mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
refactor: removed outdated code
This commit is contained in:
parent
fdbc5d6409
commit
52ebba4cd1
31 changed files with 56 additions and 66 deletions
|
|
@ -122,10 +122,10 @@ class ChainerNightmareAdeptWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
if (event.getAdditionalReference() == null) {
|
||||
if (event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
morMap.computeIfAbsent(event.getAdditionalReference().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
morMap.computeIfAbsent(event.getApprovingObject().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
.compute(event.getPlayerId(), (u, i) -> i == null ? 0 : Integer.sum(i, -1));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,10 +150,10 @@ class ChandraHopesBeaconWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST
|
||||
|| event.getAdditionalReference() == null) {
|
||||
|| event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
MageObjectReference mor = event.getAdditionalReference().getApprovingMageObjectReference();
|
||||
MageObjectReference mor = event.getApprovingObject().getApprovingMageObjectReference();
|
||||
Spell spell = game.getSpell(event.getTargetId());
|
||||
if (mor == null || spell == null) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -194,10 +194,10 @@ class ChissGoriaForgeTyrantWatcher extends Watcher {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getAdditionalReference() == null) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
MageObjectReference mor = event.getAdditionalReference().getApprovingMageObjectReference();
|
||||
MageObjectReference mor = event.getApprovingObject().getApprovingMageObjectReference();
|
||||
Spell spell = game.getSpell(event.getTargetId());
|
||||
if (mor == null || spell == null) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -237,15 +237,15 @@ class CoramTheUndertakerWatcher extends Watcher {
|
|||
cardsAllowedToBePlayedOrCast.add(new MageObjectReference(mainCard, game));
|
||||
return;
|
||||
}
|
||||
if (event.getAdditionalReference() == null
|
||||
|| !MageIdentifier.CoramTheUndertakerWatcher.equals(event.getAdditionalReference().getApprovingAbility().getIdentifier())) {
|
||||
if (event.getApprovingObject() == null
|
||||
|| !MageIdentifier.CoramTheUndertakerWatcher.equals(event.getApprovingObject().getApprovingAbility().getIdentifier())) {
|
||||
return;
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.LAND_PLAYED) {
|
||||
landPlayedForSource.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
landPlayedForSource.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
spellCastForSource.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
spellCastForSource.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ class CourtOfLocthwainWatcher extends Watcher {
|
|||
&& event.getPlayerId() != null) {
|
||||
decrementCastAvailable(
|
||||
event.getPlayerId(),
|
||||
event.getAdditionalReference().getApprovingMageObjectReference()
|
||||
event.getApprovingObject().getApprovingMageObjectReference()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,9 +201,9 @@ class EvelynTheCovetousWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if ((event.getType() == GameEvent.EventType.SPELL_CAST || event.getType() == GameEvent.EventType.LAND_PLAYED)
|
||||
&& event.getAdditionalReference() != null) {
|
||||
&& event.getApprovingObject() != null) {
|
||||
usedMap.computeIfAbsent(
|
||||
event.getAdditionalReference()
|
||||
event.getApprovingObject()
|
||||
.getApprovingMageObjectReference(),
|
||||
x -> new HashSet<>()
|
||||
).add(event.getPlayerId());
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CantBlockAbility;
|
||||
|
|
@ -132,10 +131,10 @@ class FlameskullWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST
|
||||
|| event.getAdditionalReference() == null) {
|
||||
|| event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
MageObjectReference mor = event.getAdditionalReference().getApprovingMageObjectReference();
|
||||
MageObjectReference mor = event.getApprovingObject().getApprovingMageObjectReference();
|
||||
Spell spell = game.getSpell(event.getTargetId());
|
||||
if (mor == null || spell == null) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class GaleaKindlerOfHopeTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (!isControlledBy(event.getPlayerId())
|
||||
|| event.getZone() != Zone.LIBRARY
|
||||
|| !event
|
||||
.getAdditionalReference()
|
||||
.getApprovingObject()
|
||||
.getApprovingMageObjectReference()
|
||||
.refersTo(this.getSourceObject(game), game)) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class GlimpseTheCosmosWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.GlimpseTheCosmosWatcher)) {
|
||||
Ability approvingAbility = event.getAdditionalReference().getApprovingAbility();
|
||||
Ability approvingAbility = event.getApprovingObject().getApprovingAbility();
|
||||
if (approvingAbility != null
|
||||
&& approvingAbility.getSourceId().equals(event.getSourceId())) {
|
||||
sourceCards.add(game.getCard(event.getSourceId()));
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ class HaukensInsightWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST || event.getType() == GameEvent.EventType.LAND_PLAYED) {
|
||||
if (event.hasApprovingIdentifier(MageIdentifier.HaukensInsightWatcher)) {
|
||||
usedFrom.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
usedFrom.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,12 +173,12 @@ class HedonistsTroveWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST
|
||||
|| event.getAdditionalReference() == null) {
|
||||
|| event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
playerMap
|
||||
.computeIfAbsent(event.getPlayerId(), x -> new HashSet<>())
|
||||
.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
playerMap.get(event.getPlayerId()).removeIf(Objects::isNull);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ class IanMalcolmChaoticianWatcher extends Watcher {
|
|||
if (event.getType() == GameEvent.EventType.SPELL_CAST &&
|
||||
event.hasApprovingIdentifier(MageIdentifier.IanMalcolmChaoticianWatcher)) {
|
||||
usedMap.computeIfAbsent(
|
||||
event.getAdditionalReference()
|
||||
event.getApprovingObject()
|
||||
.getApprovingMageObjectReference(),
|
||||
x -> new HashSet<>()
|
||||
).add(event.getPlayerId());
|
||||
|
|
|
|||
|
|
@ -211,10 +211,10 @@ class IdolOfEnduranceWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
if (event.getAdditionalReference() == null) {
|
||||
if (event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
morMap.computeIfAbsent(event.getAdditionalReference().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
morMap.computeIfAbsent(event.getApprovingObject().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
.compute(event.getPlayerId(), (u, i) -> i == null ? 0 : Integer.sum(i, -1));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class KaghaShadowArchdruidWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if ((GameEvent.EventType.SPELL_CAST.equals(event.getType()) || GameEvent.EventType.LAND_PLAYED.equals(event.getType()))
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.KaghaShadowArchdruidWatcher)) {
|
||||
usedFrom.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
usedFrom.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
|
|
|
|||
|
|
@ -178,9 +178,9 @@ class KessDissidentMageWatcher extends Watcher {
|
|||
&& event.hasApprovingIdentifier(MageIdentifier.KessDissidentMageWatcher)) {
|
||||
Spell spell = (Spell) game.getObject(event.getTargetId());
|
||||
if (spell != null) {
|
||||
allowingObjects.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
allowingObjects.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
castSpells.put(new MageObjectReference(spell.getMainCard().getId(), game),
|
||||
event.getAdditionalReference().getApprovingAbility().getSourceId());
|
||||
event.getApprovingObject().getApprovingAbility().getSourceId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class KotoseTheSilentSpiderWatcher extends Watcher {
|
|||
morMap.values().removeIf(Set::isEmpty);
|
||||
return;
|
||||
}
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getAdditionalReference() == null) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
Spell spell = game.getSpell(event.getTargetId());
|
||||
|
|
@ -178,7 +178,7 @@ class KotoseTheSilentSpiderWatcher extends Watcher {
|
|||
return;
|
||||
}
|
||||
morMap.getOrDefault(
|
||||
event.getAdditionalReference().getApprovingMageObjectReference(), Collections.emptySet()
|
||||
event.getApprovingObject().getApprovingMageObjectReference(), Collections.emptySet()
|
||||
).removeIf(set -> set
|
||||
.stream()
|
||||
.anyMatch(mor -> mor.getSourceId().equals(spell.getMainCard().getId())
|
||||
|
|
|
|||
|
|
@ -222,10 +222,10 @@ class LobeliaDefenderOfBagEndWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST || event.getType() == GameEvent.EventType.PLAY_LAND) {
|
||||
if (event.getAdditionalReference() == null) {
|
||||
if (event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
morMap.computeIfAbsent(event.getAdditionalReference().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
morMap.computeIfAbsent(event.getApprovingObject().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
.compute(event.getPlayerId(), (u, i) -> i == null ? 0 : Integer.sum(i, -1));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,14 +148,14 @@ class MaestrosAscendancyWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.MaestrosAscendencyAlternateCast)
|
||||
&& event.getAdditionalReference() != null) {
|
||||
&& event.getApprovingObject() != null) {
|
||||
playerMap.computeIfAbsent(
|
||||
event.getAdditionalReference()
|
||||
event.getApprovingObject()
|
||||
.getApprovingMageObjectReference(),
|
||||
x -> new HashSet<>()
|
||||
).add(event.getPlayerId());
|
||||
spellMap.computeIfAbsent(
|
||||
event.getAdditionalReference()
|
||||
event.getApprovingObject()
|
||||
.getApprovingMageObjectReference(),
|
||||
x -> new HashSet<>()
|
||||
).add(new MageObjectReference(event.getTargetId(), game));
|
||||
|
|
|
|||
|
|
@ -117,11 +117,11 @@ class MarchOfRecklessJoyWatcher extends Watcher {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getAdditionalReference() == null) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
morMap.compute(event
|
||||
.getAdditionalReference()
|
||||
.getApprovingObject()
|
||||
.getApprovingMageObjectReference(),
|
||||
CardUtil::setOrIncrementValue
|
||||
);
|
||||
|
|
|
|||
|
|
@ -146,8 +146,8 @@ class MuldrothaTheGravetideWatcher extends Watcher {
|
|||
|
||||
private void addPermanentTypes(GameEvent event, Card mageObject, Game game) {
|
||||
if (mageObject != null
|
||||
&& event.getAdditionalReference() != null
|
||||
&& MageIdentifier.MuldrothaTheGravetideWatcher.equals(event.getAdditionalReference().getApprovingAbility().getIdentifier())) {
|
||||
&& event.getApprovingObject() != null
|
||||
&& MageIdentifier.MuldrothaTheGravetideWatcher.equals(event.getApprovingObject().getApprovingAbility().getIdentifier())) {
|
||||
UUID playerId = null;
|
||||
if (mageObject instanceof Spell) {
|
||||
playerId = ((Spell) mageObject).getControllerId();
|
||||
|
|
@ -155,10 +155,10 @@ class MuldrothaTheGravetideWatcher extends Watcher {
|
|||
playerId = ((Permanent) mageObject).getControllerId();
|
||||
}
|
||||
if (playerId != null) {
|
||||
Set<CardType> permanentTypes = sourcePlayedPermanentTypes.get(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
Set<CardType> permanentTypes = sourcePlayedPermanentTypes.get(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
if (permanentTypes == null) {
|
||||
permanentTypes = EnumSet.noneOf(CardType.class);
|
||||
sourcePlayedPermanentTypes.put(event.getAdditionalReference().getApprovingMageObjectReference(), permanentTypes);
|
||||
sourcePlayedPermanentTypes.put(event.getApprovingObject().getApprovingMageObjectReference(), permanentTypes);
|
||||
}
|
||||
Set<CardType> typesNotCast = EnumSet.noneOf(CardType.class);
|
||||
for (CardType cardType : mageObject.getCardType(game)) {
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class NashiMoonSagesScionWatcher extends Watcher {
|
|||
morMap.values().removeIf(Set::isEmpty);
|
||||
return;
|
||||
}
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getAdditionalReference() == null) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
Spell spell = game.getSpell(event.getTargetId());
|
||||
|
|
@ -129,7 +129,7 @@ class NashiMoonSagesScionWatcher extends Watcher {
|
|||
return;
|
||||
}
|
||||
morMap.getOrDefault(
|
||||
event.getAdditionalReference().getApprovingMageObjectReference(), Collections.emptySet()
|
||||
event.getApprovingObject().getApprovingMageObjectReference(), Collections.emptySet()
|
||||
).removeIf(set -> set
|
||||
.stream()
|
||||
.anyMatch(mor -> mor.getSourceId().equals(spell.getMainCard().getId())
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class OneWithTheMultiverseWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.OneWithTheMultiverseWatcher)) {
|
||||
usedFrom.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
usedFrom.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -159,12 +159,12 @@ class RadiantScrollwielderWatcher extends Watcher {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getAdditionalReference() == null) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST || event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
morMap.put(
|
||||
new MageObjectReference(event.getSourceId(), game),
|
||||
event.getAdditionalReference().getApprovingMageObjectReference()
|
||||
event.getApprovingObject().getApprovingMageObjectReference()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,10 +142,10 @@ class SerpentsSoulJarWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
if (event.getAdditionalReference() == null) {
|
||||
if (event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
morMap.computeIfAbsent(event.getAdditionalReference().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
morMap.computeIfAbsent(event.getApprovingObject().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
.compute(event.getPlayerId(), (u, i) -> i == null ? 0 : Integer.sum(i, -1));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ class SerraParagonWatcher extends Watcher {
|
|||
|| event.getType() == GameEvent.EventType.LAND_PLAYED)
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.SerraParagonWatcher)) {
|
||||
map.computeIfAbsent(
|
||||
event.getAdditionalReference()
|
||||
event.getApprovingObject()
|
||||
.getApprovingMageObjectReference(),
|
||||
x -> new HashSet<>()
|
||||
).add(event.getPlayerId());
|
||||
|
|
|
|||
|
|
@ -124,10 +124,10 @@ class UnluckyWitnessWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() != GameEvent.EventType.SPELL_CAST
|
||||
|| event.getAdditionalReference() == null) {
|
||||
|| event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
MageObjectReference mor = event.getAdditionalReference().getApprovingMageObjectReference();
|
||||
MageObjectReference mor = event.getApprovingObject().getApprovingMageObjectReference();
|
||||
Spell spell = game.getSpell(event.getTargetId());
|
||||
if (mor == null || spell == null) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -155,10 +155,10 @@ class WhispersteelDaggerWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
if (event.getAdditionalReference() == null) {
|
||||
if (event.getApprovingObject() == null) {
|
||||
return;
|
||||
}
|
||||
morMap.computeIfAbsent(event.getAdditionalReference().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
morMap.computeIfAbsent(event.getApprovingObject().getApprovingMageObjectReference(), m -> new HashMap<>())
|
||||
.computeIfAbsent(game.getOwnerId(event.getSourceId()), m -> new HashMap<>())
|
||||
.compute(event.getPlayerId(), (u, i) -> i == null ? 0 : Integer.sum(i, -1));
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class WishWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if ((GameEvent.EventType.SPELL_CAST.equals(event.getType()) || GameEvent.EventType.LAND_PLAYED.equals(event.getType()))
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.WishWatcher)) {
|
||||
usedFrom.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
usedFrom.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class CastFromGraveyardOnceWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (GameEvent.EventType.SPELL_CAST.equals(event.getType())
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.CastFromGraveyardOnceWatcher)) {
|
||||
usedFrom.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
usedFrom.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -511,11 +511,6 @@ public class GameEvent implements Serializable {
|
|||
DAMAGED_BATCH_FOR_ONE_PERMANENT(true),
|
||||
|
||||
DESTROY_PERMANENT,
|
||||
/* DESTROY_PERMANENT_BY_LEGENDARY_RULE
|
||||
targetId id of the permanent to destroy
|
||||
playerId controller of the permanent to detroy
|
||||
*/
|
||||
DESTROY_PERMANENT_BY_LEGENDARY_RULE,
|
||||
/* DESTROYED_PERMANENT
|
||||
targetId id of the destroyed creature
|
||||
sourceId sourceId of the ability with the destroy effect
|
||||
|
|
@ -819,16 +814,12 @@ public class GameEvent implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns possibly approving object that allowed the creation of the event.
|
||||
* Returns possibly approving object that allowed the creation of the event. Used for cast spell and play land events.
|
||||
*/
|
||||
public ApprovingObject getAdditionalReference() {
|
||||
public ApprovingObject getApprovingObject() {
|
||||
return approvingObject;
|
||||
}
|
||||
|
||||
public void setAdditionalReference(ApprovingObject approvingObject) {
|
||||
this.approvingObject = approvingObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* used to store which replacement effects were already applied to an event
|
||||
* or any modified events that may replace it
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class OnceEachTurnCastWatcher extends Watcher {
|
|||
&& event.getPlayerId() != null
|
||||
&& event.hasApprovingIdentifier(MageIdentifier.OnceEachTurnCastWatcher)) {
|
||||
usedFrom.computeIfAbsent(event.getPlayerId(), k -> new HashSet<>())
|
||||
.add(event.getAdditionalReference().getApprovingMageObjectReference());
|
||||
.add(event.getApprovingObject().getApprovingMageObjectReference());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue