Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_swing_down_new_Step_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (timer == 2)
3
    image_index = 1;
4
if (timer > 10)
5
    depth = -999999;
6
if (timer == (timetoswing - telegraphtime))
7
    eye_con = 1;
8
if (timer > timetoswing && sprite_index == spr_gerson_swing_down_new)
9
    image_index += 0.5;
10
if (i_ex(obj_sound_of_justice_enemy))
11
{
12
    if (timer == 5 || timer == 7 || timer == 9)
13
    {
14
        _ripple = instance_create(x + 0, y + 40, obj_church_old_man_ripple_effect);
15
        _ripple.type = 2;
16
        _ripple.color = merge_color(c_red, c_black, 0);
17
        _ripple.colorstart = 255;
18
        _ripple.version = 1;
19
        _ripple.depth = depth + 1;
20
    }
21
}
22
if (timer == (timetoswing + 2))
23
{
24
    snd_stop(motor_upper_quick_mid);
25
    snd_play(motor_upper_quick_mid);
26
}
27
if (timer == (timetoswing + 5))
28
{
29
    snd_stop(motor_swing_down);
30
    snd_play(motor_swing_down);
31
}
32
if (sprite_index == spr_gerson_swing_down_new && image_index > 4.5)
33
{
34
    sprite_index = spr_gerson_swing_down_loop_new;
35
    image_index = 0;
36
    image_speed = 0;
37
}
38
if (sprite_index == spr_gerson_swing_down_new && image_index > 2.5 && con == 0)
39
{
40
    active = 1;
41
    con = 1;
42
    speed = 50;
43
    friction = 10;
44
    if (image_angle == 45 || image_angle == 135 || image_angle == 225 || image_angle == 315)
45
        friction = 6.5;
46
}
47
if (con == 1 && speed < 12)
48
{
49
    friction = 4;
50
    if (speed < 5)
51
        speed = 5;
52
    image_alpha -= 0.2;
53
    if (image_alpha == 1.2)
54
    {
55
        snd_stop(snd_impact);
56
        snd_play(snd_impact);
57
    }
58
    if (image_alpha <= 0.8)
59
    {
60
        mask_index = spr_nothing;
61
        active = 0;
62
    }
63
    if (image_alpha < 0)
64
        instance_destroy();
65
}