uses particles.df

(*
	REG_STRUCT_INT(THING, hitcheck.dist);
	REG_STRUCT_INT(THING, hitcheck.hits_allowed);
	REG_STRUCT_INT(THING, hitcheck.closest_dist);
	REG_STRUCT_INT(THING, hitcheck.blast);
	REG_STRUCT_INT(THING, hitcheck.source_id);
	REG_STRUCT_INT(THING, hitcheck.lasthit_id);
	REG_STRUCT_INT(THING, hitcheck.closest_id);
	REG_STRUCT_FLOAT(THING, hitcheck.rad);
	REG_STRUCT_FLOAT(THING, hitcheck.power);
	REG_STRUCT_FLOAT(THING, hitcheck.knockback);
	REG_STRUCT_FLOAT(THING, hitcheck.shoot_thru);
	REG_STRUCT_FLOAT(THING, hitcheck.dir.x);
	REG_STRUCT_FLOAT(THING, hitcheck.dir.y);
	REG_STRUCT_FLOAT(THING, hitcheck.pos.x);
	REG_STRUCT_FLOAT(THING, hitcheck.pos.y);
*)


: xyblast locals( bl )
	blast -> bl
	2dup <- bl .pos.y! <- bl .pos.x!
	<- bl .hitcheck.pos.y! <- bl .hitcheck.pos.x!
	<- bl
;

: xypowboom ( x y p -- ) locals( bl x y p ) 
	-> p 2dup -> y -> x xyblast -> bl

	48 <- bl .hitcheck.rad!
	1 <- bl .hitcheck.blast!
	10 <- bl .hitcheck.knockback!
	<- p <- bl .hitcheck.power!

	<- x <- y 0 particle{ shroomsplosion 8 <- x <- y xyloudness * rumble }

	sfx{ thump 0.125 fx .pitch! 500 fx .d! 0.25 fx .s! 500 fx .r! 0.75
		fx .q! 200 fx .i!
		fx .scale@ 2 * fx .scale! }

	<- x <- y xy-vol
;

: xyboom 1 xypowboom ;

// : ishere? .mapid

// : thingpowboom curmapsel . cr ;

