mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
[CLB] Implemented Vexing Puzzlebox
This commit is contained in:
parent
9313e6d36a
commit
07a8cc6bc9
3 changed files with 87 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue