|
1
|
function scr_endturnscr_endturn
function scr_endturn()
{
for (i = 0; i < 12; i += 1)
global.item[i] = tempitem[i][global.charturn];
for (i = 0; i < 12; i += 1)
{
for (j = 0; j < 3; j += 1)
tempitem[i][j] = global.item[i];
}
moveswapped = 0;
with (obj_writer)
instance_destroy();
with (obj_face)
instance_destroy();
with (obj_smallface)
instance_destroy();
for (i = 0; i < 3; i += 1)
{
if ((i == 0 && (global.chararmor1[1] == 38 || global.chararmor2[1] == 38) && global.faceaction[0] == 4) || (i == 1 && (global.chararmor1[2] == 38 || global.chararmor2[2] == 38) && global.faceaction[1] == 4) || (i == 2 && (global.chararmor1[3] == 38 || global.chararmor2[3] == 38) && global.faceaction[2] == 4))
{
var healnum = round(global.maxhp[i + 1] * 0.16);
global.charinstance[i].healnum = healnum;
scr_heal(i, healnum);
with (global.charinstance[i])
{
ha = instance_create(x, y, obj_healanim);
ha.target = id;
dmgwr = scr_dmgwriter_selfchar();
with (dmgwr)
{
delay = 8;
type = 3;
}
if (global.hp[global.char[myself]] >= global.maxhp[global.char[myself]])
{
with (dmgwr)
specialmessage = 3;
}
dmgwr.damage = healnum;
tu += 1;
}
}
for (iii = 0; iii < 3; iii++)
{
with (global.charinstance[i])
tu--;
}
}
global.attacking = 0;
for (i = 0; i < 3; i += 1)
{
global.monsterattackname[i] = " ";
if (global.charauto[global.char[i]] == 1 && global.hp[global.char[i]] > 0)
{
if (global.monster[2] == 1)
global.chartarget[i] = 2;
if (global.monster[1] == 1)
global.chartarget[i] = 1;
if (global.monster[0] == 1)
global.chartarget[i] = 0;
}
if (global.charaction[i] == 1)
global.attacking = 1;
}
__noactors = 1;
if (global.acting[0] == 1)
__noactors = 0;
for (__noactorsi = 0; __noactorsi < 3; __noactorsi++)
{
if (global.actingsingle[__noactorsi] == 1)
__noactors = 0;
}
if (__noactors == 1)
{
scr_attackphase();
}
else
{
global.charturn = 3;
global.myfight = 3;
global.currentactingchar = 0;
if (global.acting[0] == 0)
scr_nextact();
if (global.acting[0] == 1 && global.actingsimul[0] == 1)
scr_act_simul();
}
with (obj_battlecontroller)
{
messagepriority = -1;
attackpriority = -1;
}
} ()
|
|
2
|
{
|
|
3
|
for (i = 0; i < 12; i += 1)
|
|
4
|
global.item[i] = tempitem[i][global.charturn];
|
|
5
|
for (i = 0; i < 12; i += 1)
|
|
6
|
{
|
|
7
|
for (j = 0; j < 3; j += 1)
|
|
8
|
tempitem[i][j] = global.item[i];
|
|
9
|
}
|
|
10
|
moveswapped = 0;
|
|
11
|
with (obj_writer)
|
|
12
|
instance_destroy();
|
|
13
|
with (obj_face)
|
|
14
|
instance_destroy();
|
|
15
|
with (obj_smallface)
|
|
16
|
instance_destroy();
|
|
17
|
for (i = 0; i < 3; i += 1)
|
|
18
|
{
|
|
19
|
if ((i == 0 && (global.chararmor1[1] == 38 || global.chararmor2[1] == 38) && global.faceaction[0] == 4) || (i == 1 && (global.chararmor1[2] == 38 || global.chararmor2[2] == 38) && global.faceaction[1] == 4) || (i == 2 && (global.chararmor1[3] == 38 || global.chararmor2[3] == 38) && global.faceaction[2] == 4))
|
|
20
|
{
|
|
21
|
var healnum = round(global.maxhp[i + 1] * 0.16);
|
|
22
|
global.charinstance[i].healnum = healnum;
|
|
23
|
scr_healscr_heal
function scr_heal(arg0, arg1, arg2 = true)
{
abovemaxhp = 0;
belowzero = 0;
hltarget = global.char[arg0];
_curhp = global.hp[hltarget];
if (global.hp[hltarget] <= 0)
belowzero = 1;
if (global.hp[hltarget] > global.maxhp[hltarget])
abovemaxhp = 1;
if (abovemaxhp == 0)
{
global.hp[hltarget] += arg1;
if (global.hp[hltarget] > global.maxhp[hltarget])
global.hp[hltarget] = global.maxhp[hltarget];
}
if (belowzero == 1 && global.hp[hltarget] >= 0 && arg2)
{
if (global.hp[hltarget] < ceil(global.maxhp[hltarget] / 6))
global.hp[hltarget] = ceil(global.maxhp[hltarget] / 6);
scr_revive(arg0);
}
snd_stop(snd_power);
snd_play(snd_power);
return global.hp[hltarget] - _curhp;
} (i, healnum);
|
|
24
|
with (global.charinstance[i])
|
|
25
|
{
|
|
26
|
ha = instance_create(x, y, obj_healanim);
|
|
27
|
ha.target = id;
|
|
28
|
dmgwr = scr_dmgwriter_selfcharscr_dmgwriter_selfchar
function scr_dmgwriter_selfchar()
{
if (tu < -1)
tu = -1;
return instance_create(x, (y + myheight) - 40 - 24 - (tu * 20), obj_dmgwriter);
} ();
|
|
29
|
with (dmgwr)
|
|
30
|
{
|
|
31
|
delay = 8;
|
|
32
|
type = 3;
|
|
33
|
}
|
|
34
|
if (global.hp[global.char[myself]] >= global.maxhp[global.char[myself]])
|
|
35
|
{
|
|
36
|
with (dmgwr)
|
|
37
|
specialmessage = 3;
|
|
38
|
}
|
|
39
|
dmgwr.damage = healnum;
|
|
40
|
tu += 1;
|
|
41
|
}
|
|
42
|
}
|
|
43
|
for (iii = 0; iii < 3; iii++)
|
|
44
|
{
|
|
45
|
with (global.charinstance[i])
|
|
46
|
tu--;
|
|
47
|
}
|
|
48
|
}
|
|
49
|
global.attacking = 0;
|
|
50
|
for (i = 0; i < 3; i += 1)
|
|
51
|
{
|
|
52
|
global.monsterattackname[i] = " ";
|
|
53
|
if (global.charauto[global.char[i]] == 1 && global.hp[global.char[i]] > 0)
|
|
54
|
{
|
|
55
|
if (global.monster[2] == 1)
|
|
56
|
global.chartarget[i] = 2;
|
|
57
|
if (global.monster[1] == 1)
|
|
58
|
global.chartarget[i] = 1;
|
|
59
|
if (global.monster[0] == 1)
|
|
60
|
global.chartarget[i] = 0;
|
|
61
|
}
|
|
62
|
if (global.charaction[i] == 1)
|
|
63
|
global.attacking = 1;
|
|
64
|
}
|
|
65
|
__noactors = 1;
|
|
66
|
if (global.acting[0] == 1)
|
|
67
|
__noactors = 0;
|
|
68
|
for (__noactorsi = 0; __noactorsi < 3; __noactorsi++)
|
|
69
|
{
|
|
70
|
if (global.actingsingle[__noactorsi] == 1)
|
|
71
|
__noactors = 0;
|
|
72
|
}
|
|
73
|
if (__noactors == 1)
|
|
74
|
{
|
|
75
|
scr_attackphasescr_attackphase
function scr_attackphase()
{
with (obj_battlecontroller)
{
techwon = 0;
if (scr_monsterpop() == 0)
techwon = 1;
if (techwon == 1)
scr_wincombat();
if (techwon == 0)
{
for (__hiti = 0; __hiti < 3; __hiti++)
global.hittarget[__hiti] = 0;
fightphase = 1;
global.charturn = 3;
if (global.charaction[0] == 4 || global.charaction[0] == 2)
fightphase = 0;
if (global.charaction[1] == 4 || global.charaction[1] == 2)
fightphase = 0;
if (global.charaction[2] == 4 || global.charaction[2] == 2)
fightphase = 0;
if (global.myfight == 4)
fightphase = 1;
if (fightphase == 1)
{
global.myfight = 1;
instance_create(xx + 2, yy + 365, obj_attackpress);
}
else
{
global.myfight = 4;
instance_create(0, 0, obj_spellphase);
}
}
}
} ();
|
|
76
|
}
|
|
77
|
else
|
|
78
|
{
|
|
79
|
global.charturn = 3;
|
|
80
|
global.myfight = 3;
|
|
81
|
global.currentactingchar = 0;
|
|
82
|
if (global.acting[0] == 0)
|
|
83
|
scr_nextactscr_nextact
function scr_nextact()
{
global.acting[0] = 0;
global.acting[1] = 0;
global.acting[2] = 0;
global.actingsingle[global.currentactingchar] = 0;
__minstance = global.monsterinstance[global.actingtarget[global.currentactingchar]];
with (__minstance)
{
acting = 0;
actcon = 0;
actconsus = 0;
actconral = 0;
actconnoe = 0;
}
var singleactcomplete = 0;
while (global.currentactingchar < 3)
{
global.currentactingchar++;
if (global.currentactingchar < 3)
{
if (global.actingsingle[global.currentactingchar] == 1)
{
__minstance = global.monsterinstance[global.actingtarget[global.currentactingchar]];
if (global.char[global.currentactingchar] == 2)
{
with (__minstance)
actconsus = 1;
if (global.actingsimul[global.currentactingchar] == 0)
singleactcomplete = 1;
break;
}
if (global.char[global.currentactingchar] == 3)
{
with (__minstance)
actconral = 1;
if (global.actingsimul[global.currentactingchar] == 0)
singleactcomplete = 1;
break;
}
if (global.char[global.currentactingchar] == 4)
{
with (__minstance)
actconnoe = 1;
if (global.actingsimul[global.currentactingchar] == 0)
singleactcomplete = 1;
break;
}
}
}
}
if (global.currentactingchar >= 3)
{
with (obj_monsterparent)
{
acting = 0;
actingsus = 0;
actingral = 0;
actingnoe = 0;
}
global.currentactingchar = 0;
scr_attackphase();
}
else if (!singleactcomplete)
{
scr_act_simul();
}
} ();
|
|
84
|
if (global.acting[0] == 1 && global.actingsimul[0] == 1)
|
|
85
|
scr_act_simulscr_act_simul
function scr_act_simul()
{
__simulcount = 0;
for (__ii = global.currentactingchar; __ii < 3; __ii++)
{
__foundsimul = 0;
if (global.actingsingle[__ii] == 1 && instance_exists(obj_monsterparent))
{
if (global.char[__ii] == 1 && global.actsimul[global.actingtarget[__ii]][global.actingchoice[__ii]] == 1)
{
obj_monsterparent.simulorderkri = __simulcount;
with (global.monsterinstance[global.actingtarget[__ii]])
actcon = 0;
__foundsimul = 1;
}
if (global.char[__ii] == 2 && global.actsimulsus[global.actingtarget[__ii]][global.actingchoice[__ii]] == 1)
{
obj_monsterparent.simulordersus = __simulcount;
with (global.monsterinstance[global.actingtarget[__ii]])
actconsus = 1;
__foundsimul = 1;
}
if (global.char[__ii] == 3 && global.actsimulral[global.actingtarget[__ii]][global.actingchoice[__ii]] == 1)
{
obj_monsterparent.simulorderral = __simulcount;
with (global.monsterinstance[global.actingtarget[__ii]])
actconral = 1;
__foundsimul = 1;
}
if (global.char[__ii] == 4 && global.actsimulnoe[global.actingtarget[__ii]][global.actingchoice[__ii]] == 1)
{
obj_monsterparent.simulordernoe = __simulcount;
with (global.monsterinstance[global.actingtarget[__ii]])
actconnoe = 1;
__foundsimul = 1;
}
if (__foundsimul)
{
global.actingsingle[__ii] = 0;
__simulcount++;
}
obj_monsterparent.simultotal = __simulcount;
}
}
} ();
|
|
86
|
}
|
|
87
|
with (obj_battlecontroller)
|
|
88
|
{
|
|
89
|
messagepriority = -1;
|
|
90
|
attackpriority = -1;
|
|
91
|
}
|
|
92
|
}
|