[ZNR] Implemented Shell Shield

This commit is contained in:
Evan Kranzler 2020-09-01 13:56:19 -04:00
parent af598df288
commit fdba488ab5
2 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,72 @@
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HexproofAbility;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.target.common.TargetControlledCreaturePermanent;
/**
* @author TheElk801
*/
public final class ShellShield extends CardImpl {
public ShellShield(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
// Kicker {1}
this.addAbility(new KickerAbility(new ManaCostsImpl<>("{1}")));
// Target creature you control gets +0/+3 until end of turn. If this spell was kicked, that creature also gains hexproof until end of turn.
this.getSpellAbility().addEffect(new ShellShieldEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
}
private ShellShield(final ShellShield card) {
super(card);
}
@Override
public ShellShield copy() {
return new ShellShield(this);
}
}
class ShellShieldEffect extends OneShotEffect {
ShellShieldEffect() {
super(Outcome.Benefit);
staticText = "Target creature you control gets +0/+3 until end of turn. " +
"If this spell was kicked, that creature also gains hexproof until end of turn.";
}
private ShellShieldEffect(final ShellShieldEffect effect) {
super(effect);
}
@Override
public ShellShieldEffect copy() {
return new ShellShieldEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
game.addEffect(new BoostTargetEffect(0, 3, Duration.EndOfTurn), source);
if (KickedCondition.instance.apply(game, source)) {
game.addEffect(new GainAbilityTargetEffect(HexproofAbility.getInstance(), Duration.EndOfTurn), source);
}
return true;
}
}

View file

@ -33,5 +33,6 @@ public final class ZendikarRising extends ExpansionSet {
cards.add(new SetCardInfo("Murasa Rootgrazer", 229, Rarity.UNCOMMON, mage.cards.m.MurasaRootgrazer.class));
cards.add(new SetCardInfo("Nahiri, Heir of the Ancients", 230, Rarity.MYTHIC, mage.cards.n.NahiriHeirOfTheAncients.class));
cards.add(new SetCardInfo("Ruin Crab", 75, Rarity.UNCOMMON, mage.cards.r.RuinCrab.class));
cards.add(new SetCardInfo("Shell Shield", 79, Rarity.COMMON, mage.cards.s.ShellShield.class));
}
}