Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_swing_down_mask_Step_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (timer > 6)
3
    depth = -999999;
4
if (timer == (timetoswing - 12) || (swingdowntype == 0 && timer == (timetoswing - 2)) || (swingdowntype == 1 && timer == (timetoswing - 2)))
5
    eye_con = 1;
6
if (timer > timetoswing && sprite_index == spr_gerson_swing_down)
7
    image_index += 0.5;
8
if (swingdowntype == -3 && eye_con == 0)
9
{
10
    if (timer == 34)
11
    {
12
        with (obj_gerson_swing_down)
13
        {
14
            eye_con = 1;
15
            timer = timetoswing - 2;
16
        }
17
    }
18
}
19
if (swingdowntype == -4)
20
{
21
    if (timer == 12)
22
    {
23
        with (obj_gerson_swing_down)
24
        {
25
            if (swingdowntype == -4)
26
                eye_con = 1;
27
        }
28
    }
29
    if (timer == 50)
30
    {
31
        if (image_xscale > 0)
32
            instance_create(x + 52, y + 120, obj_gerson_teleport);
33
        else
34
            instance_create(x - 52, y + 120, obj_gerson_teleport);
35
        instance_destroy();
36
    }
37
}
38
if (timer == (timetoswing + 2))
39
{
40
    snd_stop(motor_upper_quick_mid);
41
    snd_play(motor_upper_quick_mid);
42
}
43
if (timer == (timetoswing + 5))
44
{
45
    snd_stop(motor_swing_down);
46
    snd_play(motor_swing_down);
47
}
48
if (sprite_index == spr_gerson_swing_down && image_index > 3.5)
49
{
50
    sprite_index = spr_gerson_swing_down_loop;
51
    image_index = 0;
52
    image_speed = 0;
53
}
54
if (sprite_index == spr_gerson_swing_down && image_index > 1.5 && con == 0)
55
{
56
    active = 1;
57
    con = 1;
58
    x += lengthdir_x(30, direction);
59
    y += lengthdir_y(30, direction);
60
    speed = 45;
61
    friction = 10;
62
}
63
if (con == 1 && vspeed < 12)
64
{
65
    friction = 4;
66
    if (speed < 5)
67
        speed = 5;
68
    image_alpha -= 0.2;
69
    if (image_alpha == 1.2)
70
        snd_play(snd_impact);
71
    if (image_alpha < 0.6)
72
        mask_index = spr_nothing;
73
    if (image_alpha < 0)
74
        instance_destroy();
75
}
76
if (swingdowntype == -3 && sprite_index == spr_gerson_swing_down && image_index >= 2)
77
{
78
    gers = instance_create(x + lengthdir_x(110, image_angle + 290), y + lengthdir_y(110, image_angle + 290), obj_gerson_teleport);
79
    gers.image_angle = image_angle;
80
    instance_destroy();
81
}