Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_church_old_man_ripple_Step_0

(view raw script w/o annotations or w/e)
1
if (room == room_ripple_test)
2
{
3
    if (keyboard_check_pressed(vk_numpad5))
4
    {
5
        type = 0;
6
        if (distance <= 0)
7
            distance = 90;
8
        else
9
            distance -= 30;
10
        play = true;
11
    }
12
    else if (keyboard_check_pressed(vk_numpad6))
13
    {
14
        type = 1;
15
        play = true;
16
    }
17
    else if (keyboard_check_pressed(vk_numpad9))
18
    {
19
        shiner = 0;
20
    }
21
    else if (keyboard_check_pressed(vk_numpad4))
22
    {
23
        type = 2;
24
        play = true;
25
    }
26
    else if (keyboard_check_pressed(vk_numpad7))
27
    {
28
        type = 3;
29
        play = true;
30
    }
31
    else if (keyboard_check_pressed(vk_numpad8))
32
    {
33
        type = 4;
34
        play = true;
35
    }
36
}
37
var _xx = x;
38
if (variant == 1)
39
    _xx = camerax() + 456 + 30;
40
if (play)
41
{
42
    active = true;
43
    if (type == 1)
44
        con = 1;
45
    else
46
        con = 0;
47
    con_timer = 0;
48
    deltatime = 1;
49
    timer = 0;
50
    susie_con = 0;
51
    dust_timer = 0;
52
    susie_timer = 0;
53
    play = false;
54
    spinner = 0;
55
    if (type == 3)
56
        snd_play(snd_metal_hit_reverb, 1, 1);
57
    if (type == 4)
58
    {
59
        var _pull_a = audio_sound_set_track_position(snd_play(snd_weaponpull, 1, 2), 0.06);
60
        var _pull_b = audio_sound_set_track_position(snd_play(snd_weaponpull, 1, 0.8), 0.06);
61
    }
62
    if (type == 5)
63
    {
64
    }
65
    with (obj_church_old_man_ripple_effect)
66
        depth += 2;
67
    if (type == 0)
68
    {
69
        _xx += distance;
70
        step_index = image_index;
71
        step_x = _xx;
72
        if ((image_index % 4) == 0)
73
            _xx -= 12;
74
    }
75
    step = 1 - step;
76
    var _ripple = -4;
77
    if (type == 2)
78
    {
79
        laugh = snd_play(snd_gerlaugh_distort);
80
        _ripple = instance_create(x, y - 70, obj_church_old_man_ripple_effect);
81
        _ripple.type = 2;
82
    }
83
    else if (type == 3 || type == 4)
84
    {
85
        _ripple = instance_create(x, y - 64, obj_church_old_man_ripple_effect);
86
        _ripple.color = c_aqua;
87
        _ripple.type = type;
88
    }
89
    else if (type == 5)
90
    {
91
        if (snd_is_playing(laugh))
92
            snd_stop(laugh);
93
        punch++;
94
        snd_play(snd_damage, 1, (punch == 1) ? 0.9 : 1.1);
95
        _ripple = instance_create(x + 10, y - 44, obj_church_old_man_ripple_effect);
96
        _ripple.type = 5;
97
        _ripple.punch = punch;
98
        _ripple.color = c_lime;
99
        _ripple.colorstart = 65280;
100
        var _sign = randomsign();
101
        var _anim = instance_create_depth(x + -32, y - 50, depth - 10, obj_animation);
102
        _anim.image_xscale = -2;
103
        _anim.image_yscale = (punch == 0) ? 2 : -2;
104
        _anim.depth = depth + 10;
105
        _anim.sprite_index = spr_gerson_hit_fx1;
106
        _anim.image_speed = 0.5;
107
    }
108
    else if (type == 6)
109
    {
110
        hurt_noise = snd_play(snd_damage, 1, 1);
111
        _ripple = instance_create(x + 10, y - 44, obj_church_old_man_ripple_effect);
112
        _ripple.type = 5;
113
        _ripple.depth = depth + 11;
114
        _ripple.active = true;
115
        var _anim = instance_create_depth(x - 30, y - 50, depth - 10, obj_animation);
116
        _anim.image_xscale = -2;
117
        _anim.image_yscale = 2;
118
        _anim.depth = depth + 10;
119
        _anim.sprite_index = spr_gerson_hit_fx2;
120
        _anim.image_speed = 0.25;
121
    }
122
    else if (type == 7)
123
    {
124
        _ripple = instance_create(x, y - 34, obj_church_old_man_ripple_effect);
125
        _ripple.type = 7;
126
        _ripple.depth = depth + 11;
127
        _ripple.active = true;
128
    }
129
    else
130
    {
131
        _ripple = instance_create(_xx, y, obj_church_old_man_ripple_effect);
132
        _ripple.type = 0;
133
    }
134
    _ripple.depth = depth + 10;
135
    if (i_ex(obj_sound_of_justice_enemy))
136
        depth = obj_sound_of_justice_enemy.depth + 1;
137
    _ripple.active = true;
138
    if (type == 0)
139
    {
140
        if ((step % 2) == 0)
141
            snd_play_pitch(snd_metalstep_echo, 1);
142
        else
143
            snd_play_pitch(snd_metalstep_echo, 0.9);
144
    }
145
    if (type == -1)
146
    {
147
        step_sound = snd_play_pitch(snd_metalstep_echo, 0.7);
148
        snd_volume(step_sound, 0, 60);
149
    }
150
    if (type == 1)
151
        snd_play(snd_noise);
152
}
153
if (active)
154
    timer += deltatime;
155
if (type == 1)
156
{
157
    con_timer++;
158
    if (variant == 1)
159
    {
160
        if (con_timer >= leap_time && con_timer <= 65)
161
            con_timer += 0.5;
162
    }
163
    var _inc = false;
164
    if (con == 2)
165
    {
166
        with (obj_church_old_man_ripple_effect)
167
            deltatime = lerp(0.5, 0.15, other.con_timer / other.leap_time);
168
    }
169
    if (con == 0 && con_timer >= 15)
170
    {
171
        _inc = true;
172
    }
173
    else if (con == 1 && con_timer >= 15)
174
    {
175
        var _ripple = instance_create(_xx, y, obj_church_old_man_ripple_effect);
176
        _ripple.type = 1;
177
        _ripple.depth = depth + 8;
178
        _ripple.active = true;
179
        if (version == 1)
180
            _ripple.looping = false;
181
        deltatime = 0.5;
182
        with (obj_church_old_man_ripple_effect)
183
            deltatime = 0.95;
184
        snd_stop(motor_swing_down);
185
        snd_play_pitch(motor_swing_down, 1.4);
186
        _inc = true;
187
    }
188
    else if (con == 2 && con_timer >= leap_time)
189
    {
190
        deltatime = 0.15;
191
        with (obj_church_old_man_ripple_effect)
192
            deltatime = 0.15;
193
        _inc = true;
194
        wind_sfx = snd_play(snd_strongwind_loop);
195
        snd_pitch(wind_sfx, 0.5);
196
        snd_volume(wind_sfx, 0, 0);
197
        snd_volume(wind_sfx, 1, 45);
198
    }
199
    else if (con == 3 && con_timer == 30)
200
    {
201
    }
202
    else if (con == 3 && con_timer >= 65)
203
    {
204
        snd_play(snd_heavyswing);
205
        snd_play_pitch(snd_heavyswing, 0.5);
206
        susie_con = 2;
207
        snd_pause(wind_sfx);
208
        snd_volume(step_sound, 1, 0);
209
        _inc = true;
210
    }
211
    else if (con == 4 && con_timer >= 12)
212
    {
213
        snd_resume(wind_sfx);
214
        snd_pitch(wind_sfx, 1);
215
        snd_volume(wind_sfx, 1, 0);
216
        snd_volume(wind_sfx, 0, 80);
217
        deltatime = 2;
218
        var _ripple = instance_create(_xx, y, obj_church_old_man_ripple_effect);
219
        _ripple.type = 0;
220
        _ripple.depth = depth + 8;
221
        _ripple.active = true;
222
        with (obj_church_old_man_ripple_effect)
223
        {
224
            deltatime = 2;
225
            looping = false;
226
        }
227
        _inc = true;
228
    }
229
    if (_inc)
230
    {
231
        con++;
232
        con_timer = 0;
233
    }
234
}
235
if (type == 2)
236
{
237
    if ((timer % 16) == 0)
238
    {
239
        var _ripple = instance_create(x, y - 64, obj_church_old_man_ripple_effect);
240
        _ripple.type = 2;
241
        _ripple.depth = depth + 10;
242
        _ripple.active = true;
243
    }
244
    if (timer > 32)
245
        timer = 33;
246
}
247
if (type == 3)
248
{
249
}