Joe123
04-20-2008, 07:02 PM
ffc script enemytallgrassshallowwater{
void run(int grass, int gcmb, int ripple, int rcmb){
int i;
if(grass == 0) grass = grasstile;
if(ripple == 0) ripple = rippletile;
if(gcmb == 0) gcmb = 131;
if(rcmb == 0) rcmb = 11;
Waitframes(4);
int ecount = Screen->NumNPCs();
npc e[10];
int j[10]; int fdly[10];
for(i=0;i<ecount;i++){
e[i] = Screen->LoadNPC(i+1);
}
while(true){
for(i=0;i<ecount;i++){
if(e[i]->isValid()){
if(Screen->ComboT[ComboAt(e[i]->X+8,e[i]->Y+8)] == rcmb){
fdly[i]++;
if(fdly[i] == 20){j[i]++; fdly[i] = 0;}
Screen->DrawTile(3, e[i]->X, e[i]->Y-2, ripple+j[i], 1, 1, 4, 1, 0, 0, 0, 0, true, 128);
if(j[i]==3) j[i] = 0;
}
if(Screen->ComboT[ComboAt(e[i]->X+8,e[i]->Y+8)] == gcmb){
fdly[i]++;
if(fdly[i] == 20){j[i]++; fdly[i] = 0;}
Screen->DrawTile(3, e[i]->X, e[i]->Y-2, grass+j[i], 1, 1, 3, 1, 0, 0, 0, 0, true, 128);
if(j[i]==3) j[i] = 0;
}
}
}
Waitframe();
}
}
}
Would this work?
I haven't actually tried it, because I don't have 780 at hand, but I think the code is ok?
So long as we have variable sized arrays and arrays of NPCs?
It's meant to make a tall grass/shallow water effect for every enemy on the screen.
void run(int grass, int gcmb, int ripple, int rcmb){
int i;
if(grass == 0) grass = grasstile;
if(ripple == 0) ripple = rippletile;
if(gcmb == 0) gcmb = 131;
if(rcmb == 0) rcmb = 11;
Waitframes(4);
int ecount = Screen->NumNPCs();
npc e[10];
int j[10]; int fdly[10];
for(i=0;i<ecount;i++){
e[i] = Screen->LoadNPC(i+1);
}
while(true){
for(i=0;i<ecount;i++){
if(e[i]->isValid()){
if(Screen->ComboT[ComboAt(e[i]->X+8,e[i]->Y+8)] == rcmb){
fdly[i]++;
if(fdly[i] == 20){j[i]++; fdly[i] = 0;}
Screen->DrawTile(3, e[i]->X, e[i]->Y-2, ripple+j[i], 1, 1, 4, 1, 0, 0, 0, 0, true, 128);
if(j[i]==3) j[i] = 0;
}
if(Screen->ComboT[ComboAt(e[i]->X+8,e[i]->Y+8)] == gcmb){
fdly[i]++;
if(fdly[i] == 20){j[i]++; fdly[i] = 0;}
Screen->DrawTile(3, e[i]->X, e[i]->Y-2, grass+j[i], 1, 1, 3, 1, 0, 0, 0, 0, true, 128);
if(j[i]==3) j[i] = 0;
}
}
}
Waitframe();
}
}
}
Would this work?
I haven't actually tried it, because I don't have 780 at hand, but I think the code is ok?
So long as we have variable sized arrays and arrays of NPCs?
It's meant to make a tall grass/shallow water effect for every enemy on the screen.