mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
* Commander: fixed duplicated triggers after play (example: Esika, God of the Tree, see #7501, #7503, #7505);
This commit is contained in:
parent
aa13b06af9
commit
ac98a3a31a
6 changed files with 108 additions and 19 deletions
|
|
@ -630,10 +630,6 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
}
|
||||
}
|
||||
|
||||
private void addTrigger(TriggeredAbility ability, MageObject attachedTo) {
|
||||
addTrigger(ability, null, attachedTo);
|
||||
}
|
||||
|
||||
private void addTrigger(TriggeredAbility ability, UUID sourceId, MageObject attachedTo) {
|
||||
if (sourceId == null) {
|
||||
triggers.add(ability, attachedTo);
|
||||
|
|
|
|||
|
|
@ -73,10 +73,21 @@ public class Commander implements CommandObject {
|
|||
|
||||
// other abilities
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (!(ability instanceof SpellAbility) && !(ability instanceof PlayLandAbility)) {
|
||||
Ability newAbility = ability.copy();
|
||||
abilities.add(newAbility);
|
||||
// skip already added above
|
||||
if (ability instanceof SpellAbility || ability instanceof PlayLandAbility) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip triggers
|
||||
// workaround to fix double triggers for commanders on battlefield (example: Esika, God of the Tree)
|
||||
// TODO: is commanders on command zone can have triggers (is there a card with triggered ability in all zones)?
|
||||
if (ability instanceof TriggeredAbility) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// OK, can add it (example: activated, static, alternative cost, etc)
|
||||
Ability newAbility = ability.copy();
|
||||
abilities.add(newAbility);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue