package com.hearthsim.card.classic.spell.common; import com.hearthsim.card.minion.Minion; import com.hearthsim.card.spellcard.SpellTargetableCard; import com.hearthsim.event.effect.EffectCharacter; import com.hearthsim.event.filter.FilterCharacter; import com.hearthsim.event.filter.FilterCharacterTargetedSpell; public class InnerFire extends SpellTargetableCard { /** * Constructor * * @param hasBeenUsed Whether the card has already been used or not */ @Deprecated public InnerFire(boolean hasBeenUsed) { this(); this.hasBeenUsed = hasBeenUsed; } /** * Constructor * * Defaults to hasBeenUsed = false */ public InnerFire() { super(); } @Override public FilterCharacter getTargetableFilter() { return FilterCharacterTargetedSpell.ALL_MINIONS; } /** * * Use the card on the given target * * Change a minion's Attack to be equal to its Health * * @return The boardState is manipulated and returned */ @Override public EffectCharacter getTargetableEffect() { if (this.effect == null) { this.effect = (targetSide, targetCharacterIndex, boardState) -> { Minion targetCharacter = boardState.data_.getCharacter(targetSide, targetCharacterIndex); targetCharacter.setAttack(targetCharacter.getTotalHealth()); return boardState; }; } return this.effect; } }