mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Ephara, God of the Polis - Fixed its watcher not able to handle copies of it correctly.
This commit is contained in:
parent
da67a67eaa
commit
efa1ce2429
1 changed files with 9 additions and 4 deletions
|
@ -43,6 +43,9 @@ public class PermanentsEnteredBattlefieldWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
|
||||
Permanent perm = game.getPermanentEntering(event.getTargetId());
|
||||
if (perm == null) {
|
||||
perm = game.getPermanent(event.getTargetId());
|
||||
}
|
||||
if (perm != null) {
|
||||
List<Permanent> permanents;
|
||||
if (!enteringBattlefield.containsKey(perm.getControllerId())) {
|
||||
|
@ -69,10 +72,12 @@ public class PermanentsEnteredBattlefieldWatcher extends Watcher {
|
|||
}
|
||||
|
||||
public boolean AnotherCreatureEnteredBattlefieldUnderPlayersControlLastTurn(Permanent sourcePermanent, Game game) {
|
||||
for (Permanent permanent : enteringBattlefield.get(sourcePermanent.getControllerId())) {
|
||||
if (!permanent.getId().equals(sourcePermanent.getId())
|
||||
|| permanent.getZoneChangeCounter(game) != sourcePermanent.getZoneChangeCounter(game)) {
|
||||
return true;
|
||||
if (enteringBattlefieldLastTurn.containsKey(sourcePermanent.getControllerId())) {
|
||||
for (Permanent permanent : enteringBattlefieldLastTurn.get(sourcePermanent.getControllerId())) {
|
||||
if (!permanent.getId().equals(sourcePermanent.getId())
|
||||
|| permanent.getZoneChangeCounter(game) != sourcePermanent.getZoneChangeCounter(game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue