Minor fixes (#12632)

* Fix Nefarious Imp, Bewitching Leechcraft

* Include zone of cast in game log
This commit is contained in:
ssk97 2024-08-02 15:43:49 -07:00 committed by GitHub
parent 65b513576b
commit ab803079b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 10 deletions

View file

@ -89,9 +89,9 @@ class BewitchingLeechcraftReplacementEffect extends ReplacementEffectImpl {
int amountBefore = permanentUntapping.getCounters(game).getCount(CounterType.P1P1); int amountBefore = permanentUntapping.getCounters(game).getCount(CounterType.P1P1);
permanentUntapping.removeCounters(CounterType.P1P1.getName(), 1, source, game); permanentUntapping.removeCounters(CounterType.P1P1.getName(), 1, source, game);
int amountAfter = permanentUntapping.getCounters(game).getCount(CounterType.P1P1); int amountAfter = permanentUntapping.getCounters(game).getCount(CounterType.P1P1);
// If we could not remove a counter, we are replacing the UNTAP event. // If we could not remove a counter, we are replacing the UNTAP event - return true.
// If we could remove a counter, we are not replacing the UNTAP, just adding to it. // If we could remove a counter, we are not replacing the UNTAP, just adding to it - return false.
return amountBefore < amountAfter; return amountBefore <= amountAfter;
} }
@Override @Override

View file

@ -79,7 +79,7 @@ class NefariousImpTriggeredAbility extends TriggeredAbilityImpl {
zEvent.getCards() zEvent.getCards()
.stream() .stream()
.map(MageItem::getId) .map(MageItem::getId)
.map(game::getPermanent) .map(game::getPermanentOrLKIBattlefield)
.filter(Objects::nonNull) .filter(Objects::nonNull)
).map(Controllable::getControllerId).anyMatch(this::isControlledBy); ).map(Controllable::getControllerId).anyMatch(this::isControlledBy);
} }

View file

@ -190,14 +190,16 @@ public class Spell extends StackObjectImpl implements Card {
return true; return true;
} }
public String getActivatedMessage(Game game) { public String getActivatedMessage(Game game, Zone fromZone) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" casts ");
if (isCopy()) { if (isCopy()) {
sb.append(" copies "); sb.append("a copied ");
} else {
sb.append(" casts ");
} }
return sb.append(ability.getGameLogMessage(game)).toString(); sb.append(ability.getGameLogMessage(game));
sb.append(" from ");
sb.append(fromZone.toString().toLowerCase(Locale.ENGLISH));
return sb.toString();
} }
public String getSpellCastText(Game game) { public String getSpellCastText(Game game) {

View file

@ -1297,7 +1297,7 @@ public abstract class PlayerImpl implements Player, Serializable {
castedEvent.setZone(fromZone); castedEvent.setZone(fromZone);
game.fireEvent(castedEvent); game.fireEvent(castedEvent);
if (!game.isSimulation()) { if (!game.isSimulation()) {
game.informPlayers(getLogName() + spell.getActivatedMessage(game)); game.informPlayers(getLogName() + spell.getActivatedMessage(game, fromZone));
} }
game.removeBookmark(bookmark); game.removeBookmark(bookmark);
resetStoredBookmark(game); resetStoredBookmark(game);