|
1
|
function scr_damage_all_overworldscr_damage_all_overworld
function scr_damage_all_overworld()
{
if (global.inv < 0)
{
gameover = 1;
if (global.char[0] != 0 && global.hp[global.char[0]] > 1)
gameover = 0;
if (global.char[1] != 0 && global.hp[global.char[1]] > 1)
gameover = 0;
if (global.char[2] != 0 && global.hp[global.char[2]] > 1)
gameover = 0;
if (gameover == 1)
{
with (obj_event_manager)
trigger_event(UnknownEnum.Value_1);
scr_gameover();
}
scr_damage_cache();
remdamage = damage;
remtarget = target;
if (!instance_exists(obj_shake))
instance_create(0, 0, obj_shake);
with (obj_dmgwriter)
killactive = 1;
snd_stop(snd_hurt1);
snd_play(snd_hurt1);
for (ti = 0; ti < 3; ti += 1)
{
global.inv = -1;
damage = remdamage;
target = ti;
tdamage = damage;
with (global.charinstance[target])
{
hurt = 1;
hurttimer = 0;
}
hpdiff = tdamage;
if (hpdiff >= global.hp[global.char[target]])
hpdiff = global.hp[global.char[target]] - 1;
d_cancel = 0;
if (hpdiff <= 1)
{
if (global.hp[global.char[target]] <= 0)
{
hpdiff = 0;
d_cancel = 1;
}
else
{
hpdiff = 1;
}
}
if (d_cancel == 0)
{
doomtype = -1;
global.hp[global.char[target]] -= hpdiff;
if ((instance_exists(global.charinstance[target]) && global.charinstance[target].visible == true) || i_ex(obj_climb_kris))
{
dmgwriter = instance_create(x, y, obj_dmgwriter);
dmgwriter.damage = hpdiff;
dmgwriter.type = doomtype;
if (i_ex(obj_climb_kris))
{
dmgwriter.x = obj_climb_kris.x;
dmgwriter.y = obj_climb_kris.y;
dmgwriter.ystart = obj_climb_kris.y;
dmgwriter.depth = obj_climb_kris.depth - 100;
if (obj_climb_kris.onrotatingtower == true)
dmgwriter.x = camerax() + (camerawidth() / 2);
}
else
{
dmgwriter.x = global.charinstance[target].x;
dmgwriter.y = (global.charinstance[target].y + global.charinstance[target].myheight) - 24;
}
}
if (global.hp[global.char[target]] < 1)
global.hp[global.char[target]] = 1;
}
}
scr_damage_check();
target = remtarget;
global.inv = global.invc * 40;
}
}
enum UnknownEnum
{
Value_1 = 1
} ()
|
|
2
|
{
|
|
3
|
if (global.inv < 0)
|
|
4
|
{
|
|
5
|
gameover = 1;
|
|
6
|
if (global.char[0] != 0 && global.hp[global.char[0]] > 1)
|
|
7
|
gameover = 0;
|
|
8
|
if (global.char[1] != 0 && global.hp[global.char[1]] > 1)
|
|
9
|
gameover = 0;
|
|
10
|
if (global.char[2] != 0 && global.hp[global.char[2]] > 1)
|
|
11
|
gameover = 0;
|
|
12
|
if (gameover == 1)
|
|
13
|
{
|
|
14
|
with (obj_event_manager)
|
|
15
|
trigger_event(UnknownEnum.Value_1);
|
|
16
|
scr_gameoverscr_gameover
function scr_gameover()
{
if (global.flag[35 gameover_mode] == 0)
{
audio_stop_all();
snd_play(snd_hurt1);
if (global.chapter == 4)
{
if (i_ex(obj_jackenstein_enemy))
global.tempflag[89]++;
}
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
} ();
|
|
17
|
}
|
|
18
|
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
} ();
|
|
19
|
remdamage = damage;
|
|
20
|
remtarget = target;
|
|
21
|
if (!instance_exists(obj_shake))
|
|
22
|
instance_create(0, 0, obj_shake);
|
|
23
|
with (obj_dmgwriter)
|
|
24
|
killactive = 1;
|
|
25
|
snd_stop(snd_hurt1);
|
|
26
|
snd_play(snd_hurt1);
|
|
27
|
for (ti = 0; ti < 3; ti += 1)
|
|
28
|
{
|
|
29
|
global.inv = -1;
|
|
30
|
damage = remdamage;
|
|
31
|
target = ti;
|
|
32
|
tdamage = damage;
|
|
33
|
with (global.charinstance[target])
|
|
34
|
{
|
|
35
|
hurt = 1;
|
|
36
|
hurttimer = 0;
|
|
37
|
}
|
|
38
|
hpdiff = tdamage;
|
|
39
|
if (hpdiff >= global.hp[global.char[target]])
|
|
40
|
hpdiff = global.hp[global.char[target]] - 1;
|
|
41
|
d_cancel = 0;
|
|
42
|
if (hpdiff <= 1)
|
|
43
|
{
|
|
44
|
if (global.hp[global.char[target]] <= 0)
|
|
45
|
{
|
|
46
|
hpdiff = 0;
|
|
47
|
d_cancel = 1;
|
|
48
|
}
|
|
49
|
else
|
|
50
|
{
|
|
51
|
hpdiff = 1;
|
|
52
|
}
|
|
53
|
}
|
|
54
|
if (d_cancel == 0)
|
|
55
|
{
|
|
56
|
doomtype = -1;
|
|
57
|
global.hp[global.char[target]] -= hpdiff;
|
|
58
|
if ((instance_exists(global.charinstance[target]) && global.charinstance[target].visible == true) || i_ex(obj_climb_kris))
|
|
59
|
{
|
|
60
|
dmgwriter = instance_create(x, y, obj_dmgwriter);
|
|
61
|
dmgwriter.damage = hpdiff;
|
|
62
|
dmgwriter.type = doomtype;
|
|
63
|
if (i_ex(obj_climb_kris))
|
|
64
|
{
|
|
65
|
dmgwriter.x = obj_climb_kris.x;
|
|
66
|
dmgwriter.y = obj_climb_kris.y;
|
|
67
|
dmgwriter.ystart = obj_climb_kris.y;
|
|
68
|
dmgwriter.depth = obj_climb_kris.depth - 100;
|
|
69
|
if (obj_climb_kris.onrotatingtower == true)
|
|
70
|
dmgwriter.x = camerax() + (camerawidth() / 2);
|
|
71
|
}
|
|
72
|
else
|
|
73
|
{
|
|
74
|
dmgwriter.x = global.charinstance[target].x;
|
|
75
|
dmgwriter.y = (global.charinstance[target].y + global.charinstance[target].myheight) - 24;
|
|
76
|
}
|
|
77
|
}
|
|
78
|
if (global.hp[global.char[target]] < 1)
|
|
79
|
global.hp[global.char[target]] = 1;
|
|
80
|
}
|
|
81
|
}
|
|
82
|
scr_damage_check();
|
|
83
|
target = remtarget;
|
|
84
|
global.inv = global.invc * 40;
|
|
85
|
}
|
|
86
|
}
|
|
87
|
|
|
88
|
enum UnknownEnum
|
|
89
|
{
|
|
90
|
Value_1 = 1
|
|
91
|
}
|