Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_enemy_mode_shift_martlet_pacifist

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

function scr_enemy_mode_shift_martlet_pacifist(argument0) //gml_Script_scr_enemy_mode_shift_martlet_pacifist { 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 = 3 reset_counters = true } else if (global.enemy_hit == false) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 1 reset_counters = true } } else { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 4 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 (global.enemy_hit == false) { if (global.miss_count >= 3) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 5 reset_counters = true } } } break case 2: global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 3 reset_counters = true break case 3: if (argument0 == "Fight 1") { if (global.enemy_hit == true) { if (global.hit_count >= 7) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 10 reset_counters = true } } else if (global.enemy_hit == false) { if ((global.no_hit_count + global.miss_count) >= 3) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 5 reset_counters = true } } } else if ((global.no_hit_count + global.miss_count) >= 3) { 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) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 2 reset_counters = true } else if (global.turns_passed >= 4) { global.enemy_mode_previous = global.enemy_mode global.enemy_mode = 5 reset_counters = true } } else if (global.turns_passed >= 4) { ...
(argument0) //gml_Script_scr_enemy_mode_shift_martlet_pacifist
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 = 3
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
24
            {
25
                global.enemy_mode_previous = global.enemy_mode
26
                global.enemy_mode = 4
27
                reset_counters = true
28
            }
29
            break
30
        case 1:
31
            if (argument0 == "Fight 1")
32
            {
33
                if (global.enemy_hit == true)
34
                {
35
                    global.enemy_mode_previous = global.enemy_mode
36
                    global.enemy_mode = 2
37
                    reset_counters = true
38
                }
39
                else if (global.enemy_hit == false)
40
                {
41
                    if (global.miss_count >= 3)
42
                    {
43
                        global.enemy_mode_previous = global.enemy_mode
44
                        global.enemy_mode = 5
45
                        reset_counters = true
46
                    }
47
                }
48
            }
49
            break
50
        case 2:
51
            global.enemy_mode_previous = global.enemy_mode
52
            global.enemy_mode = 3
53
            reset_counters = true
54
            break
55
        case 3:
56
            if (argument0 == "Fight 1")
57
            {
58
                if (global.enemy_hit == true)
59
                {
60
                    if (global.hit_count >= 7)
61
                    {
62
                        global.enemy_mode_previous = global.enemy_mode
63
                        global.enemy_mode = 10
64
                        reset_counters = true
65
                    }
66
                }
67
                else if (global.enemy_hit == false)
68
                {
69
                    if ((global.no_hit_count + global.miss_count) >= 3)
70
                    {
71
                        global.enemy_mode_previous = global.enemy_mode
72
                        global.enemy_mode = 5
73
                        reset_counters = true
74
                    }
75
                }
76
            }
77
            else if ((global.no_hit_count + global.miss_count) >= 3)
78
            {
79
                global.enemy_mode_previous = global.enemy_mode
80
                global.enemy_mode = 5
81
                reset_counters = true
82
            }
83
            break
84
        case 4:
85
            if (argument0 == "Fight 1")
86
            {
87
                if (global.enemy_hit == true)
88
                {
89
                    global.enemy_mode_previous = global.enemy_mode
90
                    global.enemy_mode = 2
91
                    reset_counters = true
92
                }
93
                else if (global.turns_passed >= 4)
94
                {
95
                    global.enemy_mode_previous = global.enemy_mode
96
                    global.enemy_mode = 5
97
                    reset_counters = true
98
                }
99
            }
100
            else if (global.turns_passed >= 4)
101
            {
102
                global.enemy_mode_previous = global.enemy_mode
103
                global.enemy_mode = 5
104
                reset_counters = true
105
            }
106
            break
107
        case 5:
108
            if (argument0 == "Fight 1")
109
            {
110
                if (global.enemy_hit == true)
111
                {
112
                    global.enemy_mode_previous = global.enemy_mode
113
                    global.enemy_mode = 2
114
                    reset_counters = true
115
                }
116
            }
117
            break
118
        case 6:
119
            if (argument0 == "Fight 1")
120
            {
121
                if (global.enemy_hit == true)
122
                {
123
                    global.enemy_mode_previous = global.enemy_mode
124
                    global.enemy_mode = 2
125
                    reset_counters = true
126
                }
127
            }
128
            break
129
        case 7:
130
            if (argument0 == "Fight 1")
131
            {
132
                if (global.enemy_hit == true)
133
                {
134
                    global.enemy_mode_previous = global.enemy_mode
135
                    global.enemy_mode = 2
136
                    reset_counters = true
137
                }
138
            }
139
            else if (argument0 == "Action 3")
140
            {
141
                global.enemy_mode_previous = global.enemy_mode
142
                global.enemy_mode = 11
143
                reset_counters = true
144
            }
145
            break
146
    }
147
148
    enemy_mode = global.enemy_mode
149
    var enemy_mode_gen_preprevious = global.enemy_mode_gen_previous
150
    var enemy_mode_gen_current = global.enemy_mode_gen
151
    switch enemy_mode
152
    {
153
        case 0:
154
            global.enemy_mode_gen = 0
155
            break
156
        case 1:
157
        case 4:
158
        case 5:
159
        case 6:
160
        case 7:
161
            global.enemy_mode_gen = 1
162
            break
163
        case 2:
164
        case 3:
165
            global.enemy_mode_gen = 2
166
            break
167
        case 8:
168
        case 9:
169
            global.enemy_mode_gen = 3
170
            break
171
        case 10:
172
        case 11:
173
        case 12:
174
            global.enemy_mode_gen = 4
175
            break
176
    }
177
178
    if (global.enemy_mode_gen != enemy_mode_gen_current)
179
        global.enemy_mode_gen_previous = enemy_mode_gen_current
180
    if ((enemy_mode_gen_preprevious == 1 && global.enemy_mode_gen_previous == 2 && global.enemy_mode_gen == 1) || (enemy_mode_gen_preprevious == 2 && global.enemy_mode_gen_previous == 1 && global.enemy_mode_gen == 2))
181
    {
182
        global.enemy_mode_previous = global.enemy_mode
183
        global.enemy_mode = 12
184
        reset_counters = true
185
        enemy_mode = global.enemy_mode
186
        enemy_mode_gen_current = global.enemy_mode_gen
187
        global.enemy_mode_gen = 4
188
        if (global.enemy_mode_gen != enemy_mode_gen_current)
189
            global.enemy_mode_gen_previous = enemy_mode_gen_current
190
    }
191
    switch enemy_mode
192
    {
193
        case 6:
194
        case 7:
195
            global.action_amount = 3
196
            break
197
        default:
198
            global.action_amount = 2
199
    }
200
201
    switch enemy_mode
202
    {
203
        case 7:
204
            global.action_3_important = true
205
            break
206
        default:
207
            global.action_3_important = false
208
    }
209
210
    if (reset_counters == true)
211
    {
212
        global.turns_passed = 0
213
        global.action_1_selected_count = 0
214
        global.action_2_selected_count = 0
215
        global.action_3_selected_count = 0
216
        global.spare_selected_count = 0
217
        global.hit_count = 0
218
        global.miss_count = 0
219
        global.no_hit_count = 0
220
        global.hurt_self_count = 0
221
        global.hurt_self_turn_count = 0
222
        global.item_use_count = 0
223
        global.item_gift_count = 0
224
    }
225
}