mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Fix Gratuitous Violence bug
This commit is contained in:
parent
2439b99031
commit
8cbffb3e69
2 changed files with 9 additions and 3 deletions
|
@ -95,7 +95,9 @@ class GratuitousViolenceReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
|
||||
return permanent != null && permanent.getControllerId().equals(source.getControllerId());
|
||||
return permanent != null
|
||||
&& permanent.getCardType().contains(CardType.CREATURE)
|
||||
&& permanent.getControllerId().equals(source.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,7 +11,9 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
*/
|
||||
public class GratuitousViolenceTest extends CardTestPlayerBase {
|
||||
@Test
|
||||
public void testWorksOnCreatures() {
|
||||
public void testDoublesDamageFromCreatures() {
|
||||
// Enchantment: If a creature you control would deal damage to a creature
|
||||
// or player, it deals double that damage to that creature or player instead.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Gratuitous Violence");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Elvish Visionary"); // 1/1
|
||||
|
||||
|
@ -24,8 +26,10 @@ public class GratuitousViolenceTest extends CardTestPlayerBase {
|
|||
|
||||
@Test
|
||||
public void testIgnoresNonCreatures() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Gratuitous Violence");
|
||||
// Legendary Enchantment - Shrine: At the beginning of your upkeep, Honden of Infinite
|
||||
// Rage deals damage to target creature or player equal to the number of Shrines you control.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Honden of Infinite Rage");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Gratuitous Violence");
|
||||
|
||||
addTarget(playerA, playerB);
|
||||
|
||||
|
|
Loading…
Reference in a new issue