From 0758f4bb723371907709fd913d4a0e391acabc47 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Fri, 31 Aug 2012 12:43:46 +0400 Subject: [PATCH] Fixed Issue#52 --- Mage.Common/src/mage/view/GameView.java | 2 +- Mage.Sets/src/mage/sets/magic2013/Thragtusk.java | 4 +++- Mage/src/mage/abilities/AbilityImpl.java | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Mage.Common/src/mage/view/GameView.java b/Mage.Common/src/mage/view/GameView.java index 8a397bcbe3..daece6866f 100644 --- a/Mage.Common/src/mage/view/GameView.java +++ b/Mage.Common/src/mage/view/GameView.java @@ -85,7 +85,7 @@ public class GameView implements Serializable { Card card = game.getCard(stackObject.getSourceId()); if (card != null) { if (object != null) { - stack.put(stackObject.getId(), new StackAbilityView((StackAbility)stackObject, object.getName(), new CardView(card))); + stack.put(stackObject.getId(), new StackAbilityView((StackAbility)stackObject, card.getName(), new CardView(card))); } else { stack.put(stackObject.getId(), new StackAbilityView((StackAbility)stackObject, "", new CardView(card))); } diff --git a/Mage.Sets/src/mage/sets/magic2013/Thragtusk.java b/Mage.Sets/src/mage/sets/magic2013/Thragtusk.java index ec7b2732b9..a2bba59adb 100644 --- a/Mage.Sets/src/mage/sets/magic2013/Thragtusk.java +++ b/Mage.Sets/src/mage/sets/magic2013/Thragtusk.java @@ -27,7 +27,6 @@ */ package mage.sets.magic2013; -import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; @@ -38,6 +37,8 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.game.permanent.token.BeastToken; +import java.util.UUID; + /** * * @author North @@ -55,6 +56,7 @@ public class Thragtusk extends CardImpl { // When Thragtusk enters the battlefield, you gain 5 life. this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(5))); + // When Thragtusk leaves the battlefield, put a 3/3 green Beast creature token onto the battlefield. this.addAbility(new LeavesBattlefieldTriggeredAbility(new CreateTokenEffect(new BeastToken()), false)); } diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index 21dcec7a57..1648581dfd 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -369,8 +369,11 @@ public abstract class AbilityImpl> implements Ability { } protected String formatRule(String rule, String source) { - String replace = rule.replace("{this}", source); - replace = replace.replace("{source}", source); + String replace = rule; + if (source != null && !source.isEmpty()) { + replace = rule.replace("{this}", source); + replace = replace.replace("{source}", source); + } return replace; }