1 |
script_execute(scr_controls_battle_mercy); |
2 |
if (key_select) |
3 |
{ |
4 |
if (global.mercy_number == 1) |
5 |
{ |
6 |
if (global.enemy_count == 1 && global.enemy_sparing == true && global.enemy_dead == false && global.enemy_spared == false) |
7 |
{ |
8 |
with (obj_battle_generator) |
9 |
audio_extend = false; |
10 |
audio_stop_all(); |
11 |
if (global.battling_boss == true) |
12 |
{ |
13 |
instance_create(0, 0, obj_dialogue_battle_win_pacifist); |
14 |
instance_create(0, 0, obj_battle_justice_effect); |
15 |
} |
16 |
else |
17 |
{ |
18 |
instance_create(0, 0, obj_dialogue_battle_win_enemy); |
19 |
} |
20 |
global.spare_selected_count += 1; |
21 |
global.last_action_selected = "Spare"; |
22 |
global.last_action_selected_2 = "Spare"; |
23 |
global.last_action_selected_3 = "Spare"; |
24 |
global.enemy_spared = true; |
25 |
moveable = false; |
26 |
audio_play_sound(snd_monster_damage_death, 20, false); |
27 |
with (obj_text_battle_move_selected_mercy_parent) |
28 |
instance_destroy(); |
29 |
instance_destroy(); |
30 |
} |
31 |
else if (global.enemy_count == 2) |
32 |
{ |
33 |
if (global.enemy_sparing == true && global.enemy_dead == false && global.enemy_spared == false) |
34 |
{ |
35 |
global.enemy_spared = true; |
36 |
audio_play_sound(snd_monster_damage_death, 20, false); |
37 |
} |
38 |
if (global.enemy_sparing_2 == true && global.enemy_dead_2 == false && global.enemy_spared_2 == false) |
39 |
{ |
40 |
global.enemy_spared_2 = true; |
41 |
if (!audio_is_playing(snd_monster_damage_death)) |
42 |
audio_play_sound(snd_monster_damage_death, 20, false); |
43 |
} |
44 |
if ((global.enemy_dead == true || global.enemy_spared == true) && (global.enemy_dead_2 == true || global.enemy_spared_2 == true)) |
45 |
{ |
46 |
with (obj_battle_generator) |
47 |
audio_extend = false; |
48 |
audio_stop_all(); |
49 |
instance_create(0, 0, obj_dialogue_battle_win_enemy); |
50 |
global.spare_selected_count += 1; |
51 |
global.last_action_selected = "Spare"; |
52 |
global.last_action_selected_2 = "Spare"; |
53 |
global.last_action_selected_3 = "Spare"; |
54 |
moveable = false; |
55 |
audio_play_sound(snd_monster_damage_death, 20, false); |
56 |
with (obj_text_battle_move_selected_mercy_parent) |
57 |
instance_destroy(); |
58 |
instance_destroy(); |
59 |
} |
60 |
else |
61 |
{ |
62 |
execute_sparing_false = true; |
63 |
} |
64 |
} |
65 |
else if (global.enemy_count == 3) |
66 |
{ |
67 |
if (global.enemy_sparing == true && global.enemy_dead == false && global.enemy_spared == false) |
68 |
{ |
69 |
global.enemy_spared = true; |
70 |
audio_play_sound(snd_monster_damage_death, 20, false); |
71 |
} |
72 |
if (global.enemy_sparing_2 == true && global.enemy_dead_2 == false && global.enemy_spared_2 == false) |
73 |
{ |
74 |
global.enemy_spared_2 = true; |
75 |
if (!audio_is_playing(snd_monster_damage_death)) |
76 |
audio_play_sound(snd_monster_damage_death, 20, false); |
77 |
} |
78 |
if (global.enemy_sparing_3 == true && global.enemy_dead_3 == false && global.enemy_spared_3 == false) |
79 |
{ |
80 |
global.enemy_spared_3 = true; |
81 |
if (!audio_is_playing(snd_monster_damage_death)) |
82 |
audio_play_sound(snd_monster_damage_death, 20, false); |
83 |
} |
84 |
if ((global.enemy_dead == true || global.enemy_spared == true) && (global.enemy_dead_2 == true || global.enemy_spared_2 == true) && (global.enemy_dead_3 == true || global.enemy_spared_3 == true)) |
85 |
{ |
86 |
with (obj_battle_generator) |
87 |
audio_extend = false; |
88 |
audio_stop_all(); |
89 |
instance_create(0, 0, obj_dialogue_battle_win_enemy); |
90 |
global.spare_selected_count += 1; |
91 |
global.last_action_selected = "Spare"; |
92 |
global.last_action_selected_2 = "Spare"; |
93 |
global.last_action_selected_3 = "Spare"; |
94 |
moveable = false; |
95 |
audio_play_sound(snd_monster_damage_death, 20, false); |
96 |
with (obj_text_battle_move_selected_mercy_parent) |
97 |
instance_destroy(); |
98 |
instance_destroy(); |
99 |
} |
100 |
else |
101 |
{ |
102 |
execute_sparing_false = true; |
103 |
} |
104 |
} |
105 |
if (global.enemy_sparing == false || execute_sparing_false == true) |
106 |
{ |
107 |
global.spare_selected_count += 1; |
108 |
global.last_action_selected = "Spare"; |
109 |
global.last_action_selected_2 = "Spare"; |
110 |
global.last_action_selected_3 = "Spare"; |
111 |
global.no_hit_count += 1; |
112 |
if (global.enemy_count >= 2) |
113 |
global.no_hit_count_2 += 1; |
114 |
if (global.enemy_count >= 3) |
115 |
global.no_hit_count_3 += 1; |
116 |
scr_determine_special_effect_enemy("Spare"); |
117 |
global.important_cutscene = script_execute(scr_determine_important_cutscene_attacking); |
118 |
global.can_attack = script_execute(scr_determine_can_attack_attacking); |
119 |
if (global.important_cutscene == false && global.can_attack == true) |
120 |
global.enemy_attacking = true; |
121 |
if (global.can_attack == false) |
122 |
{ |
123 |
with (obj_dialogue_box_battle) |
124 |
no_loop_can_attack = false; |
125 |
} |
126 |
execute_sparing_false = false; |
127 |
audio_play_sound(snd_battle_item_weapon_select, 20, false); |
128 |
with (obj_text_battle_move_selected_mercy_parent) |
129 |
instance_destroy(); |
130 |
instance_destroy(); |
131 |
} |
132 |
} |
133 |
else if (global.mercy_number == 2) |
134 |
{ |
135 |
var random_number = irandom_range(0, 1); |
136 |
if (global.player_armor_modifier == "Patch") |
137 |
random_number = 1; |
138 |
if (random_number == 0) |
139 |
{ |
140 |
global.no_hit_count += 1; |
141 |
if (global.enemy_count >= 2) |
142 |
global.no_hit_count_2 += 1; |
143 |
if (global.enemy_count >= 3) |
144 |
global.no_hit_count_3 += 1; |
145 |
scr_determine_special_effect_enemy("Flee"); |
146 |
global.important_cutscene = script_execute(scr_determine_important_cutscene_attacking); |
147 |
global.can_attack = script_execute(scr_determine_can_attack_attacking); |
148 |
if (global.important_cutscene == false && global.can_attack == true) |
149 |
global.enemy_attacking = true; |
150 |
if (global.can_attack == false) |
151 |
{ |
152 |
with (obj_dialogue_box_battle) |
153 |
no_loop_can_attack = false; |
154 |
} |
155 |
audio_play_sound(snd_battle_item_weapon_select, 20, false); |
156 |
with (obj_text_battle_move_selected_mercy_parent) |
157 |
instance_destroy(); |
158 |
instance_destroy(); |
159 |
} |
160 |
else if (random_number == 1) |
161 |
{ |
162 |
instance_create(0, 0, obj_dialogue_battle_flee); |
163 |
instance_create(x, y, obj_heart_battle_menu_flee); |
164 |
moveable = false; |
165 |
audio_play_sound(snd_flee, 20, false); |
166 |
with (obj_text_battle_move_selected_mercy_parent) |
167 |
instance_destroy(); |
168 |
instance_destroy(); |
169 |
} |
170 |
} |
171 |
} |
172 |
if (key_revert && key_select == 0) |
173 |
{ |
174 |
if (instance_exists(obj_text_battle_move_selected_spare)) |
175 |
{ |
176 |
with (obj_heart_battle_menu) |
177 |
{ |
178 |
no_loop = false; |
179 |
image_alpha = 1; |
180 |
} |
181 |
with (obj_text_battle_move_selected_mercy_parent) |
182 |
instance_destroy(); |
183 |
instance_destroy(); |
184 |
} |
185 |
} |
186 |
if (key_select == 0 && key_revert == 0 && instance_exists(obj_text_battle_move_selected_flee)) |
187 |
{ |
188 |
if (key_down && key_up == 0) |
189 |
{ |
190 |
if (global.mercy_number >= 2) |
191 |
global.mercy_number = 1; |
192 |
else |
193 |
global.mercy_number += 1; |
194 |
audio_play_sound(snd_mainmenu_select, 20, false); |
195 |
} |
196 |
else if (key_up && key_down == 0) |
197 |
{ |
198 |
if (global.mercy_number <= 1) |
199 |
global.mercy_number = 2; |
200 |
else |
201 |
global.mercy_number -= 1; |
202 |
audio_play_sound(snd_mainmenu_select, 20, false); |
203 |
} |
204 |
} |
205 |
x = obj_dialogue_box_battle.x + 44; |
206 |
if (global.mercy_number == 1) |
207 |
y = obj_dialogue_box_battle.y + 36; |
208 |
else if (global.mercy_number == 2) |
209 |
y = obj_dialogue_box_battle.y + 68; |