forked from External/mage
[OTJ] Implement Obeka, Splitter of Seconds
This commit is contained in:
parent
0c6422668e
commit
86ca3673ff
3 changed files with 123 additions and 0 deletions
84
Mage.Sets/src/mage/cards/o/ObekaSplitterOfSeconds.java
Normal file
84
Mage.Sets/src/mage/cards/o/ObekaSplitterOfSeconds.java
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
package mage.cards.o;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.SavedDamageValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.game.Game;
|
||||
import mage.game.turn.TurnMod;
|
||||
import mage.game.turn.UpkeepStep;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public final class ObekaSplitterOfSeconds extends CardImpl {
|
||||
|
||||
public ObekaSplitterOfSeconds(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}{R}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.OGRE);
|
||||
this.subtype.add(SubType.WARLOCK);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Menace
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// Whenever Obeka, Splitter of Seconds deals combat damage to a player, you get that many additional upkeep steps after this phase.
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
|
||||
new ObekaSplitterOfSecondsEffect(),
|
||||
false, true
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
private ObekaSplitterOfSeconds(final ObekaSplitterOfSeconds card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObekaSplitterOfSeconds copy() {
|
||||
return new ObekaSplitterOfSeconds(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ObekaSplitterOfSecondsEffect extends OneShotEffect {
|
||||
|
||||
ObekaSplitterOfSecondsEffect() {
|
||||
super(Outcome.Neutral);
|
||||
staticText = "you get that many additional upkeep steps after this phase";
|
||||
}
|
||||
|
||||
private ObekaSplitterOfSecondsEffect(final ObekaSplitterOfSecondsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObekaSplitterOfSecondsEffect copy() {
|
||||
return new ObekaSplitterOfSecondsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int extraSteps = SavedDamageValue.MANY.calculate(game, source, this);
|
||||
if (extraSteps <= 0) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < extraSteps; ++i) {
|
||||
game.getState().getTurnMods().add(new TurnMod(source.getControllerId()).withExtraStep(new UpkeepStep()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -152,6 +152,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Nimble Brigand", 58, Rarity.UNCOMMON, mage.cards.n.NimbleBrigand.class));
|
||||
cards.add(new SetCardInfo("Nurturing Pixie", 20, Rarity.UNCOMMON, mage.cards.n.NurturingPixie.class));
|
||||
cards.add(new SetCardInfo("Oasis Gardener", 246, Rarity.COMMON, mage.cards.o.OasisGardener.class));
|
||||
cards.add(new SetCardInfo("Obeka, Splitter of Seconds", 222, Rarity.RARE, mage.cards.o.ObekaSplitterOfSeconds.class));
|
||||
cards.add(new SetCardInfo("Oko, the Ringleader", 223, Rarity.MYTHIC, mage.cards.o.OkoTheRingleader.class));
|
||||
cards.add(new SetCardInfo("Omenport Vigilante", 21, Rarity.UNCOMMON, mage.cards.o.OmenportVigilante.class));
|
||||
cards.add(new SetCardInfo("Ornery Tumblewagg", 171, Rarity.RARE, mage.cards.o.OrneryTumblewagg.class));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package org.mage.test.cards.single.otj;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public class ObekaSplitterOfSecondsTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* {@link mage.cards.o.ObekaSplitterOfSeconds Obeka, Splitter of Seconds} {1}{U}{B}{R}
|
||||
* Legendary Creature — Ogre Warlock
|
||||
* Menace
|
||||
* Whenever Obeka, Splitter of Seconds deals combat damage to a player, you get that many additional upkeep steps after this phase.
|
||||
* 2/5
|
||||
*/
|
||||
private static final String obeka = "Obeka, Splitter of Seconds";
|
||||
|
||||
@Test
|
||||
public void test_ExtraUpkeep() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, obeka);
|
||||
// At the beginning of your upkeep, you gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Fountain of Renewal");
|
||||
|
||||
attack(1, playerA, obeka, playerB);
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20 + 1 + 2); // 1 regular upkeep + 2 obeka ones
|
||||
assertTapped(obeka, true); // checks that no extra untap happened
|
||||
assertHandCount(playerA, 0); // checks that no draw step happened
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue