Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_martlet_catapult_arm_Step_0

(view raw script w/o annotations or w/e)
1
if (launch_state == 1)
2
{
3
    if (!instance_exists(id_payload))
4
        event_user(1)
5
    if instance_exists(id_payload)
6
    {
7
        if (id_payload.image_alpha == 1 && alarm_active == false)
8
        {
9
            alarm_active = true
10
            alarm[0] = 20
alarm[0]

event_user(2)
11
        }
12
    }
13
}
14
else if (launch_state == 2)
15
{
16
    image_angle -= angle_pullback_speed
17
    if (image_angle < 0)
18
        image_angle += 360
19
    if (image_angle < max_angle_pullback && abs(max_angle_pullback - image_angle) < angle_pullback_speed)
20
        image_angle = max_angle_pullback
21
    if (image_angle == max_angle_pullback && alarm_active == false)
22
    {
23
        alarm_active = true
24
        alarm[0] = 20
alarm[0]

event_user(2)
25
    }
26
}
27
else if (launch_state == 3)
28
{
29
    image_angle += angle_release_speed
30
    if (image_angle > 360)
31
        image_angle -= 360
32
    if (image_angle > max_angle_release && abs(max_angle_release - image_angle) < angle_release_speed)
33
        image_angle = max_angle_release
34
    if (image_angle == max_angle_release && alarm_active == false)
35
    {
36
        with (id_payload)
37
            launched = true
38
        alarm_active = true
39
        alarm[0] = 20
alarm[0]

event_user(2)
40
    }
41
}
42
else if (launch_state == 4)
43
{
44
    image_angle -= angle_pullback_speed
45
    if (image_angle < 0)
46
        image_angle += 360
47
    if (image_angle < 0 && abs(image_angle) < angle_pullback_speed)
48
        image_angle = 0
49
    if (image_angle == 0)
50
        event_user(2)
51
}
52
with (id_payload)
53
    event_user(1)