diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java index b8f9759df3..1000ec0d97 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java @@ -64,7 +64,7 @@ public class KusariGama extends CardImpl { this.subtype.add("Equipment"); // Equipped creature has "{2}: This creature gets +1/+0 until end of turn." - Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new GenericManaCost(2)); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new GenericManaCost(2)); Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.EQUIPMENT); effect.setText("Equipped creature has \"{2}: This creature gets +1/+0 until end of turn.\""); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); @@ -144,22 +144,20 @@ class KusariGamaDamageEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Integer damage = (Integer) this.getValue("damageAmount"); - if (damage != null && damage.intValue() > 0) { + if (damage != null && damage > 0) { UUID damagedCreatureId = (UUID) this.getValue("damagedCreatureId"); Permanent creature = game.getPermanent(damagedCreatureId); if (creature == null) { creature = (Permanent) game.getLastKnownInformation(damagedCreatureId, Zone.BATTLEFIELD); } if (creature != null) { - for (UUID blockerId : game.getCombat().getBlockers()) { - if (!blockerId.equals(damagedCreatureId)) { - Permanent blockingCreature = game.getPermanent(blockerId); - if (blockingCreature != null && blockingCreature.getControllerId().equals(creature.getControllerId())) { - blockingCreature.damage(damage, source.getSourceId(), game, false, true); - } + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), creature.getControllerId(), game)) { + if (!permanent.getId().equals(damagedCreatureId)) { + permanent.damage(damage, source.getSourceId(), game, false, true); } } } + return true; } return false; } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/KusariGamaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/KusariGamaTest.java index 5b9a376270..3fb7ff6dfb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/KusariGamaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/KusariGamaTest.java @@ -23,26 +23,26 @@ public class KusariGamaTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Kusari-Gama"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate"); // 2/3 vigilance {1}{G} - + addCard(Zone.BATTLEFIELD, playerB, "Wall of Omens"); // 0/4 {1}{W} addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); // 2/2 {1}{W} addCard(Zone.BATTLEFIELD, playerB, "Hill Giant"); // 3/3 {3}{R} - - activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "Equip {3}", "Sylvan Advocate"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {3}", "Sylvan Advocate"); attack(1, playerA, "Sylvan Advocate"); block(1, playerB, "Wall of Omens", "Sylvan Advocate"); setStopAt(1, PhaseStep.END_COMBAT); execute(); - - assertPermanentCount(playerA, "Kusari-Gama", 1); + + assertPermanentCount(playerA, "Kusari-Gama", 1); assertPermanentCount(playerB, "Wall of Omens", 1); assertPermanentCount(playerB, "Hill Giant", 1); - + Permanent wallPerm = getPermanent("Wall of Omens", playerB); - Permanent giantPerm = getPermanent("Hill Giant", playerB); + Permanent giantPerm = getPermanent("Hill Giant", playerB); Assert.assertEquals("Wall of Omens should have 2 damage dealt to it", 2, wallPerm.getDamage()); - Assert.assertEquals("Hill Giant should have 2 damage dealt to it", 2, giantPerm.getDamage()); - + Assert.assertEquals("Hill Giant should have 2 damage dealt to it", 2, giantPerm.getDamage()); + assertGraveyardCount(playerB, "Silvercoat Lion", 2); } }