Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_battle_core_directory_action_3_selected_event

(view raw script w/o annotations or w/e)
1
function scr_battle_core_directory_action_3_selected_event
scr_battle_core_directory_action_3_selected_event

function scr_battle_core_directory_action_3_selected_event() //gml_Script_scr_battle_core_directory_action_3_selected_event { var event_check = false if (game_mode == "customs") { if (battle_enemy_name == "craniex") { global.action_1_selected_count = 0 global.action_2_selected_count = 0 global.action_3_selected_count += 1 global.enemy_sparing = false global.enemy_attacking = true instance_destroy() return; } else if (battle_enemy_name == "ms mettaton") { global.enemy_sparing = false global.enemy_attacking = true instance_destroy() return; } } else if (game_mode == "yellow") { if (battle_enemy_name == "flier a") { global.action_1_selected_count = 0 global.action_2_selected_count = 0 if (global.action_3_selected_count < 2) global.action_3_selected_count += 1 global.enemy_attacking = true instance_destroy() return; } else if (battle_enemy_name == "flier b") { global.action_1_selected_count_2 = 0 global.action_2_selected_count_2 = 0 if (global.action_3_selected_count_2 < 2) global.action_3_selected_count_2 += 1 global.enemy_attacking = true instance_destroy() return; } else if (battle_enemy_name == "flier c") { global.action_1_selected_count_3 = 0 global.action_2_selected_count_3 = 0 if (global.action_3_selected_count_3 < 2) global.action_3_selected_count_3 += 1 global.enemy_attacking = true instance_destroy() return; } else if (battle_enemy_name == "sweet corn a") { global.action_1_selected_count = 0 global.action_2_selected_count = 0 if (global.action_3_selected_count < 1) global.action_3_selected_count += 1 if (global.item_gift != "Nothing") global.enemy_sparing = true global.enemy_attacking = true instance_destroy() return; } else if (battle_enemy_name == "sweet corn b") { global.action_1_selected_count_2 = 0 global.action_2_selected_count_2 = 0 if (global.action_3_selected_count_2 < 1) global.action_3_selected_count_2 += 1 if (global.item_gift != "Nothing") global.enemy_sparing_2 = true global.enemy_attacking = true instance_destroy() return; } else if (battle_enemy_name == "crispy scroll a") { global.action_1_selected_count = 0 global.action_2_selected_count = 0 if (global.action_3_selected_count < 1) global.action_3_selected_count += 1 global.enemy_attacking = true instance_destroy() return; } else if (battle_enemy_name == "rorrim a") { global.action_1_selected_count = 0 global.action_2_selected_count = 0 if (global.action_3_selected_count < 2) global.action_3_selected_count += 1 if (!global.enemy_sparing) { global.action_2_important = true global.action_2_color = 65535 } global.enemy_attacking = true ...
() //gml_Script_scr_battle_core_directory_action_3_selected_event
2
{
3
    var event_check = false
4
    if (game_mode == "customs")
5
    {
6
        if (battle_enemy_name == "craniex")
7
        {
8
            global.action_1_selected_count = 0
9
            global.action_2_selected_count = 0
10
            global.action_3_selected_count += 1
11
            global.enemy_sparing = false
12
            global.enemy_attacking = true
13
            instance_destroy()
14
            return;
15
        }
16
        else if (battle_enemy_name == "ms mettaton")
17
        {
18
            global.enemy_sparing = false
19
            global.enemy_attacking = true
20
            instance_destroy()
21
            return;
22
        }
23
    }
24
    else if (game_mode == "yellow")
25
    {
26
        if (battle_enemy_name == "flier a")
27
        {
28
            global.action_1_selected_count = 0
29
            global.action_2_selected_count = 0
30
            if (global.action_3_selected_count < 2)
31
                global.action_3_selected_count += 1
32
            global.enemy_attacking = true
33
            instance_destroy()
34
            return;
35
        }
36
        else if (battle_enemy_name == "flier b")
37
        {
38
            global.action_1_selected_count_2 = 0
39
            global.action_2_selected_count_2 = 0
40
            if (global.action_3_selected_count_2 < 2)
41
                global.action_3_selected_count_2 += 1
42
            global.enemy_attacking = true
43
            instance_destroy()
44
            return;
45
        }
46
        else if (battle_enemy_name == "flier c")
47
        {
48
            global.action_1_selected_count_3 = 0
49
            global.action_2_selected_count_3 = 0
50
            if (global.action_3_selected_count_3 < 2)
51
                global.action_3_selected_count_3 += 1
52
            global.enemy_attacking = true
53
            instance_destroy()
54
            return;
55
        }
56
        else if (battle_enemy_name == "sweet corn a")
57
        {
58
            global.action_1_selected_count = 0
59
            global.action_2_selected_count = 0
60
            if (global.action_3_selected_count < 1)
61
                global.action_3_selected_count += 1
62
            if (global.item_gift != "Nothing")
63
                global.enemy_sparing = true
64
            global.enemy_attacking = true
65
            instance_destroy()
66
            return;
67
        }
68
        else if (battle_enemy_name == "sweet corn b")
69
        {
70
            global.action_1_selected_count_2 = 0
71
            global.action_2_selected_count_2 = 0
72
            if (global.action_3_selected_count_2 < 1)
73
                global.action_3_selected_count_2 += 1
74
            if (global.item_gift != "Nothing")
75
                global.enemy_sparing_2 = true
76
            global.enemy_attacking = true
77
            instance_destroy()
78
            return;
79
        }
80
        else if (battle_enemy_name == "crispy scroll a")
81
        {
82
            global.action_1_selected_count = 0
83
            global.action_2_selected_count = 0
84
            if (global.action_3_selected_count < 1)
85
                global.action_3_selected_count += 1
86
            global.enemy_attacking = true
87
            instance_destroy()
88
            return;
89
        }
90
        else if (battle_enemy_name == "rorrim a")
91
        {
92
            global.action_1_selected_count = 0
93
            global.action_2_selected_count = 0
94
            if (global.action_3_selected_count < 2)
95
                global.action_3_selected_count += 1
96
            if (!global.enemy_sparing)
97
            {
98
                global.action_2_important = true
99
                global.action_2_color = 65535
100
            }
101
            global.enemy_attacking = true
102
            instance_destroy()
103
            return;
104
        }
105
        else if (battle_enemy_name == "decibat")
106
        {
107
            if (global.enemy_sparing == false && (global.action_1_selected_count + global.action_3_selected_count) < 6)
108
                global.action_3_selected_count += 1
109
            if (global.enemy_sparing == false)
110
                global.action_2_selected_count = 0
111
            if (global.enemy_sparing == true && global.enemy_low_hp == false)
112
            {
113
                script_execute(gml_Script_scr_start_enemy_sparing_decibat)
114
                instance_destroy()
115
                return;
116
            }
117
            audio_sound_gain(mus_decibat_yellow, 1, 1500)
118
            if ((global.action_1_selected_count + global.action_3_selected_count) == 6 && global.enemy_low_hp == false)
119
                global.important_cutscene = true
120
            else
121
                global.enemy_attacking = true
122
            instance_destroy()
123
            return;
124
        }
125
        else if (battle_enemy_name == "micro froggit")
126
        {
127
            if (global.action_1_selected_count == 0)
128
                global.action_2_selected_count = 0
129
            if (global.action_3_selected_count < 1)
130
                global.action_3_selected_count += 1
131
            if (global.action_3_selected_count == 1)
132
                global.important_cutscene = true
133
            else
134
                global.enemy_attacking = true
135
            instance_destroy()
136
            return;
137
        }
138
        else if (battle_enemy_name == "insomnitot a")
139
        {
140
            global.action_1_selected_count = 0
141
            global.action_2_selected_count = 0
142
            if (global.action_3_selected_count < 1)
143
                global.action_3_selected_count += 1
144
            if (global.enemy_sparing == true && global.enemy_low_hp == false)
145
            {
146
                if (global.battle_enemy_name == "insomnitot solo")
147
                    script_execute(gml_Script_scr_start_enemy_no_attack_insomnitot_solo)
148
                else if (global.battle_enemy_name == "insomnitot duo")
149
                {
150
                    if ((global.enemy_sparing_2 == true && global.enemy_low_hp_2 == false) || (global.enemy_dead_2 + global.enemy_spared_2) >= 1)
151
                        script_execute(gml_Script_scr_start_enemy_no_attack_insomnitot_duo)
152
                    else
153
                        global.enemy_attacking = true
154
                }
155
                else
156
                    global.enemy_attacking = true
157
            }
158
            else
159
                global.enemy_attacking = true
160
            instance_destroy()
161
            return;
162
        }
163
        else if (battle_enemy_name == "insomnitot b")
164
        {
165
            global.action_1_selected_count_2 = 0
166
            global.action_2_selected_count_2 = 0
167
            if (global.action_3_selected_count_2 < 1)
168
                global.action_3_selected_count_2 += 1
169
            if (global.enemy_sparing_2 == true && global.enemy_low_hp_2 == false)
170
            {
171
                if (global.battle_enemy_name == "insomnitot duo")
172
                {
173
                    if ((global.enemy_sparing == true && global.enemy_low_hp == false) || (global.enemy_dead + global.enemy_spared) >= 1)
174
                        script_execute(gml_Script_scr_start_enemy_no_attack_insomnitot_duo)
175
                    else
176
                        global.enemy_attacking = true
177
                }
178
                else if (global.battle_enemy_name == "know cone insomnitot duo")
179
                {
180
                    if ((global.enemy_dead + global.enemy_spared) >= 1)
181
                        script_execute(gml_Script_scr_start_enemy_no_attack_know_cone_insomnitot_duo)
182
                    else
183
                        global.enemy_attacking = true
184
                }
185
                else
186
                    global.enemy_attacking = true
187
            }
188
            else
189
                global.enemy_attacking = true
190
            instance_destroy()
191
            return;
192
        }
193
        else if (battle_enemy_name == "know cone a")
194
        {
195
            global.action_1_selected_count = 0
196
            global.action_2_selected_count = 0
197
            if (global.action_3_selected_count < 1)
198
                global.action_3_selected_count += 1
199
            global.enemy_attacking = true
200
            instance_destroy()
201
            return;
202
        }
203
        else if (battle_enemy_name == "know cone b")
204
        {
205
            global.action_1_selected_count_2 = 0
206
            global.action_2_selected_count_2 = 0
207
            if (global.action_3_selected_count_2 < 1)
208
                global.action_3_selected_count_2 += 1
209
            global.enemy_attacking = true
210
            instance_destroy()
211
            return;
212
        }
213
        else if (battle_enemy_name == "frostermit a")
214
        {
215
            if (global.action_3_selected_count < 1)
216
                global.action_3_selected_count += 1
217
            global.enemy_attacking = true
218
            instance_destroy()
219
            return;
220
        }
221
        else if (battle_enemy_name == "trihecta")
222
        {
223
            global.action_1_selected_count = 0
224
            global.action_2_selected_count = 0
225
            if (global.action_3_selected_count < 1)
226
                global.action_3_selected_count += 1
227
            global.enemy_attacking = true
228
            instance_destroy()
229
            return;
230
        }
231
        else if (battle_enemy_name == "tri")
232
        {
233
            global.action_1_selected_count = 0
234
            global.action_2_selected_count = 0
235
            if (global.action_3_selected_count < 1)
236
                global.action_3_selected_count += 1
237
            global.enemy_attacking = true
238
            instance_destroy()
239
            return;
240
        }
241
        else if (battle_enemy_name == "hec")
242
        {
243
            global.action_1_selected_count_2 = 0
244
            global.action_2_selected_count_2 = 0
245
            if (global.action_3_selected_count_2 < 1)
246
                global.action_3_selected_count_2 += 1
247
            global.enemy_attacking = true
248
            instance_destroy()
249
            return;
250
        }
251
        else if (battle_enemy_name == "ta")
252
        {
253
            if (global.action_3_selected_count_3 < 1)
254
                global.action_3_selected_count_3 += 1
255
            global.enemy_attacking = true
256
            instance_destroy()
257
            return;
258
        }
259
        else if (battle_enemy_name == "martlet pacifist")
260
        {
261
            if (global.action_3_selected_count < 2)
262
                global.action_3_selected_count += 1
263
            event_check = true
264
        }
265
        else if (battle_enemy_name == "dunebud a")
266
        {
267
            global.action_1_selected_count = 0
268
            global.action_2_selected_count = 0
269
            if (global.action_3_selected_count < 2)
270
                global.action_3_selected_count += 1
271
            if (global.action_3_selected_count == 2)
272
            {
273
                if (global.enemy_low_hp == false)
274
                {
275
                    with (obj_dunebud_a)
276
                    {
277
                        if (object_index != obj_dunebud_b)
278
                        {
279
                            sinking_away = true
280
                            sprite_index = spr_dunebud_sink
281
                            image_speed = image_speed_sink
282
                            image_index = 0
283
                            image_xscale = 1
284
                            image_yscale = 1
285
                        }
286
                    }
287
                }
288
                else
289
                    global.enemy_attacking = true
290
            }
291
            if (global.action_3_selected_count != 2)
292
                global.enemy_attacking = true
293
            instance_destroy()
294
            return;
295
        }
296
        else if (battle_enemy_name == "dunebud b")
297
        {
298
            global.action_1_selected_count_2 = 0
299
            global.action_2_selected_count_2 = 0
300
            if (global.action_3_selected_count_2 < 2)
301
                global.action_3_selected_count_2 += 1
302
            if (global.action_3_selected_count_2 == 2)
303
            {
304
                if (global.enemy_low_hp_2 == false)
305
                {
306
                    with (obj_dunebud_b)
307
                    {
308
                        sinking_away = true
309
                        sprite_index = spr_dunebud_sink
310
                        image_speed = image_speed_sink
311
                        image_index = 0
312
                        image_xscale = 1
313
                        image_yscale = 1
314
                    }
315
                }
316
                else
317
                    global.enemy_attacking = true
318
            }
319
            if (global.action_3_selected_count_2 != 2)
320
                global.enemy_attacking = true
321
            instance_destroy()
322
            return;
323
        }
324
        else if (battle_enemy_name == "slither a")
325
        {
326
            global.action_1_selected_count = 0
327
            global.action_2_selected_count = 0
328
            if (global.action_3_selected_count < 2)
329
                global.action_3_selected_count += 1
330
            if (global.action_3_selected_count >= 2)
331
                global.enemy_sparing = true
332
            global.enemy_attacking = true
333
            instance_destroy()
334
            return;
335
        }
336
        else if (battle_enemy_name == "slither b")
337
        {
338
            global.action_1_selected_count_2 = 0
339
            global.action_2_selected_count_2 = 0
340
            if (global.action_3_selected_count_2 < 2)
341
                global.action_3_selected_count_2 += 1
342
            if (global.action_3_selected_count_2 >= 2)
343
            {
344
                global.action_3_selected_count_2 = 0
345
                global.enemy_sparing_2 = true
346
            }
347
            global.enemy_attacking = true
348
            instance_destroy()
349
            return;
350
        }
351
        else if (battle_enemy_name == "bowll a")
352
        {
353
            global.action_1_selected_count = 0
354
            global.action_2_selected_count = 0
355
            if (global.action_3_selected_count < 2)
356
                global.action_3_selected_count += 1
357
            global.enemy_attacking = true
358
            instance_destroy()
359
            return;
360
        }
361
        else if (battle_enemy_name == "el bailador")
362
        {
363
            global.action_1_selected_count = 0
364
            global.action_2_selected_count = 0
365
            if (global.action_3_selected_count < 1)
366
                global.action_3_selected_count += 1
367
            global.enemy_attacking = true
368
            instance_destroy()
369
            return;
370
        }
371
        else if (battle_enemy_name == "flower girls")
372
        {
373
            global.action_1_selected_count = 0
374
            global.action_2_selected_count = 0
375
            if (global.action_3_selected_count < 1)
376
                global.action_3_selected_count += 1
377
            global.enemy_attacking = true
378
            instance_destroy()
379
            return;
380
        }
381
        else if (battle_enemy_name == "ceroba genocide")
382
        {
383
            global.enemy_attacking = true
384
            instance_destroy()
385
        }
386
        else if (battle_enemy_name == "starlo")
387
        {
388
            global.enemy_attacking = true
389
            instance_destroy()
390
        }
391
        else if (battle_enemy_name == "tellyvis a")
392
        {
393
            if (global.action_3_selected_count < 1)
394
                global.action_3_selected_count += 1
395
            global.enemy_attacking = true
396
            instance_destroy()
397
            return;
398
        }
399
        else if (battle_enemy_name == "jandroid a")
400
        {
401
            if (global.action_3_selected_count < 1)
402
                global.action_3_selected_count += 1
403
            global.action_2_selected_count = 0
404
            global.action_1_selected_count = 0
405
            global.enemy_attacking = true
406
            instance_destroy()
407
            return;
408
        }
409
        else if (battle_enemy_name == "jandroid b")
410
        {
411
            if (global.action_3_selected_count_2 < 1)
412
                global.action_3_selected_count_2 += 1
413
            global.action_2_selected_count_2 = 0
414
            global.action_1_selected_count_2 = 0
415
            global.enemy_attacking = true
416
            instance_destroy()
417
            return;
418
        }
419
        else if (battle_enemy_name == "goosic a")
420
        {
421
            if (global.action_3_selected_count < 1)
422
                global.action_3_selected_count += 1
423
            global.enemy_attacking = true
424
            instance_destroy()
425
            return;
426
        }
427
        else if (battle_enemy_name == "goosic b")
428
        {
429
            if (global.action_3_selected_count_2 < 1)
430
                global.action_3_selected_count_2 += 1
431
            global.enemy_attacking = true
432
            instance_destroy()
433
            return;
434
        }
435
        else if (battle_enemy_name == "sousborg")
436
        {
437
            if (global.enemy_mode == 2)
438
            {
439
                global.enemy_mode = 3
440
                global.enemy_attack = "Sousborg Season"
441
                global.action_amount = 0
442
            }
443
            else
444
                global.enemy_attack = "Sousborg Flip"
445
            global.enemy_attacking = true
446
            instance_destroy()
447
            return;
448
        }
449
        else if (battle_enemy_name == "axis")
450
        {
451
            global.enemy_attacking = true
452
            instance_destroy()
453
        }
454
        else if (battle_enemy_name == "axis genocide")
455
        {
456
            global.enemy_attacking = true
457
            instance_destroy()
458
        }
459
        else if (battle_enemy_name == "macro froggit")
460
        {
461
            global.action_3_selected_count += 1
462
            global.enemy_attacking = true
463
            instance_destroy()
464
        }
465
        else if (battle_enemy_name == "guardener")
466
        {
467
            global.action_3_selected_count += 1
468
            global.enemy_attacking = true
469
            instance_destroy()
470
            return;
471
        }
472
        else if (battle_enemy_name == "ed" || battle_enemy_name == "ace" || battle_enemy_name == "mooch" || battle_enemy_name == "moray")
473
        {
474
            global.enemy_attacking = true
475
            instance_destroy()
476
        }
477
        else if (battle_enemy_name == "flowey")
478
        {
479
            if (global.flowey_act[2] == 4)
480
            {
481
                audio_play_sound(snd_heal, 1, 0)
482
                if (global.current_hp_self < global.max_hp_self)
483
                {
484
                    global.current_hp_self += floor(global.max_hp_self * 0.3)
485
                    if (global.current_hp_self > global.max_hp_self)
486
                        global.current_hp_self = global.max_hp_self
487
                }
488
                global.enemy_attacking = true
489
            }
490
            else
491
            {
492
                instance_create_depth(0, 0, -100, obj_flowey_battle_screen_glitch_fight)
493
                with (obj_heart_battle_menu)
494
                    event_user(0)
495
            }
496
            instance_destroy()
497
        }
498
        else if (battle_enemy_name == "ceroba")
499
        {
500
            if ((!instance_exists(obj_ceroba_pacifist_act_helper)) || obj_ceroba_pacifist_act_helper.can_skip == true)
501
            {
502
                global.action_3_selected_count += 1
503
                global.enemy_attacking = true
504
                instance_destroy()
505
            }
506
            return;
507
        }
508
    }
509
    if (event_check == true)
510
    {
511
        var act_number = global.act_number
512
        switch act_number
513
        {
514
            case 1:
515
                scr_determine_special_effect_enemy
scr_determine_special_effect_enemy

function scr_determine_special_effect_enemy(argument0) //gml_Script_scr_determine_special_effect_enemy { var battle_enemy_name = global.battle_enemy_name if (global.game_mode == "customs") { } else if (global.game_mode == "yellow") { switch battle_enemy_name { case "martlet pacifist": scr_enemy_mode_shift_martlet_pacifist(argument0) break case "martlet genocide": scr_enemy_mode_shift_martlet_genocide(argument0) break } } global.special_effect_end_value = argument0 }
("Action 3")
516
                break
517
            case 2:
518
                scr_determine_special_effect_enemy
scr_determine_special_effect_enemy

function scr_determine_special_effect_enemy(argument0) //gml_Script_scr_determine_special_effect_enemy { var battle_enemy_name = global.battle_enemy_name if (global.game_mode == "customs") { } else if (global.game_mode == "yellow") { switch battle_enemy_name { case "martlet pacifist": scr_enemy_mode_shift_martlet_pacifist(argument0) break case "martlet genocide": scr_enemy_mode_shift_martlet_genocide(argument0) break } } global.special_effect_end_value = argument0 }
("Action 3 2")
519
                break
520
            case 3:
521
                scr_determine_special_effect_enemy
scr_determine_special_effect_enemy

function scr_determine_special_effect_enemy(argument0) //gml_Script_scr_determine_special_effect_enemy { var battle_enemy_name = global.battle_enemy_name if (global.game_mode == "customs") { } else if (global.game_mode == "yellow") { switch battle_enemy_name { case "martlet pacifist": scr_enemy_mode_shift_martlet_pacifist(argument0) break case "martlet genocide": scr_enemy_mode_shift_martlet_genocide(argument0) break } } global.special_effect_end_value = argument0 }
("Action 3 3")
522
                break
523
        }
524
525
        global.important_cutscene = script_execute(gml_Script_scr_determine_important_cutscene_attacking)
526
        global.can_attack = script_execute(gml_Script_scr_determine_can_attack_attacking)
527
        if (global.important_cutscene == false && global.can_attack == true)
528
            global.enemy_attacking = true
529
        if (global.can_attack == false)
530
        {
531
            with (obj_dialogue_box_battle)
532
                no_loop_can_attack = false
533
        }
534
        instance_destroy()
535
        return;
536
    }
537
}