PDA

View Full Version : Din's Fire (Smash Bros version)



AmazingAmpharos
03-19-2009, 11:41 AM
Sure Din's Fire is already in Zelda Classic, but it's based off the OoT version. This spell is based off Zelda's forward special from the smash games. It (as a FFC) flies out from Link, accelerates as it goes, and can be directed perpendicular to the initial direction of motion. Once the button is released, a fire lweapon is spawned on top of the target. You could probably do some pretty cool things with long distance burn flag triggering or just use it to kill stuff.

This script does have the limitation that it is currently hardcoded to be used with the B button. I don't know how I could make it respect being used by the A button.

If you want to use this, you'll need to set DinFire2 to a custom item's "Action" script slot and slot_2 to a global script. You'll need a FFC that's reserved just for this.

Incidentally, this was my first script that worked. Major thanks go to Joe123 whose FFA Ice spell script showed me a lot of the concepts that let this work.


import "std.zh"

//This script is supposed to simulate Din's Fire from the Super Smash Brothers games. A FFC is used to
//simulate a fireball moving away from Link that can be accelerated perpendicular to its initial direction.
//When the button is released, a fire lweapon is spawned over the FFC's location. Before the FFC "detonates",
//Link is frozen in place and temporarily invincible.

bool Fireball_Active = false;

item script DinFire2 {
void run(){
Fireball_Active=true;
}
}

global script slot_2 {
void run(){
ffc Fireball = Screen->LoadFFC(1); //Feel free to change the number of the FFC used.
int Fireball_CSet = 8; //The CSet of the undetonated Fireball.
int combonumber = 661; //Set the combo for the FFC pre-detonation.
int blankcombo = 0; //Set the combo for the FFC after detonation (invisible suggested).
float initial_velocity = .8; //This is the initial velocity of the FFC.
float initial_acceleration = .1; //This is the initial acceleration of the FFC.
float delta_acceleration = .05; //Make this bigger to increase steering.
int fire_damage = 2; //This sets the power of the fire lweapon.
int fire_sound = SFX_FIRE; //This sets the sound effect the fire makes when "detonated".
bool Frame1 = true; //Don't touch this.
int direction = 0; //Don't touch this.
while(true){
if (Fireball_Active == true && Frame1 == true){
Fireball->X = Link->X;
Fireball->Y = Link->Y;
direction = Link->Dir;
if (direction == DIR_UP){
Fireball->Vx = 0;
Fireball->Vy = -initial_velocity;
Fireball->Ax = 0;
Fireball->Ay = -initial_acceleration;
}
else if (direction == DIR_DOWN){
Fireball->Vx = 0;
Fireball->Vy = initial_velocity;
Fireball->Ax = 0;
Fireball->Ay = initial_acceleration;
}
else if (direction == DIR_LEFT){
Fireball->Vx = -initial_velocity;
Fireball->Vy = 0;
Fireball->Ax = -initial_acceleration;
Fireball->Ay = 0;
}
else if (direction == DIR_RIGHT){
Fireball->Vx = initial_velocity;
Fireball->Vy = 0;
Fireball->Ax = initial_acceleration;
Fireball->Ay = 0;
}
Fireball->Data = combonumber;
Fireball->CSet = Fireball_CSet;
Frame1 = false;
}
if (Fireball_Active == true && Frame1 == false){
Link->Action = LA_FROZEN;
if (direction == DIR_UP || direction == DIR_DOWN){
if (Link->InputLeft == true){
Fireball->Ax = Fireball->Ax - delta_acceleration;
}
else if (Link->InputRight == true){
Fireball->Ax = Fireball->Ax + delta_acceleration;
}
}
else if (direction == DIR_LEFT || direction == DIR_RIGHT){
if (Link->InputDown == true){
Fireball->Ay = Fireball->Ay + delta_acceleration;
}
else if (Link->InputUp == true){
Fireball->Ay = Fireball->Ay - delta_acceleration;
}
}
Waitframe();
if (Link->InputB == false){
if (Fireball->X > 0 && Fireball->Y > 0
&& Fireball->Y < 176 && Fireball->X < 256){
lweapon fire = Screen->CreateLWeapon(LW_FIRE);
fire->Dir = direction;
fire->X = Fireball->X;
fire->Y = Fireball->Y;
fire->Damage = fire_damage;
Game->PlaySound(fire_sound);
}
Fireball->Data = blankcombo;
Fireball_Active = false;
Frame1 = true;
Link->Action = LA_NONE;
Waitframe();
}

}
Waitframe();
}
}
}

Here's a test quest that has this correctly set up. It's just two simple screens, but it covers the basics.

http://files.filefront.com/TESTqst/;13493135;/fileinfo.html

CJC
03-30-2009, 08:00 PM
There was a flamethrower script that Joe made... it used a set integer when the item was activated. I was able to easily modify that to generate two separate integers for the "B" and "A" button when the item is used.
Maybe we could do that with your script too.


item script DinFire2 {
void run(){
if (Link->InputB){
Fireball_Active=true;
ButtonCheck == 1;
else if (Link->InputA){
Fireball_Active=true;
ButtonCheck == 2;
}
}

Added a "ButtonCheck" integer.
Which is then referenced in the global script.


Then make


if (Link->InputB == false){
if (Fireball->X > 0 && Fireball->Y > 0
&& Fireball->Y < 176 && Fireball->X < 256){
lweapon fire = Screen->CreateLWeapon(LW_FIRE);
fire->Dir = direction;
fire->X = Fireball->X;
fire->Y = Fireball->Y;
fire->Damage = fire_damage;
Game->PlaySound(fire_sound);
}
Fireball->Data = blankcombo;
Fireball_Active = false;
Frame1 = true;
Link->Action = LA_NONE;
Waitframe();
}


into


if((Link->InputB == false && ButtonCheck == 1) || (Link->InputA == false && ButtonCheck == 2)){
if (Fireball->X > 0 && Fireball->Y > 0
&& Fireball->Y < 176 && Fireball->X < 256){
lweapon fire = Screen->CreateLWeapon(LW_FIRE);
fire->Dir = direction;
fire->X = Fireball->X;
fire->Y = Fireball->Y;
fire->Damage = fire_damage;
Game->PlaySound(fire_sound);
}
Fireball->Data = blankcombo;
Fireball_Active = false;
Frame1 = true;
Link->Action = LA_NONE;
ButtonCheck == 0;
Waitframe();
}

and you should be able to make it work with both buttons.

I don't have a copy of Zelda Classic on this computer, so I can't test compile it. Sorry.

Hope it helps!