I think you were right about the ID. I guess I misinterpreted zscript.txt.
I have it done. All that is left is to test it.
EDIT: Why don't you give it a spin. I'm not exactly ready to use it myself. Here is the script:
CODE
//Plant Boss
//D0: number of roots to be "spawned"
//D1: minimum number of roots to be killed to stun (probably same as or close to D0)
//D2: starting HP. You'll probably want 50-100
//D3: time length of stun (in frames) probably 600-1200
//D4: root "shadow" combo number. This combo should be BEFORE the hurting plant combo.
//D5: spawn delay (in frames) you'll want this to be 75-180 or so frames
//D6: starting reference to root FFCs
//D7: the hitbox radius
ffc script MainPlant{
void run(int rtcount, int rtkill, int HP, int stunlength, int rtcombo, int spawndelay, int firstffc, int hitbox) {
int stun = 0;
int justHit = 0;
Screen->D[0] = -1;
ffc rtref;
lweapon wpn;
while(HP > 0) {
if(stun <= 0) {
if(Screen->D[0] == -1) {
Screen->D[0] = 0;
for(int i=0;i<rtcount;i++) {
rtref = Screen->LoadFFC(i+firstffc);
rtref->Data = rtcombo;
Waitframes(spawndelay);
}
} else if(Screen->D[0] >= rtkill) {
stun = stunlength;
Screen->D[0] = -1;
}
} else {
if(justHit <= 0) {
for(int lw=1;lw<=Screen->NumLWeapons();lw++) {
wpn = Screen->LoadLWeapon(lw);
if(Distance(this->X, this->Y, wpn->X, wpn->Y) <= hitbox) {
HP -= wpn->Damage;
}
}
}
if(stun > 0)
stun --;
if(justHit > 0)
justHit --;
}
Waitframe();
}
//Death animation goes here.
}
}
//Roots
//D0: Delay between spawning and sprouting. (in frames) probably 30-75 frames.
//D1: Time to be exposed at any given time. (in frames) probably 300-900 frames.
//D2: Delay between retracting and respawning. (in frames) probably 60-180 frames.
//D3-D5: Link Weapon types to be sensitive to. (repeat values for less than 3)
//D6: the maximum distance of a weapon in order to be destroyed
//D7: the SFX to be played when the root is destroyed
//Notes: your first two comboes of the entire combospace SHOULD be blank.
// The second root combo should be a damage combo.
ffc script Root{
void run(int sprdelay, int outtime, int retdelay, int wt1, int wt2, int wt3, int size, int destroySFX) {
int startData = this->Data;
lweapon wpn;
while(true) {
this->X = Link->X; this->Y = Link->Y;
Waitframes(sprdelay);
this->Data ++;
for(int i=0;i<outtime;i++) {
for(int lw=1;lw<=Screen->NumLWeapons();lw++) {
wpn = Screen->LoadLWeapon(lw);
if(wpn->ID == wt1 || wpn->ID == wt2 || wpn->ID == wt3) {
if(Distance(this->X, this->Y, wpn->X, wpn->Y) <= size) {
Screen->D[0]++;
this->Data = 0;
}
}
}
Waitframe();
}
this->Data = 1;
Waitframes(retdelay);
this->Data = startData;
}
}
}
Edited by Beefster, 10 April 2008 - 07:44 PM.