Fixed bug #3835, stolen creatures that exploit themselves now trigger for the appropriate player

This commit is contained in:
Evan Kranzler 2017-08-22 21:34:14 -04:00
parent 6988688e64
commit 12cedf945d

View file

@ -63,7 +63,6 @@ public class ExploitCreatureTriggeredAbility extends TriggeredAbilityImpl {
return new ExploitCreatureTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.EXPLOITED_CREATURE;
@ -74,7 +73,8 @@ public class ExploitCreatureTriggeredAbility extends TriggeredAbilityImpl {
if (event.getTargetId().equals(getSourceId()) && event.getSourceId().equals(getSourceId())) {
if (!this.hasSourceObjectAbility(game, source, event)) {
return false;
}
}
this.setControllerId(event.getPlayerId());
return true; // if Exploits creature sacrifices itself, exploit triggers
}
return super.isInUseableZone(game, source, event);
@ -83,7 +83,7 @@ public class ExploitCreatureTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getSourceId().equals(getSourceId())) {
for (Effect effect: getEffects()) {
for (Effect effect : getEffects()) {
if (setTargetPointer == SetTargetPointer.PERMANENT) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
@ -98,4 +98,3 @@ public class ExploitCreatureTriggeredAbility extends TriggeredAbilityImpl {
return "When {this} exploits a creature, " + super.getRule();
}
}