mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Improve AI for Sorin, Vengeful Broodlord and similar + Fix Roiling Vortex AI logic (#3932)
* - DamageDealAi: allow beneficial PW abilities (e.g. Sorin, Vengeful Broodlord). * - Better place for the logic * - Fix AI logic for Roiling Vortex and similar. * - Simpler implementation
This commit is contained in:
@@ -15,6 +15,7 @@ import forge.game.ability.ApiType;
|
||||
import forge.game.card.*;
|
||||
import forge.game.cost.Cost;
|
||||
import forge.game.cost.CostPartMana;
|
||||
import forge.game.cost.CostPutCounter;
|
||||
import forge.game.keyword.Keyword;
|
||||
import forge.game.phase.PhaseHandler;
|
||||
import forge.game.phase.PhaseType;
|
||||
@@ -735,7 +736,8 @@ public class DamageDealAi extends DamageAiBase {
|
||||
|| (isSorcerySpeed(sa, ai) && phase.is(PhaseType.MAIN2))
|
||||
|| immediately) {
|
||||
boolean pingAfterAttack = "PingAfterAttack".equals(logic) && phase.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) && phase.isPlayerTurn(ai);
|
||||
if ((pingAfterAttack && !avoidTargetP(ai, sa)) || shouldTgtP(ai, sa, dmg, noPrevention)) {
|
||||
boolean isPWAbility = sa.isPwAbility() && sa.getPayCosts().hasSpecificCostType(CostPutCounter.class);
|
||||
if (isPWAbility || (pingAfterAttack && !avoidTargetP(ai, sa)) || shouldTgtP(ai, sa, dmg, noPrevention)) {
|
||||
tcs.add(enemy);
|
||||
if (divided) {
|
||||
sa.addDividedAllocation(enemy, dmg);
|
||||
|
||||
@@ -212,7 +212,8 @@ public class EffectAi extends SpellAbilityAi {
|
||||
return false;
|
||||
}
|
||||
final SpellAbility topStack = game.getStack().peekAbility();
|
||||
return topStack.getActivatingPlayer().isOpponentOf(ai) && topStack.getApi() == ApiType.GainLife;
|
||||
final Player tgtPlayer = topStack.getActivatingPlayer();
|
||||
return tgtPlayer.isOpponentOf(ai) && tgtPlayer.canGainLife() && topStack.getApi() == ApiType.GainLife;
|
||||
} else if (logic.equals("Fight")) {
|
||||
return FightAi.canFightAi(ai, sa, 0, 0);
|
||||
} else if (logic.equals("Pump")) {
|
||||
|
||||
Reference in New Issue
Block a user