| 1 |
if (live_call()) |
| 2 |
return global.live_result; |
| 3 |
var particles_spawn = false; |
| 4 |
item_offset = 15; |
| 5 |
switch (scene) |
| 6 |
{ |
| 7 |
case 0: |
| 8 |
with (obj_martlet_final_base) |
| 9 |
{ |
| 10 |
image_angle = 0; |
| 11 |
y = lerp(y, other.y_target, 0.25); |
| 12 |
x = lerp(x, other.x_target, 0.25); |
| 13 |
if (abs(y - other.y_target) < 1 && abs(x - other.x_target) < 1) |
| 14 |
{ |
| 15 |
x = other.x_target; |
| 16 |
y = other.y_target; |
| 17 |
other.scene++; |
| 18 |
image_speed = 1; |
| 19 |
} |
| 20 |
} |
| 21 |
break; |
| 22 |
case 1: |
| 23 |
if (flap_noloop == false) |
| 24 |
{ |
| 25 |
if (obj_martlet_final_base.image_index >= 2) |
| 26 |
{ |
| 27 |
particles_spawn = true; |
| 28 |
var flap_sound = audio_play_sound(snd_mart_flap, 20, 0); |
| 29 |
audio_sound_pitch(flap_sound, 0.8); |
| 30 |
flap_noloop = true; |
| 31 |
} |
| 32 |
} |
| 33 |
else if (obj_martlet_final_base.image_index < 2) |
| 34 |
{ |
| 35 |
flap_noloop = false; |
| 36 |
} |
| 37 |
attack_duration--; |
| 38 |
if (attack_duration <= 0) |
| 39 |
{ |
| 40 |
alarm[0] = 0; |
| 41 |
audio_stop_sound(snd_mart_flap); |
| 42 |
scene++; |
| 43 |
} |
| 44 |
break; |
| 45 |
case 2: |
| 46 |
with (obj_martlet_final_base) |
| 47 |
{ |
| 48 |
y = lerp(y, other.y_original, 0.25); |
| 49 |
x = lerp(x, other.x_original, 0.25); |
| 50 |
if (abs(y - other.y_original) < 1 && abs(x - other.x_original) < 1) |
| 51 |
{ |
| 52 |
x = other.x_original; |
| 53 |
y = other.y_original; |
| 54 |
martlet_sprites_reset = true; |
| 55 |
instance_destroy(other); |
| 56 |
} |
| 57 |
} |
| 58 |
break; |
| 59 |
} |
| 60 |
if (floor(obj_martlet_final_base.image_index) >= 3 && floor(obj_martlet_final_base.image_index) <= 6) |
| 61 |
{ |
| 62 |
with (obj_heart_battle_fighting_parent) |
| 63 |
vsp_factor = 11; |
| 64 |
} |
| 65 |
else |
| 66 |
{ |
| 67 |
with (obj_heart_battle_fighting_parent) |
| 68 |
vsp_factor = 0; |
| 69 |
} |
| 70 |
if (particles_spawn) |
| 71 |
{ |
| 72 |
var inc = 22.857142857142858; |
| 73 |
for (var i = 0; i < 7; i++) |
| 74 |
{ |
| 75 |
var xx = 250 + (i * inc); |
| 76 |
var yy = 270 + (sign(i % 2) * 20) + random_range(-10, 10); |
| 77 |
part_particles_create(global.ps, xx, yy, global.pt_Effect1, 1); |
| 78 |
part_particles_create(global.ps, xx, (yy - 60) + random_range(-10, 10), global.pt_Effect1, 1); |
| 79 |
} |
| 80 |
} |