Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_guardener_arm_half_Step_0

(view raw script w/o annotations or w/e)
1
var box = obj_dialogue_box_battle_transformation_any
2
switch scene
3
{
4
    case 0:
5
        depth = obj_heart_battle_fighting_parent.depth - 1
6
        switch launch_dir
7
        {
8
            case "down":
9
                x = clamp(x, (box.bbox_left + 32), (box.bbox_right - 32))
10
                vspeed = launch_speed
11
                image_angle = 0
12
                if (y >= 320)
13
                {
14
                    y = 320
15
                    vspeed = 0
16
                    scene = 1
17
                }
18
                break
19
            case "right":
20
                y = clamp(y, (box.bbox_top + 32), (box.bbox_bottom - 32))
21
                hspeed = launch_speed
22
                image_angle = 90
23
                if (x >= 320)
24
                {
25
                    x = 320
26
                    hspeed = 0
27
                    scene = 1
28
                }
29
                break
30
            case "up":
31
                x = clamp(x, (box.bbox_left + 32), (box.bbox_right - 32))
32
                vspeed = (-launch_speed)
33
                image_angle = 180
34
                if (y <= 320)
35
                {
36
                    y = 320
37
                    vspeed = 0
38
                    scene = 1
39
                }
40
                break
41
            case "left":
42
                y = clamp(y, (box.bbox_top + 32), (box.bbox_bottom - 32))
43
                hspeed = (-launch_speed)
44
                image_angle = 270
45
                if (x <= 320)
46
                {
47
                    x = 320
48
                    hspeed = 0
49
                    scene = 1
50
                }
51
                break
52
        }
53
54
        break
55
    case 1:
56
        audio_play_sound(snd_guardener_arm_land, 1, 0)
57
        audio_stop_sound(snd_guardener_arm_launched)
58
        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 }
(6, 1)
59
        var zap = instance_create_depth(x, y, (depth - 1), obj_battle_enemy_attack_guardener_arm_zap)
60
        zap.image_angle = image_angle
61
        sprite_index = spr_attack_guardener_arm_jam
62
        image_index = 0
63
        scene++
64
        break
65
    case 2:
66
        if (image_index >= (image_number - 1))
67
        {
68
            image_index = image_number - 1
69
            image_speed = 0
70
        }
71
        if (arm_return > 0)
72
            cutscene_wait(arm_return)
73
        break
74
    case 3:
75
        switch launch_dir
76
        {
77
            case "down":
78
                vspeed = (-launch_speed)
79
                if (y <= ystart)
80
                    instance_destroy()
81
                break
82
            case "right":
83
                hspeed = (-launch_speed)
84
                if (x <= xstart)
85
                    instance_destroy()
86
                break
87
            case "up":
88
                vspeed = launch_speed
89
                if (y >= ystart)
90
                    instance_destroy()
91
                break
92
            case "left":
93
                hspeed = (-launch_speed)
94
                if (x <= xstart)
95
                    instance_destroy()
96
                break
97
        }
98
99
        break
100
}