Search in sources :

Example 1 with BaitfishCard

use of Cards.Fish.BaitfishCard in project cardgame1 by joey101937.

the class BaitfishMinion method onDeath.

@Override
public void onDeath() {
    Sticker s = new Sticker(SpriteHandler.skullMedium, this, 600);
    if (isSilenced)
        return;
    ArrayList<Minion> targets = new ArrayList<>();
    for (Minion m : owner.minions.getOccupants()) {
        if (m.tribe == Tribe.Fish && m != this)
            targets.add(m);
    }
    if (targets.isEmpty()) {
        System.out.println("no targets for baitfish death effect");
        owner.draw(new BaitfishCard());
        return;
    }
    Minion target = targets.get(Main.generateRandom(0, targets.size()));
    target.attack += 1;
    target.health += 1;
    target.proc();
    owner.draw(new BaitfishCard());
}
Also used : Sticker(cardgame1.Sticker) BaitfishCard(Cards.Fish.BaitfishCard) Minion(Minions.Minion) ArrayList(java.util.ArrayList)

Aggregations

BaitfishCard (Cards.Fish.BaitfishCard)1 Minion (Minions.Minion)1 Sticker (cardgame1.Sticker)1 ArrayList (java.util.ArrayList)1