mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
spjspj - Grip of Phyresis (C16)
This commit is contained in:
parent
c4e69540b9
commit
e362dea7e6
3 changed files with 194 additions and 0 deletions
114
Mage.Sets/src/mage/cards/g/GripOfPhyresis.java
Normal file
114
Mage.Sets/src/mage/cards/g/GripOfPhyresis.java
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
/*
|
||||||
|
* 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.g;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.effects.common.CreateTokenEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
|
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.game.permanent.token.GermToken;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.Target;
|
||||||
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author spjspj
|
||||||
|
*/
|
||||||
|
public class GripOfPhyresis extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterPermanent filter = new FilterPermanent("Equipment");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||||
|
filter.add(new SubtypePredicate("Equipment"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public GripOfPhyresis(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}");
|
||||||
|
|
||||||
|
// Gain control of target Equipment, then create a 0/0 black Germ creature token and attach that Equipment to it.
|
||||||
|
GainControlTargetEffect effect = new GainControlTargetEffect(Duration.EndOfGame, true);
|
||||||
|
effect.setText("Gain control of target equipment");
|
||||||
|
this.getSpellAbility().addEffect(effect);
|
||||||
|
Target targetEquipment = new TargetPermanent(filter);
|
||||||
|
this.getSpellAbility().addTarget(targetEquipment);
|
||||||
|
this.getSpellAbility().addEffect(new GripOfPhyresisEffect());
|
||||||
|
}
|
||||||
|
|
||||||
|
public GripOfPhyresis(final GripOfPhyresis card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GripOfPhyresis copy() {
|
||||||
|
return new GripOfPhyresis(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class GripOfPhyresisEffect extends CreateTokenEffect {
|
||||||
|
|
||||||
|
GripOfPhyresisEffect() {
|
||||||
|
super(new GermToken());
|
||||||
|
}
|
||||||
|
|
||||||
|
GripOfPhyresisEffect(final GripOfPhyresisEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
Permanent equipment = game.getPermanent(source.getFirstTarget());
|
||||||
|
|
||||||
|
if (controller != null && equipment != null) {
|
||||||
|
if (super.apply(game, source)) {
|
||||||
|
Permanent germ = game.getPermanent(this.getLastAddedTokenId());
|
||||||
|
if (germ != null) {
|
||||||
|
germ.addAttachment(equipment.getId(), game);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GripOfPhyresisEffect copy() {
|
||||||
|
return new GripOfPhyresisEffect(this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -180,6 +180,7 @@ public class Commander2016 extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Grab the Reins", 126, Rarity.UNCOMMON, mage.cards.g.GrabTheReins.class));
|
cards.add(new SetCardInfo("Grab the Reins", 126, Rarity.UNCOMMON, mage.cards.g.GrabTheReins.class));
|
||||||
cards.add(new SetCardInfo("Grand Coliseum", 299, Rarity.RARE, mage.cards.g.GrandColiseum.class));
|
cards.add(new SetCardInfo("Grand Coliseum", 299, Rarity.RARE, mage.cards.g.GrandColiseum.class));
|
||||||
cards.add(new SetCardInfo("Grave Upheaval", 31, Rarity.UNCOMMON, mage.cards.g.GraveUpheaval.class));
|
cards.add(new SetCardInfo("Grave Upheaval", 31, Rarity.UNCOMMON, mage.cards.g.GraveUpheaval.class));
|
||||||
|
cards.add(new SetCardInfo("Grip of Phyresis", 9, Rarity.UNCOMMON, mage.cards.g.GripOfPhyresis.class));
|
||||||
cards.add(new SetCardInfo("Gruul Signet", 256, Rarity.COMMON, mage.cards.g.GruulSignet.class));
|
cards.add(new SetCardInfo("Gruul Signet", 256, Rarity.COMMON, mage.cards.g.GruulSignet.class));
|
||||||
cards.add(new SetCardInfo("Gruul Turf", 300, Rarity.UNCOMMON, mage.cards.g.GruulTurf.class));
|
cards.add(new SetCardInfo("Gruul Turf", 300, Rarity.UNCOMMON, mage.cards.g.GruulTurf.class));
|
||||||
cards.add(new SetCardInfo("Guiltfeeder", 112, Rarity.RARE, mage.cards.g.Guiltfeeder.class));
|
cards.add(new SetCardInfo("Guiltfeeder", 112, Rarity.RARE, mage.cards.g.Guiltfeeder.class));
|
||||||
|
|
79
Mage/src/main/java/mage/game/permanent/token/GermToken.java
Normal file
79
Mage/src/main/java/mage/game/permanent/token/GermToken.java
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
/*
|
||||||
|
* 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.game.permanent.token;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author spjspj
|
||||||
|
*/
|
||||||
|
public class GermToken extends Token {
|
||||||
|
|
||||||
|
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
tokenImageSets.addAll(Arrays.asList("NPH", "MBS", "SOM", "EMA", "C16"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public GermToken() {
|
||||||
|
this(null, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GermToken(String setCode) {
|
||||||
|
this(setCode, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GermToken(String setCode, int tokenType) {
|
||||||
|
super("Germ", "0/0 black Germ creature token");
|
||||||
|
availableImageSetCodes = tokenImageSets;
|
||||||
|
setOriginalExpansionSetCode(setCode);
|
||||||
|
cardType.add(CardType.CREATURE);
|
||||||
|
color.setBlack(true);
|
||||||
|
subtype.add("Germ");
|
||||||
|
power = new MageInt(0);
|
||||||
|
toughness = new MageInt(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setExpansionSetCodeForImage(String code) {
|
||||||
|
super.setExpansionSetCodeForImage(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GermToken(final GermToken token) {
|
||||||
|
super(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GermToken copy() {
|
||||||
|
return new GermToken(this);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue