You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Turbo-X-Horde-AM2R/Export_Code/gml_Script_damage_player.gml

66 lines
2.0 KiB

var damage_taken;
if (global.currentsuit == 0 || argument3 == 1)
damage_taken = (argument0 * oControl.mod_diffmult)
if (argument3 == 0)
{
if (global.currentsuit == 1)
damage_taken = (ceil((argument0 * 0.5)) * oControl.mod_diffmult)
if (global.currentsuit == 2)
{
if (global.item[5] == 0)
damage_taken = (ceil((argument0 * 0.5)) * oControl.mod_diffmult)
else
damage_taken = (ceil((argument0 * 0.25)) * oControl.mod_diffmult)
}
}
if (global.playerhealth > 0)
{
with (oCharacter)
{
if ((state != HURT && invincible == 0) || (argument4 == 1 && statetime > 2))
{
if canbehit
{
if (state == BALL || state == AIRBALL || state == SPIDERBALL || sjball == 1)
{
sjball = 1
fixedx = 12
sball = 0
}
else
sjball = 0
state = HURT
statetime = 0
canturn = 0
image_index = 0
if (other.x >= x)
xVel = (-argument1)
if (other.x < x)
xVel = argument1
yVel = argument2
sfx_play(sndHurt)
ctrl_vibrate(0.5, 0.5, 10)
invincible = 60
if inwater
{
repeat (3 + floor(random(3)))
{
bubble = instance_create(x, ((y - 6) - random(20)), oLBubble)
if instance_exists(bubble)
{
bubble.hspeed = (1 - random(2))
bubble.vspeed = (-0.1 - random(1))
}
}
}
global.playerhealth -= damage_taken
}
}
if (global.playerhealth <= 0 && state != DEFEATED)
{
alarm[0] = 6
state = DEFEATED
}
}
}