[KLD] Added Panharmonicon.

This commit is contained in:
emerald000 2016-09-13 08:21:16 -04:00
parent 5e7a4d265e
commit 959eaf6dab
3 changed files with 114 additions and 4 deletions

View file

@ -43,17 +43,17 @@ public class EntersTheBattlefieldEvent extends GameEvent {
private Permanent target;
public EntersTheBattlefieldEvent(Permanent target, UUID sourceId, UUID playerId, Zone fromZone) {
super(EventType.ENTERS_THE_BATTLEFIELD, target.getId(), sourceId, playerId);
this.fromZone = fromZone;
this.target = target;
this(target, sourceId, playerId, fromZone, null);
}
public EntersTheBattlefieldEvent(Permanent target, UUID sourceId, UUID playerId, Zone fromZone, ArrayList<UUID> appliedEffects) {
super(EventType.ENTERS_THE_BATTLEFIELD, target.getId(), sourceId, playerId);
this.fromZone = fromZone;
this.target = target;
if (appliedEffects != null) {
this.appliedEffects = appliedEffects;
}
this.amount = 1; // Number of times to trigger (Panharmonicon can change that value)
}
public Zone getFromZone() {

View file

@ -884,7 +884,10 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
EntersTheBattlefieldEvent event = new EntersTheBattlefieldEvent(this, sourceId, getControllerId(), fromZone);
if (!game.replaceEvent(event)) {
if (fireEvent) {
game.addSimultaneousEvent(event);
// Trigger multiple times with Panharmonicon.
for (int i = 0; i < event.getAmount(); i++) {
game.addSimultaneousEvent(event);
}
}
return true;
}