|
1
|
function scr_damagescr_damage
function scr_damage()
{
if (global.inv < 0)
{
scr_damage_cache();
if (global.chapter == 3)
{
with (obj_tennabattleconvo_controller)
{
damagecount++;
damagecountthisturn++;
}
with (obj_tenna_enemy)
gothit = true;
with (obj_knight_enemy)
progamer = false;
}
var __element = 0;
if (variable_instance_exists(id, "element"))
{
if (is_real(element))
__element = element;
}
if (target < 3)
{
if (global.hp[global.char[target]] <= 0)
{
scr_randomtarget_old();
target = mytarget;
with (global.charinstance[target])
{
image_blend = c_white;
darkify = 0;
}
}
}
var __remtarget = -1;
if (target == 4)
{
__remtarget = 4;
scr_randomtarget_old();
target = mytarget;
if ((global.hp[global.char[target]] / global.maxhp[global.char[target]]) < (scr_party_hpaverage() / 2))
{
scr_randomtarget_old();
target = mytarget;
}
if ((global.hp[global.char[target]] / global.maxhp[global.char[target]]) < (scr_party_hpaverage() / 2))
{
scr_randomtarget_old();
target = mytarget;
}
if (target == 0 && (global.hp[global.char[target]] / global.maxhp[global.char[target]]) < 0.35)
{
scr_randomtarget_old();
target = mytarget;
}
with (global.charinstance[target])
{
image_blend = c_white;
darkify = 0;
}
}
var truedamage = 0;
if ((global.chapter == 3 && i_ex(obj_tenna_enemy) && obj_tenna_enemy.minigameinsanity) || i_ex(obj_knight_roaring2))
truedamage = 1;
chartarget = 3;
if (global.chapter == 3 && i_ex(obj_knight_enemy) && truedamage == 0)
{
if (obj_knight_enemy.aoedamage == false)
{
if (target == 0)
{
if (global.hp[2] > 0 && global.hp[3] > 0)
target = choose(1, 2);
else if (global.hp[2] > 0)
target = 1;
else if (global.hp[3] > 0)
target = 2;
}
if (obj_knight_enemy.myattackchoice != 13)
{
if (global.chararmor1[1] == 23 || global.chararmor2[1] == 23 || global.chararmor1[2] == 23 || global.chararmor2[2] == 23 || global.chararmor1[3] == 23 || global.chararmor2[3] == 23)
{
obj_knight_enemy.damagecounter++;
if (obj_knight_enemy.damagecounter < 3)
{
if (global.hp[1] > 0 && (global.chararmor1[1] == 23 || global.chararmor2[1] == 23))
target = 0;
if (global.hp[2] > 0 && (global.chararmor1[2] == 23 || global.chararmor2[2] == 23))
target = 1;
if (global.hp[3] > 0 && (global.chararmor1[3] == 23 || global.chararmor2[3] == 23))
target = 2;
}
else
{
target = choose(0, 1, 2);
repeat (2)
{
if (global.hp[1] < 1 && target == 0)
target++;
... ()
|
|
2
|
{
|
|
3
|
if (global.inv < 0)
|
|
4
|
{
|
|
5
|
scr_damage_cachescr_damage_cache
function scr_damage_cache()
{
global.damage_cache = [];
for (var i = 0; i < 3; i++)
global.damage_cache[array_length(global.damage_cache)] = global.hp[global.char[i]];
}
function scr_damage_check()
{
if (!variable_global_exists("damage_cache"))
global.damage_cache = [];
var took_damage = false;
for (var i = 0; i < array_length(global.damage_cache); i++)
{
var hp_cache = global.damage_cache[i];
if (global.hp[global.char[i]] < hp_cache)
{
took_damage = true;
break;
}
}
if (took_damage)
{
with (obj_event_manager)
trigger_event(UnknownEnum.Value_1);
}
}
enum UnknownEnum
{
Value_1 = 1
} ();
|
|
6
|
if (global.chapter == 3)
|
|
7
|
{
|
|
8
|
with (obj_tennabattleconvo_controller)
|
|
9
|
{
|
|
10
|
damagecount++;
|
|
11
|
damagecountthisturn++;
|
|
12
|
}
|
|
13
|
with (obj_tenna_enemy)
|
|
14
|
gothit = true;
|
|
15
|
with (obj_knight_enemy)
|
|
16
|
progamer = false;
|
|
17
|
}
|
|
18
|
var __element = 0;
|
|
19
|
if (variable_instance_exists(id, "element"))
|
|
20
|
{
|
|
21
|
if (is_real(element))
|
|
22
|
__element = element;
|
|
23
|
}
|
|
24
|
if (target < 3)
|
|
25
|
{
|
|
26
|
if (global.hp[global.char[target]] <= 0)
|
|
27
|
{
|
|
28
|
scr_randomtarget_oldscr_randomtarget_old
function scr_randomtarget_old()
{
abletotarget = 1;
if (global.charcantarget[0] == 0 && global.charcantarget[1] == 0 && global.charcantarget[2] == 0)
abletotarget = 0;
mytarget = choose(0, 1, 2);
if (abletotarget == 1)
{
while (global.charcantarget[mytarget] == 0)
mytarget = choose(0, 1, 2);
}
else
{
mytarget = 3;
}
global.targeted[mytarget] = 1;
} ();
|
|
29
|
target = mytarget;
|
|
30
|
with (global.charinstance[target])
|
|
31
|
{
|
|
32
|
image_blend = c_white;
|
|
33
|
darkify = 0;
|
|
34
|
}
|
|
35
|
}
|
|
36
|
}
|
|
37
|
var __remtarget = -1;
|
|
38
|
if (target == 4)
|
|
39
|
{
|
|
40
|
__remtarget = 4;
|
|
41
|
scr_randomtarget_oldscr_randomtarget_old
function scr_randomtarget_old()
{
abletotarget = 1;
if (global.charcantarget[0] == 0 && global.charcantarget[1] == 0 && global.charcantarget[2] == 0)
abletotarget = 0;
mytarget = choose(0, 1, 2);
if (abletotarget == 1)
{
while (global.charcantarget[mytarget] == 0)
mytarget = choose(0, 1, 2);
}
else
{
mytarget = 3;
}
global.targeted[mytarget] = 1;
} ();
|
|
42
|
target = mytarget;
|
|
43
|
if ((global.hp[global.char[target]] / global.maxhp[global.char[target]]) < (scr_party_hpaveragescr_party_hpaverage
function scr_party_hpaverage()
{
var _totalhp = 0;
var _totalmaxhp = 0;
var _members = 0;
for (var _hpi = 0; _hpi < 3; _hpi++)
{
if (global.char[_hpi] > 0)
{
_members++;
_totalhp += global.hp[global.char[_hpi]];
_totalmaxhp += global.maxhp[global.char[_hpi]];
}
}
if (_totalhp > 0)
return floor(_totalhp / _totalmaxhp);
else
return 0;
} () / 2))
|
|
44
|
{
|
|
45
|
scr_randomtarget_oldscr_randomtarget_old
function scr_randomtarget_old()
{
abletotarget = 1;
if (global.charcantarget[0] == 0 && global.charcantarget[1] == 0 && global.charcantarget[2] == 0)
abletotarget = 0;
mytarget = choose(0, 1, 2);
if (abletotarget == 1)
{
while (global.charcantarget[mytarget] == 0)
mytarget = choose(0, 1, 2);
}
else
{
mytarget = 3;
}
global.targeted[mytarget] = 1;
} ();
|
|
46
|
target = mytarget;
|
|
47
|
}
|
|
48
|
if ((global.hp[global.char[target]] / global.maxhp[global.char[target]]) < (scr_party_hpaveragescr_party_hpaverage
function scr_party_hpaverage()
{
var _totalhp = 0;
var _totalmaxhp = 0;
var _members = 0;
for (var _hpi = 0; _hpi < 3; _hpi++)
{
if (global.char[_hpi] > 0)
{
_members++;
_totalhp += global.hp[global.char[_hpi]];
_totalmaxhp += global.maxhp[global.char[_hpi]];
}
}
if (_totalhp > 0)
return floor(_totalhp / _totalmaxhp);
else
return 0;
} () / 2))
|
|
49
|
{
|
|
50
|
scr_randomtarget_oldscr_randomtarget_old
function scr_randomtarget_old()
{
abletotarget = 1;
if (global.charcantarget[0] == 0 && global.charcantarget[1] == 0 && global.charcantarget[2] == 0)
abletotarget = 0;
mytarget = choose(0, 1, 2);
if (abletotarget == 1)
{
while (global.charcantarget[mytarget] == 0)
mytarget = choose(0, 1, 2);
}
else
{
mytarget = 3;
}
global.targeted[mytarget] = 1;
} ();
|
|
51
|
target = mytarget;
|
|
52
|
}
|
|
53
|
if (target == 0 && (global.hp[global.char[target]] / global.maxhp[global.char[target]]) < 0.35)
|
|
54
|
{
|
|
55
|
scr_randomtarget_oldscr_randomtarget_old
function scr_randomtarget_old()
{
abletotarget = 1;
if (global.charcantarget[0] == 0 && global.charcantarget[1] == 0 && global.charcantarget[2] == 0)
abletotarget = 0;
mytarget = choose(0, 1, 2);
if (abletotarget == 1)
{
while (global.charcantarget[mytarget] == 0)
mytarget = choose(0, 1, 2);
}
else
{
mytarget = 3;
}
global.targeted[mytarget] = 1;
} ();
|
|
56
|
target = mytarget;
|
|
57
|
}
|
|
58
|
with (global.charinstance[target])
|
|
59
|
{
|
|
60
|
image_blend = c_white;
|
|
61
|
darkify = 0;
|
|
62
|
}
|
|
63
|
}
|
|
64
|
var truedamage = 0;
|
|
65
|
if ((global.chapter == 3 && i_ex(obj_tenna_enemy) && obj_tenna_enemy.minigameinsanity) || i_ex(obj_knight_roaring2))
|
|
66
|
truedamage = 1;
|
|
67
|
chartarget = 3;
|
|
68
|
if (global.chapter == 3 && i_ex(obj_knight_enemy) && truedamage == 0)
|
|
69
|
{
|
|
70
|
if (obj_knight_enemy.aoedamage == false)
|
|
71
|
{
|
|
72
|
if (target == 0)
|
|
73
|
{
|
|
74
|
if (global.hp[2] > 0 && global.hp[3] > 0)
|
|
75
|
target = choose(1, 2);
|
|
76
|
else if (global.hp[2] > 0)
|
|
77
|
target = 1;
|
|
78
|
else if (global.hp[3] > 0)
|
|
79
|
target = 2;
|
|
80
|
}
|
|
81
|
if (obj_knight_enemy.myattackchoice != 13)
|
|
82
|
{
|
|
83
|
if (global.chararmor1[1] == 23 || global.chararmor2[1] == 23 || global.chararmor1[2] == 23 || global.chararmor2[2] == 23 || global.chararmor1[3] == 23 || global.chararmor2[3] == 23)
|
|
84
|
{
|
|
85
|
obj_knight_enemy.damagecounter++;
|
|
86
|
if (obj_knight_enemy.damagecounter < 3)
|
|
87
|
{
|
|
88
|
if (global.hp[1] > 0 && (global.chararmor1[1] == 23 || global.chararmor2[1] == 23))
|
|
89
|
target = 0;
|
|
90
|
if (global.hp[2] > 0 && (global.chararmor1[2] == 23 || global.chararmor2[2] == 23))
|
|
91
|
target = 1;
|
|
92
|
if (global.hp[3] > 0 && (global.chararmor1[3] == 23 || global.chararmor2[3] == 23))
|
|
93
|
target = 2;
|
|
94
|
}
|
|
95
|
else
|
|
96
|
{
|
|
97
|
target = choose(0, 1, 2);
|
|
98
|
repeat (2)
|
|
99
|
{
|
|
100
|
if (global.hp[1] < 1 && target == 0)
|
|
101
|
target++;
|
|
102
|
if (global.hp[2] < 1 && target == 1)
|
|
103
|
target++;
|
|
104
|
if (global.hp[3] < 1 && target == 2)
|
|
105
|
target++;
|
|
106
|
if (target > 2)
|
|
107
|
target = 0;
|
|
108
|
}
|
|
109
|
if ((target == 0 && global.chararmor1[1] == 23) || global.chararmor2[1] == 23)
|
|
110
|
{
|
|
111
|
}
|
|
112
|
else if ((target == 1 && global.chararmor1[2] == 23) || global.chararmor2[2] == 23)
|
|
113
|
{
|
|
114
|
}
|
|
115
|
else if ((target == 2 && global.chararmor1[3] == 23) || global.chararmor2[3] == 23)
|
|
116
|
{
|
|
117
|
}
|
|
118
|
else
|
|
119
|
{
|
|
120
|
obj_knight_enemy.damagecounter = 0;
|
|
121
|
}
|
|
122
|
}
|
|
123
|
}
|
|
124
|
}
|
|
125
|
}
|
|
126
|
}
|
|
127
|
if (global.chapter == 3 && i_ex(obj_rouxls_ch3_enemy))
|
|
128
|
{
|
|
129
|
if (global.hp[1] > global.hp[2] && global.hp[1] > global.hp[3])
|
|
130
|
target = 0;
|
|
131
|
if (global.hp[2] > global.hp[1] && global.hp[2] > global.hp[3])
|
|
132
|
target = 1;
|
|
133
|
if (global.hp[3] > global.hp[1] && global.hp[3] > global.hp[2])
|
|
134
|
target = 2;
|
|
135
|
if (i_ex(obj_dbulletcontroller) && i_ex(obj_rouxls_ch3_enemy) && obj_dbulletcontroller.type == 72 && obj_rouxls_ch3_enemy.ralseiyarnhp > 0 && global.hp[3] > 0)
|
|
136
|
target = 2;
|
|
137
|
}
|
|
138
|
if (global.chapter == 3 && i_ex(obj_tenna_enemy) && obj_tenna_enemy.popularboy && global.hp[3] > 0)
|
|
139
|
target = 2;
|
|
140
|
tdamage = damage;
|
|
141
|
var oldcalculation = 0;
|
|
142
|
var shadowmantlereduction = false;
|
|
143
|
if (target < 3)
|
|
144
|
{
|
|
145
|
if (global.chapter == 3 && truedamage == 1)
|
|
146
|
{
|
|
147
|
}
|
|
148
|
else if (oldcalculation)
|
|
149
|
{
|
|
150
|
tdamage = ceil(tdamage - (global.battledf[target] * 3));
|
|
151
|
}
|
|
152
|
else
|
|
153
|
{
|
|
154
|
tdamage = scr_damage_calculationscr_damage_calculation
function scr_damage_calculation(arg0, arg1)
{
var _tdamage = arg0;
var _tdef = global.battledf[arg1];
var _tmaxhp = global.maxhp[global.char[arg1]];
var _finaldamage = 1;
var _hpthresholda = _tmaxhp / 5;
var _hpthresholdb = _tmaxhp / 8;
for (var _di = 0; _di < _tdef; _di++)
{
if (_tdamage > _hpthresholda)
_tdamage -= 3;
else if (_tdamage > _hpthresholdb)
_tdamage -= 2;
else
_tdamage -= 1;
}
return max(_tdamage, _finaldamage);
} (tdamage, target);
|
|
155
|
}
|
|
156
|
chartarget = global.char[target];
|
|
157
|
if (global.chapter == 3 && i_ex(obj_knight_enemy) && truedamage == 0)
|
|
158
|
{
|
|
159
|
if ((global.chararmor1[1] == 23 || global.chararmor2[1] == 23) && target == 0)
|
|
160
|
{
|
|
161
|
tdamage = round(tdamage * 0.33);
|
|
162
|
shadowmantlereduction = true;
|
|
163
|
}
|
|
164
|
if ((global.chararmor1[2] == 23 || global.chararmor2[2] == 23) && target == 1)
|
|
165
|
{
|
|
166
|
tdamage = round(tdamage * 0.33);
|
|
167
|
shadowmantlereduction = true;
|
|
168
|
}
|
|
169
|
if ((global.chararmor1[3] == 23 || global.chararmor2[3] == 23) && target == 2)
|
|
170
|
{
|
|
171
|
tdamage = round(tdamage * 0.33);
|
|
172
|
shadowmantlereduction = true;
|
|
173
|
}
|
|
174
|
}
|
|
175
|
if (global.chapter == 3 && truedamage == 1)
|
|
176
|
{
|
|
177
|
}
|
|
178
|
else
|
|
179
|
{
|
|
180
|
if (global.charaction[target] == 10)
|
|
181
|
tdamage = ceil((2 * tdamage) / 3);
|
|
182
|
if (shadowmantlereduction == false)
|
|
183
|
tdamage = ceil(tdamage * scr_element_damage_reductionscr_element_damage_reduction
function scr_element_damage_reduction(arg0, arg1)
{
var ___element = arg0;
var ___char = arg1;
var ___reduction = 1;
if (___element != 0)
{
for (var ___itemi = 0; ___itemi < 2; ___itemi++)
{
if (global.itemelement[___char][___itemi + 1] != 0)
{
if (global.itemelement[___char][___itemi + 1] == ___element)
___reduction -= global.itemelementamount[___char][___itemi + 1];
if (global.itemelement[___char][___itemi + 1] == 9)
{
if (___element == 2 || ___element == 8)
___reduction -= global.itemelementamount[___char][___itemi + 1];
}
if (global.itemelement[___char][___itemi + 1] == 10)
___reduction -= global.itemelementamount[___char][___itemi + 1];
}
}
}
if (___reduction < 0.25)
___reduction = 0.25;
return ___reduction;
} (__element, global.char[target]));
|
|
184
|
}
|
|
185
|
debug_message("The element is: " + string(__element));
|
|
186
|
if (tdamage < 1)
|
|
187
|
tdamage = 1;
|
|
188
|
}
|
|
189
|
if (!instance_exists(obj_shake))
|
|
190
|
instance_create(0, 0, obj_shake);
|
|
191
|
with (global.charinstance[target])
|
|
192
|
{
|
|
193
|
hurt = 1;
|
|
194
|
hurttimer = 0;
|
|
195
|
if (sprite_index == spr_ralseib_yarn_2)
|
|
196
|
scr_shakeobjscr_shakeobj
function scr_shakeobj()
{
var _shakeobj = instance_create(x, y, obj_shakeobj);
_shakeobj.target = id;
if (argument_count >= 1)
{
if (i_ex(argument0))
_shakeobj.target = argument0;
}
if (argument_count >= 2)
{
if (argument1 != -1)
_shakeobj.shakeamt = argument1;
}
if (argument_count >= 3)
{
if (argument2 != -1)
_shakeobj.shakereduct = argument2;
}
with (_shakeobj)
event_user(0);
} ();
|
|
197
|
}
|
|
198
|
hpdiff = tdamage;
|
|
199
|
with (obj_dmgwriter)
|
|
200
|
{
|
|
201
|
if (delaytimer >= 1)
|
|
202
|
killactive = 1;
|
|
203
|
}
|
|
204
|
doomtype = -1;
|
|
205
|
with (obj_heart)
|
|
206
|
dmgnoise = 1;
|
|
207
|
if (global.chapter == 3 && i_ex(obj_tenna_zoom) && i_ex(obj_elnina_umbrella) && i_ex(obj_tenna_enemy) && obj_tenna_enemy.minigameinsanitydamage == false && obj_tenna_zoom.con <= 1)
|
|
208
|
{
|
|
209
|
obj_tenna_enemy.minigamefailcount++;
|
|
210
|
}
|
|
211
|
else if (target < 3)
|
|
212
|
{
|
|
213
|
if (global.hp[chartarget] <= 0)
|
|
214
|
{
|
|
215
|
doomtype = 4;
|
|
216
|
global.hp[chartarget] -= round(tdamage / 4);
|
|
217
|
hpdiff = round(tdamage / 4);
|
|
218
|
}
|
|
219
|
else
|
|
220
|
{
|
|
221
|
if (global.chapter == 3 && i_ex(obj_knight_enemy) && obj_knight_enemy.myattackchoice == 2 && (obj_knight_enemy.difficulty == 1 || obj_knight_enemy.difficulty == 3))
|
|
222
|
{
|
|
223
|
tdamage = round(tdamage * 0.66);
|
|
224
|
hpdiff = tdamage;
|
|
225
|
}
|
|
226
|
global.hp[chartarget] -= tdamage;
|
|
227
|
if (global.hp[chartarget] <= 0)
|
|
228
|
{
|
|
229
|
if (global.chapter == 3 && i_ex(obj_knight_enemy))
|
|
230
|
{
|
|
231
|
if (target == 0)
|
|
232
|
{
|
|
233
|
hpdiff = abs(global.hp[chartarget] - (global.maxhp[chartarget] / 2));
|
|
234
|
doomtype = 4;
|
|
235
|
global.hp[chartarget] = round(-global.maxhp[chartarget] / 2);
|
|
236
|
scr_deadscr_dead
function scr_dead(arg0)
{
global.charmove[arg0] = 0;
global.charcantarget[arg0] = 0;
global.chardead[arg0] = 1;
global.charaction[arg0] = 0;
global.charspecial[arg0] = 0;
} (target);
|
|
237
|
}
|
|
238
|
else
|
|
239
|
{
|
|
240
|
doomtype = 12;
|
|
241
|
hpdiff = round(global.hp[chartarget] + 999);
|
|
242
|
global.hp[chartarget] = -999;
|
|
243
|
scr_deadscr_dead
function scr_dead(arg0)
{
global.charmove[arg0] = 0;
global.charcantarget[arg0] = 0;
global.chardead[arg0] = 1;
global.charaction[arg0] = 0;
global.charspecial[arg0] = 0;
} (target);
|
|
244
|
}
|
|
245
|
}
|
|
246
|
else
|
|
247
|
{
|
|
248
|
hpdiff = abs(global.hp[chartarget] - (global.maxhp[chartarget] / 2));
|
|
249
|
doomtype = 4;
|
|
250
|
global.hp[chartarget] = round(-global.maxhp[chartarget] / 2);
|
|
251
|
scr_deadscr_dead
function scr_dead(arg0)
{
global.charmove[arg0] = 0;
global.charcantarget[arg0] = 0;
global.chardead[arg0] = 1;
global.charaction[arg0] = 0;
global.charspecial[arg0] = 0;
} (target);
|
|
252
|
}
|
|
253
|
}
|
|
254
|
}
|
|
255
|
dmgwriter = instance_create(global.charinstance[target].x, (global.charinstance[target].y + global.charinstance[target].myheight) - 24, obj_dmgwriter);
|
|
256
|
dmgwriter.damage = hpdiff;
|
|
257
|
dmgwriter.type = doomtype;
|
|
258
|
}
|
|
259
|
if (target == 3)
|
|
260
|
{
|
|
261
|
for (hpi = 0; hpi < 3; hpi += 1)
|
|
262
|
{
|
|
263
|
chartarget = global.char[hpi];
|
|
264
|
if (global.hp[chartarget] >= 0)
|
|
265
|
{
|
|
266
|
if (oldcalculation)
|
|
267
|
tdamage = ceil(tdamage - (global.battledf[hpi] * 3));
|
|
268
|
else
|
|
269
|
tdamage = scr_damage_calculationscr_damage_calculation
function scr_damage_calculation(arg0, arg1)
{
var _tdamage = arg0;
var _tdef = global.battledf[arg1];
var _tmaxhp = global.maxhp[global.char[arg1]];
var _finaldamage = 1;
var _hpthresholda = _tmaxhp / 5;
var _hpthresholdb = _tmaxhp / 8;
for (var _di = 0; _di < _tdef; _di++)
{
if (_tdamage > _hpthresholda)
_tdamage -= 3;
else if (_tdamage > _hpthresholdb)
_tdamage -= 2;
else
_tdamage -= 1;
}
return max(_tdamage, _finaldamage);
} (tdamage, hpi);
|
|
270
|
if (global.chapter == 3 && i_ex(obj_knight_enemy))
|
|
271
|
{
|
|
272
|
if ((global.chararmor1[1] == 23 || global.chararmor2[1] == 23) && hpi == 0)
|
|
273
|
{
|
|
274
|
tdamage = round(tdamage * 0.33);
|
|
275
|
shadowmantlereduction = true;
|
|
276
|
}
|
|
277
|
if ((global.chararmor1[2] == 23 || global.chararmor2[2] == 23) && hpi == 1)
|
|
278
|
{
|
|
279
|
tdamage = round(tdamage * 0.33);
|
|
280
|
shadowmantlereduction = true;
|
|
281
|
}
|
|
282
|
if ((global.chararmor1[3] == 23 || global.chararmor2[3] == 23) && hpi == 2)
|
|
283
|
{
|
|
284
|
tdamage = round(tdamage * 0.33);
|
|
285
|
shadowmantlereduction = true;
|
|
286
|
}
|
|
287
|
}
|
|
288
|
if (shadowmantlereduction == false)
|
|
289
|
tdamage = ceil(tdamage * scr_element_damage_reductionscr_element_damage_reduction
function scr_element_damage_reduction(arg0, arg1)
{
var ___element = arg0;
var ___char = arg1;
var ___reduction = 1;
if (___element != 0)
{
for (var ___itemi = 0; ___itemi < 2; ___itemi++)
{
if (global.itemelement[___char][___itemi + 1] != 0)
{
if (global.itemelement[___char][___itemi + 1] == ___element)
___reduction -= global.itemelementamount[___char][___itemi + 1];
if (global.itemelement[___char][___itemi + 1] == 9)
{
if (___element == 2 || ___element == 8)
___reduction -= global.itemelementamount[___char][___itemi + 1];
}
if (global.itemelement[___char][___itemi + 1] == 10)
___reduction -= global.itemelementamount[___char][___itemi + 1];
}
}
}
if (___reduction < 0.25)
___reduction = 0.25;
return ___reduction;
} (__element, chartarget));
|
|
290
|
if (global.charaction[hpi] == 10)
|
|
291
|
global.hp[chartarget] -= ceil((3 * tdamage) / 4);
|
|
292
|
else
|
|
293
|
global.hp[chartarget] -= tdamage;
|
|
294
|
if (global.hp[chartarget] <= 0)
|
|
295
|
global.hp[chartarget] = round(-global.maxhp[0] / 2);
|
|
296
|
}
|
|
297
|
}
|
|
298
|
}
|
|
299
|
global.inv = global.invc * 30;
|
|
300
|
scr_damage_check();
|
|
301
|
gameover = 1;
|
|
302
|
if (global.char[0] != 0 && global.hp[global.char[0]] > 0)
|
|
303
|
gameover = 0;
|
|
304
|
if (global.char[1] != 0 && global.hp[global.char[1]] > 0)
|
|
305
|
gameover = 0;
|
|
306
|
if (global.char[2] != 0 && global.hp[global.char[2]] > 0)
|
|
307
|
gameover = 0;
|
|
308
|
if (global.chapter == 3 && (room == room_board_1 || room == room_board_2 || room == room_board_3))
|
|
309
|
gameover = 0;
|
|
310
|
if (global.chapter == 3 && i_ex(obj_knight_enemy))
|
|
311
|
gameover = 0;
|
|
312
|
if (global.chapter == 3 && i_ex(obj_tenna_board4_enemy))
|
|
313
|
gameover = 0;
|
|
314
|
if (gameover == 1)
|
|
315
|
scr_gameoverscr_gameover
function scr_gameover()
{
if (global.flag[35 gameover_mode] == 0)
{
audio_stop_all();
snd_play(snd_hurt1);
global.screenshot = sprite_create_from_surface(application_surface, 0, 0, __view_get(e__VW.WView, 0), __view_get(e__VW.HView, 0), 0, 0, 0, 0);
snd_free_all();
room_goto(room_gameover );
}
if (global.flag[35 gameover_mode] == 1)
{
global.turntimer = -1;
global.flag[36 dojo_failure] = 1;
global.flag[39 dojo_abort?] = 1;
}
if (global.flag[35 gameover_mode] == 2)
{
audio_stop_all();
snd_play(snd_hurt1);
snd_free_all();
global.entrance = 0;
global.tempflag[9] = 1;
global.fighting = 0;
global.interact = 0;
global.hp[0] = 1;
global.hp[1] = 1;
global.hp[2] = 1;
global.hp[3] = 1;
__room = room;
if (global.chapter == 2)
{
with (instance_create(0, 0, obj_persistentfadein))
image_alpha = 1.2;
}
room_goto(__room);
}
}
enum e__VW
{
XView,
YView,
WView,
HView,
Angle,
HBorder,
VBorder,
HSpeed,
VSpeed,
Object,
Visible,
XPort,
YPort,
WPort,
HPort,
Camera,
SurfaceID
} ();
|
|
316
|
if (__remtarget != -1)
|
|
317
|
target = __remtarget;
|
|
318
|
}
|
|
319
|
}
|