- Restructured the logic of AI planar die rolls a little bit.

- Added a way to specify the minimum turn in which it is viable to start rolling a planar die for a particular plane. Added this setting to some planes which require a bit more context on the battlefield before their Chaos rolls start to make sense.
- Added an AI profile variable specifying the minimum turn in which the AI will start rolling the planar die in general unless the plane has an override specified (default AI - on its second turn, reckless AI - on its first turn).
This commit is contained in:
Agetian
2013-07-04 18:05:07 +00:00
parent 37d4245363
commit 1772faae3f
18 changed files with 43 additions and 19 deletions

View File

@@ -1,4 +1,5 @@
DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN=1 DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN=1
DEFAULT_MIN_TURN_TO_ROLL_PLANAR_DIE=3
DEFAULT_PLANAR_DIE_ROLL_CHANCE=50 DEFAULT_PLANAR_DIE_ROLL_CHANCE=50
MULLIGAN_THRESHOLD=5 MULLIGAN_THRESHOLD=5
PLANAR_DIE_ROLL_HESITATION_CHANCE=10 PLANAR_DIE_ROLL_HESITATION_CHANCE=10

View File

@@ -1,4 +1,5 @@
DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN=1 DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN=1
DEFAULT_MIN_TURN_TO_ROLL_PLANAR_DIE=1
DEFAULT_PLANAR_DIE_ROLL_CHANCE=100 DEFAULT_PLANAR_DIE_ROLL_CHANCE=100
MULLIGAN_THRESHOLD=2 MULLIGAN_THRESHOLD=2
PLANAR_DIE_ROLL_HESITATION_CHANCE=0 PLANAR_DIE_ROLL_HESITATION_CHANCE=0

View File

@@ -6,4 +6,5 @@ T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChao
SVar:RolledChaos:AB$ Destroy | Cost$ 0 | ValidTgts$ Creature.unenchanted | TgtPrompt$ Select target creature that isn't enchanted SVar:RolledChaos:AB$ Destroy | Cost$ 0 | ValidTgts$ Creature.unenchanted | TgtPrompt$ Select target creature that isn't enchanted
SVar:Picture:http://www.wizards.com/global/images/magic/general/akoum.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/akoum.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:3
Oracle:Players may cast enchantment cards as though they had flash.\nWhenever you roll {C}, destroy target creature that isn't enchanted. Oracle:Players may cast enchantment cards as though they had flash.\nWhenever you roll {C}, destroy target creature that isn't enchanted.

View File

@@ -6,4 +6,6 @@ S:Mode$ Continuous | EffectZone$ Command | GlobalRule$ No more than one creature
T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll Chaos, CARDNAME deals 2 damage to each creature. T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll Chaos, CARDNAME deals 2 damage to each creature.
SVar:RolledChaos:AB$ DamageAll | Cost$ 0 | NumDmg$ 2 | ValidCards$ Creature | ValidDescription$ each creature. SVar:RolledChaos:AB$ DamageAll | Cost$ 0 | NumDmg$ 2 | ValidCards$ Creature | ValidDescription$ each creature.
SVar:Picture:http://www.wizards.com/global/images/magic/general/astral_arena.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/astral_arena.jpg
SVar:AIRollPlanarDie:Random
SVar:AIRollPlanarDieMinTurn:5
Oracle:No more than one creature can attack each combat.\nNo more than one creature can block each combat.\nWhenever you roll {C}, Astral Arena deals 2 damage to each creature. Oracle:No more than one creature can attack each combat.\nNo more than one creature can block each combat.\nWhenever you roll {C}, Astral Arena deals 2 damage to each creature.

View File

@@ -9,4 +9,5 @@ SVar:RestorationReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | De
SVar:Picture:http://www.wizards.com/global/images/magic/general/bloodhill_bastion.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/bloodhill_bastion.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieInMain1:True SVar:AIRollPlanarDieInMain1:True
SVar:AIRollPlanarDieMinTurn:3
Oracle:Whenever a creature enters the battlefield, it gains double strike and haste until end of turn.\nWhenever you roll {C}, exile target nontoken creature you control, then return it to the battlefield under your control. Oracle:Whenever a creature enters the battlefield, it gains double strike and haste until end of turn.\nWhenever you roll {C}, exile target nontoken creature you control, then return it to the battlefield under your control.

View File

@@ -8,4 +8,5 @@ SVar:DBPutCounter:DB$ PutCounter | ValidTgts$ Creature | TgtPrompt$ Select targe
SVar:Y:Targeted$CardManaCost SVar:Y:Targeted$CardManaCost
SVar:Picture:http://www.wizards.com/global/images/magic/general/feeding_grounds.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/feeding_grounds.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:3
Oracle:Red spells cost {1} less to cast.\nGreen spells cost {1} less to cast.\nWhenever you roll {C}, put X +1/+1 counters on target creature, where X is that creature's converted mana cost. Oracle:Red spells cost {1} less to cast.\nGreen spells cost {1} less to cast.\nWhenever you roll {C}, put X +1/+1 counters on target creature, where X is that creature's converted mana cost.

View File

@@ -10,4 +10,5 @@ T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChao
SVar:RolledChaos:AB$ Destroy | Cost$ 0 | ValidTgts$ Permanent.nonLand | TgtPrompt$ Select target nonland permanent to destroy SVar:RolledChaos:AB$ Destroy | Cost$ 0 | ValidTgts$ Permanent.nonLand | TgtPrompt$ Select target nonland permanent to destroy
SVar:Picture:http://www.wizards.com/global/images/magic/general/furnace_layer.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/furnace_layer.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:3
Oracle:When you planeswalk to Furnace Layer or at the beginning of your upkeep, select target player at random. That player discards a card. If that player discards a land card this way, he or she loses 3 life.\nWhenever you roll {C}, you may destroy target nonland permanent. Oracle:When you planeswalk to Furnace Layer or at the beginning of your upkeep, select target player at random. That player discards a card. If that player discards a land card this way, he or she loses 3 life.\nWhenever you roll {C}, you may destroy target nonland permanent.

View File

@@ -10,4 +10,5 @@ T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChao
SVar:RolledChaos:AB$ ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | TgtPrompt$ Choose target creature card in a graveyard | ValidTgts$ Creature SVar:RolledChaos:AB$ ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | TgtPrompt$ Choose target creature card in a graveyard | ValidTgts$ Creature
SVar:Picture:http://www.wizards.com/global/images/magic/general/grixis.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/grixis.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:3
Oracle:Blue, black, and/or red creature cards in your graveyard have unearth. The unearth cost is equal to the card's mana cost. (Pay the card's mana cost: Return it to the battlefield. The creature gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)\nWhenever you roll {C}, put target creature card from a graveyard onto the battlefield under your control. Oracle:Blue, black, and/or red creature cards in your graveyard have unearth. The unearth cost is equal to the card's mana cost. (Pay the card's mana cost: Return it to the battlefield. The creature gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)\nWhenever you roll {C}, put target creature card from a graveyard onto the battlefield under your control.

View File

@@ -8,4 +8,5 @@ T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChao
SVar:RolledChaos:AB$ ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Battlefield | TgtPrompt$ Choose target creature card in your graveyard | ValidTgts$ Creature.YouCtrl SVar:RolledChaos:AB$ ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Battlefield | TgtPrompt$ Choose target creature card in your graveyard | ValidTgts$ Creature.YouCtrl
SVar:Picture:http://www.wizards.com/global/images/magic/general/grove_of_the_dreampods.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/grove_of_the_dreampods.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:5
Oracle:When you planeswalk to Grove of the Dreampods or at the beginning of your upkeep, reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and the rest on the bottom of your library in a random order.\nWhenever you roll {C}, return target creature card from your graveyard to the battlefield. Oracle:When you planeswalk to Grove of the Dreampods or at the beginning of your upkeep, reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and the rest on the bottom of your library in a random order.\nWhenever you roll {C}, return target creature card from your graveyard to the battlefield.

View File

@@ -9,4 +9,6 @@ SVar:DBChoose:DB$ ChooseCard | Choices$ Card.RememberedPlayerCtrl+Blue | ChoiceZ
SVar:DBChangeZoneAll:DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered | Origin$ Graveyard | Destination$ Hand | SubAbility$ DBCleanup SVar:DBChangeZoneAll:DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered | Origin$ Graveyard | Destination$ Hand | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Picture:http://www.wizards.com/global/images/magic/general/minamo.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/minamo.jpg
SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:5
Oracle:Whenever a player casts a spell, that player may draw a card.\nWhenever you roll {C}, each player may return a blue card from his or her graveyard to his or her hand. Oracle:Whenever a player casts a spell, that player may draw a card.\nWhenever you roll {C}, each player may return a blue card from his or her graveyard to his or her hand.

View File

@@ -7,4 +7,5 @@ T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChao
SVar:RolledChaos:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | KW$ HIDDEN Unblockable SVar:RolledChaos:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | KW$ HIDDEN Unblockable
SVar:Picture:http://www.wizards.com/global/images/magic/general/orochi_colony.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/orochi_colony.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:3
Oracle:Whenever a creature you control deals combat damage to a player, you may search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.\nWhenever you roll {C}, target creature is unblockable this turn. Oracle:Whenever a creature you control deals combat damage to a player, you may search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.\nWhenever you roll {C}, target creature is unblockable this turn.

View File

@@ -8,5 +8,6 @@ SVar:RolledChaos2:DB$ PutCounter | ValidTgts$ Creature.IsNotRemembered | Counter
SVar:RolledChaos3:DB$ PutCounter | ValidTgts$ Creature.IsNotRemembered | CounterType$ M1M1 | CounterNum$ 3 | SubAbility$ RolledChaosCleanup SVar:RolledChaos3:DB$ PutCounter | ValidTgts$ Creature.IsNotRemembered | CounterType$ M1M1 | CounterNum$ 3 | SubAbility$ RolledChaosCleanup
SVar:RolledChaosCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RolledChaosCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Picture:http://www.cardforge.org/fpics/lq_planes_promos/ravens_run.jpg SVar:Picture:http://www.cardforge.org/fpics/lq_planes_promos/ravens_run.jpg
SVar:AIRollPlanarDie:Random SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:5
Oracle:All creatures have wither. (They deal damage to creatures in the form of -1/-1 counters.)\nWhenever you roll {C}, put a -1/-1 counter on target creature, two -1/-1 counters on another target creature, and three -1/-1 counters on a third target creature. Oracle:All creatures have wither. (They deal damage to creatures in the form of -1/-1 counters.)\nWhenever you roll {C}, put a -1/-1 counter on target creature, two -1/-1 counters on another target creature, and three -1/-1 counters on a third target creature.

View File

@@ -8,4 +8,5 @@ SVar:TrigTapForMana:Mode$ TapsForMana | TriggerZones$ Command | ValidCard$ Land.
SVar:TrigMana:AB$ ManaReflected | Cost$ 0 | ColorOrType$ Type | Valid$ Defined.Triggered | ReflectProperty$ Produced | Defined$ TriggeredPlayer SVar:TrigMana:AB$ ManaReflected | Cost$ 0 | ColorOrType$ Type | Valid$ Defined.Triggered | ReflectProperty$ Produced | Defined$ TriggeredPlayer
YouSVar:Picture:http://www.wizards.com/global/images/magic/general/selesnya_loft_gardens.jpg YouSVar:Picture:http://www.wizards.com/global/images/magic/general/selesnya_loft_gardens.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:1
Oracle:If an effect would put one or more tokens onto the battlefield, it puts twice that many of those tokens onto the battlefield instead.\nIf an effect would place one or more counters on a permanent, it places twice that many of those counters on that permanent instead.\nWhenever you roll {C}, until end of turn, whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. Oracle:If an effect would put one or more tokens onto the battlefield, it puts twice that many of those tokens onto the battlefield instead.\nIf an effect would place one or more counters on a permanent, it places twice that many of those counters on that permanent instead.\nWhenever you roll {C}, until end of turn, whenever you tap a land for mana, add one mana to your mana pool of any type that land produced.

View File

@@ -6,4 +6,5 @@ T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChao
SVar:RolledChaos:AB$ PumpAll | Cost$ 0 | ValidCards$ Creature.ActivePlayerCtrl | NumDef$ 2 | KW$ Trample SVar:RolledChaos:AB$ PumpAll | Cost$ 0 | ValidCards$ Creature.ActivePlayerCtrl | NumDef$ 2 | KW$ Trample
SVar:Picture:http://www.wizards.com/global/images/magic/general/the_great_forest.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/the_great_forest.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:3
Oracle:Each creature assigns combat damage equal to its toughness rather than its power.\nWhenever you roll {C}, creatures you control get +0/+2 and gain trample until end of turn. Oracle:Each creature assigns combat damage equal to its toughness rather than its power.\nWhenever you roll {C}, creatures you control get +0/+2 and gain trample until end of turn.

View File

@@ -7,4 +7,5 @@ T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChao
SVar:RolledChaos:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ Flying SVar:RolledChaos:AB$ Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ Flying
SVar:Picture:http://www.wizards.com/global/images/magic/general/the_zephyr_maze.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/the_zephyr_maze.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:3
Oracle:Creatures with flying get +2/+0.\nCreatures without flying get -2/-0.\nWhenever you roll {C}, target creature gains flying until end of turn. Oracle:Creatures with flying get +2/+0.\nCreatures without flying get -2/-0.\nWhenever you roll {C}, target creature gains flying until end of turn.

View File

@@ -7,4 +7,5 @@ T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChao
SVar:RolledChaos:AB$ Animate | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | Types$ AllCreatureTypes SVar:RolledChaos:AB$ Animate | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | Types$ AllCreatureTypes
SVar:Picture:http://www.wizards.com/global/images/magic/general/velis_vel.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/velis_vel.jpg
SVar:AIRollPlanarDie:Always SVar:AIRollPlanarDie:Always
SVar:AIRollPlanarDieMinTurn:3
Oracle:Each creature gets +1/+1 for each other creature on the battlefield that shares at least one creature type with it. (For example, if two Elemental Shamans and an Elemental Spirit are on the battlefield, each gets +2/+2.)\nWhenever you roll {C}, target creature gains all creature types until end of turn. Oracle:Each creature gets +1/+1 for each other creature on the battlefield that shares at least one creature type with it. (For example, if two Elemental Shamans and an Elemental Spirit are on the battlefield, each gets +2/+2.)\nWhenever you roll {C}, target creature gains all creature types until end of turn.

View File

@@ -24,12 +24,7 @@ public class RollPlanarDiceAi extends SpellAbilityAi {
int maxActivations = aic.getIntProperty(AiProps.DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN); int maxActivations = aic.getIntProperty(AiProps.DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN);
int chance = aic.getIntProperty(AiProps.DEFAULT_PLANAR_DIE_ROLL_CHANCE); int chance = aic.getIntProperty(AiProps.DEFAULT_PLANAR_DIE_ROLL_CHANCE);
int hesitationChance = aic.getIntProperty(AiProps.PLANAR_DIE_ROLL_HESITATION_CHANCE); int hesitationChance = aic.getIntProperty(AiProps.PLANAR_DIE_ROLL_HESITATION_CHANCE);
int minTurnToRoll = aic.getIntProperty(AiProps.DEFAULT_MIN_TURN_TO_ROLL_PLANAR_DIE);
if (!plane.hasSVar("AIRollPlanarDieInMain1") && ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2)) {
return false;
} else if (plane.hasSVar("AIRollPlanarDieInMain1") && plane.getSVar("AIRollPlanarDieInMain1").toLowerCase().equals("false")) {
return false;
}
if (plane.hasSVar("AIRollPlanarDie")) { if (plane.hasSVar("AIRollPlanarDie")) {
switch (plane.getSVar("AIRollPlanarDie")) { switch (plane.getSVar("AIRollPlanarDie")) {
@@ -45,22 +40,32 @@ public class RollPlanarDiceAi extends SpellAbilityAi {
} }
break; break;
case "Never": case "Never":
break; return false;
default: default:
break; return false;
} }
}
if (plane.hasSVar("AIRollPlanarDieMaxPerTurn")) { if (!plane.hasSVar("AIRollPlanarDieMinTurn") && ai.getGame().getPhaseHandler().getTurn() < minTurnToRoll) {
maxActivations = Integer.parseInt(plane.getSVar("AIRollPlanarDieMaxPerTurn")); decideToRoll = false;
} } else if (plane.hasSVar("AIRollPlanarDieMinTurn") && ai.getGame().getPhaseHandler().getTurn() < Integer.parseInt(plane.getSVar("AIRollPlanarDieMinTurn"))) {
if (ai.getGame().getPhaseHandler().getPlanarDiceRolledthisTurn() >= maxActivations) { decideToRoll = false;
decideToRoll = false; } else if (!plane.hasSVar("AIRollPlanarDieInMain1") && ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2)) {
} decideToRoll = false;
} else if (plane.hasSVar("AIRollPlanarDieInMain1") && plane.getSVar("AIRollPlanarDieInMain1").toLowerCase().equals("false")) {
decideToRoll = false;
}
// check if the AI hesitates if (plane.hasSVar("AIRollPlanarDieMaxPerTurn")) {
if (MyRandom.getRandom().nextInt(100) < hesitationChance) { maxActivations = Integer.parseInt(plane.getSVar("AIRollPlanarDieMaxPerTurn"));
decideToRoll = false; // hesitate }
if (ai.getGame().getPhaseHandler().getPlanarDiceRolledthisTurn() >= maxActivations) {
decideToRoll = false;
}
// check if the AI hesitates
if (MyRandom.getRandom().nextInt(100) < hesitationChance) {
decideToRoll = false; // hesitate
}
} }
return decideToRoll ? true : false; return decideToRoll ? true : false;

View File

@@ -25,6 +25,7 @@ package forge.game.ai;
*/ */
public enum AiProps { /** */ public enum AiProps { /** */
DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN ("1"), /** */ DEFAULT_MAX_PLANAR_DIE_ROLLS_PER_TURN ("1"), /** */
DEFAULT_MIN_TURN_TO_ROLL_PLANAR_DIE ("3"), /** */
DEFAULT_PLANAR_DIE_ROLL_CHANCE ("50"), /** */ DEFAULT_PLANAR_DIE_ROLL_CHANCE ("50"), /** */
MULLIGAN_THRESHOLD ("5"), /** */ MULLIGAN_THRESHOLD ("5"), /** */
PLANAR_DIE_ROLL_HESITATION_CHANCE ("10"); /** */ PLANAR_DIE_ROLL_HESITATION_CHANCE ("10"); /** */