|
9
|
scr_damagescr_damage
function scr_damage()
{
if (global.inv < 0)
{
scr_damage_cache();
var __element = 0;
if (variable_instance_exists(id, "element") && is_real(element))
__element = element;
if (global.chapter == 4 && i_ex(obj_hammer_of_justice_enemy))
obj_hammer_of_justice_enemy.gothitlastturn++;
if (global.chapter == 4 && i_ex(obj_sound_of_justice_enemy))
obj_sound_of_justice_enemy.gothitlastturn++;
if (global.chapter == 4 && i_ex(obj_guei_enemy))
obj_guei_enemy.gothitthisturn = true;
if (global.chapter == 4 && global.encounterno == 157 && !i_ex(obj_herosusie) && !i_ex(obj_heroralsei))
damage = round(damage * 0.7);
if (global.chapter == 4 && i_ex(obj_jackenstein_enemy) && obj_jackenstein_enemy.scaredycat)
damage = round(damage * 1.5);
with (obj_mike_minigame_controller)
hurt = true;
if (target < 3)
{
var skipthis = false;
if (global.chapter == 4)
{
if (i_ex(obj_climb_kris))
skipthis = true;
}
if (!skipthis)
{
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;
var getList = array_length(global.char);
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 == 4 && i_ex(obj_titan_enemy) && obj_titan_enemy.forcehitralsei)
{
damage *= 0.5;
if (global.hp[3] > 0)
target = 2;
}
if (global.chapter == 4 && i_ex(obj_sound_of_justice_enemy) && obj_sound_of_justice_enemy.phase == 2)
{
if (global.hp[1] > 0 && global.hp[2] < (global.maxhp[2] * 0.4))
target = 0;
}
if (i_ex(obj_titan_enemy) || i_ex(obj_titan_spawn_enemy))
{
if ((target == 0 && (global.chararmor1[1] == 23 || global.chararmor2[1] == 23)) || (target == 1 && (global.chararmor1[2] == 23 || global.chararmor2[2] == 23)) || (target == 2 && (global.chararmor1[3] == 23 || global.chararmor2[3] == 23)))
damage = round(damage * 0.5);
}
tdamage = damage;
var oldcalculation = 0;
if (target < 3)
{
if (oldcalculation)
tdamage = ceil(tdamage - (global.battledf[target] * 3));
else
tdamage = scr_damage_calculation(tdamage, target);
chartarget = global.char[target];
if (global.charaction[target] == 10)
tdamage = ceil((2 * tdamage) / 3);
tdamage = ceil(tdamage * scr_element_damage_reduction(__element, global.char[target]));
debug_message("The element is: " + string(__element));
if (tdamage < 1)
... ();
|