mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
The targets of casted spells are shown again in the log.
This commit is contained in:
parent
ad035f1e47
commit
59f70c28f5
2 changed files with 12 additions and 4 deletions
|
@ -44,6 +44,7 @@ import mage.game.stack.StackAbility;
|
|||
import mage.target.Target;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -187,9 +188,15 @@ public abstract class ActivatedAbilityImpl<T extends ActivatedAbilityImpl<T>> ex
|
|||
} else {
|
||||
sb.append(object.getName());
|
||||
}
|
||||
} else {
|
||||
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");
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue