Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shutta_nobyacttest_Step_0

(view raw script w/o annotations or w/e)
1
if (type == 0)
2
{
3
    if (init == 0)
4
    {
5
        ralseimax = 16;
6
        for (var i = 0; i < ralseimax; i++)
7
        {
8
            ralseiactor[i] = instance_create(camerax() + 140 + random(300), cameray() + 40 + random(190), obj_actor);
9
            ralseiactor[i].usprite = spr_ralsei_walk_up;
10
            ralseiactor[i].dsprite = spr_ch3_shutta_act_ralsei_walk_down_pippins;
11
            ralseiactor[i].rsprite = spr_ch3_shutta_act_ralsei_walk_right_pippins;
12
            ralseiactor[i].lsprite = spr_ch3_shutta_act_ralsei_walk_left_pippins;
13
            ralseiactor[i].sprite_index = spr_ralsei_walk_up;
14
            ralseiactor[i].image_speed = 0.25;
15
            ralseiactor[i].image_index = random(3);
16
            ralseiactor[i].image_xscale = 2;
17
            ralseiactor[i].image_yscale = 2;
18
            ralseiactor[i].mask_index = spr_ralsei_walk_left_sad;
19
            ralseiactor[i].ralseitimer = random(10);
20
            ralseiactor[i].ralseicon = 0;
21
            ralseiactor[i].auto_walk = 0;
22
            ralseiactor[i].depthbonus = -100;
23
        }
24
        with (ralseiactor[0])
25
        {
26
            dsprite = spr_ralsei_walk_down;
27
            rsprite = spr_ralsei_walk_right;
28
            lsprite = spr_ralsei_walk_left;
29
        }
30
        init = 1;
31
    }
32
    if (con == 0)
33
    {
34
        with (obj_actor)
35
        {
36
            if (usprite == spr_ralsei_walk_up)
37
            {
38
                depth = -1000 + y;
39
                ralseitimer++;
40
                if (ralseitimer >= 30)
41
                {
42
                    if (speed == 0)
43
                    {
44
                        speed = 2;
45
                        direction = choose(0, 90, 180, 270);
46
                        ralseitimer = random(20);
47
                    }
48
                    else
49
                    {
50
                        speed = 0;
51
                        ralseitimer = random(10);
52
                        if (direction != 90)
53
                        {
54
                            if (dsprite == spr_ralsei_walk_down)
55
                                ralseitimer = 15 + random(5);
56
                        }
57
                    }
58
                }
59
                if (x > (camerax() + 520))
60
                {
61
                    x -= 4;
62
                    hspeed = -hspeed;
63
                }
64
                if (x < (camerax() + 140))
65
                {
66
                    x += 4;
67
                    hspeed = -hspeed;
68
                }
69
                if (y > (cameray() + 200))
70
                {
71
                    y -= 4;
72
                    vspeed = -vspeed;
73
                }
74
                if (y < (cameray() + 0))
75
                {
76
                    y += 4;
77
                    vspeed = -vspeed;
78
                }
79
            }
80
        }
81
    }
82
}
83
if (type == 1)
84
{
85
    if (init == 0)
86
    {
87
        init = 1;
88
        _lancergotchi = instance_create(0, 0, obj_lancergotchi);
89
        _lancergotchi.x = (camerax() + 320) - 18;
90
        _lancergotchi.y = cameray() + 400;
91
    }
92
}
93
if (type == 2)
94
{
95
    var xx = camerax() + 320;
96
    var yy = cameray() + 220;
97
    var shuttahcount = 4;
98
    if (difficulty == 1)
99
        shuttahcount = 7;
100
    if (init == 0)
101
    {
102
        angle = random(360);
103
        init = 1;
104
        con = 1;
105
        radius = 190;
106
        for (var i = 0; i < shuttahcount; i++)
107
        {
108
            shutta[i] = instance_create(xx + lengthdir_x(radius, angle + ((i / shuttahcount) * 360)), yy + lengthdir_y(radius / 3, angle + ((i / shuttahcount) * 360)), obj_shutta_nobyact_shutta);
109
            if (difficulty == 0)
110
                shutta[i].tutorial = true;
111
        }
112
        shutta[0].sprite_index = spr_shutta_jump;
113
        if (shutta[0].x < (camerax() + (camerawidth() / 2)))
114
            obj_shutta_photo_controller.x = shutta[0].x + 250;
115
        else
116
            obj_shutta_photo_controller.x = shutta[0].x - 250;
117
        timer = 55;
118
        with (obj_shutta_photo_controller)
119
            rotatingvar = true;
120
    }
121
    if (init >= 1)
122
    {
123
        if (startrotating)
124
            siner++;
125
        if (startrotating && obj_shutta_photo_controller.fastphoto == true)
126
            siner++;
127
        if (difficulty == 0)
128
            angle += (sin(siner / 26) * 5);
129
        if (difficulty == 1)
130
            angle += (sin(siner / 20) * 10);
131
        for (var i = 0; i < shuttahcount; i++)
132
        {
133
            shutta[i].x = xx + lengthdir_x(radius, angle + ((i / shuttahcount) * 360));
134
            shutta[i].y = yy + lengthdir_y(radius / 3, angle + ((i / shuttahcount) * 360));
135
        }
136
    }
137
    timer++;
138
    if (timer == 60)
139
    {
140
        with (obj_shutta_nobyact_shutta)
141
            con = 1;
142
    }
143
    if ((obj_shutta_photo_controller.fastphoto == true && timer >= 85) || timer >= 170)
144
        timer = 4 + irandom(20);
145
}
146
if (type == 3)
147
{
148
    if (init == 0)
149
    {
150
        var tvcount = 16;
151
        for (var i = 0; i < tvcount; i++)
152
            tv[i] = instance_create(camerax() + 320, cameray() + 120, obj_shutta_nobyact_tv);
153
        tv[0].type = 1;
154
        tv[1].type = 1;
155
        tv[2].type = 1;
156
        with (obj_shutta_nobyact_tv)
157
        {
158
            if (type != 0)
159
                depth = obj_shutta_photo_controller.depth + 4;
160
        }
161
        init = 1;
162
    }
163
    timer++;
164
    if ((timer % 45) == 0)
165
    {
166
        with (tv[0])
167
        {
168
            if (con == 0)
169
                con = 1;
170
        }
171
    }
172
    if ((timer % 45) == 15)
173
    {
174
        with (tv[1])
175
        {
176
            if (con == 0)
177
                con = 1;
178
        }
179
    }
180
    if ((timer % 45) == 30)
181
    {
182
        with (tv[2])
183
        {
184
            if (con == 0)
185
                con = 1;
186
        }
187
    }
188
    photocooldowntimer--;
189
    if (photocooldowntimer == 1)
190
        obj_shutta_photo_controller.disablemovement = false;
191
    if (button1_p() && photocooldowntimer < 0)
192
    {
193
        var foundsmiling = 0;
194
        with (obj_shutta_nobyact_tv)
195
        {
196
            if (smiling == 1 && place_meeting(x, y, obj_shutta_photo_controller))
197
            {
198
                foundsmiling++;
199
                con = 20;
200
                other.smilecount--;
201
                
scr_tenna_add_score
scr_tenna_add_score

function
scr_tenna_add_score(arg0)
{ if (i_ex(obj_tenna_enemy_bg)) { var _multiplier = 1; var _multi_minigame_adjustment = 1; if (obj_tenna_enemy.minigameactivated) { if (obj_tenna_enemy.minigamecount >= 6) _multi_minigame_adjustment = 0.65; _multiplier = (obj_tenna_enemy.pointsmultiplierthisturn + obj_tenna_enemy.pointsmultiplier) * _multi_minigame_adjustment; obj_tenna_enemy.pointsmultiplierthisturn -= 1; if (obj_tenna_enemy.pointsmultiplierthisturn < 1) obj_tenna_enemy.pointsmultiplierthisturn = 1; } if (!i_ex(obj_tenna_zoom)) obj_tenna_enemy_bg.addscore += round(arg0 * _multiplier); else if (i_ex(obj_tenna_minigame_ui)) obj_tenna_minigame_ui.myscore += round(arg0 * _multiplier); } }
(10);
202
                snd_play_x(snd_coin, 0.9, 1);
203
                if (other.smilecount == 0)
204
                    
scr_tenna_add_score
scr_tenna_add_score

function
scr_tenna_add_score(arg0)
{ if (i_ex(obj_tenna_enemy_bg)) { var _multiplier = 1; var _multi_minigame_adjustment = 1; if (obj_tenna_enemy.minigameactivated) { if (obj_tenna_enemy.minigamecount >= 6) _multi_minigame_adjustment = 0.65; _multiplier = (obj_tenna_enemy.pointsmultiplierthisturn + obj_tenna_enemy.pointsmultiplier) * _multi_minigame_adjustment; obj_tenna_enemy.pointsmultiplierthisturn -= 1; if (obj_tenna_enemy.pointsmultiplierthisturn < 1) obj_tenna_enemy.pointsmultiplierthisturn = 1; } if (!i_ex(obj_tenna_zoom)) obj_tenna_enemy_bg.addscore += round(arg0 * _multiplier); else if (i_ex(obj_tenna_minigame_ui)) obj_tenna_minigame_ui.myscore += round(arg0 * _multiplier); } }
(round((215 - obj_tenna_minigame_ui.timer) / 5));
205
            }
206
        }
207
        if (foundsmiling == 0)
208
        {
209
            with (obj_shutta_nobyact_tv)
210
            {
211
                if (type == 0 && place_meeting(x, y, obj_shutta_photo_controller))
212
                {
213
                    myimage = choose(3, 7);
214
                    timer = 0;
215
                    con = 11;
216
                    statictimer = 15;
217
                }
218
            }
219
        }
220
        with (obj_shutta_photo_controller)
221
        {
222
            flash_alpha = 0.9;
223
            snd_play_volume(snd_camera_flash, 0.8);
224
        }
225
        photocooldowntimer = 30;
226
    }
227
    var typecount = 0;
228
    with (obj_shutta_nobyact_tv)
229
    {
230
        if (type == 1)
231
            typecount++;
232
    }
233
    if (typecount == 0)
234
    {
235
        if ((timer % 3) == 0)
236
        {
237
            with (obj_shutta_nobyact_tv)
238
            {
239
                speed = 0;
240
                myimage = choose(2, 1);
241
                image_alpha -= 0.05;
242
                if (image_alpha <= 0)
243
                    instance_destroy();
244
            }
245
        }
246
    }
247
}
248
if (type == 4)
249
{
250
    var firex = camerax() + 480;
251
    var firey = cameray() + 170;
252
    if (i_ex(obj_shutta_photo_controller) && obj_shutta_photo_controller.bullettarget.object_index == obj_shadowman_enemy)
253
    {
254
        firex = camerax() + 490;
255
        firey = cameray() + 186;
256
    }
257
    timer++;
258
    if (timer < 24 && (timer % 6) == 0)
259
    {
260
        with (obj_shutta_photo_controller)
261
        {
262
            if (bullettarget.object_index == obj_shadowman_enemy)
263
            {
264
                bullettarget.guntimer = 28;
265
                snd_play(snd_gunshot);
266
            }
267
            else
268
            {
269
                snd_play(snd_bump);
270
            }
271
        }
272
        var fakebullet = instance_create(firex, firey, obj_shutta_nobyact_fakebullet);
273
        fakebullet.type = 1;
274
        
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(fakebullet, "x", firex, camerax() + 320 + random_range(-60, 60), 24, 1, "out");
275
        
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(fakebullet, "y", firey, cameray() + 180 + random_range(-60, 60), 24, 1, "out");
276
        
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(fakebullet, "image_xscale", 0.2, 1.4, 24, 1, "out");
277
        
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(fakebullet, "image_yscale", 0.2, 1.4, 24, 1, "out");
278
        with (fakebullet)
279
            scr_var_delayed("con", 1, 30);
280
    }
281
    if (timer == 87 && i_ex(obj_shutta_photo_controller))
282
    {
283
        if (obj_shutta_photo_controller.timer > (obj_shutta_photo_controller.timer_duration - 30))
284
            timer = 100;
285
    }
286
    if (timer == 88)
287
    {
288
        with (obj_shutta_photo_controller)
289
        {
290
            pipetimer = 1;
291
            if (bullettarget.object_index == obj_zapper_enemy)
292
            {
293
                bullettarget.siner = 4;
294
                bullettarget.idlesprite = spr_zapper_cannon;
295
            }
296
        }
297
    }
298
    if (timer == 90)
299
        timer = 0;
300
    photocooldowntimer--;
301
    if (button1_p() && photocooldowntimer < 0)
302
    {
303
        photocooldowntimer = 30;
304
        with (obj_shutta_photo_controller)
305
            flash_alpha = 0.9;
306
        snd_play_volume(snd_camera_flash, 0.8);
307
        with (obj_shutta_nobyact_fakebullet)
308
        {
309
            if (place_meeting(x, y, obj_shutta_photo_controller) && photographed == 0)
310
            {
311
                event_user(0);
312
                with (obj_shutta_photo_controller)
313
                    mercygained += 4;
314
            }
315
        }
316
        with (obj_shutta_photo_controller)
317
        {
318
            if (timer < (timer_duration - 10))
319
                timer = timer_duration - 10;
320
            with (obj_dmgwriter)
321
                instance_destroy();
322
            mercygained = round(mercygained);
323
            if (mercygained > 100)
324
                mercygained = 100;
325
            if (mercygained > 0)
326
                endmessage = message_nicephoto;
327
            with (obj_monsterparent)
328
                
scr_mercyadd
scr_mercyadd

function
scr_mercyadd(arg0, arg1)
{ global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; if (global.mercymod[arg0] >= 100) global.mercymod[arg0] = 100; var _playsound = 1; if (arg1 <= 0) _playsound = 0; with (obj_dmgwriter) { if (type == 5 && mercytimer < 8) _playsound = 0; } if (_playsound) { var _pitch = 0.8; if (arg1 < 99) _pitch = 1; if (arg1 <= 50) _pitch = 1.2; if (arg1 <= 25) _pitch = 1.4; snd_play_x(snd_mercyadd, 0.8, _pitch); } __mercydmgwriter = instance_create(global.monsterx[arg0], (global.monstery[arg0] + 20) - (global.hittarget[arg0] * 20), obj_dmgwriter); __mercydmgwriter.damage = arg1; __mercydmgwriter.type = 5; global.hittarget[arg0]++; }
(myself, other.mercygained);
329
            mercygained = 0;
330
            tookaphoto = true;
331
        }
332
    }
333
}
334
delaydeath--;
335
if (delaydeath == 0)
336
{
337
    instance_destroy();
338
    with (obj_shutta_nobyact_shutta)
339
        instance_destroy();
340
}