package com.hearthsim.card.classic.spell.rare; import com.hearthsim.card.minion.Minion; import com.hearthsim.card.spellcard.SpellTargetableCard; import com.hearthsim.event.deathrattle.DeathrattleSummonMinionAction; import com.hearthsim.event.effect.EffectCharacter; import com.hearthsim.event.filter.FilterCharacter; import com.hearthsim.event.filter.FilterCharacterTargetedSpell; public class AncestralSpirit extends SpellTargetableCard { public static final EffectCharacter effect = (targetSide, targetCharacterIndex, boardState) -> { Minion targetCharacter = boardState.data_.getCharacter(targetSide, targetCharacterIndex); targetCharacter.setDeathrattle(new DeathrattleSummonMinionAction(targetCharacter.getClass(), 1)); return boardState; }; /** * Constructor * * @param hasBeenUsed Whether the card has already been used or not */ @Deprecated public AncestralSpirit(boolean hasBeenUsed) { this(); this.hasBeenUsed = hasBeenUsed; } /** * Constructor * * Defaults to hasBeenUsed = false */ public AncestralSpirit() { super(); } @Override public FilterCharacter getTargetableFilter() { return FilterCharacterTargetedSpell.ALL_MINIONS; } /** * * Use the card on the given target * * Give a minion 'Deathrattle: Resummon this minion' * * @return The boardState is manipulated and returned */ @Override public EffectCharacter getTargetableEffect() { return AncestralSpirit.effect; } }