[CLB] Implemented Vexing Puzzlebox

This commit is contained in:
Evan Kranzler 2022-06-02 07:57:16 -04:00
parent 9313e6d36a
commit 07a8cc6bc9
3 changed files with 87 additions and 0 deletions

View file

@ -47,7 +47,15 @@ public class OneOrMoreDiceRolledTriggeredAbility extends TriggeredAbilityImpl {
.mapToInt(Integer::intValue)
.max()
.orElse(0);
int totalRoll = ((DiceRolledEvent) event)
.getResults()
.stream()
.filter(Integer.class::isInstance) // only numerical die result can be masured
.map(Integer.class::cast)
.mapToInt(Integer::intValue)
.sum();
this.getEffects().setValue("maxDieRoll", maxRoll);
this.getEffects().setValue("totalDieRoll", totalRoll);
return true;
}