| 1 |
if (live_call()) |
| 2 |
return global.live_result; |
| 3 |
if (damaged_stage == 0 && image_alpha < 1) |
| 4 |
image_alpha += 0.1; |
| 5 |
if (image_alpha >= 1) |
| 6 |
{ |
| 7 |
with (obj_heart_yellow_shot) |
| 8 |
{ |
| 9 |
if (place_meeting(x, y, obj_martlet_final_armor)) |
| 10 |
{ |
| 11 |
other.damage_flash_timer = 3; |
| 12 |
other.armor_hp -= 1; |
| 13 |
other.hit_shake = 3; |
| 14 |
audio_play_sound(snd_arc_hit, 0.1, 0); |
| 15 |
instance_destroy(); |
| 16 |
} |
| 17 |
} |
| 18 |
} |
| 19 |
if (damage_flash_timer > 0) |
| 20 |
damage_flash_timer -= 1; |
| 21 |
if (damaged_stage == 0) |
| 22 |
{ |
| 23 |
if (armor_hp <= ((armor_hp_max / 4) * 3)) |
| 24 |
{ |
| 25 |
audio_play_sound(snd_monster_damage_hit_critical, 1, 0); |
| 26 |
damaged_stage = 1; |
| 27 |
hit_shake = 4; |
| 28 |
var xp = x; |
| 29 |
var yp = y; |
| 30 |
part_emitter_region(armr_ps, armr_pe_effect_1, xp - 1, xp + 1, yp - 1, yp + 1, 0, 0); |
| 31 |
part_emitter_burst(armr_ps, armr_pe_effect_1, armr_pt_effect_1, 3); |
| 32 |
} |
| 33 |
} |
| 34 |
else if (damaged_stage == 1) |
| 35 |
{ |
| 36 |
if (armor_hp <= ((armor_hp_max / 4) * 2)) |
| 37 |
{ |
| 38 |
audio_play_sound(snd_monster_damage_hit_critical, 1, 0); |
| 39 |
damaged_stage = 2; |
| 40 |
hit_shake = 5; |
| 41 |
part_emitter_burst(armr_ps, armr_pe_effect_1, armr_pt_effect_1, 4); |
| 42 |
} |
| 43 |
} |
| 44 |
else if (damaged_stage == 2) |
| 45 |
{ |
| 46 |
if (armor_hp <= (armor_hp_max / 4)) |
| 47 |
{ |
| 48 |
audio_play_sound(snd_monster_damage_hit_critical, 1, 0); |
| 49 |
damaged_stage = 3; |
| 50 |
hit_shake = 6; |
| 51 |
part_emitter_burst(armr_ps, armr_pe_effect_1, armr_pt_effect_1, 5); |
| 52 |
} |
| 53 |
} |
| 54 |
else if (damaged_stage == 3) |
| 55 |
{ |
| 56 |
if (armor_hp <= 0) |
| 57 |
{ |
| 58 |
audio_play_sound(snd_monster_damage_hit_critical, 1, 0); |
| 59 |
damaged_stage = 4; |
| 60 |
hit_shake = 7; |
| 61 |
part_emitter_burst(armr_ps, armr_pe_effect_1, armr_pt_effect_1, 6); |
| 62 |
} |
| 63 |
} |
| 64 |
if (hit_shake > 0) |
| 65 |
{ |
| 66 |
x = xstart + choose(-hit_shake, hit_shake); |
| 67 |
y = ystart + choose(-hit_shake, hit_shake); |
| 68 |
if (damaged_stage < 4 || hit_shake > 1) |
| 69 |
hit_shake--; |
| 70 |
} |
| 71 |
else |
| 72 |
{ |
| 73 |
x = xstart; |
| 74 |
y = ystart; |
| 75 |
} |
| 76 |
if (damaged_stage == 4) |
| 77 |
{ |
| 78 |
if (white_fade_alpha < 1) |
| 79 |
{ |
| 80 |
white_fade_alpha += 0.05; |
| 81 |
} |
| 82 |
else |
| 83 |
{ |
| 84 |
damaged_stage = 5; |
| 85 |
alarm[0] = 60; |
| 86 |
} |
| 87 |
} |
| 88 |
if (damaged_stage == 5) |
| 89 |
{ |
| 90 |
if (image_alpha > 0) |
| 91 |
image_alpha -= 0.1; |
| 92 |
} |
| 93 |
if (fade_out == true) |
| 94 |
{ |
| 95 |
if (fade_alpha < 1) |
| 96 |
fade_alpha += 0.025; |
| 97 |
else if (!alarm[2]) |
| 98 |
alarm[2] = 60; |
| 99 |
} |