use of com.janfic.games.computercombat.model.animations.ChangeStatAnim in project computercombat by janfic.
the class ChangeDefenseAbility method doAbility.
@Override
public List<MoveResult> doAbility(MatchState state, Move move) {
List<MoveResult> results = new ArrayList<>();
String currentUID = move.getPlayerUID();
String opponentUID = state.getOtherProfile(state.currentPlayerMove);
List<MoveAnimation> animation = new ArrayList<>();
MoveAnimation consume = Ability.consumeCardProgress(state, move);
animation.add(consume);
for (Card card : state.getAllCards()) {
if (cardFilter.filter(card, state, move)) {
int amount = this.amount.analyze(state, move);
card.changeArmor(amount);
animation.add(new ChangeStatAnim("armor", amount, card, card.getOwnerUID()));
}
}
state.currentPlayerMove = state.getOtherProfile(state.currentPlayerMove);
MoveResult result = new MoveResult(move, MatchState.record(state), animation);
results.add(result);
return results;
}
Aggregations