* Fixed bug that rule text of singletons like FlyingAbility were missing sometimes in permanents tooltiptext (fixes #453) .

This commit is contained in:
LevelX2 2014-07-27 02:00:07 +02:00
parent 7b8a6e3f46
commit 2e7219de2f
4 changed files with 13 additions and 6 deletions

View file

@ -57,6 +57,7 @@ import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.util.CardUtil;
import mage.watchers.Watcher;
/**
@ -119,7 +120,7 @@ class CavernOfSoulsEffect extends OneShotEffect {
}
game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice());
game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice().toString());
permanent.addInfo("chosen type", "<i>Chosen type: " + typeChoice.getChoice().toString() + "</i>");
permanent.addInfo("chosen type", CardUtil.addToolTipMarkTags("Chosen type: " + typeChoice.getChoice().toString()));
}
return false;
}

View file

@ -795,7 +795,9 @@ public abstract class AbilityImpl implements Ability {
@Override
public void setRuleVisible(boolean ruleVisible) {
this.ruleVisible = ruleVisible;
if (!(this instanceof MageSingleton)) { // prevent to change singletons
this.ruleVisible = ruleVisible;
}
}
@Override

View file

@ -60,7 +60,7 @@ public class EntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl {
this.rulePrefix = rulePrefix;
}
public EntersBattlefieldTriggeredAbility(EntersBattlefieldTriggeredAbility ability) {
public EntersBattlefieldTriggeredAbility(final EntersBattlefieldTriggeredAbility ability) {
super(ability);
this.rulePrefix = ability.rulePrefix;
this.noRule = ability.noRule;

View file

@ -40,6 +40,7 @@ import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.cards.Card;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
/**
@ -59,9 +60,12 @@ public class Commander implements CommandObject{
abilites.add(new CastCommanderAbility(card));
for (Ability ability : card.getAbilities()) {
if (!(ability instanceof SpellAbility)) {
Ability newAbility = ability.copy();
newAbility.setRuleVisible(false);
abilites.add(newAbility);
if (ability.getZone().match(Zone.COMMAND)){
Ability newAbility = ability.copy();
// Why are the abilities in command zone printed twice to the toolTipText
newAbility.setRuleVisible(false);
abilites.add(newAbility);
}
}
}
}