Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_enemy_mode_shift_martlet_genocide

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

function scr_enemy_mode_shift_martlet_genocide(argument0) //gml_Script_scr_enemy_mode_shift_martlet_genocide { var reset_counters = false var enemy_mode = global.enemy_mode switch enemy_mode { case 0: if (argument0 == "Fight 1") { if (global.enemy_hit == true) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 2 reset_counters = true } else if (global.enemy_hit == false) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 1 reset_counters = true } } else if (argument0 == "Action 1") { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 4 reset_counters = true } else { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 1 reset_counters = true } break case 1: if (argument0 == "Fight 1") { if (global.enemy_hit == true) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 2 reset_counters = true } } else if (argument0 == "Action 1") { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 4 reset_counters = true } break case 2: if (argument0 == "Action 1") { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 4 reset_counters = true } break case 3: if (argument0 == "Fight 1") { if (global.enemy_low_hp == true) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 5 reset_counters = true } } break case 4: if (argument0 == "Fight 1") { if (global.enemy_hit == true) { if (global.action_1_selected_count < 2) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 3 reset_counters = true } else { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 6 reset_counters = true } } } break } enemy_mode = global.enemy_mode var enemy_mode_gen_preprevious = global.enemy_mode_gen_previous var enemy_mode_gen_current = global.enemy_mode_gen switch enemy_mode { case 0: global.enemy_mode_gen = 0 break ...
(argument0) //gml_Script_scr_enemy_mode_shift_martlet_genocide
2
{
3
    var reset_counters = false
4
    var enemy_mode = global.enemy_mode
5
    switch enemy_mode
6
    {
7
        case 0:
8
            if (argument0 == "Fight 1")
9
            {
10
                if (global.enemy_hit == true)
11
                {
12
                    global.enemy_mode_previous = global.enemy_mode
13
                    global.enemy_mode = 2
14
                    reset_counters = true
15
                }
16
                else if (global.enemy_hit == false)
17
                {
18
                    global.enemy_mode_previous = global.enemy_mode
19
                    global.enemy_mode = 1
20
                    reset_counters = true
21
                }
22
            }
23
            else if (argument0 == "Action 1")
24
            {
25
                global.enemy_mode_previous = global.enemy_mode
26
                global.enemy_mode = 4
27
                reset_counters = true
28
            }
29
            else
30
            {
31
                global.enemy_mode_previous = global.enemy_mode
32
                global.enemy_mode = 1
33
                reset_counters = true
34
            }
35
            break
36
        case 1:
37
            if (argument0 == "Fight 1")
38
            {
39
                if (global.enemy_hit == true)
40
                {
41
                    global.enemy_mode_previous = global.enemy_mode
42
                    global.enemy_mode = 2
43
                    reset_counters = true
44
                }
45
            }
46
            else if (argument0 == "Action 1")
47
            {
48
                global.enemy_mode_previous = global.enemy_mode
49
                global.enemy_mode = 4
50
                reset_counters = true
51
            }
52
            break
53
        case 2:
54
            if (argument0 == "Action 1")
55
            {
56
                global.enemy_mode_previous = global.enemy_mode
57
                global.enemy_mode = 4
58
                reset_counters = true
59
            }
60
            break
61
        case 3:
62
            if (argument0 == "Fight 1")
63
            {
64
                if (global.enemy_low_hp == true)
65
                {
66
                    global.enemy_mode_previous = global.enemy_mode
67
                    global.enemy_mode = 5
68
                    reset_counters = true
69
                }
70
            }
71
            break
72
        case 4:
73
            if (argument0 == "Fight 1")
74
            {
75
                if (global.enemy_hit == true)
76
                {
77
                    if (global.action_1_selected_count < 2)
78
                    {
79
                        global.enemy_mode_previous = global.enemy_mode
80
                        global.enemy_mode = 3
81
                        reset_counters = true
82
                    }
83
                    else
84
                    {
85
                        global.enemy_mode_previous = global.enemy_mode
86
                        global.enemy_mode = 6
87
                        reset_counters = true
88
                    }
89
                }
90
            }
91
            break
92
    }
93
94
    enemy_mode = global.enemy_mode
95
    var enemy_mode_gen_preprevious = global.enemy_mode_gen_previous
96
    var enemy_mode_gen_current = global.enemy_mode_gen
97
    switch enemy_mode
98
    {
99
        case 0:
100
            global.enemy_mode_gen = 0
101
            break
102
        case 1:
103
            global.enemy_mode_gen = 1
104
            break
105
        case 2:
106
        case 3:
107
            global.enemy_mode_gen = 2
108
            break
109
        case 4:
110
            global.enemy_mode_gen = 3
111
            break
112
        case 5:
113
        case 6:
114
            global.enemy_mode_gen = 4
115
            break
116
    }
117
118
    if (global.enemy_mode_gen != enemy_mode_gen_current)
119
        global.enemy_mode_gen_previous = enemy_mode_gen_current
120
    if (reset_counters == true)
121
    {
122
        global.turns_passed = 0
123
        global.action_1_selected_count = 0
124
        global.action_2_selected_count = 0
125
        global.spare_selected_count = 0
126
        global.hit_count = 0
127
        global.miss_count = 0
128
        global.no_hit_count = 0
129
        global.hurt_self_count = 0
130
        global.hurt_self_turn_count = 0
131
        global.item_use_count = 0
132
        global.item_gift_count = 0
133
    }
134
}