/*
Gemma's DASH sprites implementation

Programming by Great Glass (Team Platinum Sparks)
*/

addHook("PlayerThink", function(p)
   if (p.mo and p.mo.valid and p.mo.skin == "gemma")
   local mo = p.mo
   
   if mo.state == S_PLAY_RUN and ((FixedDiv(p.speed,mo.scale) >= 50*FRACUNIT) and (FixedDiv(mo.momz, mo.scale) == 0*FRACUNIT))
		if mo.state != S_PLAY_DASH
			mo.state = S_PLAY_DASH
		end
	end
	
	if mo.state == S_PLAY_DASH and (not ((FixedDiv(p.speed,mo.scale) >= 50*FRACUNIT) and (FixedDiv(mo.momz, mo.scale) == 0*FRACUNIT)))
		if mo.state != S_PLAY_RUN
			mo.state = S_PLAY_RUN
		end
	end
   
end
end)
