mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 20:29:19 -08:00
modified triggered abilities, continuous effects and zones
This commit is contained in:
parent
fe0c5e48e9
commit
1d32f49fd0
78 changed files with 279 additions and 434 deletions
|
|
@ -130,35 +130,35 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
|||
}
|
||||
}
|
||||
|
||||
public void checkPermanentOnlyTriggers(ZoneChangeEvent event, Game game) {
|
||||
// we only want to trigger abilities that are not on the underlying card ie. have been added by another effect
|
||||
// or we want to trigger abilities that only trigger on leaving the battlefield
|
||||
// card abilities will get triggered later when the card hits the new zone
|
||||
List<UUID> triggered = new ArrayList<UUID>();
|
||||
for (TriggeredAbility ability : abilities.getTriggeredAbilities(event.getFromZone())) {
|
||||
if (!card.getAbilities().containsKey(ability.getId())) {
|
||||
if (ability.checkTrigger(event, game)) {
|
||||
triggered.add(ability.getId());
|
||||
ability.trigger(game, controllerId);
|
||||
}
|
||||
} else if (ability instanceof ZoneChangeTriggeredAbility && event.getFromZone() == Zone.BATTLEFIELD) {
|
||||
ZoneChangeTriggeredAbility zcAbility = (ZoneChangeTriggeredAbility) ability;
|
||||
if (zcAbility.getToZone() == null) {
|
||||
if (ability.checkTrigger(event, game)) {
|
||||
triggered.add(ability.getId());
|
||||
ability.trigger(game, controllerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (TriggeredAbility ability : abilities.getTriggeredAbilities(event.getToZone())) {
|
||||
if (!card.getAbilities().containsKey(ability.getId())) {
|
||||
if (!triggered.contains(ability.getId()) && ability.checkTrigger(event, game)) {
|
||||
ability.trigger(game, controllerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// public void checkPermanentOnlyTriggers(ZoneChangeEvent event, Game game) {
|
||||
// // we only want to trigger abilities that are not on the underlying card ie. have been added by another effect
|
||||
// // or we want to trigger abilities that only trigger on leaving the battlefield
|
||||
// // card abilities will get triggered later when the card hits the new zone
|
||||
// List<UUID> triggered = new ArrayList<UUID>();
|
||||
// for (TriggeredAbility ability : abilities.getTriggeredAbilities(event.getFromZone())) {
|
||||
// if (!card.getAbilities().containsKey(ability.getId())) {
|
||||
// if (ability.checkTrigger(event, game)) {
|
||||
// triggered.add(ability.getId());
|
||||
// ability.trigger(game, controllerId);
|
||||
// }
|
||||
// } else if (ability instanceof ZoneChangeTriggeredAbility && event.getFromZone() == Zone.BATTLEFIELD) {
|
||||
// ZoneChangeTriggeredAbility zcAbility = (ZoneChangeTriggeredAbility) ability;
|
||||
// if (zcAbility.getToZone() == null) {
|
||||
// if (ability.checkTrigger(event, game)) {
|
||||
// triggered.add(ability.getId());
|
||||
// ability.trigger(game, controllerId);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// for (TriggeredAbility ability : abilities.getTriggeredAbilities(event.getToZone())) {
|
||||
// if (!card.getAbilities().containsKey(ability.getId())) {
|
||||
// if (!triggered.contains(ability.getId()) && ability.checkTrigger(event, game)) {
|
||||
// ability.trigger(game, controllerId);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue