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;
}
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 + ")";
}
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);
}
}
Aggregations