ffc script SquidBoss
{
void run()
{
npc ghost = Ghost_InitAutoGhost(this, SQUID_BIG);
Ghost_TileWidth = 4;
Ghost_TileHeight = 4;
int timerAttack = 120;
int Ghost_MaxHP = Ghost_HP;
int HP_temp = Ghost_HP;
npc tent1;
npc tent2;
// Makes 2 tentacles at the start so Phanquid doesn't begin the fight stunned.
tent1 = SpawnNPC(SQUID_TENTACLE);
tent1->X = 48;
tent1->Y = 48;
tent2 = SpawnNPC(SQUID_TENTACLE);
tent2->X = 192;
tent2->Y = 48;
while (true)
{
if (HP_temp != Ghost_HP)
{
timerAttack = 60;
}
HP_temp = Ghost_HP;
if (timerAttack <= 0 && Ghost_HP > (Ghost_MaxHP * 0.7))
{
Phanquid_Attack1(this, ghost);
timerAttack = 120;
}
if (timerAttack <= 0 && Ghost_HP > (Ghost_MaxHP * 0.2) && Ghost_HP <= (Ghost_MaxHP * 0.7))
{
Phanquid_Attack2(this, ghost, Ghost_MaxHP);
timerAttack = 120;
}
if (timerAttack <= 0 && Ghost_HP <= (Ghost_MaxHP * 0.2))
{
Phanquid_Attack3(this, ghost, Ghost_MaxHP);
timerAttack = 120;
}
timerAttack--;
Phanquid_Ghost_Waitframe(this, ghost, Ghost_MaxHP);
}
}
}
void Phanquid_Ghost_Waitframe(ffc this, npc ghost, int Ghost_MaxHP)
{
int tentCount = 0;
int storedDefense[18];
int SpawnLocation1[175];
int SpawnLocation2[175];
int index = 0;
int SpawnIndex = -1;
int SpawnCombo;
npc enemy;
npc tent1;
npc tent2;
npc minion;
// Initialize these two arrays to 0 every time Phanquid_Ghost_Waitframe is called.
for (int i = 0; i <= 175; i++)
{
SpawnLocation1[i] = 0;
}
for (int i = 0; i <= 175; i++)
{
SpawnLocation2[i] = 0;
}
for (int i = 1; i <= Screen->NumNPCs(); i++)
{
enemy = Screen->LoadNPC(i);
if (enemy->ID == SQUID_TENTACLE)
{
tentCount++;
}
}
if (tentCount == 0)
{
Ghost_StoreDefenses(ghost, storedDefense);
Ghost_SetAllDefenses(ghost, NPCDT_NONE);
Ghost_Data = BIG_SQUID_STUN_COMBO;
Ghost_TileHeight = 3;
Ghost_Y += 16;
// Spawns minions for protection while stunned if HP is under certain thresholds.
if (Ghost_HP <= (Ghost_MaxHP * 0.9) && Ghost_HP > (Ghost_MaxHP * 0.6))
{
minion = Screen->CreateNPC(SQUID2_HOP);
minion->X = ComboX(113);
minion->Y = ComboY(113);
}
if (Ghost_HP <= (Ghost_MaxHP * 0.6) && Ghost_HP > (Ghost_MaxHP * 0.2))
{
minion = Screen->CreateNPC(SQUID2_HOP);
minion->X = ComboX(113);
minion->Y = ComboY(113);
minion = Screen->CreateNPC(SQUID2_HOP);
minion->X = ComboX(126);
minion->Y = ComboY(126);
}
if (Ghost_HP <= (Ghost_MaxHP * 0.2))
{
minion = Screen->CreateNPC(SQUID2_HOP);
minion->X = ComboX(113);
minion->Y = ComboY(113);
minion = Screen->CreateNPC(SQUID2_HOP);
minion->X = ComboX(126);
minion->Y = ComboY(126);
minion = Screen->CreateNPC(SQUID2_HOP);
minion->X = ComboX(49);
minion->Y = ComboY(49);
minion = Screen->CreateNPC(SQUID2_HOP);
minion->X = ComboX(62);
minion->Y = ComboY(62);
}
// Remain stunned for 6 seconds.
for (int i = 1; i <= 360; i++)
{
if (Ghost_HP <= 0)
{
for (int i = 1; i <= Screen->NumNPCs(); i++)
{
enemy = Screen->LoadNPC(i);
if (enemy->ID == SQUID2_HOP || enemy->ID == SQUID_TENTACLE)
{
enemy->HP = 0;
}
}
Ghost_DeathAnimation(this, ghost, 1);
Quit();
}
Ghost_Waitframe(this, ghost, false, false);
}
Ghost_Data = BIG_SQUID_COMBO;
Ghost_TileHeight = 4;
Ghost_Y -= 16;
Ghost_SetDefenses(ghost, storedDefense);
tent1 = Screen->CreateNPC(SQUID_TENTACLE);
tent2 = Screen->CreateNPC(SQUID_TENTACLE);
for (int i = 0; i <= 175; i++)
{
if (Screen->ComboF[i] == 98)
{
SpawnLocation1[index] = i;
index++;
}
}
for (int i = 0; i <= 175; i++)
{
if (SpawnLocation1[i] != 0)
{
SpawnIndex++;
}
else
{
break;
}
}
SpawnCombo = Rand(0, SpawnIndex);
tent1->X = ComboX(SpawnLocation1[SpawnCombo]);
tent1->Y = ComboY(SpawnLocation1[SpawnCombo]);
while (true)
{
index = 0;
SpawnIndex = -1;
SpawnCombo = 0;
for (int i = 0; i <= 175; i++)
{
if (Screen->ComboF[i] == 98)
{
SpawnLocation2[index] = i;
index++;
}
}
for (int i = 0; i <= 175; i++)
{
if (SpawnLocation2[i] != 0)
{
SpawnIndex++;
}
else
{
break;
}
}
SpawnCombo = Rand(0, SpawnIndex);
tent2->X = ComboX(SpawnLocation1[SpawnCombo]);
tent2->Y = ComboY(SpawnLocation1[SpawnCombo]);
if (tent2->X != tent1->X && tent2->Y != tent1->Y && tent2->Y != tent1->Y + 16 && tent2->Y != tent1->Y - 16)
{
break;
}
}
tentCount = 0;
Game->PlaySound(SFX_SPLASH);
}
else
{
tentCount = 0;
if (Ghost_HP <= 0)
{
for (int i = 1; i <= Screen->NumNPCs(); i++)
{
enemy = Screen->LoadNPC(i);
if (enemy->ID == SQUID2_HOP || enemy->ID == SQUID_TENTACLE)
{
enemy->HP = 0;
}
}
Ghost_DeathAnimation(this, ghost, 1);
Quit();
}
Ghost_Waitframe(this, ghost, false, false);
}
}
void Phanquid_Attack1(ffc this, npc ghost)
{
eweapon weapon = FireAimedEWeapon(EW_FIREBALL, Ghost_X + 16, Ghost_Y + 48, 0, 200, ghost->WeaponDamage, -1, -1, EWF_UNBLOCKABLE);
}
void Phanquid_Attack2(ffc this, npc ghost, int Ghost_MaxHP)
{
eweapon weapon;
for (int i = 0; i < 5; i++)
{
weapon = FireAimedEWeapon(EW_FIREBALL, Ghost_X + 16, Ghost_Y + 48, 0, 200, ghost->WeaponDamage, -1, -1, EWF_UNBLOCKABLE);
for (int i = 0; i < 10; i++)
{
Phanquid_Ghost_Waitframe(this, ghost, Ghost_MaxHP);
}
}
}
void Phanquid_Attack3(ffc this, npc ghost, int Ghost_MaxHP)
{
eweapon weapon;
weapon = FireAimedEWeapon(EW_FIREBALL, Ghost_X + 16, Ghost_Y + 48, 0, 200, ghost->WeaponDamage, -1, -1, EWF_UNBLOCKABLE);
weapon = FireAimedEWeapon(EW_FIREBALL, Ghost_X + 16, Ghost_Y + 48, (PI/6), 200, ghost->WeaponDamage, -1, -1, EWF_UNBLOCKABLE);
weapon = FireAimedEWeapon(EW_FIREBALL, Ghost_X + 16, Ghost_Y + 48, -1*(PI/6), 200, ghost->WeaponDamage, -1, -1, EWF_UNBLOCKABLE);
for (int i = 0; i < 20; i++)
{
Phanquid_Ghost_Waitframe(this, ghost, Ghost_MaxHP);
}
weapon = FireAimedEWeapon(EW_FIREBALL, Ghost_X + 16, Ghost_Y + 48, (PI/12), 200, ghost->WeaponDamage, -1, -1, EWF_UNBLOCKABLE);
weapon = FireAimedEWeapon(EW_FIREBALL, Ghost_X + 16, Ghost_Y + 48, -1*(PI/12), 200, ghost->WeaponDamage, -1, -1, EWF_UNBLOCKABLE);
}
ffc script SquidTentacle
{
void run()
{
npc ghost = Ghost_InitAutoGhost(this, SQUID_TENTACLE);
Ghost_TileWidth = 1;
Ghost_TileHeight = 2;
while (true)
{
Ghost_Waitframe(this, ghost, true, true);
}
}
}