[VOC] Implemented Rhoda, Geist Avenger

This commit is contained in:
Evan Kranzler 2021-11-13 12:39:14 -05:00
parent 7a8db0c878
commit 9c5f63403a
4 changed files with 103 additions and 46 deletions

View file

@ -0,0 +1,51 @@
package mage.cards.r;
import mage.MageInt;
import mage.abilities.common.TappedNotAttackingTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.PartnerWithAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class RhodaGeistAvenger extends CardImpl {
public RhodaGeistAvenger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SOLDIER);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Partner with Timin, Youthful Geist
this.addAbility(new PartnerWithAbility("Timin, Youthful Geist"));
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// Whenever a creature an opponent controls becomes tapped, if it isn't being declared as an attacker, put a +1/+1 counter on Rhoda, Geist Avenger.
this.addAbility(new TappedNotAttackingTriggeredAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false
));
}
private RhodaGeistAvenger(final RhodaGeistAvenger card) {
super(card);
}
@Override
public RhodaGeistAvenger copy() {
return new RhodaGeistAvenger(this);
}
}

View file

@ -1,8 +1,8 @@
package mage.cards.v;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.TappedNotAttackingTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.TapTargetEffect;
@ -10,14 +10,9 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
@ -37,10 +32,10 @@ public final class VerityCircle extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
// Whenever a creature an opponent controls becomes tapped, if it isn't being declared as an attacker, you may draw a card.
this.addAbility(new VerityCircleTriggeredAbility());
this.addAbility(new TappedNotAttackingTriggeredAbility(new DrawCardSourceControllerEffect(1), true));
// {4}{U}: Tap target creature without flying.
Ability ability = new SimpleActivatedAbility(new TapTargetEffect(), new ManaCostsImpl("{4}{U}"));
Ability ability = new SimpleActivatedAbility(new TapTargetEffect(), new ManaCostsImpl<>("{4}{U}"));
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
}
@ -54,41 +49,3 @@ public final class VerityCircle extends CardImpl {
return new VerityCircle(this);
}
}
class VerityCircleTriggeredAbility extends TriggeredAbilityImpl {
VerityCircleTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), true);
}
private VerityCircleTriggeredAbility(final VerityCircleTriggeredAbility ability) {
super(ability);
}
@Override
public VerityCircleTriggeredAbility copy() {
return new VerityCircleTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.TAPPED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getFlag()) {
return false;
}
Permanent permanent = game.getPermanent(event.getTargetId());
Player player = game.getPlayer(controllerId);
return permanent != null && player != null && permanent.isCreature(game)
&& player.hasOpponent(permanent.getControllerId(), game);
}
@Override
public String getRule() {
return "Whenever a creature an opponent controls becomes tapped, " +
"if it isn't being declared as an attacker, you may draw a card.";
}
}

View file

@ -116,6 +116,7 @@ public final class CrimsonVowCommander extends ExpansionSet {
cards.add(new SetCardInfo("Rattlechains", 110, Rarity.RARE, mage.cards.r.Rattlechains.class));
cards.add(new SetCardInfo("Reconnaissance Mission", 111, Rarity.UNCOMMON, mage.cards.r.ReconnaissanceMission.class));
cards.add(new SetCardInfo("Remorseful Cleric", 97, Rarity.RARE, mage.cards.r.RemorsefulCleric.class));
cards.add(new SetCardInfo("Rhoda, Geist Avenger", 8, Rarity.RARE, mage.cards.r.RhodaGeistAvenger.class));
cards.add(new SetCardInfo("Sanctum Seeker", 136, Rarity.RARE, mage.cards.s.SanctumSeeker.class));
cards.add(new SetCardInfo("Scion of Opulence", 28, Rarity.RARE, mage.cards.s.ScionOfOpulence.class));
cards.add(new SetCardInfo("Shacklegeist", 112, Rarity.RARE, mage.cards.s.Shacklegeist.class));

View file

@ -0,0 +1,48 @@
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
* @author TheElk801
*/
public class TappedNotAttackingTriggeredAbility extends TriggeredAbilityImpl {
public TappedNotAttackingTriggeredAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
}
private TappedNotAttackingTriggeredAbility(final TappedNotAttackingTriggeredAbility ability) {
super(ability);
}
@Override
public TappedNotAttackingTriggeredAbility copy() {
return new TappedNotAttackingTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.TAPPED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getFlag()) {
return false;
}
Permanent permanent = game.getPermanent(event.getTargetId());
return permanent != null && permanent.isCreature(game)
&& game.getOpponents(permanent.getControllerId()).contains(getControllerId());
}
@Override
public String getTriggerPhrase() {
return "Whenever a creature an opponent controls becomes tapped, " +
"if it isn't being declared as an attacker, ";
}
}