The targets of casted spells are shown again in the log.

This commit is contained in:
LevelX2 2012-11-07 23:39:11 +01:00
parent ad035f1e47
commit 59f70c28f5
2 changed files with 12 additions and 4 deletions

View file

@ -44,6 +44,7 @@ import mage.game.stack.StackAbility;
import mage.target.Target;
import java.util.UUID;
import mage.game.stack.Spell;
/**
*
@ -188,7 +189,13 @@ public abstract class ActivatedAbilityImpl<T extends ActivatedAbilityImpl<T>> ex
sb.append(object.getName());
}
} else {
sb.append(object.getName());
if (object instanceof Spell) {
Spell<?> spell = (Spell<?>) object;
String castText = spell.getSpellAbility().toString();
sb.append((castText.startsWith("Cast ") ? castText.substring(5):castText));
} else {
sb.append(object.getName());
}
}
} else {
sb.append("unknown");

View file

@ -505,16 +505,17 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
Zone fromZone = game.getState().getZone(card.getId());
card.cast(game, fromZone, ability, playerId);
Ability spellAbility = game.getStack().getSpell(ability.getId()).getSpellAbility();
SpellAbility spellAbility = game.getStack().getSpell(ability.getId()).getSpellAbility();
if (spellAbility.activate(game, noMana)) {
for (KickerAbility kicker: card.getAbilities().getKickerAbilities()) {
if (kicker.getCosts().canPay(ability.getSourceId(), playerId, game) && kicker.canChooseTarget(game))
if (kicker.getCosts().canPay(ability.getSourceId(), playerId, game) && kicker.canChooseTarget(game)) {
kicker.activate(game, false);
}
}
GameEvent event = GameEvent.getEvent(GameEvent.EventType.SPELL_CAST, spellAbility.getId(), spellAbility.getSourceId(), playerId);
event.setZone(fromZone);
game.fireEvent(event);
game.fireInformEvent(name + " casts " + card.getName());
game.fireInformEvent(name + spellAbility.getActivatedMessage(game));
game.removeBookmark(bookmark);
return true;
}