mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Added Serum Powder, Paradise Mantle and Quicken card.
This commit is contained in:
parent
955f5ea391
commit
e66822c564
3 changed files with 315 additions and 0 deletions
127
Mage.Sets/src/mage/sets/darksteel/SerumPowder.java
Normal file
127
Mage.Sets/src/mage/sets/darksteel/SerumPowder.java
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* 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.sets.darksteel;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SerumPowder extends CardImpl<SerumPowder> {
|
||||
|
||||
public SerumPowder(UUID ownerId) {
|
||||
super(ownerId, 138, "Serum Powder", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
this.expansionSetCode = "DST";
|
||||
|
||||
// {tap}: Add {1} to your mana pool.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
|
||||
// Any time you could mulligan and Serum Powder is in your hand, you may exile all the cards from your hand, then draw that many cards.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.HAND, new SerumPowderReplaceEffect()));
|
||||
}
|
||||
|
||||
public SerumPowder(final SerumPowder card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SerumPowder copy() {
|
||||
return new SerumPowder(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SerumPowderReplaceEffect extends ReplacementEffectImpl<SerumPowderReplaceEffect> {
|
||||
SerumPowderReplaceEffect() {
|
||||
super(Duration.EndOfGame, Outcome.Detriment);
|
||||
staticText = "Any time you could mulligan and {this} is in your hand, you may exile all the cards from your hand, then draw that many cards";
|
||||
}
|
||||
|
||||
SerumPowderReplaceEffect(final SerumPowderReplaceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
if (controller != null && sourceCard != null) {
|
||||
int cardsHand = controller.getHand().size();
|
||||
if (cardsHand > 0){
|
||||
Cards cards = new CardsImpl();
|
||||
for (UUID cardId: controller.getHand()) {
|
||||
cards.add(game.getCard(cardId));
|
||||
}
|
||||
for (Card card: cards.getCards(game)) {
|
||||
card.moveToExile(null, null, source.getId(), game);
|
||||
}
|
||||
controller.drawCards(cardsHand, game);
|
||||
}
|
||||
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(controller.getName()).append(" exiles hand and draws ").append(cardsHand).append(" card(s)").toString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAN_TAKE_MULLIGAN && source.getControllerId().equals(event.getPlayerId())) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
return controller.chooseUse(outcome, "Exile all cards from hand and draw that many cards?", game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SerumPowderReplaceEffect copy() {
|
||||
return new SerumPowderReplaceEffect(this);
|
||||
}
|
||||
}
|
71
Mage.Sets/src/mage/sets/fifthdawn/ParadiseMantle.java
Normal file
71
Mage.Sets/src/mage/sets/fifthdawn/ParadiseMantle.java
Normal file
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* 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.sets.fifthdawn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.AttachmentType;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.mana.AnyColorManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ParadiseMantle extends CardImpl<ParadiseMantle> {
|
||||
|
||||
public ParadiseMantle(UUID ownerId) {
|
||||
super(ownerId, 142, "Paradise Mantle", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{0}");
|
||||
this.expansionSetCode = "5DN";
|
||||
this.subtype.add("Equipment");
|
||||
|
||||
// Equipped creature has "{tap}: Add one mana of any color to your mana pool."
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
||||
new GainAbilityAttachedEffect(new AnyColorManaAbility(new TapSourceCost()), AttachmentType.EQUIPMENT, Duration.WhileOnBattlefield)));
|
||||
// Equip {1}
|
||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
|
||||
}
|
||||
|
||||
public ParadiseMantle(final ParadiseMantle card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParadiseMantle copy() {
|
||||
return new ParadiseMantle(this);
|
||||
}
|
||||
}
|
117
Mage.Sets/src/mage/sets/guildpact/Quicken.java
Normal file
117
Mage.Sets/src/mage/sets/guildpact/Quicken.java
Normal file
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* 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.sets.guildpact;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.AsThoughEffectType;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*
|
||||
* TODO: Change to handling with CAST_SPELL watcher. All existing effects must be consumed if a sorcery is cast.
|
||||
*/
|
||||
public class Quicken extends CardImpl<Quicken> {
|
||||
|
||||
public Quicken(UUID ownerId) {
|
||||
super(ownerId, 31, "Quicken", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{U}");
|
||||
this.expansionSetCode = "GPT";
|
||||
|
||||
this.color.setBlue(true);
|
||||
|
||||
// The next sorcery card you cast this turn can be cast as though it had flash.
|
||||
this.getSpellAbility().addEffect(new QuickenAsThoughEffect());
|
||||
|
||||
// Draw a card.
|
||||
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
|
||||
}
|
||||
|
||||
public Quicken(final Quicken card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Quicken copy() {
|
||||
return new Quicken(this);
|
||||
}
|
||||
}
|
||||
|
||||
class QuickenAsThoughEffect extends AsThoughEffectImpl<QuickenAsThoughEffect> {
|
||||
private UUID cardId;
|
||||
private int zoneChangeCounter;
|
||||
|
||||
public QuickenAsThoughEffect() {
|
||||
super(AsThoughEffectType.CAST, Duration.EndOfTurn, Outcome.Benefit);
|
||||
staticText = "The next sorcery card you cast this turn can be cast as though it had flash";
|
||||
}
|
||||
|
||||
public QuickenAsThoughEffect(final QuickenAsThoughEffect effect) {
|
||||
super(effect);
|
||||
this.cardId = effect.cardId;
|
||||
this.zoneChangeCounter = effect.zoneChangeCounter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuickenAsThoughEffect copy() {
|
||||
return new QuickenAsThoughEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID sourceId, Ability source, Game game) {
|
||||
Card card = game.getCard(sourceId);
|
||||
if (card != null && (cardId == null || (cardId.equals(sourceId) && zoneChangeCounter == card.getZoneChangeCounter()))) {
|
||||
if (card.getCardType().contains(CardType.SORCERY) && card.getOwnerId().equals(source.getControllerId())) {
|
||||
if (card.getSpellAbility().isInUseableZone(game, card, false)) {
|
||||
if (cardId == null) {
|
||||
cardId = card.getId();
|
||||
zoneChangeCounter = card.getZoneChangeCounter();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue