CODE
import "std.zh"
ffc script facade{
void run(int enemy_id, int delay, int idle_time, int bridge, int shots){
ffc face = this;
for(int i = 0; i <= 6; i += 1) face->Misc[i] = face->Data + i;
Waitframes(delay);
Change(face, face->Misc[1]);
npc enemy = Screen->LoadNPC(enemy_id);
bool attacking = false;
while(enemy->isValid()){
if(face->Data == face->Misc[0]){
enemy->Defense[NPCD_BOMB] = NPCDT_IGNORE;
enemy->Defense[NPCD_SBOMB] = NPCDT_IGNORE;
Waitframes(delay);
Change(face, face->Misc[1]);
}
else if(face->Data == face->Misc[1]){
enemy->Defense[NPCD_BOMB] = NPCDT_NONE;
enemy->Defense[NPCD_SBOMB] = NPCDT_NONE;
Waitframe();
}
else if(face->Data == face->Misc[2]){
enemy->Defense[NPCD_BOMB] = NPCDT_NONE;
enemy->Defense[NPCD_SBOMB] = NPCDT_NONE;
Waitframes(idle_time);
Change(face, face->Misc[3]);
}
else if(face->Data == face->Misc[3]){
enemy->Defense[NPCD_BOMB] = NPCDT_NONE;
enemy->Defense[NPCD_SBOMB] = NPCDT_NONE;
if(!attacking){
bool attacking = true;
Attack(enemy, face, Rand(2), bridge, shots, attacking);
Waitframe();
}
else{
Waitframe();
}
}
else if(face->Data == face->Misc[4]){
enemy->Defense[NPCD_BOMB] = NPCDT_NONE;
enemy->Defense[NPCD_SBOMB] = NPCDT_NONE;
Waitframe();
}
}
}
void Change(ffc face, int combo){
face->Data = combo;
}
void Attack(npc face, ffc face2, int phase, int bridge, int shots, bool attacking){
if(phase == 0){
for(int i = shots; shots > 0; shots -= 1){
eweapon flame = CreateEWeaponAt(EW_FIRE, face->X, face->Y);
flame->UseSprite(35); //this number should be the sprite id of the fire sprite you want to use.
flame->Jump = 20; //this is how fast the flame moves along the z axis.
flame->Damage = face->WeaponDamage;
flame->Flip = 2;
Waitframes(bridge);
}
Change(face2, face2->Misc[4]);
attacking = false;
}
else if(phase == 1){
bool comboarray[175];
for(int combo = 175; combo >= 0; combo -= 1){
if(Screen->ComboF[combo] == CF_SCRIPT2) comboarray[combo] = true;
else comboarray[combo] = false;
}
for(int i = shots; shots > 0; shots -= 1){
int Combo = 0;
while(Combo == 0){
Combo = Rand(176);
if(comboarray[Combo] == false){
Combo = 0;
}
else{
Waitframe();
}
}
Screen->ComboD[Combo] = face2->Misc[5];
Waitframes(bridge);
}
Change(face2, face2->Misc[4]);
}
}
}
ffc script fallingflames{ //used with things that shoot fire into the sky that falls back down.
void run(int upwardvelocity){
int maxheight = 50; //NEED TO CALCULATE THIS!
bool comboarray[176];
for(int combo = 175; combo >= 0; combo -= 1){
if(Screen->ComboF[combo] == CF_SCRIPT2) comboarray[combo] = true;
else comboarray[combo] = false;
}
while(true){
for(int i = Screen->NumEWeapons(); i > 0; i -= 1){
eweapon ew = Screen->LoadEWeapon(i);
if(ew->isValid()){
if(ew->ID == EW_FIRE && ew->Z == maxheight);
ew->Flip = 0;
int Combo = 0;
while(Combo == 0){
Combo = Rand(176);
if(comboarray[Combo] == false){
Combo = 0;
}
else{
Waitframe();
}
}
ew->X = ComboX(Combo);
ew->Y = ComboY(Combo);
}
}
Waitframe();
}
}
}
He's untested so I don't know if he works correctly and have lost interest otherwise I would continue it making sure he works like the one in oos. If anyone is interested in carrying on with what I left off. It's find by me.