[KHM] Implemented Doomskar Oracle

This commit is contained in:
Evan Kranzler 2021-01-09 10:10:26 -05:00
parent 924663f27e
commit 91c8e1f5b5
7 changed files with 151 additions and 194 deletions

View file

@ -0,0 +1,42 @@
package mage.cards.d;
import mage.MageInt;
import mage.abilities.common.CastSecondSpellTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.ForetellAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class DoomskarOracle extends CardImpl {
public DoomskarOracle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Whenever you cast your second spell each turn, you gain 2 life.
this.addAbility(new CastSecondSpellTriggeredAbility(new GainLifeEffect(2)));
// Foretell {W}
this.addAbility(new ForetellAbility(this, "{W}"));
}
private DoomskarOracle(final DoomskarOracle card) {
super(card);
}
@Override
public DoomskarOracle copy() {
return new DoomskarOracle(this);
}
}

View file

@ -1,30 +1,25 @@
package mage.cards.i;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.Ability;
import mage.abilities.common.CastSecondSpellTriggeredAbility;
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.watchers.common.CastSpellLastTurnWatcher;
import mage.constants.SubType;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class IncursionSpecialist extends CardImpl {
public IncursionSpecialist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
@ -32,10 +27,14 @@ public final class IncursionSpecialist extends CardImpl {
this.toughness = new MageInt(3);
// Whenever you cast your second spell each turn, Incursion Specialist gets +2/+0 until end of turn and can't be blocked this turn.
this.addAbility(new IncursionTriggeredAbility(), new CastSpellLastTurnWatcher());
Ability ability = new CastSecondSpellTriggeredAbility(
new BoostSourceEffect(2, 0, Duration.EndOfTurn)
);
ability.addEffect(new CantBeBlockedSourceEffect().setText("and can't be blocked this turn"));
this.addAbility(ability);
}
public IncursionSpecialist(final IncursionSpecialist card) {
private IncursionSpecialist(final IncursionSpecialist card) {
super(card);
}
@ -44,41 +43,3 @@ public final class IncursionSpecialist extends CardImpl {
return new IncursionSpecialist(this);
}
}
class IncursionTriggeredAbility extends TriggeredAbilityImpl {
public IncursionTriggeredAbility() {
super(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn));
this.addEffect(new CantBeBlockedSourceEffect(Duration.EndOfTurn));
}
public IncursionTriggeredAbility(final IncursionTriggeredAbility ability) {
super(ability);
}
@Override
public IncursionTriggeredAbility copy() {
return new IncursionTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getPlayerId().equals(controllerId)) {
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 2) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever you cast your second spell each turn, Incursion Specialist gets +2/+0 until end of turn and can't be blocked this turn.";
}
}

View file

@ -1,29 +1,23 @@
package mage.cards.j;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.CastSecondSpellTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.watchers.common.CastSpellLastTurnWatcher;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class JoriEnRuinDiver extends CardImpl {
public JoriEnRuinDiver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{R}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{R}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.MERFOLK);
this.subtype.add(SubType.WIZARD);
@ -31,10 +25,10 @@ public final class JoriEnRuinDiver extends CardImpl {
this.toughness = new MageInt(3);
// Whenever you cast your second spell each turn, draw a card.
this.addAbility(new JoriEnTriggeredAbility(), new CastSpellLastTurnWatcher());
this.addAbility(new CastSecondSpellTriggeredAbility(new DrawCardSourceControllerEffect(1)));
}
public JoriEnRuinDiver(final JoriEnRuinDiver card) {
private JoriEnRuinDiver(final JoriEnRuinDiver card) {
super(card);
}
@ -43,40 +37,3 @@ public final class JoriEnRuinDiver extends CardImpl {
return new JoriEnRuinDiver(this);
}
}
class JoriEnTriggeredAbility extends TriggeredAbilityImpl {
public JoriEnTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1));
}
public JoriEnTriggeredAbility(final JoriEnTriggeredAbility ability) {
super(ability);
}
@Override
public JoriEnTriggeredAbility copy() {
return new JoriEnTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getPlayerId().equals(controllerId)) {
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 2) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever you cast your second spell each turn, draw a card.";
}
}

View file

@ -1,36 +1,30 @@
package mage.cards.p;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.CastSecondSpellTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetAnyTarget;
import mage.watchers.common.CastSpellLastTurnWatcher;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class PyromancersAssault extends CardImpl {
public PyromancersAssault(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
// Whenever you cast your second spell each turn, Pyromancer's Assault deals 2 damage to any target.
Ability ability = new PyromancersAssaultTriggeredAbility();
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability, new CastSpellLastTurnWatcher());
Ability ability = new CastSecondSpellTriggeredAbility(new DamageTargetEffect(2));
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
}
public PyromancersAssault(final PyromancersAssault card) {
private PyromancersAssault(final PyromancersAssault card) {
super(card);
}
@ -39,40 +33,3 @@ public final class PyromancersAssault extends CardImpl {
return new PyromancersAssault(this);
}
}
class PyromancersAssaultTriggeredAbility extends TriggeredAbilityImpl {
public PyromancersAssaultTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(2));
}
public PyromancersAssaultTriggeredAbility(final PyromancersAssaultTriggeredAbility ability) {
super(ability);
}
@Override
public PyromancersAssaultTriggeredAbility copy() {
return new PyromancersAssaultTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getPlayerId().equals(controllerId)) {
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 2) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever you cast your second spell each turn, {this} deals 2 damage to any target.";
}
}

View file

@ -1,18 +1,14 @@
package mage.cards.t;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.CastSecondSpellTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.watchers.common.CastSpellLastTurnWatcher;
import java.util.UUID;
@ -33,7 +29,9 @@ public final class ThunderDrake extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Whenever you cast you cast your second spell each turn, put a +1/+1 counter on Thunder Drake.
this.addAbility(new ThunderDrakeTriggeredAbility(), new CastSpellLastTurnWatcher());
this.addAbility(new CastSecondSpellTriggeredAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance())
));
}
private ThunderDrake(final ThunderDrake card) {
@ -45,40 +43,3 @@ public final class ThunderDrake extends CardImpl {
return new ThunderDrake(this);
}
}
class ThunderDrakeTriggeredAbility extends TriggeredAbilityImpl {
ThunderDrakeTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
}
private ThunderDrakeTriggeredAbility(final ThunderDrakeTriggeredAbility ability) {
super(ability);
}
@Override
public ThunderDrakeTriggeredAbility copy() {
return new ThunderDrakeTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getPlayerId().equals(controllerId)) {
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 2) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever you cast your second spell each turn, put a +1/+1 counter on {this}";
}
}

View file

@ -58,6 +58,7 @@ public final class Kaldheim extends ExpansionSet {
cards.add(new SetCardInfo("Canopy Tactician", 378, Rarity.RARE, mage.cards.c.CanopyTactician.class));
cards.add(new SetCardInfo("Cleaving Reaper", 376, Rarity.RARE, mage.cards.c.CleavingReaper.class));
cards.add(new SetCardInfo("Darkbore Pathway", 254, Rarity.RARE, mage.cards.d.DarkborePathway.class));
cards.add(new SetCardInfo("Doomskar Oracle", 10, Rarity.COMMON, mage.cards.d.DoomskarOracle.class));
cards.add(new SetCardInfo("Elderfang Ritualist", 385, Rarity.UNCOMMON, mage.cards.e.ElderfangRitualist.class));
cards.add(new SetCardInfo("Elven Ambush", 391, Rarity.UNCOMMON, mage.cards.e.ElvenAmbush.class));
cards.add(new SetCardInfo("Elvish Warmaster", 167, Rarity.RARE, mage.cards.e.ElvishWarmaster.class));

View file

@ -0,0 +1,78 @@
package mage.abilities.common;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.watchers.common.CastSpellLastTurnWatcher;
/**
* @author TheElk801
*/
public class CastSecondSpellTriggeredAbility extends TriggeredAbilityImpl {
private static final Hint hint = new ValueHint("Spells you cast this turn", SpellCastValue.instance);
public CastSecondSpellTriggeredAbility(Effect effect) {
this(Zone.BATTLEFIELD, effect, false);
}
public CastSecondSpellTriggeredAbility(Zone zone, Effect effect, boolean optional) {
super(zone, effect, optional);
this.addWatcher(new CastSpellLastTurnWatcher());
this.addHint(hint);
}
private CastSecondSpellTriggeredAbility(final CastSecondSpellTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!isControlledBy(event.getPlayerId())) {
return false;
}
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
return watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 2;
}
@Override
public String getRule() {
return "Whenever you cast your second spell each turn, " + super.getRule();
}
@Override
public CastSecondSpellTriggeredAbility copy() {
return new CastSecondSpellTriggeredAbility(this);
}
}
enum SpellCastValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
return watcher != null ? watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(sourceAbility.getControllerId()) : 0;
}
@Override
public SpellCastValue copy() {
return instance;
}
@Override
public String getMessage() {
return "";
}
}