[PIP] Implement Shaun, Father of Synths (#12109)

* Added method to set triggered abilities to optional

* TokenCopy effect now copies permanentModifier

* Implemented Shaun, Father of Synths

* remove TODO

* Made `setOptional` chainable
This commit is contained in:
Alexander Novotny 2024-04-12 19:41:58 -04:00 committed by GitHub
parent 96939b31eb
commit 8271686cb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 101 additions and 1 deletions

View file

@ -363,6 +363,21 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
return optional;
}
@Override
public TriggeredAbility setOptional() {
this.optional = true;
if (getEffects().stream().filter(
effect -> effect instanceof DoIfCostPaid && (this.optional && ((DoIfCostPaid) effect).isOptional()))
.findAny().isPresent()) {
throw new IllegalArgumentException(
"DoIfCostPaid effect must have only one optional settings, but it have two (trigger + DoIfCostPaid): "
+ this.getClass().getSimpleName());
}
return this;
}
@Override
public TriggeredAbilityImpl setAbilityWord(AbilityWord abilityWord) {
super.setAbilityWord(abilityWord);