mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Added an experimental AI property controlling damage chaining.
This commit is contained in:
@@ -126,9 +126,10 @@ public enum AiProps { /** */
|
||||
FLASH_USE_BUFF_AURAS_AS_COMBAT_TRICKS("true"),
|
||||
FLASH_BUFF_AURA_CHANCE_TO_CAST_EARLY("1"),
|
||||
FLASH_BUFF_AURA_CHANCE_CAST_AT_EOT("5"),
|
||||
FLASH_BUFF_AURA_CHANCE_TO_RESPOND_TO_STACK("100"); /** */
|
||||
FLASH_BUFF_AURA_CHANCE_TO_RESPOND_TO_STACK("100"), /** */
|
||||
// Experimental features, must be promoted or removed after extensive testing and, ideally, defaulting
|
||||
// <-- There are no experimental options here -->
|
||||
CHANCE_TO_CHAIN_TWO_DAMAGE_SPELLS("0"); /** */
|
||||
|
||||
|
||||
private final String strDefaultVal;
|
||||
|
||||
@@ -23,6 +23,7 @@ import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.SpellAbilityStackInstance;
|
||||
import forge.game.spellability.TargetRestrictions;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.MyRandom;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
@@ -190,6 +191,11 @@ public class ComputerUtilAbility {
|
||||
}
|
||||
|
||||
public static Pair<SpellAbility, Integer> getDamageAfterChainingSpells(Player ai, SpellAbility sa, String damage) {
|
||||
int chance = ((PlayerControllerAi)ai.getController()).getAi().getIntProperty(AiProps.CHANCE_TO_CHAIN_TWO_DAMAGE_SPELLS);
|
||||
if (!MyRandom.percentTrue(chance)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (sa.getSubAbility() != null || sa.getParent() != null) {
|
||||
// Doesn't work yet for complex decisions where damage is only a part of the decision process
|
||||
return null;
|
||||
|
||||
@@ -277,3 +277,8 @@ MOJHOSTO_CHANCE_TO_USE_JHOIRA_COPY_INSTANT=20
|
||||
# -- different name if necessary --
|
||||
|
||||
# <-- there are no experimental options here at the moment -->
|
||||
|
||||
# The chance that the AI will try to chain two damage spells or a damage spell and a debuffing pump spell to try to
|
||||
# kill a bigger creature or a planeswalker.
|
||||
CHANCE_TO_CHAIN_TWO_DAMAGE_SPELLS=100
|
||||
|
||||
|
||||
Reference in New Issue
Block a user