Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_swing_down_Step_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (timer > 10)
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
        }
26
    }
27
    if (timer == 50)
28
    {
29
        if (image_xscale > 0)
30
            instance_create(x + 52, y + 120, obj_gerson_teleport);
31
        else
32
            instance_create(x - 52, y + 120, obj_gerson_teleport);
33
        instance_destroy();
34
    }
35
}
36
if (timer == (timetoswing + 2))
37
{
38
    snd_stop(motor_upper_quick_mid);
39
    snd_play(motor_upper_quick_mid);
40
}
41
if (timer == (timetoswing + 5))
42
{
43
    snd_stop(motor_swing_down);
44
    snd_play(motor_swing_down);
45
}
46
if (sprite_index == spr_gerson_swing_down && image_index > 3.5)
47
{
48
    sprite_index = spr_gerson_swing_down_loop;
49
    image_index = 0;
50
    image_speed = 0;
51
}
52
if (sprite_index == spr_gerson_swing_down && image_index > 1.5 && con == 0)
53
{
54
    active = 1;
55
    con = 1;
56
    x += lengthdir_x(30, direction);
57
    y += lengthdir_y(30, direction);
58
    speed = 45;
59
    if (image_angle != 0)
60
        speed = 30;
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
    {
71
        snd_stop(snd_impact);
72
        snd_play(snd_impact);
73
    }
74
    if (image_alpha <= 0.8)
75
    {
76
        mask_index = spr_nothing;
77
        active = 0;
78
    }
79
    if (image_alpha < 0)
80
        instance_destroy();
81
}
82
if (swingdowntype == -3 && sprite_index == spr_gerson_swing_down && image_index >= 2)
83
{
84
    gers = instance_create(x + lengthdir_x(110, image_angle + 290), y + lengthdir_y(110, image_angle + 290), obj_gerson_teleport);
85
    gers.image_angle = image_angle;
86
    instance_destroy();
87
}