forked from External/mage
[SPM] Implement Oscorp Industries
This commit is contained in:
parent
e19c454aa3
commit
6e29b8e7fa
4 changed files with 163 additions and 0 deletions
50
Mage.Sets/src/mage/cards/o/OscorpIndustries.java
Normal file
50
Mage.Sets/src/mage/cards/o/OscorpIndustries.java
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
package mage.cards.o;
|
||||
|
||||
import mage.abilities.common.EntersBattlefieldFromGraveyardTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||
import mage.abilities.keyword.MayhemLandAbility;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jmlundeen
|
||||
*/
|
||||
public final class OscorpIndustries extends CardImpl {
|
||||
|
||||
public OscorpIndustries(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
|
||||
|
||||
// This land enters tapped.
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
||||
// When this land enters from a graveyard, you lose 2 life.
|
||||
this.addAbility(new EntersBattlefieldFromGraveyardTriggeredAbility(new LoseLifeSourceControllerEffect(2)));
|
||||
|
||||
// {T}: Add {U}, {B}, or {R}.
|
||||
this.addAbility(new BlueManaAbility());
|
||||
this.addAbility(new BlackManaAbility());
|
||||
this.addAbility(new RedManaAbility());
|
||||
|
||||
// Mayhem
|
||||
this.addAbility(new MayhemLandAbility(this));
|
||||
|
||||
}
|
||||
|
||||
private OscorpIndustries(final OscorpIndustries card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OscorpIndustries copy() {
|
||||
return new OscorpIndustries(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -117,6 +117,7 @@ public final class MarvelsSpiderMan extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Ominous Asylum", 181, Rarity.COMMON, mage.cards.o.OminousAsylum.class));
|
||||
cards.add(new SetCardInfo("Origin of Spider-Man", 218, Rarity.RARE, mage.cards.o.OriginOfSpiderMan.class, FULL_ART_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Origin of Spider-Man", 9, Rarity.RARE, mage.cards.o.OriginOfSpiderMan.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Oscorp Industries", 182, Rarity.RARE, mage.cards.o.OscorpIndustries.class));
|
||||
cards.add(new SetCardInfo("Oscorp Research Team", 40, Rarity.COMMON, mage.cards.o.OscorpResearchTeam.class));
|
||||
cards.add(new SetCardInfo("Peter Parker", 10, Rarity.MYTHIC, mage.cards.p.PeterParker.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Peter Parker", 208, Rarity.MYTHIC, mage.cards.p.PeterParker.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
package org.mage.test.cards.single.spm;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jmlundeen
|
||||
*/
|
||||
public class OscorpIndustriesTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
Oscorp Industries
|
||||
|
||||
Land
|
||||
This land enters tapped.
|
||||
When this land enters from a graveyard, you lose 2 life.
|
||||
{T}: Add {U}, {B}, or {R}.
|
||||
Mayhem
|
||||
*/
|
||||
private static final String oscorpIndustries = "Oscorp Industries";
|
||||
|
||||
/*
|
||||
Thought Courier
|
||||
{1}{U}
|
||||
Creature - Human Wizard
|
||||
{tap}: Draw a card, then discard a card.
|
||||
1/1
|
||||
*/
|
||||
private static final String thoughtCourier = "Thought Courier";
|
||||
|
||||
@Test
|
||||
public void testOscorpIndustries() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.HAND, playerA, oscorpIndustries);
|
||||
addCard(Zone.BATTLEFIELD, playerA, thoughtCourier);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw");
|
||||
setChoice(playerA, oscorpIndustries);
|
||||
|
||||
playLand(1, PhaseStep.POSTCOMBAT_MAIN, playerA, oscorpIndustries + " with mayhem");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20 - 2);
|
||||
assertPermanentCount(playerA, oscorpIndustries, 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.MageIdentifier;
|
||||
import mage.abilities.PlayLandAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class MayhemLandAbility extends PlayLandAbility {
|
||||
|
||||
private final String rule;
|
||||
|
||||
public MayhemLandAbility(Card card) {
|
||||
super(card.getName());
|
||||
this.zone = Zone.GRAVEYARD;
|
||||
this.newId();
|
||||
this.name += " with Mayhem";
|
||||
this.addWatcher(new MayhemWatcher());
|
||||
this.setRuleAtTheTop(true);
|
||||
this.rule = "Mayhem " +
|
||||
" <i>(You may play this card from your graveyard if you discarded it this turn. " +
|
||||
"Timing rules still apply.)</i>";
|
||||
}
|
||||
|
||||
protected MayhemLandAbility(final MayhemLandAbility ability) {
|
||||
super(ability);
|
||||
this.rule = ability.rule;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivationStatus canActivate(UUID playerId, Game game) {
|
||||
if (!Zone.GRAVEYARD.match(game.getState().getZone(getSourceId()))
|
||||
|| !MayhemWatcher.checkCard(getSourceId(), game)) {
|
||||
return ActivationStatus.getFalse();
|
||||
}
|
||||
return super.canActivate(playerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate(Game game, Set<MageIdentifier> allowedIdentifiers, boolean noMana) {
|
||||
if (!super.activate(game, allowedIdentifiers, noMana)) {
|
||||
return false;
|
||||
}
|
||||
this.setCostsTag(MayhemAbility.MAYHEM_ACTIVATION_VALUE_KEY, null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MayhemLandAbility copy() {
|
||||
return new MayhemLandAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return rule;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue