Okey Dokie, sounds easy enough.
...Alright I gotta jet. Just add in the weapon code ..or maybe someone who feels like it could put it in there. Should be a fairly simple script.
CODE
const int SINGLE_DIRECT_SHOT = 0;
const int s36_SHOT = 1;
void addAngleShot(ffc f, int angle, int speed, int tile, int cset){
eweapon laser;
laser = Screen->CreateEWeapon(EW_SCRIPT1);
laser->HitWidth=5;laser->HitHeight=5;laser->HitXOffset=4;laser->HitYOffset=4;
laser->X=f->X;laser->Y=f->Y;laser->Step=speed;laser->Damage=2;laser->CSet=cset;laser->Tile=tile;
laser->Angular=true;laser->Angle=angle*(PI/180);
}
void doDirectShot(ffc f, int speed, int tile, int cset )
{
addAngleShot( f,RadtoDeg(ArcTan(f->X-Link->X,f->Y-Link->Y)), speed, tile, cset);
}
void do36Shot(ffc f, int speed, int tile, int cset )
{
for(int i;i<36;i++)
{
addAngleShot( f, i*10,speed,tile, cset);
}
}
void fire_stuff( int type, ffc f, int tile, int cset )
{
if(type == SINGLE_DIRECT_SHOT) doDirectShot( f, 300, tile, cset );
if(type == s36_SHOT ) do36Shot( f, 200, tile, cset );
}
ffc script Instill_Energy //mkII 0.1 -will finish later;)
{
void run( int screen_enemy_number, int enemyHP, int delay, int burst, int burst_speed, int shot_type, int regen, int tile, int cset )
{
int d = 0; int b = 0;
Waitframes(4);
npc enemy = Screen->LoadNPC(screen_enemy_number);
enemy->HP = enemyHP;
while(true)
{
if(enemy->isValid())
{
d++;
this->X = enemy->X;
this->Y = enemy->Y;
if(d > delay)
{
if(b < burst)
{
d -= burst_speed; b++;
fire_stuff( shot_type, this, tile, cset );
}
else
{
b = 0; d = 0; enemy->HP += regen;
}
}
}
else
{
this->X = 0; this->Y = 0; this->Data = 0; Quit();
}
Waitframe();
}
}
}
edit: ok try that.
These are your D[] arguments.
0-enemy number.
1-HP of enemy
2-delay between shots
3-how many shots are fired at interval D[4] of type 'shot_type;.
4-shot type (plug in system - If you want different projectile patterns just request one. ) see constants.
5-how much HP enemy will regenerate at 'delay' [NOT capped].
6-tile of weapon
7-cset of weapon
void run( int screen_enemy_number, int enemyHP, int delay, int burst, int burst_speed, int shot_type, int regen,int tile, int cset )
Untested but should work.