@Override public MyTurnState perform(PlayableCard minion, BoardState oldstate) { Set<Action> actions = new LinkedHashSet<Action>(); for (int id : oldstate.getIdsInPlayOrder()) { Minion targetMinion = oldstate.findMinion(id); if (targetMinion.isTargettable() && targetMinion.getRace().equals(Race.MURLOC)) actions.add(new HungryCrabChoice((Minion) minion, id)); } if (actions.size() == 0) return oldstate; return new ChoiceState(oldstate, actions, BufferType.BATTLECRY, ((Minion) minion).getId()); }
@Override public MyTurnState result(BoardState oldstate) { Minion defender = oldstate.findMinion(id); MyTurnState tempstate = defender.destroy(oldstate); return tempstate.applyBuff(source.getId(), new AdditiveBuff(-1, 2, 2, 0)); }
@Override public MyTurnState perform(PlayableCard minion, BoardState oldstate) { return oldstate.drawCard(); }
@Override public MyTurnState result(BoardState oldstate) { Hero hero = (oldstate.getHero()).fresh(); hero.setPowerUsed(true); hero.setCurrentMana(hero.getCurrentMana() - manacost); BoardState tempstate = new BoardState( oldstate.getViewType(), hero, oldstate.getEnemy(), oldstate.getOppSide(), oldstate.getMySide(), oldstate.getIdsInPlayOrder(), oldstate.getEnemyHandSize(), oldstate.isTurnEnded(), oldstate.getIdCounter()); return (tempstate.getEnemy()).damage(tempstate, damage); }
public boolean useable(BoardState oldstate) { return ((oldstate.getHero()).getCurrentMana() >= manacost); }