|
2
|
scr_damagescr_damage
function scr_damage(arg0 = true)
{
if (global.inv < 0)
{
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;
}
}
chartarget = 3;
if (global.chapter == 5 && i_ex(obj_flowery_enemy))
{
var dam_reduction = 0;
if (global.tempflag[74] == 7)
dam_reduction = -0.05;
if (global.tempflag[74] == 8)
dam_reduction = -0.1;
if (global.tempflag[74] == 9)
dam_reduction = -0.12;
if (global.tempflag[74] == 10)
dam_reduction = -0.15;
if (global.tempflag[74] == 11)
dam_reduction = -0.18;
if (global.tempflag[74] == 12)
dam_reduction = -0.21;
if (global.tempflag[74] >= 13)
dam_reduction = -0.25;
if (obj_flowery_enemy.partydefenselowered == true)
{
damage = ceil(damage * (1.1 + dam_reduction));
dam_reduction = 0;
}
if (obj_flowery_enemy.remove_ralsei_con > 0)
{
damage = ceil(damage * (0.8 + dam_reduction));
dam_reduction = 0;
}
if (dam_reduction != 0)
damage = ceil(damage * (1 + dam_reduction));
if (obj_flowery_enemy.ralsei_removed == true && target == 2)
{
target = choose(0, 1);
if (global.hp[1] < 1)
target = 1;
if (global.hp[2] < 1)
target = 0;
}
if (i_ex(obj_dbulletcontroller) && obj_dbulletcontroller.type == 637)
obj_flowery_enemy.damage_taken_during_tutorial++;
}
if (global.chapter == 5 && i_ex(obj_pink_enemy) && global.flag[1914] == 2)
damage = round(damage * 1.21);
tdamage = damage;
var oldcalculation = 0;
if (target < 3)
{
chartarget = global.char[target];
if (global.ignoredefense == true)
{
tdamage = ceil(tdamage);
... ();
|