With the help of Lejes, I was able to get the Big Stalfos script to work. I've also submitted tiles for it, the Big Gibdo and some other Zelda and Metroid enemies that I've ripped from Spriter's Resource.
Here's the Big Stalfos.
Big Stalfos
//Big Stalfos by ywkls
//Creates a large Stalfos that fires a large projectile.
//When its HP drops low enough, it collapses into a pile of bones.
//If not hit with a bomb or super bomb fast enough, it revives to full health.
//Version Final
//9-6-15
const int WAVE_SPRITE = 101;//Sprite for wave of energy sent out by the sword.
//Designed to be two tiles tall. Create a separate sprite for the animation when throwing the sprite to the right and have it be the next sprite in the list.
ffc script Big_Stalfos{
void run(int enemyID){
npc n = Ghost_InitAutoGhost(this, enemyID);
Ghost_TileWidth = 4;
Ghost_TileHeight = 3;
int combo = n->Attributes[10];
float counter = -1;
Ghost_X = 112;
Ghost_Y = 48;
eweapon wave;
Ghost_Transform(this,n,combo,-1,4,3);
int turncombo;
//Handles whether it is moving or not.
int mode = 1;
int step = n->Step;
int MaxHP = n->HP;
//Handles whether the foe has collapsed.
int death_timer;
//Uses to start the timer for the collapsed form.
bool start_timer = false;
//Handles the firing of the projectile.
int fire_timer = Choose(90,150,180);
while(n->HP> 0){
//Everything is normal, so have the boss move around.
if(mode ==1){
counter = Ghost_ConstantWalk4(counter, n->Step, n->Rate, n->Homing, n->Hunger);
Ghost_SetAllDefenses(n, NPCDT_NONE);
//Change size and appearance to normal.
Ghost_CSet = 5;
Ghost_TileWidth = 4;
Ghost_TileHeight = 3;
//Alters combo based on direction it is facing.
if(n->Dir == DIR_RIGHT || n->Dir == DIR_UP){
Ghost_SetHitOffsets(n, 2, 0, 9, 20);
turncombo = combo+1;
}
else{
Ghost_SetHitOffsets(n, 2, 0, 20, 9);
turncombo = combo;
}
}
//It has collapsed. Render it vulnerable only to bombs and super bombs.
else{
Ghost_SetAllDefenses(n, NPCDT_IGNORE);
n->Defense[NPCD_BOMB] = NPCDT_ONEHITKILL;
n->Defense[NPCD_SBOMB] = NPCDT_ONEHITKILL;
turncombo = combo+2;
Ghost_Data = turncombo;
Ghost_CSet = 2;
Ghost_TileWidth = 2;
Ghost_TileHeight = 2;
//Start the timer to revive to normal form.
if(!start_timer){
death_timer = 180;
start_timer = true;
}
n->Step = 0;
}
//Handles the firing of the projectile.
if(fire_timer <0 && mode ==1){
//Uses a different weapon sprite based on whether it faces left or right, so be sure to make two.
if (n->Dir == DIR_RIGHT || n->Dir == DIR_UP){
wave = FireBigAimedEWeapon(n->Weapon, n->X+64, n->Y+32, DegtoRad(0), 100, n->WeaponDamage, WAVE_SPRITE+1, 40, 0,1,2);
SetEWeaponLifespan(wave,EWL_TIMER, 120);
SetEWeaponMovement(wave, EWM_HOMING, DegtoRad(3), 120);
SetEWeaponDeathEffect(wave,EWD_4_FIRES_RANDOM, 40);
}
else{
wave = FireBigAimedEWeapon(n->Weapon, n->X, n->Y+32, DegtoRad(0), 100, n->WeaponDamage, WAVE_SPRITE, 40, 0,1,2);
SetEWeaponLifespan(wave,EWL_TIMER, 120);
SetEWeaponMovement(wave, EWM_HOMING, DegtoRad(3), 120);
SetEWeaponDeathEffect(wave,EWD_4_FIRES_RANDOM, 40);
}
//Resets the timer.
fire_timer = Choose(90,150,180);
}
//If HP is lower than 1/5 of max, change form.
if(n->HP <= MaxHP * .2 && mode ==1)mode = 2;
//If it has changed form, start a countdown.
if(death_timer>0){
death_timer--;
//If it is still alive when the countdown is over, restore full health and have it change back to normal.
if(death_timer<=0){
mode = 1;
Ghost_HP = MaxHP;
n->Step = step;
start_timer = false;
}
}
fire_timer--;
Ghost_Data = turncombo;
Gen_Explode_Waitframe(this,n);
}
}
}
I'm working on the Wood Warden, but at the moment I've hit a snag so I may hold off on it until I get some of the others I have planned done.
Edited by ywkls, 06 September 2015 - 08:39 PM.


