mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
more work at Kicker - now we shall use special KickerManaCost for it
This commit is contained in:
parent
0491c34005
commit
8dfd3bfc9d
6 changed files with 43 additions and 27 deletions
|
@ -28,7 +28,6 @@
|
|||
|
||||
package mage.sets.apocalypse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
|
@ -37,11 +36,9 @@ import mage.Constants.Rarity;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.KickerManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
|
@ -59,7 +56,7 @@ public class DesolationAngel extends CardImpl<DesolationAngel> {
|
|||
this.color.setBlack(true);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(4);
|
||||
this.getSpellAbility().addOptionalCost(new ManaCostsImpl("{W}{W}"));
|
||||
this.getSpellAbility().addOptionalCost(new KickerManaCost("{W}{W}"));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DesolationAngelEntersBattlefieldEffect()));
|
||||
}
|
||||
|
||||
|
@ -90,8 +87,8 @@ class DesolationAngelEntersBattlefieldEffect extends OneShotEffect<DesolationAng
|
|||
boolean kicked = false;
|
||||
if (p != null) {
|
||||
for (Object cost : p.getSpellAbility().getOptionalCosts()) {
|
||||
if (cost instanceof ManaCost) {
|
||||
if (((ManaCost) cost).isPaid()) {
|
||||
if (cost instanceof KickerManaCost) {
|
||||
if (((KickerManaCost) cost).isPaid()) {
|
||||
kicked = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,25 +32,14 @@ import java.util.UUID;
|
|||
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.TargetController;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.costs.mana.KickerManaCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.HexproofAbility;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterStackObject;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
@ -68,7 +57,7 @@ public class VinesOfVastwood extends CardImpl<VinesOfVastwood> {
|
|||
this.getSpellAbility().addTarget(target);
|
||||
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new HexproofAbility(), Duration.EndOfTurn));
|
||||
|
||||
this.getSpellAbility().addOptionalCost(new ManaCostsImpl("{G}"));
|
||||
this.getSpellAbility().addOptionalCost(new KickerManaCost("{G}"));
|
||||
this.getSpellAbility().addEffect(new ConditionalContinousEffect(new BoostTargetEffect(4, 4, Duration.EndOfTurn),
|
||||
KickedCondition.getInstance(), staticText));
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import mage.abilities.costs.AlternativeCost;
|
|||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.costs.mana.KickerManaCost;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
|
@ -56,8 +57,6 @@ import mage.target.Targets;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.management.openmbean.ArrayType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.KickerManaCost;
|
||||
import mage.cards.Card;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
|
@ -28,8 +26,8 @@ public class KickedCondition implements Condition {
|
|||
boolean kicked = false;
|
||||
if (p != null) {
|
||||
for (Object cost : p.getSpellAbility().getOptionalCosts()) {
|
||||
if (cost instanceof ManaCost) {
|
||||
if (((ManaCost) cost).isPaid()) {
|
||||
if (cost instanceof KickerManaCost) {
|
||||
if (((KickerManaCost) cost).isPaid()) {
|
||||
kicked = true;
|
||||
}
|
||||
}
|
||||
|
|
32
Mage/src/mage/abilities/costs/mana/KickerManaCost.java
Normal file
32
Mage/src/mage/abilities/costs/mana/KickerManaCost.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
package mage.abilities.costs.mana;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* This cost must be used only as optional mana cost in cards with Kicker
|
||||
* @author Loki
|
||||
*/
|
||||
public class KickerManaCost extends ManaCostsImpl {
|
||||
public KickerManaCost(String manaString) {
|
||||
super(manaString);
|
||||
}
|
||||
|
||||
public KickerManaCost(final KickerManaCost cost) {
|
||||
super(cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KickerManaCost copy() {
|
||||
return new KickerManaCost(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return "Kicker - " + super.getText();
|
||||
}
|
||||
}
|
|
@ -39,6 +39,7 @@ import mage.abilities.Abilities;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.KickerManaCost;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
|
Loading…
Reference in a new issue