* UI: improved prevention effect messages (now it shows source object name in message window);

This commit is contained in:
Oleg Agafonov 2020-02-01 11:37:10 +04:00
parent f4a0c70cf3
commit 9cd3eeb898

View file

@ -756,7 +756,11 @@ public class ContinuousEffects implements Serializable {
effect.setValue("targetAbility", targetAbility);
if (effect.applies(event, sourceAbility, game)) {
if (!game.inCheckPlayableState() && !silentMode) {
MageObject sourceObject = sourceAbility.getSourceObject(game);
String message = effect.getInfoMessage(sourceAbility, event, game);
if (sourceObject != null) {
message = sourceObject.getIdName() + ": " + message;
}
if (message != null && !message.isEmpty()) {
if (effect.sendMessageToUser()) {
Player player = game.getPlayer(event.getPlayerId());