Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shootout_controller_Step_0

(view raw script w/o annotations or w/e)
1
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
2
{
3
    if (keyboard_check_pressed(ord("1")))
4
    {
5
        state = "wave_outro";
6
        wave = 0;
7
        timer = -1;
8
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { }
("switch to wave 1");
9
    }
10
    if (keyboard_check_pressed(ord("2")))
11
    {
12
        state = "wave_outro";
13
        wave = 1;
14
        timer = -1;
15
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { }
("switch to wave 2");
16
    }
17
    if (keyboard_check_pressed(ord("3")))
18
    {
19
        state = "wave_outro";
20
        wave = 2;
21
        timer = -1;
22
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { }
("switch to wave 3");
23
    }
24
    if (keyboard_check_pressed(ord("H")))
25
        kris_hp = 5;
26
}
27
if (i_ex(obj_tenna_enemy))
28
{
29
    tennatimer++;
30
    if (tennatimer == 270 && obj_tenna_zoom.con != 2 && obj_tenna_zoom.minigameinsanity == false)
31
    {
32
        with (obj_tenna_zoom)
33
        {
34
            con = 2;
35
            timer = -1;
36
        }
37
    }
38
}
39
invtimer--;
40
if (tutorialmode && tutorialorder == 1)
41
{
42
}
43
else
44
{
45
    shootout_endtimer++;
46
}
47
if (shootout_type == 0 && shootout_endtimer > 540)
48
    stopspawns = true;
49
if (shootout_type == 0 && shootout_endtimer > 600)
50
    endminigame = true;
51
if (shootout_type == 1 && shootout_endtimer > 540)
52
    stopspawns = true;
53
if (shootout_type == 1 && shootout_endtimer == 600)
54
    endminigame = true;
55
if (shootout_type == 2 && shootout_endtimer > 540)
56
    stopspawns = true;
57
if (shootout_type == 2 && shootout_endtimer == 600)
58
    endminigame = true;
59
if (i_ex(obj_tenna_minigame_ui) && obj_tenna_minigame_ui.timer > 240 && i_ex(obj_tenna_zoom) && obj_tenna_zoom.minigameinsanity == false)
60
    stopspawns = true;
61
if (music_init == false)
62
{
63
    music_init_timer++;
64
    if (music_init_timer == 10 || !i_ex(obj_tenna_enemy))
65
    {
66
        music_init = true;
67
        var snd = snd_play_complex(0, 0, -1);
68
        snd_add_complex(snd, 0, 445, 1.5, 0.15, 4, 10, 1);
69
        snd_add_complex(snd, 1, 374, 1.4, 0.7, 0, 14, 1);
70
        snd_add_complex(snd, 2, 445, 1.6, 0.1, 2, 10, 1);
71
        snd_add_complex(snd, 3, 445, 1.55, 0.05, 6, 10, 1);
72
    }
73
}
74
switch (state)
75
{
76
    case "intro":
77
        kris_actionable = false;
78
        var _intro_duration;
79
        if (i_ex(obj_ch3_GSD03))
80
            _intro_duration = 90;
81
        if (!i_ex(obj_ch3_GSD03))
82
            _intro_duration = 5;
83
        current_train = shootout_carriages[0];
84
        if (i_ex(obj_ch3_GSD03))
85
            obj_shootout_horse.x = kris_x + kris_x2 + (sin(current_time / 600) * 8);
86
        if (!i_ex(obj_ch3_GSD03))
87
            kris_x = ease_out_back(ease_in_sine(max(0, timer - 0), 0, _intro_duration, _intro_duration), -120, 180, _intro_duration - 0);
88
        train_x_prev = 650;
89
        train_x_target = -current_train.x_offset + 150;
90
        train_x = ease_out_sine(timer, train_x_prev, train_x_target - train_x_prev, _intro_duration);
91
        if (timer >= _intro_duration)
92
        {
93
            kris_actionable = true;
94
            state = "main";
95
            timer = -1;
96
            aim_x = current_window.x;
97
            aim_y = current_window.y;
98
        }
99
        break;
100
    case "wave_intro":
101
        kris_actionable = false;
102
        current_train = shootout_carriages[wave - 1];
103
        train_x_target = -current_train.x_offset + 150;
104
        var _intro_duration = 120;
105
        if (i_ex(obj_tenna_enemy))
106
        {
107
            layer_hspeed(bg, lerp(layer_get_hspeed(bg), -(wave * 1), timer / _intro_duration));
108
            layer_hspeed(md_back, lerp(layer_get_hspeed(md_back), -(wave * 2), timer / _intro_duration));
109
            layer_hspeed(md, lerp(layer_get_hspeed(md), -(wave * 3), timer / _intro_duration));
110
            layer_hspeed(fg, lerp(layer_get_hspeed(fg), -4 - (wave * 4), timer / _intro_duration));
111
        }
112
        else
113
        {
114
            layer_hspeed("bg", lerp(layer_get_hspeed("bg"), -(wave * 1), timer / _intro_duration));
115
            layer_hspeed("md_back", lerp(layer_get_hspeed("md_back"), -(wave * 2), timer / _intro_duration));
116
            layer_hspeed("md", lerp(layer_get_hspeed("md"), -(wave * 3), timer / _intro_duration));
117
            layer_hspeed("fg", lerp(layer_get_hspeed("fg"), -4 - (wave * 4), timer / _intro_duration));
118
        }
119
        var _factor = ease_in_sine(timer, 0, 1, _intro_duration);
120
        train_x = ease_out_back(_factor, train_x_prev, train_x_target - train_x_prev, 1, 1);
121
        with (obj_shootout_carriage)
122
            image_speed = lerp(image_speed, 0.5 + (other.wave * 0.5), 0.2);
123
        if (timer >= _intro_duration)
124
        {
125
            kris_actionable = true;
126
            state = "main";
127
            timer = -1;
128
            aim_x = current_window.x;
129
            aim_y = current_window.y;
130
        }
131
        break;
132
    case "wave_outro":
133
        hazard_warning = -1;
134
        kris_actionable = false;
135
        train_x_target = -current_train.x_offset + 150;
136
        if (timer == 0)
137
        {
138
            with (obj_shootout_window)
139
                event_user(14);
140
        }
141
        if (timer < 10)
142
        {
143
            train_x = lerp(train_x, train_x_target, 0.2);
144
        }
145
        else
146
        {
147
            train_x_prev = train_x_target;
148
            timer = -1;
149
            if (wave < 3)
150
                wave++;
151
            state = "wave_intro";
152
        }
153
        break;
154
    case "main":
155
        train_x = train_x_target + (sin(timer / 20) * 10);
156
        if (obj_shootout_controller.shootout_type == 3)
157
        {
158
            with (obj_shootout_window)
159
                krspopout = false;
160
            with (obj_shootout_window)
161
                event_user(12);
162
        }
163
        var _prev_col = current_window_column;
164
        var _prev_row = current_window_row;
165
        current_window_column = (1 + right_h()) - left_h();
166
        current_window_column = clamp(current_window_column, 0, window_columns - 1);
167
        current_window_row = (1 + down_h()) - up_h();
168
        current_window_row = clamp(current_window_row, 0, window_rows - 1);
169
        var _new_window = windows[current_window_column][current_window_row];
170
        if (_new_window.active == false)
171
        {
172
            current_window_column = _prev_col;
173
            current_window_row = _prev_row;
174
        }
175
        else
176
        {
177
            current_window = _new_window;
178
            current_window.krspopout = true;
179
        }
180
        aim_x = lerp(aim_x, current_window.x, 0.7);
181
        aim_y = lerp(aim_y, current_window.y, 0.7);
182
        if (point_distance(aim_x, aim_y, current_window.x, current_window.y) < 3)
183
        {
184
            aim_x = current_window.x;
185
            aim_y = current_window.y;
186
        }
187
        if (hazard_warning >= 0 && endminigame == false)
188
        {
189
            if (hazard_warning == 0)
190
            {
191
                var _hazard = instance_create_depth(640, kris_y_ground, depth - 1, obj_shootout_cactus);
192
                _hazard.hspeed = -4 - (wave * 4);
193
            }
194
            hazard_warning--;
195
        }
196
        if (timer == 0 && endminigame == false)
197
        {
198
            pattern_performed = array_create(50, 0);
199
            pattern = -1;
200
            pattern_timer = 0;
201
        }
202
        if (pattern == -1 && endminigame == false)
203
        {
204
            var _a = 0;
205
            if (shootout_type > 0)
206
                _a = 0.5;
207
            pattern = 1;
208
            if (room == room_shootout && 
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; }
(1232) != 0)
209
                pattern_timer = 22;
210
            else if (i_ex(obj_tenna_enemy) && obj_tenna_enemy.cowboy1tooknodamage == true)
211
                pattern_timer = 22;
212
            else
213
                pattern_timer = 27;
214
            if (endminigame == true)
215
                pattern = -1;
216
        }
217
        if (pattern_timer == 0 && endminigame == false)
218
        {
219
            pattern_performed[pattern] += 1;
220
            debug_message("pattern: " + string(pattern));
221
        }
222
        switch (pattern)
223
        {
224
            case 0:
225
                if (pattern_timer >= 10)
226
                {
227
                    pattern = -1;
228
                    pattern_timer = -1;
229
                }
230
                break;
231
            case 1:
232
                if (pattern_timer >= 270 || endminigame == true)
233
                {
234
                    pattern_prev = pattern;
235
                    pattern = 0;
236
                    pattern_timer = -1;
237
                    break;
238
                }
239
                var createenemy = true;
240
                if (tutorialmode == true && hitcount < 3)
241
                {
242
                    for (var i = 0; i < instance_number(obj_shootout_window); i++)
243
                    {
244
                        enemy[i] = instance_find(obj_shootout_window, i);
245
                        if (enemy[i].type == 1 && (enemy[i].char_state == "idle" || enemy[i].char_state == "aim" || enemy[i].char_state == "shoot" || enemy[i].char_state == "hit"))
246
                            createenemy = false;
247
                    }
248
                }
249
                if (i_ex(obj_tenna_zoom) && obj_tenna_zoom.minigameinsanity == true)
250
                    createenemy = false;
251
                insanitytimer++;
252
                if (((pattern_timer % windowdelay) == 0 && stopspawns == false && alarm[1]
 < 1 && tennatimer < 240 && createenemy == true) || (i_ex(obj_tenna_zoom) && obj_tenna_zoom.minigameinsanity == true && insanitytimer == 4))
gml_Object_obj_shootout_controller_Alarm_1.gml

kris_invincible = false;
253
                {
254
                    var _rep = 1;
255
                    if (insanitytimer == 4 && i_ex(obj_tenna_enemy))
256
                    {
257
                        obj_tenna_enemy.insanitycowboycount++;
258
                        if (obj_tenna_enemy.insanitycowboycount == 1)
259
                            _rep = 2;
260
                        if (obj_tenna_enemy.insanitycowboycount == 2)
261
                            _rep = 3;
262
                        if (obj_tenna_enemy.insanitycowboycount >= 3)
263
                            _rep = 3;
264
                        if (i_ex(obj_tenna_zoom) && obj_tenna_zoom.minigameinsanity == true && obj_tenna_zoom.minigameinsanitytimermax <= 40)
265
                            _rep = 1;
266
                    }
267
                    repeat (_rep)
268
                    {
269
                        windowcount = 0;
270
                        if (tutorialmode == false)
271
                        {
272
                            with (obj_shootout_window)
273
                            {
274
                                if (state != "closed" && column == 1 && row == 0)
275
                                    other.windowcount++;
276
                                if (state != "closed" && column == 1 && row == 1)
277
                                    other.windowcount++;
278
                                if (state != "closed" && column == 1 && row == 2)
279
                                    other.windowcount++;
280
                                if (state != "closed" && column == 0 && row == 1)
281
                                    other.windowcount++;
282
                                if (state != "closed" && column == 2 && row == 1)
283
                                    other.windowcount++;
284
                            }
285
                        }
286
                        var _available_windows;
287
                        if (windowcount == 5 || tutorialmode == true)
288
                        {
289
                            _available_windows = [];
290
                            with (obj_shootout_window)
291
                            {
292
                                if (state == "closed" && active)
293
                                    array_push(_available_windows, id);
294
                            }
295
                        }
296
                        else
297
                        {
298
                            _available_windows = [];
299
                            with (obj_shootout_window)
300
                            {
301
                                if ((state == "closed" && active) && (column == 1 || (column == 0 && row == 1) || (column == 2 && row == 1)))
302
                                    array_push(_available_windows, id);
303
                            }
304
                        }
305
                        if (array_length(_available_windows) > 0)
306
                        {
307
                            var _chosen_window = _available_windows[irandom(array_length(_available_windows) - 1)];
308
                            if (tutorialmode == true && tutorialorder < 10)
309
                            {
310
                                var _column = irandom(2);
311
                                var _row = irandom(2);
312
                                tutorialorder++;
313
                                if (tutorialorder == 1)
314
                                {
315
                                    _column = 1;
316
                                    _row = 1;
317
                                }
318
                                if (tutorialorder == 2)
319
                                {
320
                                    _column = 2;
321
                                    _row = 1;
322
                                }
323
                                if (tutorialorder == 3)
324
                                {
325
                                    _column = 1;
326
                                    _row = 0;
327
                                }
328
                                if (tutorialorder == 4)
329
                                {
330
                                    _column = 0;
331
                                    _row = 1;
332
                                }
333
                                if (tutorialorder == 5)
334
                                {
335
                                    _column = 1;
336
                                    _row = 2;
337
                                }
338
                                if (tutorialorder == 6)
339
                                {
340
                                    _column = 0;
341
                                    _row = 0;
342
                                }
343
                                if (tutorialorder == 7)
344
                                {
345
                                    _column = 0;
346
                                    _row = 2;
347
                                }
348
                                if (tutorialorder == 8)
349
                                {
350
                                    _column = 2;
351
                                    _row = 2;
352
                                }
353
                                if (tutorialorder == 9)
354
                                {
355
                                    _column = 2;
356
                                    _row = 0;
357
                                }
358
                                for (var i = 0; i < instance_number(obj_shootout_window); i++)
359
                                {
360
                                    _window[i] = instance_find(obj_shootout_window, i);
361
                                    if (_window[i].column == _column && _window[i].row == _row)
362
                                        _chosen_window = _window[i];
363
                                }
364
                            }
365
                            with (_chosen_window)
366
                            {
367
                                event_user(12);
368
                                if (type == 2)
369
                                    duration = 30;
370
                                if (other.insanitytimer == 4 && obj_tenna_zoom.minigameinsanitytimermax <= 60)
371
                                    insta = true;
372
                            }
373
                        }
374
                        if (i_ex(obj_tenna_enemy) && obj_tenna_enemy.cowboy1tooknodamage == true && windowdelay > 15)
375
                            windowdelay -= 1;
376
                        else if (windowdelay > 19)
377
                            windowdelay -= 1;
378
                    }
379
                }
380
                break;
381
        }
382
        break;
383
}
384
timer++;
385
pattern_timer++;
386
if (kris_state == "idle")
387
{
388
    if (kris_y == kris_y_ground)
389
        obj_shootout_kris.sprite_index = kris_can_shoot ? spr_kris_ride_2 : spr_kris_ride_1;
390
    else
391
        obj_shootout_kris.sprite_index = kris_can_shoot ? spr_kris_ride_jump_2 : spr_kris_ride_jump_1;
392
}
393
if (kris_actionable)
394
{
395
    if ((i_ex(obj_tenna_zoom) && obj_tenna_zoom.con != 1) || minigameend == 1)
396
    {
397
    }
398
    else if (button1_p() && shootout_type != 3)
399
    {
400
        kris_state = "shoot";
401
        kris_timer = -1;
402
    }
403
}
404
if (kris_state == "shoot")
405
{
406
    if (kris_timer == 0)
407
    {
408
        with (obj_shootout_kris)
409
        {
410
            var fingerx = x + 28;
411
            var fingery = y - 16;
412
            sprite_index = spr_kris_ride_shoot;
413
            image_index = 0;
414
            image_speed = 0;
415
            var impactfx = instance_create(fingerx, fingery, obj_animation);
416
            impactfx.sprite_index = spr_attack_slap2;
417
            impactfx.image_xscale = 0.25;
418
            impactfx.image_yscale = 0.25;
419
            impactfx.image_blend = c_white;
420
            for (var i = 0; i < 8; i++)
421
            {
422
                var smokefx = 
scr_marker
scr_marker

function
scr_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(fingerx, fingery, spr_slidedust);
423
                smokefx.hspeed = random_range(-2, 8);
424
                smokefx.gravity_direction = 180;
425
                smokefx.gravity = 2 - random(0.4);
426
                smokefx.image_speed = 0.2;
427
                smokefx.image_xscale = 2 + random(1);
428
                smokefx.image_yscale = 2 + random(1);
429
                smokefx.vspeed = random_range(-4, 0);
430
                scr_lerp_var_instance(smokefx, "image_alpha", 0.6, 0, 12);
431
                
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(smokefx, 12);
432
            }
433
            snd_play_x(snd_punchmed, 0.8, 0.8 + random(0.2));
434
            timer = 0;
435
            shootcon = 2;
436
        }
437
        reticle_index = 1;
438
        with (current_window)
439
            event_user(13);
440
        var shot = instance_create_depth(obj_shootout_kris.x + 20, obj_shootout_kris.y - 20, obj_shootout_kris.depth, obj_shootout_vfx_mockup_shot);
441
        shot.targetx = current_window.x;
442
        shot.targety = current_window.y;
443
        shot.hittarget = hitwindow;
444
        hitwindow = false;
445
    }
446
    if (kris_timer >= 3)
447
    {
448
        alarm[2]
 = 10;
gml_Object_obj_shootout_controller_Alarm_2.gml

kris_can_shoot = true;
449
        kris_can_shoot = false;
450
        kris_state = "idle";
451
        kris_timer = -1;
452
    }
453
}
454
if ((button2_p() && kris_actionable && kris_y == kris_y_ground) && shootout_type != 3)
455
{
456
    kris_jump_held = true;
457
    kris_vy = -10;
458
}
459
if ((!button2_h() || (kris_y_ground - kris_y) > 50) && shootout_type != 3)
460
    kris_jump_held = false;
461
if (kris_jump_held)
462
    kris_vy -= 1;
463
kris_vy += 1;
464
kris_y += kris_vy;
465
if (kris_y > kris_y_ground)
466
{
467
    if (kris_vy > 1)
468
        dust_timer = 0;
469
    kris_y = min(kris_y, kris_y_ground);
470
    kris_vy = 0;
471
}
472
obj_shootout_horse.x = kris_x + kris_x2 + (sin(current_time / 600) * 8);
473
obj_shootout_horse.y = kris_y;
474
if (kris_y == kris_y_ground && shootout_type != 3)
475
{
476
    obj_shootout_horse.sprite_index = spr_ralsei_horse_run;
477
    if ((dust_timer % 12) == 0)
478
    {
479
        var _dust = instance_create_depth(obj_shootout_horse.x + 24 + irandom(8), kris_y_ground - 18, depth - 2, obj_shootout_dust);
480
        _dust.hspeed = -4;
481
    }
482
    if ((dust_timer % 8) == 0)
483
    {
484
        var _dust = instance_create_depth(obj_shootout_horse.x + 48, kris_y_ground - 12, depth - 2, obj_shootout_dust);
485
        _dust.hspeed = -3.5;
486
    }
487
    if ((dust_timer % 6) == 0)
488
    {
489
        var _dust = instance_create_depth(obj_shootout_horse.x + 94, kris_y_ground - 12, depth - 2, obj_shootout_dust);
490
        _dust.hspeed = -3;
491
    }
492
    dust_timer++;
493
}
494
else
495
{
496
    obj_shootout_horse.sprite_index = spr_ralsei_horse_jump;
497
}
498
var _jump_y_offset = min((kris_y_ground - kris_y) * 0.15, 8);
499
with (obj_shootout_kris)
500
{
501
    x = obj_shootout_horse.x + 68;
502
    y = obj_shootout_horse.y - 66 - _jump_y_offset;
503
    if (other.kris_y == other.kris_y_ground)
504
    {
505
        y -= (round(cos(((obj_shootout_horse.image_index + 1) / 8) * pi * 2)) * 2);
506
    }
507
    else
508
    {
509
    }
510
}
511
with (obj_shootout_susie)
512
{
513
    x = obj_shootout_horse.x + 38;
514
    y = obj_shootout_horse.y - 72 - _jump_y_offset;
515
    if (other.kris_y == other.kris_y_ground)
516
    {
517
        sprite_index = spr_susie_ride;
518
        y -= (round(cos(((obj_shootout_horse.image_index + 2) / 8) * pi * 2)) * 2);
519
    }
520
    else
521
    {
522
        sprite_index = spr_susie_ride_jump;
523
    }
524
}
525
var _hazard_hit;
526
with (obj_shootout_horse)
527
    _hazard_hit = place_meeting(x, y, obj_shootout_hazard);
528
if (krishit)
529
    _hazard_hit = 1;
530
if (_hazard_hit && !kris_invincible && state == "main")
531
{
532
    kris_actionable = false;
533
    kris_invincible = true;
534
    alarm[1]
 = 30;
gml_Object_obj_shootout_controller_Alarm_1.gml

kris_invincible = false;
535
    alarm[0]
 = 12;
gml_Object_obj_shootout_controller_Alarm_0.gml

kris_actionable = true;
536
    kris_vy = -8;
537
    beatwithoutgettinghit = false;
538
    global.interact = 1;
539
    if (i_ex(obj_tenna_zoom) && obj_tenna_zoom.con > 1)
540
    {
541
    }
542
    if (i_ex(obj_tenna_enemy))
543
    {
544
        
scr_shakescreen
scr_shakescreen

function
scr_shakescreen()
{ instance_create(x, y, obj_shake); }
();
545
        global.inv = -1;
546
        obj_tenna_enemy.minigamefailcount++;
547
        if (obj_tenna_enemy.minigamefailcount == 3 && obj_tenna_zoom.minigameinsanity == false)
548
        {
549
            with (obj_tenna_zoom)
550
            {
551
                con = 2;
552
                timer = -1;
553
            }
554
        }
555
    }
556
    else
557
    {
558
        global.inv = -1;
559
        
scr_damage_all_overworld
scr_damage_all_overworld

function
scr_damage_all_overworld()
{ if (global.inv < 0) { gameover = 1; if (global.char[0] != 0 && global.hp[global.char[0]] > 1) gameover = 0; if (global.char[1] != 0 && global.hp[global.char[1]] > 1) gameover = 0; if (global.char[2] != 0 && global.hp[global.char[2]] > 1) gameover = 0; if (gameover == 1) { with (obj_event_manager) trigger_event(UnknownEnum.Value_1);
scr_gameover();
}
scr_damage_cache();
remdamage = damage; remtarget = target; if (!instance_exists(obj_shake)) instance_create(0, 0, obj_shake); with (obj_dmgwriter) killactive = 1; snd_stop(snd_hurt1); snd_play(snd_hurt1); for (ti = 0; ti < 3; ti += 1) { global.inv = -1; damage = remdamage; target = ti; tdamage = damage; with (global.charinstance[target]) { hurt = 1; hurttimer = 0; } hpdiff = tdamage; if (hpdiff >= global.hp[global.char[target]]) hpdiff = global.hp[global.char[target]] - 1; d_cancel = 0; if (hpdiff <= 1) { if (global.hp[global.char[target]] <= 0) { hpdiff = 0; d_cancel = 1; } else { hpdiff = 1; } } if (d_cancel == 0) { doomtype = -1; global.hp[global.char[target]] -= hpdiff; if (global.charinstance[target].visible == true || (global.chapter == 3 && room == room_shootout)) { dmgwriter = instance_create(global.charinstance[target].x, (global.charinstance[target].y + global.charinstance[target].myheight) - 24, obj_dmgwriter); dmgwriter.damage = hpdiff; dmgwriter.type = doomtype; } } if (global.hp[global.char[target]] < 1) global.hp[global.char[target]] = 1; } scr_damage_check(); target = remtarget; global.inv = global.invc * 30; } } enum UnknownEnum { Value_1 = 1 }
();
560
        with (obj_darkcontroller)
561
            charcon = 1;
562
        with (obj_dmgwriter)
563
        {
564
            x = camerax() + 100;
565
            y += 30;
566
            if (instance_number(obj_dmgwriter) > 1)
567
                instance_destroy();
568
        }
569
    }
570
    var _inst = instance_place(x, y, obj_shootout_hazard);
571
    with (_inst)
572
        instance_destroy();
573
    snd_play(snd_hurt1);
574
}
575
krishit = false;
576
if (kris_invincible)
577
{
578
    with (obj_shootout_horse)
579
    {
580
        if (!instance_exists(flash))
581
            flash = 
scr_oflash
scr_oflash

function
scr_oflash(arg0 = false)
{ var _oflash = instance_create_depth(x, y, depth - 1, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_yscale = image_yscale; _oflash.image_speed = 0; _oflash.image_index = image_index; _oflash.sprite_index = sprite_index; _oflash.target = id; _oflash.follow = arg0; return _oflash; }
(true);
582
    }
583
    with (obj_shootout_kris)
584
    {
585
        if (!instance_exists(flash))
586
            flash = 
scr_oflash
scr_oflash

function
scr_oflash(arg0 = false)
{ var _oflash = instance_create_depth(x, y, depth - 1, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_yscale = image_yscale; _oflash.image_speed = 0; _oflash.image_index = image_index; _oflash.sprite_index = sprite_index; _oflash.target = id; _oflash.follow = arg0; return _oflash; }
(true);
587
    }
588
    with (obj_shootout_susie)
589
    {
590
        if (!instance_exists(flash))
591
            flash = 
scr_oflash
scr_oflash

function
scr_oflash(arg0 = false)
{ var _oflash = instance_create_depth(x, y, depth - 1, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_yscale = image_yscale; _oflash.image_speed = 0; _oflash.image_index = image_index; _oflash.sprite_index = sprite_index; _oflash.target = id; _oflash.follow = arg0; return _oflash; }
(true);
592
    }
593
}
594
if (obj_shootout_kris.sprite_index == spr_kris_ride_1 || obj_shootout_kris.sprite_index == spr_kris_ride_jump_1)
595
{
596
    if ((timer % 3) == 0)
597
    {
598
        var _hrt = 
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
599
        _hrt.depth = depth - 5;
600
        _hrt.x = obj_shootout_kris.x + 18;
601
        _hrt.y = obj_shootout_kris.y - 28;
602
        _hrt.sprite_index = spr_shootout_heart;
603
        _hrt.image_xscale = 1;
604
        _hrt.image_yscale = 1;
605
        _hrt.direction = 135;
606
        _hrt.speed = 2;
607
        _hrt.image_speed = 0;
608
        _hrt.image_index = 1;
609
        _hrt.fadeSpeed = 0.1;
610
    }
611
}
612
kris_timer++;
613
susietimer++;
614
if (button1_p())
615
    susietimer = 520;
616
if (button2_p() && i_ex(obj_battleblcon))
617
    susietimer = 520;
618
if (susietimer == 350)
619
{
620
    global.typer = 75;
621
    msgsetloc(0, 
Hey, what are
you doing!?
Shoot!
"Hey, what are&you doing!?&Shoot!", "obj_shootout_controller_slash_Step_0_gml_591_0"
);
622
    
scr_enemyblcon
scr_enemyblcon

function
scr_enemyblcon(arg0, arg1, arg2)
{ if (arg2 == 0) { mywriter = instance_create(arg0, arg1, obj_writer); return mywriter; } if (arg2 == 1) { myblcon = instance_create(arg0, arg1, obj_battleblcon); return myblcon; } if (arg2 == 2) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v; return myblcon; } if (arg2 == 3) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; return myblcon; } if (arg2 == 4) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; myblcon.image_index = 0; myblcon.image_speed = 0; return myblcon; } if (arg2 == 5) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; myblcon.image_index = 1; myblcon.image_speed = 0; return myblcon; } if (arg2 == 6) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_clubs; myblcon.image_index = 2; myblcon.image_speed = 0; return myblcon; } if (arg2 == 7) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long_r; myblcon.image_index = 2; myblcon.image_speed = 0; return myblcon; } if (arg2 == 8) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long_tall; return myblcon; } if (arg2 == 10) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_long; myblcon.auto_length = 1; return myblcon; } if (arg2 == 11) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v2_left; return myblcon; } if (arg2 == 12) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v2_right; return myblcon; } if (arg2 == 12.1) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v2_right2; return myblcon; } if (arg2 == 12.2) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v2_right3; return myblcon; } if (arg2 == 12.3) { myblcon = instance_create(arg0, arg1, obj_battleblcon); myblcon.sprite_index = spr_battleblcon_v2_right4; return myblcon; } if (arg2 == 12.4) { ...
(camerax() + 50, cameray() + 180, 2);
623
    with (obj_battleblcon)
624
    {
625
        sprite_index = spr_battleblcon_v_bigger;
626
        x += 4;
627
    }
628
}
629
if (susietimer == 520)
630
{
631
    with (obj_battleblcon)
632
        instance_destroy();
633
    with (obj_writer)
634
        instance_destroy();
635
}
636
if (endminigame == true && !i_ex(obj_tenna_enemy))
637
{
638
    endminigametimer++;
639
    if (endminigametimer == 1)
640
    {
641
        minigametext = instance_create(x, y - 150, obj_tenna_enemy_minigametext);
642
        minigametext.mystring = stringsetloc(
ROUND CLEAR!
"ROUND CLEAR!", "obj_shootout_controller_slash_Step_0_gml_604_0"
);
643
        minigameend = 1;
644
    }
645
    if (endminigametimer > 60)
646
        kris_x2 += 12;
647
}
648
if (kris_x2 == 600)
649
    
scr_fadeout
scr_fadeout

function
scr_fadeout(arg0)
{ __fadeouter = instance_create(camerax() - 200, cameray() - 200, obj_fadeout); __fadeouter.fadespeed = 1 / arg0; __fadeouter.depth = 3; return __fadeouter; }
(10);
650
if (kris_x2 == 720)
651
{
652
    global.interact = 3;
653
    global.facing = 2;
654
    global.entrance = 1;
655
    persistent = true;
656
    if (room == room_shootout)
657
    {
658
        if (
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; }
(1232) == 0)
659
            room_goto(room_dw_teevie_cowboy_zone_01_after);
660
        else
661
            room_goto(room_dw_teevie_cowboy_zone_02_after);
662
    }
663
    instance_create(0, 0, obj_persistentfadein);
664
    instance_destroy();
665
}
666
if (i_ex(obj_tenna_zoom) && obj_tenna_zoom.minigameinsanity == true && obj_tenna_zoom.minigametype == "cowboy" && obj_tenna_zoom.minigamedifficulty == 0)
667
{
668
    for (var i = 0; i < instance_number(obj_shootout_window); i++)
669
    {
670
        enemy[i] = instance_find(obj_shootout_window, i);
671
        if ((enemy[i].state == "open" || enemy[i].state == "opening") && enemy[i].char_state != "hit")
672
            obj_tenna_zoom.minigameinsanitytimer = obj_tenna_zoom.minigameinsanitytimermax - 5;
673
    }
674
}