mirror of
https://github.com/correl/mage.git
synced 2024-12-27 20:06:31 +00:00
[BRO] fix Slagstone Refinery trigger (#9761)
* fix Slagstone Refinery trigger fixes #9755 by rewritting the checkTrigger method. * apply changes from review * minor fix, remove unecessary import
This commit is contained in:
parent
4ee59174cb
commit
038bee5402
1 changed files with 14 additions and 5 deletions
|
@ -15,7 +15,7 @@ import mage.game.permanent.token.PowerstoneToken;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
* @author TheElk801, Susucre
|
||||
*/
|
||||
public final class SlagstoneRefinery extends CardImpl {
|
||||
|
||||
|
@ -59,10 +59,19 @@ class SlagstoneRefineryTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
return zEvent.getFromZone().match(Zone.BATTLEFIELD)
|
||||
&& (zEvent.getToZone().match(Zone.GRAVEYARD) || zEvent.getToZone().match(Zone.EXILED))
|
||||
&& zEvent.getTargetId().equals(getSourceId())
|
||||
|| (zEvent.getTarget().isArtifact(game) && !(zEvent.getTarget() instanceof PermanentToken));
|
||||
|
||||
// Filters ZC events for only battlefield => graveyard or battlefield => exile.
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD && (zEvent.getToZone() == Zone.GRAVEYARD || zEvent.getToZone() == Zone.EXILED)) {
|
||||
if(zEvent.getTargetId().equals(getSourceId())) { // {this}
|
||||
return true;
|
||||
} else { // another
|
||||
return zEvent.getTarget().isArtifact(game) // artifact
|
||||
&& !(zEvent.getTarget() instanceof PermanentToken) // nontoken
|
||||
&& (zEvent.getTarget().getControllerId().equals(getControllerId())); // you control
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue