global script Active
{
void run()
{
while (true)
{
EnemyLevelUp();
EnemyStatDisplay();
Waitframe();
}
}
}
void EnemyLevelUp()
{
npc en;
int numTriforce = 3;
int HP_multiplier = (Link->MaxHP * 0.125 * 0.5) + (Link->MaxMP * 0.0313 * 0.5) + (numTriforce * 1.2);
if (Link->Item[I_HAMMER])
{
HP_multiplier += 0.5;
}
int damage_multiplier = (Link->MaxHP * 0.125 * 0.5) + (Link->MaxMP * 0.0313 * 0.5) + (numTriforce * 1.2);
if (Link->Item[I_RING1])
{
damage_multiplier += 0.5;
}
int step_multiplier = (Link->MaxHP * 0.125 * 0.5) + (Link->MaxMP * 0.0313 * 0.5) + (numTriforce * 1.2);
if (Link->Item[I_ROCSFEATHER])
{
step_multiplier += 1;
}
for (int i = 1; i <= Screen->NumNPCs(); i++)
{
en = Screen->LoadNPC(i);
if (en->Misc[0] == 0)
{
en->HP *= HP_multiplier;
en->Damage *= damage_multiplier;
en->Step *= step_multiplier;
en->Misc[0] = 1;
}
}
}
int enemy_index;
void EnemyStatDisplay()
{
int enemy_num[] = "ENEMY #";
int HP[] = "HP";
int damage[] = "DAMAGE";
int weapon_damage[] = "WEAPON DAMAGE";
int step[] = "STEP";
int homing[] = "HOMING";
int hunger[] = "HUNGER";
npc check = Screen->LoadNPC(enemy_index);
if (Link->PressEx1)
{
enemy_index++;
}
if (enemy_index > Screen->NumNPCs() || enemy_index < 1)
{
enemy_index = 1;
}
if (check->isValid())
{
Screen->DrawInteger(6, 0, 0, FONT_Z1, 0x01, 0x07, 0, 0, enemy_index, 0, OP_OPAQUE);
Screen->DrawString(6, 48, 0, FONT_S, 0x01, 0x07, TF_NORMAL, enemy_num, OP_OPAQUE);
Screen->DrawInteger(6, 0, 16, FONT_Z1, 0x01, 0x07, 0, 0, check->HP, 0, OP_OPAQUE);
Screen->DrawString(6, 48, 16, FONT_S, 0x01, 0x07, TF_NORMAL, HP, OP_OPAQUE);
Screen->DrawInteger(6, 0, 32, FONT_Z1, 0x01, 0x07, 0, 0, check->Damage, 0, OP_OPAQUE);
Screen->DrawString(6, 48, 32, FONT_S, 0x01, 0x07, TF_NORMAL, damage, OP_OPAQUE);
Screen->DrawInteger(6, 0, 48, FONT_Z1, 0x01, 0x07, 0, 0, check->WeaponDamage, 0, OP_OPAQUE);
Screen->DrawString(6, 48, 48, FONT_S, 0x01, 0x07, TF_NORMAL, weapon_damage, OP_OPAQUE);
Screen->DrawInteger(6, 0, 64, FONT_Z1, 0x01, 0x07, 0, 0, check->Step, 0, OP_OPAQUE);
Screen->DrawString(6, 48, 64, FONT_S, 0x01, 0x07, TF_NORMAL, step, OP_OPAQUE);
Screen->DrawInteger(6, 0, 80, FONT_Z1, 0x01, 0x07, 0, 0, check->Homing, 0, OP_OPAQUE);
Screen->DrawString(6, 48, 80, FONT_S, 0x01, 0x07, TF_NORMAL, homing, OP_OPAQUE);
Screen->DrawInteger(6, 0, 96, FONT_Z1, 0x01, 0x07, 0, 0, check->Hunger, 0, OP_OPAQUE);
Screen->DrawString(6, 48, 96, FONT_S, 0x01, 0x07, TF_NORMAL, hunger, OP_OPAQUE);
}
}