Merge pull request #4247 from spjspj/master

Add 4 unstable cards.
This commit is contained in:
spjspj 2017-12-14 20:20:54 +10:00 committed by GitHub
commit 5ee1c5d2bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 483 additions and 15 deletions

View file

@ -0,0 +1,132 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.m;
import java.util.List;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.mana.ActivatedManaAbilityImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author spjspj
*/
public class MadScienceFairProject extends CardImpl {
public MadScienceFairProject(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// {tap}: Roll a six-sided die. On a 3 or lower, target player adds {C} to his or her mana pool. Otherwise, that player adds one mana of any color he or she chooses to his or her mana pool.
this.addAbility(new MadScienceFairProjectManaAbility());
}
public MadScienceFairProject(final MadScienceFairProject card) {
super(card);
}
@Override
public MadScienceFairProject copy() {
return new MadScienceFairProject(this);
}
}
class MadScienceFairProjectManaAbility extends ActivatedManaAbilityImpl {
public MadScienceFairProjectManaAbility() {
super(Zone.BATTLEFIELD, new MadScienceFairManaEffect(), new TapSourceCost());
}
public MadScienceFairProjectManaAbility(final MadScienceFairProjectManaAbility ability) {
super(ability);
}
@Override
public MadScienceFairProjectManaAbility copy() {
return new MadScienceFairProjectManaAbility(this);
}
}
class MadScienceFairManaEffect extends ManaEffect {
public MadScienceFairManaEffect() {
super();
this.staticText = "Roll a six-sided die. On a 3 or lower, target player adds {C} to his or her mana pool. Otherwise, that player adds one mana of any color he or she chooses to his or her mana pool";
}
public MadScienceFairManaEffect(final MadScienceFairManaEffect effect) {
super(effect);
}
@Override
public MadScienceFairManaEffect copy() {
return new MadScienceFairManaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
int amount = controller.rollDice(game, 6);
if (amount <= 3) {
controller.getManaPool().addMana(Mana.ColorlessMana(1), game, source);
} else {
ChoiceColor choice = new ChoiceColor();
controller.choose(Outcome.PutManaInPool, choice, game);
if (choice.getColor() == null) {
return false;
}
Mana chosen = choice.getMana(1);
if (chosen != null) {
checkToFirePossibleEvents(chosen, game, source);
controller.getManaPool().addMana(chosen, game, source);
return true;
}
}
return true;
}
return false;
}
@Override
public Mana getMana(Game game, Ability source) {
return null;
}
}

View file

@ -0,0 +1,120 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author spjspj
*/
public class SnickeringSquirrel extends CardImpl {
public SnickeringSquirrel(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}");
this.subtype.add("Squirrel");
this.subtype.add("Advisor");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// You may tap Snickering Squirrel to increase the result of a die any player rolled by 1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SnickeringSquirrelEffect()));
}
public SnickeringSquirrel(final SnickeringSquirrel card) {
super(card);
}
@Override
public SnickeringSquirrel copy() {
return new SnickeringSquirrel(this);
}
}
class SnickeringSquirrelEffect extends ReplacementEffectImpl {
SnickeringSquirrelEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "You may tap {this} to increase the result of a die any player rolled by 1";
}
SnickeringSquirrelEffect(final SnickeringSquirrelEffect effect) {
super(effect);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null && permanent.canTap() && !permanent.isTapped()) {
if (controller.chooseUse(Outcome.AIDontUseIt, "Do you want to tap this to increase the result of a die any player rolled by 1?", null, "Yes", "No", source, game)) {
permanent.tap(game);
event.setAmount(event.getAmount() + 1);
}
}
}
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ROLL_DICE;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return source.getControllerId().equals(event.getPlayerId());
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public SnickeringSquirrelEffect copy() {
return new SnickeringSquirrelEffect(this);
}
}

View file

@ -0,0 +1,102 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author spjspj
*/
public class SquirrelPoweredScheme extends CardImpl {
public SquirrelPoweredScheme(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
// Increase the result of each die you roll by 2.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SquirrelPoweredSchemeEffect()));
}
public SquirrelPoweredScheme(final SquirrelPoweredScheme card) {
super(card);
}
@Override
public SquirrelPoweredScheme copy() {
return new SquirrelPoweredScheme(this);
}
}
class SquirrelPoweredSchemeEffect extends ReplacementEffectImpl {
SquirrelPoweredSchemeEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "Increase the result of each die you roll by 2";
}
SquirrelPoweredSchemeEffect(final SquirrelPoweredSchemeEffect effect) {
super(effect);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
event.setAmount(event.getAmount() + 2);
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ROLL_DICE;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return source.getControllerId().equals(event.getPlayerId());
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public SquirrelPoweredSchemeEffect copy() {
return new SquirrelPoweredSchemeEffect(this);
}
}

View file

@ -0,0 +1,120 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.RollDiceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.ReachAbility;
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;
/**
*
* @author spjspj
*/
public class WillingTestSubject extends CardImpl {
public WillingTestSubject(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.subtype.add(SubType.SPIDER);
this.subtype.add(SubType.MONKEY);
this.subtype.add(SubType.SCIENTIST);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Reach
this.addAbility(ReachAbility.getInstance());
// Whenever you roll a 4 or higher on a die, put a +1/+1 counter on Willing Test Subject.
this.addAbility(new WillingTestSubjectTriggeredAbility());
// 6: Roll a six-sided die.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RollDiceEffect(null, 6), new GenericManaCost(6));
this.addAbility(ability);
}
public WillingTestSubject(final WillingTestSubject card) {
super(card);
}
@Override
public WillingTestSubject copy() {
return new WillingTestSubject(this);
}
}
class WillingTestSubjectTriggeredAbility extends TriggeredAbilityImpl {
public WillingTestSubjectTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
}
public WillingTestSubjectTriggeredAbility(final WillingTestSubjectTriggeredAbility ability) {
super(ability);
}
@Override
public WillingTestSubjectTriggeredAbility copy() {
return new WillingTestSubjectTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DICE_ROLLED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (this.getControllerId().equals(event.getPlayerId()) && event.getFlag()) {
if (event.getAmount() >= 4) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever you roll a 4 or higher on a die, put a +1/+1 counter on {this}";
}
}

View file

@ -56,11 +56,15 @@ public class Unstable extends ExpansionSet {
cards.add(new SetCardInfo("Ground Pounder", 110, Rarity.COMMON, mage.cards.g.GroundPounder.class));
cards.add(new SetCardInfo("Hammer Helper", 85, Rarity.COMMON, mage.cards.h.HammerHelper.class));
cards.add(new SetCardInfo("Island", 213, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Mad Science Fair Project", 154, Rarity.COMMON, mage.cards.m.MadScienceFairProject.class));
cards.add(new SetCardInfo("Mountain", 215, Rarity.LAND, mage.cards.basiclands.Mountain.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Painiac", 91, Rarity.COMMON, mage.cards.p.Painiac.class));
cards.add(new SetCardInfo("Plains", 212, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Snickering Squirrel", 68, Rarity.COMMON, mage.cards.s.SnickeringSquirrel.class));
cards.add(new SetCardInfo("Squirrel-Powered Scheme", 70, Rarity.UNCOMMON, mage.cards.s.SquirrelPoweredScheme.class));
cards.add(new SetCardInfo("Swamp", 214, Rarity.LAND, mage.cards.basiclands.Swamp.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Sword of Dungeons and Dragons", 1, Rarity.MYTHIC, mage.cards.s.SwordOfDungeonsAndDragons.class));
cards.add(new SetCardInfo("Target Minotaur", 98, Rarity.COMMON, mage.cards.t.TargetMinotaur.class));
cards.add(new SetCardInfo("Willing Test Subject", 126, Rarity.COMMON, mage.cards.w.WillingTestSubject.class));
}
}

View file

@ -74,19 +74,8 @@ public class RollDiceEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject mageObject = game.getObject(source.getSourceId());
if (controller != null && mageObject != null) {
boolean result = true;
for (Effect effect : executingEffects) {
int rolled = controller.rollDice(game, numSides);
effect.setTargetPointer(this.targetPointer);
effect.setValue("rolled", rolled);
this.setValue("rolled", rolled);
if (effect instanceof OneShotEffect) {
result &= effect.apply(game, source);
} else {
game.addEffect((ContinuousEffect) effect, source);
}
}
return result;
controller.rollDice(game, numSides);
return true;
}
return false;
}
@ -96,7 +85,7 @@ public class RollDiceEffect extends OneShotEffect {
if (!staticText.isEmpty()) {
return staticText;
}
StringBuilder sb = new StringBuilder("Roll a " + numSides + " sided dice and then ").append(executingEffects.getText(mode));
StringBuilder sb = new StringBuilder("Roll a " + numSides + " sided dice");
return sb.toString();
}

View file

@ -72,7 +72,7 @@ public enum SubType {
BITH("Bith", SubTypeSet.CreatureType, true), // Star Wars
BLINKMOTH("Blinkmoth", SubTypeSet.CreatureType),
BOAR("Boar", SubTypeSet.CreatureType),
BRAINIAC("Brainiac", SubTypeSet.CreatureType),
BRAINIAC("Brainiac", SubTypeSet.CreatureType, true), // Unstable
BRINGER("Bringer", SubTypeSet.CreatureType),
BRUSHWAGG("Brushwagg", SubTypeSet.CreatureType),
// C
@ -269,6 +269,7 @@ public enum SubType {
SAPROLING("Saproling", SubTypeSet.CreatureType),
SATYR("Satyr", SubTypeSet.CreatureType),
SCARECROW("Scarecrow", SubTypeSet.CreatureType),
SCIENTIST("Scientist", SubTypeSet.CreatureType, true), // Unstable
SCION("Scion", SubTypeSet.CreatureType),
SCORPION("Scorpion", SubTypeSet.CreatureType),
SCOUT("Scout", SubTypeSet.CreatureType),