Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

First Z-Script Custom Boss(Unfinished)

7 replies · 2,473 views · Started 07 January 2007

This is my first FFC custom boss. A lich that shoots fire.. just see the script.

ffc script firelich{

//Variables//
int flashcounter;
int i;
int state = 0; //0 = Float
//1 = Fire three fireballs
//2 = Fire a large homing fireball
//3 = Dead
int directionmem

//Constants//
int counter1 = 360;
int counter2 = 540;
int casting = not implemented;
int normal = not implemented;
int initCset = 7;

void run() {

//Pointers(Not used yet)

ffc fire1 = Screen->LoadFFC(1);
ffc fire2 = Screen->LoadFFC(2);
ffc fire3 = Screen->LoadFFC(3);
ffc homing = Screen->LoadFFC(4);

while (true){

if (this->Cset == 5 && flashcounter <= 1){
Game->PlaySound(SFX_Hurt);
if (Link->Item[I_SWORD4])
hp -= 8;
else
if (Link->Item[I_SWORD3])
hp -= 4;
else
if (Link->Item[I_SWORD2])
hp -= 2;
else
hp --;


if(hp == 0){
state = 3;
}
else
flashcounter == 32;
}
else
if (flashcounter > 0){

if (flashcounter % 2 == 0){
this->Cset --;
if (this3->CSet < 6)
this->CSet = 9;
}
flashcounter --;
}
else
if (this3->CSet != initCSet)
this3->CSet = initCSet;
}

// Floating
// X Speed starts at 3


if(state == 0){

if(this->Vx == 0)
this->Vx = directionmem

if(this->X <= 180){
this->Vx -= 6;
}

if(this->X <= 40){
this->Vx += 6;
}

if(counter1 != 0){ //Time for the fireball attack?
counter1 -= 1;
}
else
{
state = 1;
}

if(counter2 != 0){ //Time for the homing attack?
}
counter2 -= 1;
else
{
state = 2;
}
}

if(state == 1){

directionmem = this->Vx;
for ( i = 120; i>0; i-- ){ //Wait 2 seconds
Waitframe();
this->Vx = 0;
this->Data = casting;
}
//Position Projectiles
fire1->X = this->X-8;
fire1->Y = this->Y-8;
fire2->X = this->X;
fire2->X = this->Y-8;
fire3->X = this->X+8;
fire3->X = this->Y-8;
counter1 = 360;
state = 0;
}

if(state == 2){

directionmem = this->Vx;
for ( i = 120; i>=0; i-- ){ //Wait 2 seconds
Waitframe();
this->Vx = 0;
this->Data = casting;
}

this->Data = normal;
homing->X = this->X;
homing->Y = this->Y-8;
counter2 = 360;
state = 0;
}

if(state == 3){

Game->PlaySound(SFX_GROAN);
ffc this = Screen->LoadFFC(6); //Dying animation, gives HC too
Quit();
}
Waitframe();

} //End of while loop
} //End of void run
} //End of FFC

Uh, technically the "first" ZScript custom boss is the ZScript version of that Red Aquamentus I wrote last year. Now with sound effects!

Speaking of which, I should probably get CMotW #3 done at some point... possibly using that new ghosting technique...

_L_ wrote:Uh, technically the "first" ZScript custom boss is the ZScript version of that Red Aquamentus I wrote last year. Now with sound effects!

Speaking of which, I should probably get CMotW #3 done at some point... possibly using that new ghosting technique...

Oh you kids and your online contests.

I think I'll whip up four more custom bosses today and just quietly stick em in script showcase or in LSGMB.

Added the attack phases. The projectile combo's functions are seperate from the script. The fireball attack is 3 fireballs that fly in an arch out from the boss. The homing attack is a giant that follows Link for 3 seconds, then flies off-screen diagonally.

I am unsure about this part of the code working;

for ( i = 60; i>=0; i-- ){
//Wait a second
Waitframe();
this->Vx = 0;
this->Data = casting;

Heh, my first time using the for structure. Will the waitframes slow down animation? And will the casting animation be reset everytime it loops?

the animation will not reset, since the combo timer is independent of everything else. And using a waitframe there is precisely what you were supposed to do if you wanted to wait 1 second.

I like your Aquamentus flashing routine, L, and I hope you don't mind me borrowing it.😊


if(hp == 0){
Dying(this6);
}
else
flashcounter == 32;
}
else
if (flashcounter > 0){

if (flashcounter % 2 == 0){
this->Cset --;
if (this3->CSet < 6)
this->CSet = 9;
}
flashcounter --;
}
else
if (this3->CSet != initCSet)
this3->CSet = initCSet;
}

Can you (or someone else) explain to me how it works? Does there have to be a flag on the combo that changes it to CSet5? And I assume Dying(this6) would change the current FFC to the 6th?