forked from External/mage
Refactor: replaced sourceId by source and introduced source param in some methods;
This commit is contained in:
parent
2bb472607b
commit
db239a1055
3205 changed files with 7080 additions and 6795 deletions
|
|
@ -61,12 +61,8 @@ public class TriggeredAbilities extends ConcurrentHashMap<String, TriggeredAbili
|
|||
if (object != null) {
|
||||
boolean controllerSet = false;
|
||||
if (ability.getZone() != Zone.COMMAND && event != null
|
||||
&& event.getTargetId() != null // && event.getTargetId().equals(ability.getSourceId())
|
||||
&& event.getTargetId() != null
|
||||
&& ability.isLeavesTheBattlefieldTrigger()
|
||||
// && ((event.getType().equals(EventType.ZONE_CHANGE)
|
||||
// && ((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD))
|
||||
// || event.getType().equals(EventType.DESTROYED_PERMANENT)
|
||||
// || event.getType().equals(EventType.SACRIFICED_PERMANENT))
|
||||
&& game.getLKI().get(Zone.BATTLEFIELD) != null && game.getLKI().get(Zone.BATTLEFIELD).containsKey(ability.getSourceId())) {
|
||||
// need to check if object was face down for dies and destroy events because the ability triggers in the new zone, zone counter -1 is used
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(ability.getSourceId(), Zone.BATTLEFIELD, ability.getSourceObjectZoneChangeCounter() - 1);
|
||||
|
|
@ -92,7 +88,7 @@ public class TriggeredAbilities extends ConcurrentHashMap<String, TriggeredAbili
|
|||
}
|
||||
|
||||
if (ability.checkTrigger(event, game)) {
|
||||
NumberOfTriggersEvent numberOfTriggersEvent = new NumberOfTriggersEvent(ability.getControllerId(), ability.getSourceId(), event);
|
||||
NumberOfTriggersEvent numberOfTriggersEvent = new NumberOfTriggersEvent(ability, event);
|
||||
if (!game.replaceEvent(numberOfTriggersEvent)) {
|
||||
for (int i = 0; i < numberOfTriggersEvent.getAmount(); i++) {
|
||||
ability.trigger(game, ability.getControllerId());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue