Search in sources :

Example 26 with Minion

use of Minions.Minion in project cardgame1 by joey101937.

the class FrenzyCard method cast.

@Override
public int cast(Minion target) {
    if (canAfford()) {
        for (Minion m : owner.minions.getOccupants()) {
            if (m.name.equals("Baitfish")) {
                m.attack += 3;
                m.proc();
            }
        }
        owner.resource -= cost;
        owner.hand.remove(this);
        TrapListener.onPlay(this);
        return 1;
    }
    return 0;
}
Also used : Minion(Minions.Minion)

Example 27 with Minion

use of Minions.Minion in project cardgame1 by joey101937.

the class PredationCard method tick.

@Override
public void tick() {
    int highest = 0;
    for (Minion m : owner.minions.getOccupants()) {
        if (m.tribe == Tribe.Fish) {
            if (m.attack > highest)
                highest = m.attack;
        }
    }
    spellDamage = highest;
    cardText = "Deal Damage equal \n to the attack of \n your strongest fish \n (" + spellDamage + ")";
}
Also used : Minion(Minions.Minion)

Example 28 with Minion

use of Minions.Minion in project cardgame1 by joey101937.

the class Hero method onTurnStart.

public void onTurnStart() {
    System.out.println("on turn start: " + this);
    if (Board.playerHero == this)
        InputHandler.enablingTimer = 20;
    ArrayList<Minion> done = new ArrayList<>();
    while (true) {
        try {
            for (Minion m : minions.getStorage()) {
                if (m != null && !done.contains(m)) {
                    m.onTurnStart();
                    done.add(m);
                }
            }
            break;
        } catch (ConcurrentModificationException cme) {
            System.out.println("caught concurrent modication exception in Hero.onTurnStart()");
            cme.printStackTrace();
        }
    }
    this.draw();
    if (this.maxResource < Hero.MAX_POSSIBLE_RESOURCE)
        this.maxResource++;
    this.resource = maxResource;
    this.turn = true;
    if (this.isAIControlled) {
        AI.takeTurn(this);
    }
}
Also used : ConcurrentModificationException(java.util.ConcurrentModificationException) Minion(Minions.Minion) ArrayList(java.util.ArrayList)

Aggregations

Minion (Minions.Minion)28 Sticker (cardgame1.Sticker)7 Hero (cardgame1.Hero)5 ArrayList (java.util.ArrayList)3 ConcurrentModificationException (java.util.ConcurrentModificationException)2 SimulatedMinion (AI.SimulatedMinion)1 Card (Cards.Card)1 Trap (Cards.CardPurpose.Trap)1 BaitfishCard (Cards.Fish.BaitfishCard)1 SkeletonMinion (Minions.Undead.SkeletonMinion)1 Trap (Traps.Trap)1