* Reworked dealtDamageByThisTurn handling of permanents to take zone change of referenced objects into account.

This commit is contained in:
LevelX2 2015-03-07 01:15:27 +01:00
parent 2e8eeff49f
commit 532ff611c4
6 changed files with 105 additions and 118 deletions

View file

@ -55,6 +55,17 @@ public class MageObjectReference implements Comparable<MageObjectReference> {
this.zoneChangeCounter = card.getZoneChangeCounter();
}
public MageObjectReference(MageObject mageObject) {
this.sourceId = mageObject.getId();
if (mageObject instanceof Card) {
this.zoneChangeCounter = ((Card)mageObject).getZoneChangeCounter();
} else if (mageObject instanceof Permanent) {
this.zoneChangeCounter = ((Permanent)mageObject).getZoneChangeCounter();
} else {
this.zoneChangeCounter = 0;
}
}
/**
* That values manually (can be used to let it reference to a Permanent
* that is not yet on the battlefield.