Fixed that surge craeted exceptions for rule tooltip text generation.

This commit is contained in:
LevelX2 2016-01-26 00:36:42 +01:00
parent 6100609ae2
commit 1e89fb60d1
4 changed files with 20 additions and 14 deletions

View file

@ -24,8 +24,7 @@
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
*/
package mage.abilities.condition.common;
import mage.abilities.Ability;
@ -35,16 +34,16 @@ import mage.cards.Card;
import mage.game.Game;
/**
* Checks if a the spell was cast with the alternate prowl costs
* Checks if a the spell was cast with the alternate prowl costs
*
* @author LevelX2
*/
public class ProwlCondition implements Condition {
private static ProwlCondition fInstance = null;
private ProwlCondition() {}
private ProwlCondition() {
}
public static Condition getInstance() {
if (fInstance == null) {
@ -57,9 +56,9 @@ public class ProwlCondition implements Condition {
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
for (Ability ability: card.getAbilities()) {
for (Ability ability : card.getAbilities()) {
if (ability instanceof ProwlAbility) {
if(((ProwlAbility) ability).isActivated(source, game)) {
if (((ProwlAbility) ability).isActivated(source, game)) {
return true;
}
}
@ -67,4 +66,10 @@ public class ProwlCondition implements Condition {
}
return false;
}
@Override
public String toString() {
return "{source}'s prowl cost was paid";
}
}

View file

@ -57,12 +57,13 @@ public class SurgeAbility extends SpellAbility {
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
this.timing = card.getSpellAbility().getTiming();
this.setRuleAtTheTop(true);
rule = "Surge " + surgeCosts
this.rule = "Surge " + surgeCosts
+ " <i>(You may cast this spell for its surge cost if you or a teammate has cast another spell this turn.)</i>";
}
public SurgeAbility(final SurgeAbility ability) {
super(ability);
this.rule = ability.rule;
}
@Override