From f56e9b1de10b059c524250c185e37884e7a76acf Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 8 Apr 2016 13:45:12 +0200 Subject: [PATCH] * Bloodlord of Vaasgoth - Fixed that it did not apply bloodthirst properly to other vampires (fixes #1792). --- .../src/mage/sets/magic2012/BloodlordOfVaasgoth.java | 5 +---- .../test/cards/abilities/keywords/BloodthirstTest.java | 8 ++++++-- .../src/main/java/mage/game/permanent/PermanentCard.java | 9 +++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java index cc6cc96b15e..ee5929174b1 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java +++ b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java @@ -134,10 +134,7 @@ class BloodlordOfVaasgothEffect extends ContinuousEffectImpl { } Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); if (spell != null) { // Bloodthirst checked while spell is on the stack so needed to give it already to the spell - Ability ability1 = ability.copy(); - ability1.setSourceId(spell.getSourceId()); - ability1.setControllerId(spell.getControllerId()); - game.getState().addAbility(ability1, spell); + game.getState().addOtherAbility(spell.getCard(), ability, true); } } return true; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BloodthirstTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BloodthirstTest.java index 3143a2d1d1f..5556a18fba2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BloodthirstTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BloodthirstTest.java @@ -65,15 +65,16 @@ public class BloodthirstTest extends CardTestPlayerBase { */ @Test public void testBloodlord() { - addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 8); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); // Bloodthirst 3 // Whenever you cast a Vampire creature spell, it gains bloodthirst 3 - addCard(Zone.BATTLEFIELD, playerA, "Bloodlord of Vaasgoth"); + addCard(Zone.HAND, playerA, "Bloodlord of Vaasgoth"); // {3}{B}{B} addCard(Zone.HAND, playerA, "Barony Vampire"); // 3/2 {2}{B} addCard(Zone.HAND, playerA, "Lightning Bolt"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bloodlord of Vaasgoth"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barony Vampire"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -89,6 +90,9 @@ public class BloodthirstTest extends CardTestPlayerBase { } } Assert.assertTrue("Baron Vampire is missing the bloodthirst ability", bloodthirstFound); + assertPermanentCount(playerA, "Bloodlord of Vaasgoth", 1); + assertPowerToughness(playerA, "Bloodlord of Vaasgoth", 6, 6); + assertPermanentCount(playerA, "Barony Vampire", 1); assertPowerToughness(playerA, "Barony Vampire", 6, 5); } diff --git a/Mage/src/main/java/mage/game/permanent/PermanentCard.java b/Mage/src/main/java/mage/game/permanent/PermanentCard.java index 795f83501e0..0dacd6f63b9 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentCard.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentCard.java @@ -29,6 +29,7 @@ package mage.game.permanent; import java.util.ArrayList; import java.util.UUID; +import mage.abilities.Abilities; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; @@ -53,7 +54,7 @@ public class PermanentCard extends PermanentImpl { public PermanentCard(Card card, UUID controllerId, Game game) { super(card.getId(), card.getOwnerId(), controllerId, card.getName()); - // this.card = card.copy(); + this.card = card; this.zoneChangeCounter = card.getZoneChangeCounter(game); // local value already set to the raised number init(card, game); @@ -61,7 +62,11 @@ public class PermanentCard extends PermanentImpl { private void init(Card card, Game game) { copyFromCard(card); - + // if temporary added abilities to the spell/card exist, you need to add it to the permanent derived from that card + Abilities otherAbilities = game.getState().getAllOtherAbilities(card.getId()); + if (otherAbilities != null) { + abilities.addAll(otherAbilities); + } /*if (card.getCardType().contains(CardType.PLANESWALKER)) { this.loyalty = new MageInt(card.getLoyalty().getValue()); }*/