Fix PutIntoGraveFromBattlefieldAllTriggeredAbility: the onlyToControllerGraveyard parameter was not implemented at all.

This commit is contained in:
LoneFox 2015-09-16 08:50:51 +03:00
parent d2a90e6131
commit 9abfe04054

View file

@ -60,7 +60,7 @@ public class PutIntoGraveFromBattlefieldAllTriggeredAbility extends TriggeredAbi
public PutIntoGraveFromBattlefieldAllTriggeredAbility(final PutIntoGraveFromBattlefieldAllTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard;
this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard;
this.setTargetPointer = ability.setTargetPointer;
}
@ -73,8 +73,11 @@ public class PutIntoGraveFromBattlefieldAllTriggeredAbility extends TriggeredAbi
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD
&& zEvent.getToZone() == Zone.GRAVEYARD) {
&& zEvent.getToZone() == Zone.GRAVEYARD) {
if (filter.match(zEvent.getTarget(), this.getSourceId(), this.getControllerId(), game)) {
if(onlyToControllerGraveyard && !this.getControllerId().equals(zEvent.getPlayerId())) {
return false;
}
if (setTargetPointer) {
for (Effect effect :this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));