Stop permanents getting counters when phased out (#9194)

This commit is contained in:
Alex Vasile 2022-07-04 09:33:30 -04:00 committed by GitHub
parent 97fd9b6b6e
commit b52576fcf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 61 additions and 49 deletions

View file

@ -699,6 +699,12 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
}
public boolean addCounters(Counter counter, UUID playerAddingCounters, Ability source, Game game, List<UUID> appliedEffects, boolean isEffect, int maxCounters) {
if (this instanceof Permanent) {
if (!((Permanent) this).isPhasedIn()) {
return false;
}
}
boolean returnCode = true;
GameEvent addingAllEvent = GameEvent.getEvent(GameEvent.EventType.ADD_COUNTERS, objectId, source, playerAddingCounters, counter.getName(), counter.getCount());
addingAllEvent.setAppliedEffects(appliedEffects);