PDA

View Full Version : Flameshot Weapon



Joe123
05-12-2008, 07:04 AM
And seeing as the enemys get all those new uber-weapons, I thought I better give Link one too.
I call it Flameshot :cool:


And it's stupidly over-powerful =P
But quite fun though!
Might be useable if you make it take up magic in the item editor.

item script flameshot{
void run(int d,int s,int t,int c,int n,int a){
if(Screen->NumNPCs() > 0){
lweapon f = Screen->CreateLWeapon(31);
f->Tile = t; f->OriginalTile = t;
f->NumFrames = n; f->ASpeed = a;
f->CSet = c;
f->Step = s;
f->Damage = d;
f->X = Link->X;
f->Y = Link->Y;
f->Z = Link->Z;
npc e = Screen->LoadNPC(Rand(Screen->NumNPCs())+1);
f->Angular = true;
f->Angle = ArcTan((e->X-Link->X),(e->Y-Link->Y));
Game->PlaySound(13);
}
}
}

What it does is pick a random enemy on the screen, and shoot a fireball at it =D
A bit powerful =P

D0: Damage of fireball
D1: Speed of fireball
D2: Tile to use
D3: CSet
D4: Number of frames of animation
D5: Speed of animation


Oh yeah, if there're no enemies on the screen, it won't do anything.
So you might want to make it take up magic in the script?
I can do that if anyone wants me to.

C-Dawg
05-12-2008, 09:42 AM
Rapid fire or GTFO ;)

Joe123
05-12-2008, 11:02 AM
It is rapid fire!
Press the button again! =P


I have to make a global script code to make it rapid fire and meh.
I might do that later, but what I was planning on doing with it next was making it actually shoot a wand magic projectile, so that it'd trigger wand magic flags, and then if there were no enemies on the screen, it could check for a wand flag and shoot at that.
Then it'd be quite a nice upgrade to the wand, no?

I suppose I should probably put a random angle generator in for when there's no enemies too.

Russ
05-12-2008, 11:03 AM
Wow, this could be interesting.
Link: Stand down Ganon. I have a flamethrower and I'm not afraid to use it! :)

Regardless, this could be a useful item, as long as you set it in the item editor to use an insane amount of magic.

Joe123
05-12-2008, 11:09 AM
Yah, it's a bit powerful really.

But then again, the flamethrower and homing laser in the extra enemy attack thread are too =P

Joe123
05-12-2008, 11:59 AM
ok, mark 2:

item script flameshot{
void run(int d,int s,int t,int c,int n,int a){
int i; int b;
int fx; int fy;
if(Screen->NumNPCs() > 0){
npc e = Screen->LoadNPC(Rand(Screen->NumNPCs())+1);
go(e->X,e->Y,d,s,t,c,n,a);
}else{
for(i=0;i<176;i++){
if(Screen->ComboF[i] == 76 || Screen->ComboI[i] == 76){
b = i;
i = 176;
}
}
if(b>0){
fy = Floor(b/16);
fx = b-(fy*16);
go(fx*16,fy*16,d,s,t,c,n,a);
}else go(Rand(256)+1,Rand(168)+1,d,s,t,c,n,a);
}
}
void go(int x,int y,int d,int s,int t,int c,int n,int a){
lweapon f = Screen->CreateLWeapon(13);
f->Tile = t; f->OriginalTile = t;
f->NumFrames = n; f->ASpeed = a;
f->CSet = c;
f->Step = s;
f->Damage = d;
f->X = Link->X;
f->Y = Link->Y;
f->Z = Link->Z;
f->Angular = true;
f->Angle = ArcTan((x-Link->X),(y-Link->Y));
Game->PlaySound(32);
}
}

It now creates a Wand Magic sprite, which will first attack all enemies on the screen, then go for any Wand Magic Flags (76), then just shoot off in random directions.
Fraid it's not rapid fire just yet though =P

The_Amaster
05-12-2008, 05:46 PM
...this just might be the item I've been looking for for level 8. And I assume that I can get the second script to attack any flag I want if I change the number in the code? EDIT: Ohh, Ohh, Joe, how could you set it up so that the new "Custom Flags" when triggered activate screen secrets and how would you set the secret combo? I'm thinking a series of weapons, a thunder shooter, a fire shooter, a wind shooter...

Joe123
05-12-2008, 06:33 PM
Oh no, I'm afraid it's not that simple.
You can't just change the number of the flag in the script; it works like that because the system actually makes a wand magic projectile, so that's why I sent it to attack the wand flag.

I might be able to change it so that the script makes a custom projectile, and sends it at flag 98 though, and then when it hits flag 98, trigger the screen's secrets?
It'd require changing the combotype underneath Link's foot though, so you'd have to be careful what combos you put in that room.

The_Amaster
05-12-2008, 07:03 PM
Ah, well if it's too much trouble nevermind. Although...
It'd require changing the combotype underneath Link's foot though, so you'd have to be careful what combos you put in that room. Don't quite follow here.

Joe123
05-12-2008, 07:14 PM
Nah, shouldn't be too bad.
I've acquired a lot of free time at the moment so I'm looking for things to do.

Well, the only way to trigger secrets via script is to put a trigger combotype underneath Link's feet.