Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_generate_battle_trihecta_separated

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

function scr_generate_battle_trihecta_separated() //gml_Script_scr_generate_battle_trihecta_separated { var battle_phase_step = global.battle_phase_step global.battle_enemy_name_1 = "tri" global.battle_enemy_name_2 = "hec" global.battle_enemy_name_3 = "ta" if (battle_phase_step == 0) { global.battle_menu_number = 1 global.speed_self = 4 global.invulnerability_self = global.player_invulnerability } global.attacking_damage_cap = -1 global.attacking_damage_cap_2 = -1 global.attacking_damage_cap_3 = -1 if (battle_phase_step == 0) { global.hit_self = false global.hurt_self = false } var new_current_hp = max(1, floor(global.current_hp_enemy / 3)) global.current_hp_enemy = 60 global.current_hp_enemy_2 = 60 global.current_hp_enemy_3 = 60 global.max_hp_enemy = 60 global.max_hp_enemy_2 = 60 global.max_hp_enemy_3 = 60 global.last_hp_enemy = global.current_hp_enemy global.last_hp_enemy_2 = global.current_hp_enemy_2 global.last_hp_enemy_3 = global.current_hp_enemy_3 global.current_hp_enemy_draw = global.current_hp_enemy global.current_hp_enemy_draw_2 = global.current_hp_enemy_2 global.current_hp_enemy_draw_3 = global.current_hp_enemy_3 global.enemy_low_hp = false global.enemy_low_hp_2 = false global.enemy_low_hp_3 = false global.enemy_hit = false global.enemy_hit_2 = false global.enemy_hit_3 = false global.enemy_hurt = false global.enemy_hurt_2 = false global.enemy_hurt_3 = false global.enemy_attack_stat = 7 global.enemy_attack_stat_2 = 7 global.enemy_attack_stat_3 = 7 global.enemy_defense_stat = 8 global.enemy_defense_stat_2 = 8 global.enemy_defense_stat_3 = 8 global.enemy_vulnerable = true global.enemy_vulnerable_2 = true global.enemy_vulnerable_3 = true if (battle_phase_step == 0) global.enemy_attacking = false global.enemy_sparing = true global.enemy_sparing_2 = true global.enemy_sparing_3 = true global.enemy_dead = false global.enemy_dead_2 = false global.enemy_dead_3 = false global.enemy_spared = false global.enemy_spared_2 = false global.enemy_spared_3 = false global.enemy_betrayed = false global.enemy_betrayed_2 = false global.enemy_betrayed_3 = false global.enemy_fleeable = true global.enemy_special_text = 0 global.enemy_special_text_2 = 0 global.enemy_special_text_3 = 0 global.enemy_exp = 9 global.enemy_exp_2 = 9 global.enemy_exp_3 = 9 global.enemy_gold = 4 global.enemy_gold_2 = 4 global.enemy_gold_3 = 4 global.enemy_count = 3 global.turns_passed = 0 if (battle_phase_step == 0) { global.last_action_selected = "Nothing" global.last_action_selected_2 = "Nothing" global.last_action_selected_3 = "Nothing" } global.action_1_important = false global.action_1_important_2 = false global.action_1_important_3 = false global.action_2_important = false global.action_2_important_2 = false global.action_2_important_3 = false global.action_3_important = false global.action_3_important_2 = false global.action_3_important_3 = false global.action_1_color = 16777215 global.action_1_color_2 = 16777215 global.action_1_color_3 = 16777215 global.action_2_color = 16777215 global.action_2_color_2 = 16777215 global.action_2_color_3 = 16777215 global.action_3_color = 16777215 global.action_3_color_2 = 16777215 global.action_3_color_3 = 16777215 ...
() //gml_Script_scr_generate_battle_trihecta_separated
2
{
3
    var battle_phase_step = global.battle_phase_step
4
    global.battle_enemy_name_1 = "tri"
5
    global.battle_enemy_name_2 = "hec"
6
    global.battle_enemy_name_3 = "ta"
7
    if (battle_phase_step == 0)
8
    {
9
        global.battle_menu_number = 1
10
        global.speed_self = 4
11
        global.invulnerability_self = global.player_invulnerability
12
    }
13
    global.attacking_damage_cap = -1
14
    global.attacking_damage_cap_2 = -1
15
    global.attacking_damage_cap_3 = -1
16
    if (battle_phase_step == 0)
17
    {
18
        global.hit_self = false
19
        global.hurt_self = false
20
    }
21
    var new_current_hp = max(1, floor(global.current_hp_enemy / 3))
22
    global.current_hp_enemy = 60
23
    global.current_hp_enemy_2 = 60
24
    global.current_hp_enemy_3 = 60
25
    global.max_hp_enemy = 60
26
    global.max_hp_enemy_2 = 60
27
    global.max_hp_enemy_3 = 60
28
    global.last_hp_enemy = global.current_hp_enemy
29
    global.last_hp_enemy_2 = global.current_hp_enemy_2
30
    global.last_hp_enemy_3 = global.current_hp_enemy_3
31
    global.current_hp_enemy_draw = global.current_hp_enemy
32
    global.current_hp_enemy_draw_2 = global.current_hp_enemy_2
33
    global.current_hp_enemy_draw_3 = global.current_hp_enemy_3
34
    global.enemy_low_hp = false
35
    global.enemy_low_hp_2 = false
36
    global.enemy_low_hp_3 = false
37
    global.enemy_hit = false
38
    global.enemy_hit_2 = false
39
    global.enemy_hit_3 = false
40
    global.enemy_hurt = false
41
    global.enemy_hurt_2 = false
42
    global.enemy_hurt_3 = false
43
    global.enemy_attack_stat = 7
44
    global.enemy_attack_stat_2 = 7
45
    global.enemy_attack_stat_3 = 7
46
    global.enemy_defense_stat = 8
47
    global.enemy_defense_stat_2 = 8
48
    global.enemy_defense_stat_3 = 8
49
    global.enemy_vulnerable = true
50
    global.enemy_vulnerable_2 = true
51
    global.enemy_vulnerable_3 = true
52
    if (battle_phase_step == 0)
53
        global.enemy_attacking = false
54
    global.enemy_sparing = true
55
    global.enemy_sparing_2 = true
56
    global.enemy_sparing_3 = true
57
    global.enemy_dead = false
58
    global.enemy_dead_2 = false
59
    global.enemy_dead_3 = false
60
    global.enemy_spared = false
61
    global.enemy_spared_2 = false
62
    global.enemy_spared_3 = false
63
    global.enemy_betrayed = false
64
    global.enemy_betrayed_2 = false
65
    global.enemy_betrayed_3 = false
66
    global.enemy_fleeable = true
67
    global.enemy_special_text = 0
68
    global.enemy_special_text_2 = 0
69
    global.enemy_special_text_3 = 0
70
    global.enemy_exp = 9
71
    global.enemy_exp_2 = 9
72
    global.enemy_exp_3 = 9
73
    global.enemy_gold = 4
74
    global.enemy_gold_2 = 4
75
    global.enemy_gold_3 = 4
76
    global.enemy_count = 3
77
    global.turns_passed = 0
78
    if (battle_phase_step == 0)
79
    {
80
        global.last_action_selected = "Nothing"
81
        global.last_action_selected_2 = "Nothing"
82
        global.last_action_selected_3 = "Nothing"
83
    }
84
    global.action_1_important = false
85
    global.action_1_important_2 = false
86
    global.action_1_important_3 = false
87
    global.action_2_important = false
88
    global.action_2_important_2 = false
89
    global.action_2_important_3 = false
90
    global.action_3_important = false
91
    global.action_3_important_2 = false
92
    global.action_3_important_3 = false
93
    global.action_1_color = 16777215
94
    global.action_1_color_2 = 16777215
95
    global.action_1_color_3 = 16777215
96
    global.action_2_color = 16777215
97
    global.action_2_color_2 = 16777215
98
    global.action_2_color_3 = 16777215
99
    global.action_3_color = 16777215
100
    global.action_3_color_2 = 16777215
101
    global.action_3_color_3 = 16777215
102
    global.action_amount = 1
103
    global.action_amount_2 = 1
104
    global.action_amount_3 = 1
105
    if (battle_phase_step == 0)
106
    {
107
        global.item_use = "Nothing"
108
        global.item_used = "Nothing"
109
        global.item_gift = "Nothing"
110
        global.item_gifted = "Nothing"
111
        global.image_alpha_enemy_attacking = 1
112
        global.important_cutscene = false
113
        global.can_attack = true
114
    }
115
    global.action_1_selected_count = 0
116
    global.action_1_selected_count_2 = 0
117
    global.action_1_selected_count_3 = 0
118
    global.action_2_selected_count = 0
119
    global.action_2_selected_count_2 = 0
120
    global.action_2_selected_count_3 = 0
121
    global.action_3_selected_count = 0
122
    global.action_3_selected_count_2 = 0
123
    global.action_3_selected_count_3 = 0
124
    global.spare_selected_count = 0
125
    global.hit_count = 0
126
    global.hit_count_2 = 0
127
    global.hit_count_3 = 0
128
    global.miss_count = 0
129
    global.miss_count_2 = 0
130
    global.miss_count_3 = 0
131
    global.no_hit_count = 0
132
    global.no_hit_count_2 = 0
133
    global.no_hit_count_3 = 0
134
    if (battle_phase_step == 0)
135
    {
136
        global.hurt_self_count = 0
137
        global.hurt_self_turn_count = 0
138
    }
139
    global.item_use_count = 0
140
    global.item_gift_count = 0
141
    global.item_gift_count_2 = 0
142
    global.item_gift_count_3 = 0
143
    global.enemy_mode = 0
144
    global.enemy_mode_previous = 0
145
    global.enemy_mode_2 = 0
146
    global.enemy_mode_2_previous = 0
147
    global.enemy_mode_3 = 0
148
    global.enemy_mode_3_previous = 0
149
    global.enemy_mode_gen = 0
150
    global.enemy_mode_gen_previous = 0
151
    global.enemy_mode_gen_2 = 0
152
    global.enemy_mode_gen_2_previous = 0
153
    global.enemy_mode_gen_3 = 0
154
    global.enemy_mode_gen_3_previous = 0
155
    if (battle_phase_step == 0)
156
    {
157
        scr_audio_stop_sound
scr_audio_stop_sound

function scr_audio_stop_sound(argument0) //gml_Script_scr_audio_stop_sound { audio_array_val = 0 sound_y[audio_array_val] = mus_apprehension_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_dalvbattle_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_dalvopening_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_dalvbattle_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_decibat_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_dalvopening_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_01_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_02_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_03_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_04_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_05_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_06_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_07_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_08_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_09_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_10_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_attack_finale_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_danza_battle_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_floweynew_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_funsized_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_genobattle_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_mart_geno_wind_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_martletbattle_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_nobodycame_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_occupied_turf_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_prebattle1_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_prebattle2_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_battle_snowdin audio_array_val += 1 sound_y[audio_array_val] = mus_trial_by_fury audio_array_val += 1 sound_y[audio_array_val] = mus_prebattle3_yellow audio_array_val += 1 sound_y[audio_array_val] = mus_heatwave_approaching for (i = 0; i < array_length_1d(sound_y); i += 1) { var audio_gain = audio_sound_get_gain(sound_y[i]) if (audio_gain <= argument0) audio_stop_sound(sound_y[i]) } }
(0)
158
        script_execute(gml_Script_scr_determine_enemy_music_yellow)
159
        audio_extend = false
160
        global.sound_carry_battle = false
161
        global.mettaton_voice_count = 1
162
    }
163
    instance_create(318, 196, obj_tri_separated)
164
    global.enemy_damage_x = obj_tri_separated.x
165
    global.enemy_damage_y = obj_tri_separated.y
166
    global.enemy_target_x = obj_tri_separated.x
167
    global.enemy_target_y = obj_tri_separated.y
168
    instance_create(208, 196, obj_hec_separated)
169
    global.enemy_damage_x_2 = obj_hec_separated.x
170
    global.enemy_damage_y_2 = obj_hec_separated.y
171
    global.enemy_target_x_2 = obj_hec_separated.x
172
    global.enemy_target_y_2 = obj_hec_separated.y
173
    instance_create(432, 196, obj_ta_separated)
174
    global.enemy_damage_x_3 = obj_ta_separated.x
175
    global.enemy_damage_y_3 = obj_ta_separated.y
176
    global.enemy_target_x_3 = obj_ta_separated.x
177
    global.enemy_target_y_3 = obj_ta_separated.y
178
    if (battle_phase_step == 0)
179
    {
180
        script_execute(gml_Script_scr_create_background_battle_yellow)
181
        instance_create(0, 0, obj_battle_fade_in_screen)
182
        instance_create(275, 400, obj_battle_hp_current_self)
183
        instance_create(275, 400, obj_battle_hp_max_self)
184
        instance_create(275, 400, obj_battle_hp_cover_self)
185
        instance_create(0, 0, obj_text_battle_stat_name)
186
        instance_create(0, 0, obj_text_battle_stat_lv)
187
        instance_create(244, 405, obj_text_hp)
188
        instance_create(0, 0, obj_text_hp_stat)
189
        instance_create(32, 250, obj_dialogue_box_battle)
190
        instance_create(31, 431, obj_fight)
191
        instance_create(184, 431, obj_act)
192
        instance_create(344, 431, obj_item)
193
        instance_create(499, 431, obj_mercy)
194
        global.last_text_move_select = 0
195
        global.soul_mode = "Red"
196
        instance_create((obj_fight.x + 17), (obj_fight.y + 23), obj_heart_battle_menu)
197
        instance_create(0, 0, obj_dialogue_battle_move_select_intro)
198
    }
199
    else if (battle_phase_step == 1)
200
        global.last_text_move_select = -1
201
    script_execute(gml_Script_scr_determine_attacking_damage_stat_critical)
202
}