mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
* Some fixes to Liting Refrain, Dying Wish and Violet Pall.
This commit is contained in:
parent
ddceaa3e54
commit
21cfe0611c
4 changed files with 95 additions and 37 deletions
|
|
@ -28,17 +28,21 @@
|
||||||
package mage.sets.gatecrash;
|
package mage.sets.gatecrash;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.DiesAttachedTriggeredAbility;
|
import mage.abilities.common.DiesAttachedTriggeredAbility;
|
||||||
import mage.abilities.dynamicvalue.DynamicValue;
|
import mage.abilities.dynamicvalue.DynamicValue;
|
||||||
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.AttachEffect;
|
import mage.abilities.effects.common.AttachEffect;
|
||||||
import mage.abilities.effects.common.GainLifeEffect;
|
import mage.abilities.effects.common.GainLifeEffect;
|
||||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||||
import mage.abilities.keyword.EnchantAbility;
|
import mage.abilities.keyword.EnchantAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
|
@ -62,9 +66,8 @@ public class DyingWish extends CardImpl {
|
||||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
|
||||||
// When enchanted creature dies, target player loses X life and you gain X life, where X is its power.
|
// When enchanted creature dies, target player loses X life and you gain X life, where X is its power.
|
||||||
DynamicValue attachedPower = new AttachedPermanentPowerCount();
|
DynamicValue attachedPower = new DyingWishAttachedPermanentPowerCount();
|
||||||
ability = new DiesAttachedTriggeredAbility(new LoseLifeTargetEffect(attachedPower), "enchanted creature");
|
ability = new DiesAttachedTriggeredAbility(new LoseLifeTargetEffect(attachedPower), "enchanted creature");
|
||||||
ability.addEffect(new GainLifeEffect(attachedPower));
|
ability.addEffect(new GainLifeEffect(attachedPower));
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
|
|
@ -80,3 +83,38 @@ public class DyingWish extends CardImpl {
|
||||||
return new DyingWish(this);
|
return new DyingWish(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class DyingWishAttachedPermanentPowerCount implements DynamicValue {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||||
|
Permanent attachmentPermanent = game.getPermanent(sourceAbility.getSourceId());
|
||||||
|
if (attachmentPermanent == null) {
|
||||||
|
attachmentPermanent = (Permanent) game.getLastKnownInformation(sourceAbility.getSourceId(), Zone.BATTLEFIELD, sourceAbility.getSourceObjectZoneChangeCounter());
|
||||||
|
}
|
||||||
|
if (attachmentPermanent != null && attachmentPermanent.getAttachedTo() != null) {
|
||||||
|
if (effect.getValue("attachedTo") != null) {
|
||||||
|
Permanent attached = (Permanent) effect.getValue("attachedTo");
|
||||||
|
if (attached != null) {
|
||||||
|
return attached.getPower().getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DynamicValue copy() {
|
||||||
|
return new DyingWishAttachedPermanentPowerCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "X";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage() {
|
||||||
|
return "its power";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,15 +28,18 @@
|
||||||
package mage.sets.morningtide;
|
package mage.sets.morningtide;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.effects.common.CreateTokenEffect;
|
import mage.abilities.effects.common.CreateTokenEffect;
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
|
import mage.game.permanent.token.Token;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -58,7 +61,7 @@ public class VioletPall extends CardImpl {
|
||||||
|
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
||||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new FaerieToken(), 1));
|
this.getSpellAbility().addEffect(new CreateTokenEffect(new VioletPallFaerieToken(), 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public VioletPall(final VioletPall card) {
|
public VioletPall(final VioletPall card) {
|
||||||
|
|
@ -70,3 +73,17 @@ public class VioletPall extends CardImpl {
|
||||||
return new VioletPall(this);
|
return new VioletPall(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class VioletPallFaerieToken extends Token {
|
||||||
|
|
||||||
|
VioletPallFaerieToken() {
|
||||||
|
super("Faerie Rogue", "1/1 black Faerie Rogue creature token with flying");
|
||||||
|
cardType.add(CardType.CREATURE);
|
||||||
|
color.setBlack(true);
|
||||||
|
subtype.add("Faerie");
|
||||||
|
subtype.add("Rogue");
|
||||||
|
power = new MageInt(1);
|
||||||
|
toughness = new MageInt(1);
|
||||||
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,30 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification, are
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
* permitted provided that the following conditions are met:
|
* permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
* conditions and the following disclaimer.
|
* conditions and the following disclaimer.
|
||||||
*
|
*
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
* 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
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
* provided with the distribution.
|
* provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* 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
|
* 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
|
* 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
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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
|
* 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
|
* 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
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* The views and conclusions contained in the software and documentation are those of the
|
* 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
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.counters;
|
package mage.counters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -34,6 +33,7 @@ package mage.counters;
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
*/
|
*/
|
||||||
public enum CounterType {
|
public enum CounterType {
|
||||||
|
|
||||||
AGE("age"),
|
AGE("age"),
|
||||||
AIM("aim"),
|
AIM("aim"),
|
||||||
ARROWHEAD("arrowhead"),
|
ARROWHEAD("arrowhead"),
|
||||||
|
|
@ -76,6 +76,7 @@ public enum CounterType {
|
||||||
POISON("poison"),
|
POISON("poison"),
|
||||||
PRESSURE("pressure"),
|
PRESSURE("pressure"),
|
||||||
QUEST("quest"),
|
QUEST("quest"),
|
||||||
|
SHIELD("shield"),
|
||||||
SLIME("slime"),
|
SLIME("slime"),
|
||||||
SPORE("spore"),
|
SPORE("spore"),
|
||||||
STORAGE("storage"),
|
STORAGE("storage"),
|
||||||
|
|
@ -85,6 +86,7 @@ public enum CounterType {
|
||||||
TOWER("tower"),
|
TOWER("tower"),
|
||||||
VELOCITY("velocity"),
|
VELOCITY("velocity"),
|
||||||
VILE("vile"),
|
VILE("vile"),
|
||||||
|
VERSE("verse"),
|
||||||
WISH("wish");
|
WISH("wish");
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
@ -112,7 +114,8 @@ public enum CounterType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create instance of counter type with defined amount of counters of the given type.
|
* Create instance of counter type with defined amount of counters of the
|
||||||
|
* given type.
|
||||||
*
|
*
|
||||||
* @param amount amount of counters of the given type.
|
* @param amount amount of counters of the given type.
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue