mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
[CLB] Fixes Gond Gate from triggering on itself. Closes #9125.
This commit is contained in:
parent
efda22c993
commit
8cdfd1ee4a
1 changed files with 15 additions and 2 deletions
|
@ -62,7 +62,11 @@ class GondGateEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
((EntersTheBattlefieldEvent) event).getTarget().setTapped(false);
|
||||
Permanent target = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (target != null) {
|
||||
target.setTapped(false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -73,8 +77,17 @@ class GondGateEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (sourceObject == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent targetObject = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
return targetObject != null
|
||||
if (targetObject == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !sourceObject.getId().equals(targetObject.getId())
|
||||
&& targetObject.isControlledBy(source.getControllerId())
|
||||
&& targetObject.hasSubtype(SubType.GATE, game);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue