diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 0d435391cc..3b8209c9ae 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -431,6 +431,8 @@ public class GameController implements GameCallback { gameZone = Zone.BATTLEFIELD; } else if ("graveyard".equalsIgnoreCase(zone)) { gameZone = Zone.GRAVEYARD; + } else if ("library".equalsIgnoreCase(zone)) { + gameZone = Zone.LIBRARY; } else { continue; // go parse next line } diff --git a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java index 5cd70edf17..35223623c9 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java @@ -101,7 +101,7 @@ class FinestHourAbility extends TriggeredAbilityImpl { if (game.getCombat().attacksAlone()) { this.addTarget(new TargetCreaturePermanent()); this.targets.get(0).add(game.getCombat().getAttackers().get(0), game); - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java index 90a2a785c7..9673fbacf5 100644 --- a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java +++ b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java @@ -89,7 +89,7 @@ class FontOfMythosAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.DRAW_STEP_PRE) { this.addTarget(new TargetPlayer()); this.targets.get(0).add(event.getPlayerId(),game); - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/conflux/MartialCoup.java b/Mage.Sets/src/mage/sets/conflux/MartialCoup.java index ecfa9ae1a6..c34dd17e61 100644 --- a/Mage.Sets/src/mage/sets/conflux/MartialCoup.java +++ b/Mage.Sets/src/mage/sets/conflux/MartialCoup.java @@ -90,8 +90,8 @@ class MartialCoupEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int amount = 0; - if (source.getCosts().getVariableCosts().size() > 0) { - amount = source.getCosts().getVariableCosts().get(0).getAmount(); + if (source.getManaCosts().getVariableCosts().size() > 0) { + amount = source.getManaCosts().getVariableCosts().get(0).getAmount(); } if (amount > 4) { diff --git a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java index cd2b7a7f37..a9020a4179 100644 --- a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java +++ b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java @@ -141,7 +141,7 @@ class QuenchableFireDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean apply(Game game, Ability source) { - int amount = source.getCosts().getVariableCosts().get(0).getAmount(); + int amount = source.getManaCosts().getVariableCosts().get(0).getAmount(); for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { permanent.damage(amount, source.getId(), game, true); diff --git a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java index f5db12c4ed..f6b8860299 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java +++ b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java @@ -88,7 +88,7 @@ class HowlingMineAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.DRAW_STEP_PRE) { this.addTarget(new TargetPlayer()); this.targets.get(0).add(event.getPlayerId(), game); - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/magic2010/IceCage.java b/Mage.Sets/src/mage/sets/magic2010/IceCage.java index b75f03934e..03ae60bb09 100644 --- a/Mage.Sets/src/mage/sets/magic2010/IceCage.java +++ b/Mage.Sets/src/mage/sets/magic2010/IceCage.java @@ -151,7 +151,7 @@ class IceCageAbility extends TriggeredAbilityImpl { Permanent enchantment = game.getPermanent(sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { if (event.getTargetId().equals(enchantment.getAttachedTo())) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2010/MindSpring.java b/Mage.Sets/src/mage/sets/magic2010/MindSpring.java index 2a1fc1c417..b63406a77e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MindSpring.java +++ b/Mage.Sets/src/mage/sets/magic2010/MindSpring.java @@ -84,7 +84,7 @@ class MindSpringEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int amount = source.getCosts().getVariableCosts().get(0).getAmount(); + int amount = source.getManaCosts().getVariableCosts().get(0).getAmount(); Player player = game.getPlayer(source.getControllerId()); if (player != null) { player.drawCards(amount, game); diff --git a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java index a82ce43ea2..24fdd3831c 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java +++ b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java @@ -189,7 +189,7 @@ public class ProteanHydra extends CardImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.COUNTER_REMOVED && event.getData().equals("+1/+1") && event.getTargetId().equals(this.getSourceId())) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; @@ -220,7 +220,7 @@ public class ProteanHydra extends CardImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/magic2010/WallOfFrost.java b/Mage.Sets/src/mage/sets/magic2010/WallOfFrost.java index c8d93b601f..c20125024d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/WallOfFrost.java +++ b/Mage.Sets/src/mage/sets/magic2010/WallOfFrost.java @@ -97,7 +97,7 @@ class WallOfFrostAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.BLOCKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { this.addTarget(new TargetCreaturePermanent()); this.getTargets().get(0).add(event.getTargetId(), game); - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java index 623648550d..a70f3cfa4f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java +++ b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java @@ -92,7 +92,7 @@ class AjanisPridemateAbility extends TriggeredAbilityImpl { TargetStackObject target = new TargetStackObject(); target.add(event.getSourceId(), game); this.addTarget(target); - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; @@ -135,13 +135,13 @@ class FrostTitanAbility2 extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getToZone() == Zone.BATTLEFIELD) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java b/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java index b2f124616a..7c12a9ff87 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java @@ -95,13 +95,13 @@ class GraveTitanAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getToZone() == Zone.BATTLEFIELD) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java index f1e9af2368..87318387f7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java @@ -99,13 +99,13 @@ class InfernoTitanAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getToZone() == Zone.BATTLEFIELD) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2011/JacesErasure.java b/Mage.Sets/src/mage/sets/magic2011/JacesErasure.java index a5e26df2a8..a1d6bdf522 100644 --- a/Mage.Sets/src/mage/sets/magic2011/JacesErasure.java +++ b/Mage.Sets/src/mage/sets/magic2011/JacesErasure.java @@ -89,7 +89,7 @@ class JacesErasureAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.DREW_CARD && event.getPlayerId().equals(controllerId)) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java b/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java index d57bb8efad..66b88ef9ed 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java +++ b/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java @@ -89,7 +89,7 @@ class LilianasCaressAbility extends TriggeredAbilityImpl if (event.getType() == EventType.DISCARDED_CARD && game.getOpponents(controllerId).contains(event.getPlayerId())) { this.addTarget(new TargetPlayer()); this.targets.get(0).add(event.getPlayerId(), game); - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java index 0c0ce58c71..9b4c14bfb4 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java +++ b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java @@ -142,7 +142,7 @@ class MystifyingMazeDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.TARGETED && event.getTargetId().equals(sourceId)) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java index ebbc03d594..2f162a894a 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java +++ b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java @@ -134,7 +134,7 @@ class PrimalCocoonAbility2 extends TriggeredAbilityImpl { if (event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.BLOCKER_DECLARED) { Permanent enchantment = game.getPermanent(sourceId); if (enchantment != null && enchantment.getAttachedTo() != null && event.getSourceId() != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java b/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java index 1545232518..9236aa78a8 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java @@ -99,13 +99,13 @@ class PrimevalTitanAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getToZone() == Zone.BATTLEFIELD) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java b/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java index bccc79b5bc..b60d7961a4 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java +++ b/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java @@ -41,6 +41,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.game.Game; import mage.game.permanent.Permanent; @@ -61,6 +62,7 @@ public class SerraAscendant extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); + this.addAbility(LifelinkAbility.getInstance()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SerraAscendantEffect())); } diff --git a/Mage.Sets/src/mage/sets/magic2011/SorcerersStrongbox.java b/Mage.Sets/src/mage/sets/magic2011/SorcerersStrongbox.java index 6038bd9643..4bd5a2a445 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SorcerersStrongbox.java +++ b/Mage.Sets/src/mage/sets/magic2011/SorcerersStrongbox.java @@ -58,7 +58,7 @@ public class SorcerersStrongbox extends CardImpl { Costs costs = new CostsImpl(); costs.add(new GenericManaCost(2)); costs.add(new TapSourceCost()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryEffect(2), costs)); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SorcerersStrongboxEffect(), costs)); } public SorcerersStrongbox(final SorcerersStrongbox card) { diff --git a/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java b/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java index da4df37de3..066d4efa1b 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java +++ b/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java @@ -61,7 +61,7 @@ public class SquadronHawk extends CardImpl { this.addAbility(FlyingAbility.getInstance()); TargetCardInLibrary target = new TargetCardInLibrary(3, filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target), true)); } public SquadronHawk(final SquadronHawk card) { diff --git a/Mage.Sets/src/mage/sets/magic2011/StormtideLeviathan.java b/Mage.Sets/src/mage/sets/magic2011/StormtideLeviathan.java index 4d384e6fe2..e7b9fc0c2d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/StormtideLeviathan.java +++ b/Mage.Sets/src/mage/sets/magic2011/StormtideLeviathan.java @@ -149,8 +149,8 @@ class StormtideLeviathanEffect2 extends ReplacementEffectImpl { public SunTitan(UUID ownerId) { - super(ownerId, 35, "Sun Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + super(ownerId, 35, "Sun Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); this.expansionSetCode = "M11"; this.subtype.add("Giant"); this.color.setWhite(true); @@ -117,13 +117,13 @@ class SunTitanAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getToZone() == Zone.BATTLEFIELD) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } @@ -132,7 +132,7 @@ class SunTitanAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Whenever Primeval Titan enters the battlefield or attacks, you may search your library for up to two land cards, put them onto the battlefield tapped, then shuffle your library."; + return "Whenever Sun Titan enters the battlefield or attacks, you may return target permanent card with converted mana cost 3 or less from your graveyard to the battlefield."; } } diff --git a/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java b/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java index 222b464057..f4a3b15d9e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java +++ b/Mage.Sets/src/mage/sets/magic2011/VengefulArchon.java @@ -101,8 +101,8 @@ class VengefulArchonEffect extends PreventionEffectImpl { @Override public void init(Ability source, Game game) { - if (source.getCosts().getVariableCosts().size() > 0) - amount = source.getCosts().getVariableCosts().get(0).getAmount(); + if (source.getManaCosts().getVariableCosts().size() > 0) + amount = source.getManaCosts().getVariableCosts().get(0).getAmount(); } @Override @@ -142,4 +142,9 @@ class VengefulArchonEffect extends PreventionEffectImpl { return false; } + @Override + public String getText(Ability source) { + return "Prevent the next X damage that would be dealt to you this turn. If damage is prevented this way, Vengeful Archon deals that much damage to target player"; + } + } diff --git a/Mage.Sets/src/mage/sets/magic2011/WildEvocation.java b/Mage.Sets/src/mage/sets/magic2011/WildEvocation.java index 791eeb6f59..5fa2bd8493 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WildEvocation.java +++ b/Mage.Sets/src/mage/sets/magic2011/WildEvocation.java @@ -95,7 +95,7 @@ class WildEvocationAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.DRAW_STEP_PRE) { this.addTarget(new TargetPlayer()); this.targets.get(0).add(event.getPlayerId(), game); - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeaGateOracle.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeaGateOracle.java index b880119c42..d96ead954e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeaGateOracle.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SeaGateOracle.java @@ -113,6 +113,7 @@ class SeaGateOracleEffect extends OneShotEffect { player.choose(cards, target, game); card = cards.get(target.getFirstTarget(), game); card.moveToZone(Zone.HAND, source.getId(), game, false); + cards.remove(card); for (Card card1: cards.getCards(game)) { card1.moveToZone(Zone.LIBRARY, source.getId(), game, false); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java index a751ebfdd6..bebb346472 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java @@ -99,7 +99,7 @@ class VengevineAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) { Watcher watcher = game.getState().getWatchers().get(controllerId, "CreatureCast"); if (watcher != null && watcher.conditionMet()) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java index b71448b606..77127caa93 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java @@ -102,7 +102,7 @@ class RafiqOfTheManyAbility extends TriggeredAbilityImpl if (game.getCombat().attacksAlone()) { this.addTarget(new TargetCreaturePermanent()); this.targets.get(0).add(game.getCombat().getAttackers().get(0), game); - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/tenth/AngelsFeather.java b/Mage.Sets/src/mage/sets/tenth/AngelsFeather.java index 72fc30db1f..8c2c35e295 100644 --- a/Mage.Sets/src/mage/sets/tenth/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/tenth/AngelsFeather.java @@ -88,7 +88,7 @@ class AngelsFeatherAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getColor().isWhite()) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/tenth/DemonsHorn.java b/Mage.Sets/src/mage/sets/tenth/DemonsHorn.java index 5e8135a22f..7a6990f21b 100644 --- a/Mage.Sets/src/mage/sets/tenth/DemonsHorn.java +++ b/Mage.Sets/src/mage/sets/tenth/DemonsHorn.java @@ -88,7 +88,7 @@ class DemonsHornAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getColor().isBlack()) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/tenth/DragonsClaw.java b/Mage.Sets/src/mage/sets/tenth/DragonsClaw.java index fca944816b..d32466fb71 100644 --- a/Mage.Sets/src/mage/sets/tenth/DragonsClaw.java +++ b/Mage.Sets/src/mage/sets/tenth/DragonsClaw.java @@ -88,7 +88,7 @@ class DragonsClawAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getColor().isRed()) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/tenth/KrakensEye.java b/Mage.Sets/src/mage/sets/tenth/KrakensEye.java index c2cdf0520d..6e6ec2619a 100644 --- a/Mage.Sets/src/mage/sets/tenth/KrakensEye.java +++ b/Mage.Sets/src/mage/sets/tenth/KrakensEye.java @@ -88,7 +88,7 @@ class KrakensEyeAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getColor().isBlue()) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/tenth/WurmsTooth.java b/Mage.Sets/src/mage/sets/tenth/WurmsTooth.java index e0c02bc783..ec709220c4 100644 --- a/Mage.Sets/src/mage/sets/tenth/WurmsTooth.java +++ b/Mage.Sets/src/mage/sets/tenth/WurmsTooth.java @@ -88,7 +88,7 @@ class WurmsToothAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getColor().isGreen()) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java b/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java index 6f4c29aa13..a4da8b9ef5 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java +++ b/Mage.Sets/src/mage/sets/zendikar/BeastmasterAscension.java @@ -95,7 +95,7 @@ class BeastmasterAscensionAbility extends TriggeredAbilityImpl> implements Ability { result &= effect.apply(game, this); } else { - ContinuousEffect cEffect = (ContinuousEffect) effect; - cEffect.init(this, game); - game.addEffect(cEffect, this); + game.addEffect((ContinuousEffect) effect, this); } } } diff --git a/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java b/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java index 426f4ccda6..78a7e4f5be 100644 --- a/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java @@ -60,7 +60,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)) { this.addTarget(new TargetPlayer()); this.targets.get(0).add(event.getPlayerId(), game); - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } return false; diff --git a/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldTriggeredAbility.java b/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldTriggeredAbility.java index 5cc32d5ae0..e61bc0968e 100644 --- a/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldTriggeredAbility.java @@ -55,7 +55,7 @@ public class PutIntoGraveFromBattlefieldTriggeredAbility extends TriggeredAbilit if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java b/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java index 5c03d6bcf6..01caeb5b82 100644 --- a/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java @@ -56,7 +56,7 @@ public class SimpleTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean apply(Game game, Ability source) { - int amount = source.getCosts().getVariableCosts().get(0).getAmount(); + int amount = source.getManaCosts().getVariableCosts().get(0).getAmount(); Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { permanent.damage(amount, source.getId(), game, true); diff --git a/Mage/src/mage/abilities/keyword/CascadeAbility.java b/Mage/src/mage/abilities/keyword/CascadeAbility.java index b04cac6294..04175ef581 100644 --- a/Mage/src/mage/abilities/keyword/CascadeAbility.java +++ b/Mage/src/mage/abilities/keyword/CascadeAbility.java @@ -63,7 +63,7 @@ public class CascadeAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getSourceId().equals(this.getSourceId())) { - trigger(game, event.getPlayerId()); + trigger(game, this.controllerId); return true; } } diff --git a/Mage/src/mage/abilities/keyword/ExaltedAbility.java b/Mage/src/mage/abilities/keyword/ExaltedAbility.java index 19f5c30d6f..31451b54ff 100644 --- a/Mage/src/mage/abilities/keyword/ExaltedAbility.java +++ b/Mage/src/mage/abilities/keyword/ExaltedAbility.java @@ -63,7 +63,7 @@ public class ExaltedAbility extends TriggeredAbilityImpl { TargetCreaturePermanent target = new TargetCreaturePermanent(); this.addTarget(target); this.getTargets().get(0).add(game.getCombat().getAttackers().get(0),game); - trigger(game, event.getPlayerId()); + trigger(game, controllerId); return true; } } diff --git a/Mage/src/mage/abilities/keyword/UnearthAbility.java b/Mage/src/mage/abilities/keyword/UnearthAbility.java index 24b2629cfc..523ba85d23 100644 --- a/Mage/src/mage/abilities/keyword/UnearthAbility.java +++ b/Mage/src/mage/abilities/keyword/UnearthAbility.java @@ -101,7 +101,7 @@ class UnearthDelayedTriggeredAbility extends DelayedTriggeredAbility> implements Game, Serializa @Override public void addEffect(ContinuousEffect continuousEffect, Ability source) { + continuousEffect.init(source, this); state.addEffect(continuousEffect, source); }