1 |
function scr_damage_ch1scr_damage_ch1function scr_damage_ch1()
{
var debug_inv = 0;
if (variable_global_exists("chemg_god_mode"))
debug_inv = global.chemg_god_mode;
if (global.inv < 0 && debug_inv == 0)
{
if (target < 3)
{
if (global.hp[global.char[target]] <= 0)
{
scr_randomtarget_ch1();
target = mytarget;
with (global.charinstance[target])
{
image_blend = c_white;
darkify = 0;
}
}
}
chartarget = 3;
tdamage = damage;
if (target < 3)
{
tdamage = ceil(tdamage - (global.battledf[target] * 3));
chartarget = global.char[target];
if (global.charaction[target] == 10)
tdamage = ceil((2 * tdamage) / 3);
if (tdamage < 1)
tdamage = 1;
}
if (!instance_exists(obj_shake_ch1))
instance_create_ch1(0, 0, obj_shake_ch1);
with (global.charinstance[target])
{
hurt = 1;
hurttimer = 0;
}
hpdiff = tdamage;
with (obj_dmgwriter_ch1)
{
if (delaytimer >= 1)
killactive = 1;
}
doomtype = -1;
with (obj_heart_ch1)
dmgnoise = 1;
if (target < 3)
{
if (global.hp[chartarget] <= 0)
{
doomtype = 4;
global.hp[chartarget] -= round(tdamage / 4);
hpdiff = round(tdamage / 4);
}
else
{
global.hp[chartarget] -= tdamage;
if (global.hp[chartarget] <= 0)
{
hpdiff = abs(global.hp[chartarget] - (global.maxhp[chartarget] / 2));
doomtype = 4;
global.hp[chartarget] = round(-global.maxhp[chartarget] / 2);
scr_dead_ch1(target);
}
}
dmgwriter = instance_create_ch1(global.charinstance[target].x, (global.charinstance[target].y + global.charinstance[target].myheight) - 24, obj_dmgwriter_ch1);
dmgwriter.damage = hpdiff;
dmgwriter.type = doomtype;
}
if (target == 3)
{
for (hpi = 0; hpi < 3; hpi += 1)
{
chartarget = global.char[hpi];
if (global.hp[chartarget] >= 0)
{
if (global.charaction[hpi] == 10)
global.hp[chartarget] -= ceil(tdamage / 2);
else
global.hp[chartarget] -= tdamage;
if (global.hp[chartarget] <= 0)
global.hp[chartarget] = round(-global.maxhp[0] / 2);
}
}
}
global.inv = global.invc * 40;
gameover = 1;
if (global.char[0] != 0 && global.hp[global.char[0]] > 0)
gameover = 0;
if (global.char[1] != 0 && global.hp[global.char[1]] > 0)
gameover = 0;
if (global.char[2] != 0 && global.hp[global.char[2]] > 0)
gameover = 0;
if (gameover == 1)
scr_gameover_ch1();
}
} () |
2 |
{ |
3 |
var debug_inv = 0; |
4 |
if (variable_global_exists("chemg_god_mode")) |
5 |
debug_inv = global.chemg_god_mode; |
6 |
if (global.inv < 0 && debug_inv == 0) |
7 |
{ |
8 |
if (target < 3) |
9 |
{ |
10 |
if (global.hp[global.char[target]] <= 0) |
11 |
{ |
12 |
scr_randomtarget_ch1scr_randomtarget_ch1function scr_randomtarget_ch1()
{
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;
} (); |
13 |
target = mytarget; |
14 |
with (global.charinstance[target]) |
15 |
{ |
16 |
image_blend = c_white; |
17 |
darkify = 0; |
18 |
} |
19 |
} |
20 |
} |
21 |
chartarget = 3; |
22 |
tdamage = damage; |
23 |
if (target < 3) |
24 |
{ |
25 |
tdamage = ceil(tdamage - (global.battledf[target] * 3)); |
26 |
chartarget = global.char[target]; |
27 |
if (global.charaction[target] == 10) |
28 |
tdamage = ceil((2 * tdamage) / 3); |
29 |
if (tdamage < 1) |
30 |
tdamage = 1; |
31 |
} |
32 |
if (!instance_exists(obj_shake_ch1)) |
33 |
instance_create_ch1(0, 0, obj_shake_ch1); |
34 |
with (global.charinstance[target]) |
35 |
{ |
36 |
hurt = 1; |
37 |
hurttimer = 0; |
38 |
} |
39 |
hpdiff = tdamage; |
40 |
with (obj_dmgwriter_ch1) |
41 |
{ |
42 |
if (delaytimer >= 1) |
43 |
killactive = 1; |
44 |
} |
45 |
doomtype = -1; |
46 |
with (obj_heart_ch1) |
47 |
dmgnoise = 1; |
48 |
if (target < 3) |
49 |
{ |
50 |
if (global.hp[chartarget] <= 0) |
51 |
{ |
52 |
doomtype = 4; |
53 |
global.hp[chartarget] -= round(tdamage / 4); |
54 |
hpdiff = round(tdamage / 4); |
55 |
} |
56 |
else |
57 |
{ |
58 |
global.hp[chartarget] -= tdamage; |
59 |
if (global.hp[chartarget] <= 0) |
60 |
{ |
61 |
hpdiff = abs(global.hp[chartarget] - (global.maxhp[chartarget] / 2)); |
62 |
doomtype = 4; |
63 |
global.hp[chartarget] = round(-global.maxhp[chartarget] / 2); |
64 |
scr_dead_ch1scr_dead_ch1function scr_dead_ch1(arg0)
{
global.charmove[arg0] = 0;
global.charcantarget[arg0] = 0;
global.chardead[arg0] = 1;
global.charaction[arg0] = 0;
global.charspecial[arg0] = 0;
} (target); |
65 |
} |
66 |
} |
67 |
dmgwriter = instance_create_ch1(global.charinstance[target].x, (global.charinstance[target].y + global.charinstance[target].myheight) - 24, obj_dmgwriter_ch1); |
68 |
dmgwriter.damage = hpdiff; |
69 |
dmgwriter.type = doomtype; |
70 |
} |
71 |
if (target == 3) |
72 |
{ |
73 |
for (hpi = 0; hpi < 3; hpi += 1) |
74 |
{ |
75 |
chartarget = global.char[hpi]; |
76 |
if (global.hp[chartarget] >= 0) |
77 |
{ |
78 |
if (global.charaction[hpi] == 10) |
79 |
global.hp[chartarget] -= ceil(tdamage / 2); |
80 |
else |
81 |
global.hp[chartarget] -= tdamage; |
82 |
if (global.hp[chartarget] <= 0) |
83 |
global.hp[chartarget] = round(-global.maxhp[0] / 2); |
84 |
} |
85 |
} |
86 |
} |
87 |
global.inv = global.invc * 40; |
88 |
gameover = 1; |
89 |
if (global.char[0] != 0 && global.hp[global.char[0]] > 0) |
90 |
gameover = 0; |
91 |
if (global.char[1] != 0 && global.hp[global.char[1]] > 0) |
92 |
gameover = 0; |
93 |
if (global.char[2] != 0 && global.hp[global.char[2]] > 0) |
94 |
gameover = 0; |
95 |
if (gameover == 1) |
96 |
scr_gameover_ch1scr_gameover_ch1function scr_gameover_ch1()
{
audio_stop_all();
snd_play_ch1(snd_hurt1_ch1);
if (room != room_forest_fightsusie_ch1)
{
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_ch1();
room_goto( room_gameover_ch1 Game Over screen? (crashes));
}
else
{
global.entrance = 0;
global.tempflag[9] = 1;
room_goto( room_forest_savepoint3_ch1 Maze - Exit (SAVE point));
}
}
enum e__VW
{
XView,
YView,
WView,
HView,
Angle,
HBorder,
VBorder,
HSpeed,
VSpeed,
Object,
Visible,
XPort,
YPort,
WPort,
HPort,
Camera,
SurfaceID
} (); |
97 |
} |
98 |
} |