Trigger RollDie and RollDieOnce for planar die too

This commit is contained in:
Lyu Zong-Hong
2021-07-13 21:58:52 +09:00
parent 4598c67578
commit cd05a8ffe1

View File

@@ -1,5 +1,6 @@
package forge.game;
import java.util.Arrays;
import java.util.Map;
import com.google.common.collect.ImmutableList;
@@ -37,11 +38,23 @@ public enum PlanarDice {
trigRes = Chaos;
}
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
Map<AbilityKey, Object> runParams = AbilityKey.newMap();
runParams.put(AbilityKey.Player, roller);
runParams.put(AbilityKey.Result, trigRes);
roller.getGame().getTriggerHandler().runTrigger(TriggerType.PlanarDice, runParams,false);
// Also run normal RolledDie and RolledDieOnce triggers
runParams = AbilityKey.newMap();
runParams.put(AbilityKey.Player, roller);
runParams.put(AbilityKey.Sides, 6);
runParams.put(AbilityKey.Result, 0);
roller.getGame().getTriggerHandler().runTrigger(TriggerType.RolledDie, runParams, false);
runParams = AbilityKey.newMap();
runParams.put(AbilityKey.Player, roller);
runParams.put(AbilityKey.Sides, 6);
runParams.put(AbilityKey.Result, Arrays.asList(0));
roller.getGame().getTriggerHandler().runTrigger(TriggerType.RolledDieOnce, runParams, false);
return res;
}