PDA

View Full Version : First Z-Script Custom Boss(Unfinished)



Fire Wizzrobe
01-07-2007, 04:04 PM
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

_L_
01-08-2007, 04:58 AM
Uh, technically the "first" ZScript custom boss is the ZScript version (http://www.armageddongames.net/showthread.php?t=93195) 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...

Fire Wizzrobe
01-08-2007, 06:14 PM
Heh, I meant my first.:tongue:

C-Dawg
01-09-2007, 09:55 AM
Uh, technically the "first" ZScript custom boss is the ZScript version (http://www.armageddongames.net/showthread.php?t=93195) 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.

Fire Wizzrobe
01-09-2007, 11:33 PM
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?

jman2050
01-09-2007, 11:35 PM
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.

Fire Wizzrobe
01-13-2007, 11:44 PM
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?

Fire Wizzrobe
01-14-2007, 05:08 PM
Now it's done, but I don't know if it's even functional. At the end, do I need ffc in front of this->?