1 |
switch attack_state |
2 |
{ |
3 |
case 0: |
4 |
if (image_alpha < 0.99) |
5 |
image_alpha = lerp(image_alpha, 1, 0.25) |
6 |
else |
7 |
{ |
8 |
image_alpha = 1 |
9 |
attack_state++ |
10 |
} |
11 |
break |
12 |
case 1: |
13 |
var target_y = ystart - 50 |
14 |
if (y > (target_y + 0.01)) |
15 |
y = lerp(y, target_y, 0.4) |
16 |
else |
17 |
{ |
18 |
audio_play_sound(snd_undertale_swoosh, 1, 0) |
19 |
attack_state++ |
20 |
} |
21 |
break |
22 |
case 2: |
23 |
var grav = 2 |
24 |
var fall_speed_max = 30 |
25 |
var battle_box = obj_dialogue_box_battle_transformation_any |
26 |
var y_max = battle_box.bbox_bottom - 4 |
27 |
if ((bbox_bottom + fall_speed_max) >= y_max) |
28 |
{ |
29 |
vspeed = 0 |
30 |
y = y_max |
31 |
attack_state = -1 |
32 |
scr_screenshake_battlescr_screenshake_battlefunction scr_screenshake_battle() //gml_Script_scr_screenshake_battle
{
instance_destroy(obj_screenshake_battle)
var screenshake = instance_create(0, 0, obj_screenshake_battle)
battle_screenshake_duration = argument[0]
battle_screenshake_intensity = argument[1]
battle_screenshake_dec = battle_screenshake_intensity / battle_screenshake_duration
} (10, 1) |
33 |
audio_play_sound(snd_feisty_moray_stab_impact, 1, 0) |
34 |
} |
35 |
else |
36 |
vspeed = clamp((vspeed + grav), 0, fall_speed_max) |
37 |
break |
38 |
} |