Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_attack_ed_grab_moray_sword_sword_Step_0

(view raw script w/o annotations or w/e)
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_x = xstart - 50
14
        if (x > (target_x + 0.01))
15
            x = lerp(x, target_x, 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 x_max = battle_box.bbox_right - 4
27
        if ((bbox_right + fall_speed_max) >= x_max)
28
        {
29
            hspeed = 0
30
            x = x_max
31
            attack_state = -1
32
            scr_screenshake_battle
scr_screenshake_battle

function 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
            hspeed = clamp((hspeed + grav), 0, fall_speed_max)
37
        break
38
}