From 9f64c00dc50a96a5f14a96c8845cd43fa9d0a860 Mon Sep 17 00:00:00 2001 From: BetaSteward Date: Fri, 19 Aug 2011 22:16:31 -0400 Subject: [PATCH] moved BloodthirstWatcher to player - does not need be added to card anymore --- Mage.Sets/src/mage/sets/magic2012/BloodOgre.java | 2 -- .../mage/sets/magic2012/BloodlordOfVaasgoth.java | 13 +------------ .../src/mage/sets/magic2012/BloodrageVampire.java | 2 -- Mage.Sets/src/mage/sets/magic2012/CarnageWurm.java | 2 -- .../src/mage/sets/magic2012/DuskhunterBat.java | 2 -- .../src/mage/sets/magic2012/FurybornHellkite.java | 2 -- .../src/mage/sets/magic2012/GorehornMinotaurs.java | 2 -- .../src/mage/sets/magic2012/LurkingCrocodile.java | 2 -- .../src/mage/sets/magic2012/VampireOutcasts.java | 2 -- Mage/src/mage/players/PlayerImpl.java | 5 +++++ .../mage/watchers/common/BloodthirstWatcher.java | 2 +- 11 files changed, 7 insertions(+), 29 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2012/BloodOgre.java b/Mage.Sets/src/mage/sets/magic2012/BloodOgre.java index 0bef234f17..ef468a8807 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BloodOgre.java +++ b/Mage.Sets/src/mage/sets/magic2012/BloodOgre.java @@ -34,7 +34,6 @@ import mage.MageInt; import mage.abilities.keyword.BloodthirstAbility; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.watchers.common.BloodthirstWatcher; /** * @@ -52,7 +51,6 @@ public class BloodOgre extends CardImpl { this.toughness = new MageInt(2); this.addAbility(new BloodthirstAbility(1)); - this.addWatcher(new BloodthirstWatcher()); this.addAbility(FirstStrikeAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java index d5866b56e2..fd0da2a5a1 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java +++ b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java @@ -31,13 +31,9 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; -import mage.abilities.Abilities; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.BloodthirstAbility; import mage.cards.CardImpl; import mage.filter.Filter; @@ -45,9 +41,6 @@ import mage.filter.FilterCard; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; -import mage.game.stack.StackObject; -import mage.target.TargetSpell; -import mage.watchers.common.BloodthirstWatcher; import java.util.UUID; @@ -77,7 +70,6 @@ public class BloodlordOfVaasgoth extends CardImpl { // Bloodthirst 3 this.addAbility(new BloodthirstAbility(3)); - this.addWatcher(new BloodthirstWatcher()); // Whenever you cast a Vampire creature spell, it gains bloodthirst 3. this.addAbility(new SpellCastTriggeredAbility(new BloodlordOfVaasgothEffect(), filterCard, false, true)); @@ -117,10 +109,7 @@ class BloodlordOfVaasgothEffect extends ContinuousEffectImpl { if (object != null) { Permanent permanent = game.getPermanent(object.getSourceId()); if (permanent != null) { - Ability bloodthirst = ability.copy(); - bloodthirst.newId(); - bloodthirst.setSourceId(source.getSourceId()); - permanent.addAbility(bloodthirst); + permanent.addAbility(ability); return true; } } else { diff --git a/Mage.Sets/src/mage/sets/magic2012/BloodrageVampire.java b/Mage.Sets/src/mage/sets/magic2012/BloodrageVampire.java index 9cb357ce47..a1379eabd5 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BloodrageVampire.java +++ b/Mage.Sets/src/mage/sets/magic2012/BloodrageVampire.java @@ -33,7 +33,6 @@ import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.keyword.BloodthirstAbility; import mage.cards.CardImpl; -import mage.watchers.common.BloodthirstWatcher; /** * @@ -51,7 +50,6 @@ public class BloodrageVampire extends CardImpl { this.toughness = new MageInt(1); this.addAbility(new BloodthirstAbility(1)); - this.addWatcher(new BloodthirstWatcher()); } public BloodrageVampire(final BloodrageVampire card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/CarnageWurm.java b/Mage.Sets/src/mage/sets/magic2012/CarnageWurm.java index 80ce0642a0..96d1b0fb8f 100644 --- a/Mage.Sets/src/mage/sets/magic2012/CarnageWurm.java +++ b/Mage.Sets/src/mage/sets/magic2012/CarnageWurm.java @@ -34,7 +34,6 @@ import mage.MageInt; import mage.abilities.keyword.BloodthirstAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.watchers.common.BloodthirstWatcher; /** * @@ -52,7 +51,6 @@ public class CarnageWurm extends CardImpl { this.toughness = new MageInt(6); this.addAbility(new BloodthirstAbility(3)); - this.addWatcher(new BloodthirstWatcher()); this.addAbility(TrampleAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/magic2012/DuskhunterBat.java b/Mage.Sets/src/mage/sets/magic2012/DuskhunterBat.java index 132434e543..da0534ec77 100644 --- a/Mage.Sets/src/mage/sets/magic2012/DuskhunterBat.java +++ b/Mage.Sets/src/mage/sets/magic2012/DuskhunterBat.java @@ -34,7 +34,6 @@ import mage.MageInt; import mage.abilities.keyword.BloodthirstAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.watchers.common.BloodthirstWatcher; /** * @@ -52,7 +51,6 @@ public class DuskhunterBat extends CardImpl { this.toughness = new MageInt(1); this.addAbility(new BloodthirstAbility(1)); - this.addWatcher(new BloodthirstWatcher()); this.addAbility(FlyingAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/magic2012/FurybornHellkite.java b/Mage.Sets/src/mage/sets/magic2012/FurybornHellkite.java index 122078a9af..89b038e432 100644 --- a/Mage.Sets/src/mage/sets/magic2012/FurybornHellkite.java +++ b/Mage.Sets/src/mage/sets/magic2012/FurybornHellkite.java @@ -34,7 +34,6 @@ import mage.MageInt; import mage.abilities.keyword.BloodthirstAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.watchers.common.BloodthirstWatcher; /** * @@ -52,7 +51,6 @@ public class FurybornHellkite extends CardImpl { this.toughness = new MageInt(6); this.addAbility(new BloodthirstAbility(6)); - this.addWatcher(new BloodthirstWatcher()); this.addAbility(FlyingAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/magic2012/GorehornMinotaurs.java b/Mage.Sets/src/mage/sets/magic2012/GorehornMinotaurs.java index c1b9e2cdd0..62697f8879 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GorehornMinotaurs.java +++ b/Mage.Sets/src/mage/sets/magic2012/GorehornMinotaurs.java @@ -33,7 +33,6 @@ import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.keyword.BloodthirstAbility; import mage.cards.CardImpl; -import mage.watchers.common.BloodthirstWatcher; /** * @@ -52,7 +51,6 @@ public class GorehornMinotaurs extends CardImpl { this.toughness = new MageInt(3); this.addAbility(new BloodthirstAbility(2)); - this.addWatcher(new BloodthirstWatcher()); } public GorehornMinotaurs(final GorehornMinotaurs card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/LurkingCrocodile.java b/Mage.Sets/src/mage/sets/magic2012/LurkingCrocodile.java index 03f99a72f2..2d7bb87d2e 100644 --- a/Mage.Sets/src/mage/sets/magic2012/LurkingCrocodile.java +++ b/Mage.Sets/src/mage/sets/magic2012/LurkingCrocodile.java @@ -34,7 +34,6 @@ import mage.MageInt; import mage.abilities.keyword.BloodthirstAbility; import mage.abilities.keyword.IslandwalkAbility; import mage.cards.CardImpl; -import mage.watchers.common.BloodthirstWatcher; /** * @@ -52,7 +51,6 @@ public class LurkingCrocodile extends CardImpl { this.toughness = new MageInt(2); this.addAbility(new BloodthirstAbility(1)); - this.addWatcher(new BloodthirstWatcher()); this.addAbility(new IslandwalkAbility()); } diff --git a/Mage.Sets/src/mage/sets/magic2012/VampireOutcasts.java b/Mage.Sets/src/mage/sets/magic2012/VampireOutcasts.java index a387e3f666..00474ae8d0 100644 --- a/Mage.Sets/src/mage/sets/magic2012/VampireOutcasts.java +++ b/Mage.Sets/src/mage/sets/magic2012/VampireOutcasts.java @@ -34,7 +34,6 @@ import mage.MageInt; import mage.abilities.keyword.BloodthirstAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; -import mage.watchers.common.BloodthirstWatcher; /** * @@ -52,7 +51,6 @@ public class VampireOutcasts extends CardImpl { this.toughness = new MageInt(2); this.addAbility(new BloodthirstAbility(2)); - this.addWatcher(new BloodthirstWatcher()); this.addAbility(LifelinkAbility.getInstance()); } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 1604787ed4..c2972cf110 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -68,6 +68,8 @@ import mage.game.events.GameEvent; import mage.game.stack.StackAbility; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetDiscard; +import mage.watchers.Watcher; +import mage.watchers.common.BloodthirstWatcher; public abstract class PlayerImpl> implements Player, Serializable { @@ -171,6 +173,9 @@ public abstract class PlayerImpl> implements Player, Ser this.left = false; this.passed = false; this.passedTurn = false; + Watcher bloodthirst = new BloodthirstWatcher(); + bloodthirst.setControllerId(playerId); + game.getState().getWatchers().add(bloodthirst); } @Override diff --git a/Mage/src/mage/watchers/common/BloodthirstWatcher.java b/Mage/src/mage/watchers/common/BloodthirstWatcher.java index a666da6912..1cecd5fd14 100644 --- a/Mage/src/mage/watchers/common/BloodthirstWatcher.java +++ b/Mage/src/mage/watchers/common/BloodthirstWatcher.java @@ -6,7 +6,7 @@ import mage.game.events.GameEvent; import mage.watchers.WatcherImpl; /** - * Must be installed to card for proper Bloodthirst work + * Must be installed to player for proper Bloodthirst work * @author Loki */ public class BloodthirstWatcher extends WatcherImpl {