mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Merge branch 'trigger_planar_die' into 'master'
Roll a planar die will also run RollDie and RollDieOnce triggers See merge request core-developers/forge!5003
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package forge.game;
|
package forge.game;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
@@ -37,11 +38,23 @@ public enum PlanarDice {
|
|||||||
trigRes = Chaos;
|
trigRes = Chaos;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
|
Map<AbilityKey, Object> runParams = AbilityKey.newMap();
|
||||||
runParams.put(AbilityKey.Player, roller);
|
runParams.put(AbilityKey.Player, roller);
|
||||||
runParams.put(AbilityKey.Result, trigRes);
|
runParams.put(AbilityKey.Result, trigRes);
|
||||||
roller.getGame().getTriggerHandler().runTrigger(TriggerType.PlanarDice, runParams,false);
|
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;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ public class TriggerRolledDie extends Trigger {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (hasParam("ValidSides")) {
|
||||||
|
final int validSides = Integer.parseInt(getParam("ValidSides"));
|
||||||
|
final int sides = (int) runParams.get(AbilityKey.Sides);
|
||||||
|
if (sides == validSides) return true;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Name:Chicken à la King
|
|||||||
ManaCost:1 U U
|
ManaCost:1 U U
|
||||||
Types:Creature Bird Noble
|
Types:Creature Bird Noble
|
||||||
PT:2/2
|
PT:2/2
|
||||||
T:Mode$ RolledDie | TriggerZones$ Battlefield | Execute$ TrigCounters | ValidResult$ 6 | TriggerDescription$ Whenever a 6 is rolled on a six-sided die, put a +1/+1 counter on each Bird.
|
T:Mode$ RolledDie | TriggerZones$ Battlefield | Execute$ TrigCounters | ValidResult$ 6 | ValidSides$ 6 | TriggerDescription$ Whenever a 6 is rolled on a six-sided die, put a +1/+1 counter on each Bird.
|
||||||
SVar:TrigCounters:DB$ PutCounterAll | ValidCards$ Bird | CounterType$ P1P1 | CounterNum$ 1
|
SVar:TrigCounters:DB$ PutCounterAll | ValidCards$ Bird | CounterType$ P1P1 | CounterNum$ 1
|
||||||
A:AB$ RollDice | Cost$ tapXType<1/Bird> | AILogic$ AtOppEOT | SpellDescription$ Roll a six-sided die.
|
A:AB$ RollDice | Cost$ tapXType<1/Bird> | AILogic$ AtOppEOT | SpellDescription$ Roll a six-sided die.
|
||||||
DeckHas:Ability$Counters
|
DeckHas:Ability$Counters
|
||||||
|
|||||||
Reference in New Issue
Block a user