Jump to content

Photo

Kill shooters when other enemies are dead


  • Please log in to reply
6 replies to this topic

#1 Lemmy Koopa

Lemmy Koopa

    We are the champions

  • Members
  • Location:Ohio

Posted 25 June 2010 - 02:05 AM

I want the shooters to stop when all the other enemies, besides bubbles, are dead.

#2 lucas92

lucas92

    Defender

  • Members

Posted 25 June 2010 - 10:34 AM

What are shooters?

#3 Lemmy Koopa

Lemmy Koopa

    We are the champions

  • Members
  • Location:Ohio

Posted 25 June 2010 - 08:12 PM

The enemies that statues spawn, that shoot fireballs.

#4 Joe123

Joe123

    Retired

  • Members

Posted 26 June 2010 - 11:06 AM

CODE
ffc script KillShooters{
    void run(){
        while(!OnlyShooters()) Waitframe();
        npc n;
        for(int i=Screen->NumNPCs();i>=1;i--){
            n = Screen->LoadNPC(i);
            n->DeadState = 0; n->X = -256;
        }
    }
    bool OnlyShooters(){
        npc n;
        for(int i=Screen->NumNPCs();i>=1;i--){
            n = Screen->LoadNPC(i);
            if(n->Type != NPCT_PROJECTILE)
                return false;
        }
        return true;
    }
}


#5 Lemmy Koopa

Lemmy Koopa

    We are the champions

  • Members
  • Location:Ohio

Posted 26 June 2010 - 12:24 PM

I get this error
IPB Image

Edited by Hot Water Music man, 26 June 2010 - 12:24 PM.


#6 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 26 June 2010 - 12:49 PM

QUOTE(Joe123 @ Jun 26 2010, 09:06 AM) View Post

CODE
ffc script KillShooters{
    void run(){
        while(!OnlyShooters()) Waitframe();
        npc n;
        for(int i=Screen->NumNPCs();i>=1;i--){
            n = Screen->LoadNPC(i);
            if(n->Type == NPCT_PROJECTILE) n->X = 1000;
        }
    }
    bool OnlyShooters(){
        npc n;
        for(int i=Screen->NumNPCs();i>=1;i--){
            n = Screen->LoadNPC(i);
            if(n->Type != NPCT_PROJECTILE || n->Type != add bubbles,traps etc...) //look in std.zh for values
                return false;
        }
        return true;
    }
}



You have to add in the NPC* constants (one for each enemy you don't want to kill) then it should work.

#7 Lemmy Koopa

Lemmy Koopa

    We are the champions

  • Members
  • Location:Ohio

Posted 27 June 2010 - 12:32 AM

Do I add the shooter enemy too? Because it compiles but does nothing.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users