mirror of
https://github.com/Relintai/mtg-forge-ios.git
synced 2025-01-22 09:47:19 +01:00
- AI should not be so reckless with triggered pumps that result in losing the card at end of turn (e.g. Hazoret's Favor)
git-svn-id: http://svn.slightlymagic.net/forge/trunk@35806 269b9781-a132-4a9b-9d4e-f004f1b56b58
This commit is contained in:
parent
52863adf49
commit
80459bfbbd
@ -1196,6 +1196,8 @@ public class ComputerUtilCard {
|
|||||||
final PhaseHandler phase = game.getPhaseHandler();
|
final PhaseHandler phase = game.getPhaseHandler();
|
||||||
final Combat combat = phase.getCombat();
|
final Combat combat = phase.getCombat();
|
||||||
final boolean isBerserk = "Berserk".equals(sa.getParam("AILogic"));
|
final boolean isBerserk = "Berserk".equals(sa.getParam("AILogic"));
|
||||||
|
final boolean loseCardAtEOT = "Sacrifice".equals(sa.getParam("AtEOT")) || "Exile".equals(sa.getParam("AtEOT"))
|
||||||
|
|| "Destroy".equals(sa.getParam("AtEOT")) || "ExileCombat".equals(sa.getParam("AtEOT"));
|
||||||
|
|
||||||
boolean combatTrick = false;
|
boolean combatTrick = false;
|
||||||
boolean holdCombatTricks = false;
|
boolean holdCombatTricks = false;
|
||||||
@ -1236,8 +1238,8 @@ public class ComputerUtilCard {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// buff attacker/blocker using triggered pump
|
// buff attacker/blocker using triggered pump (unless it's lethal and we don't want to be reckless)
|
||||||
if (immediately && phase.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS)) {
|
if (immediately && phase.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS) && !loseCardAtEOT) {
|
||||||
if (phase.isPlayerTurn(ai)) {
|
if (phase.isPlayerTurn(ai)) {
|
||||||
if (CombatUtil.canAttack(c)) {
|
if (CombatUtil.canAttack(c)) {
|
||||||
return true;
|
return true;
|
||||||
@ -1315,7 +1317,7 @@ public class ComputerUtilCard {
|
|||||||
boolean pumpedWillDie = false;
|
boolean pumpedWillDie = false;
|
||||||
final boolean isAttacking = combat.isAttacking(c);
|
final boolean isAttacking = combat.isAttacking(c);
|
||||||
|
|
||||||
if (isBerserk && isAttacking) { pumpedWillDie = true; }
|
if ((isBerserk && isAttacking) || loseCardAtEOT) { pumpedWillDie = true; }
|
||||||
|
|
||||||
if (isAttacking) {
|
if (isAttacking) {
|
||||||
pumpedCombat.addAttacker(pumped, opp);
|
pumpedCombat.addAttacker(pumped, opp);
|
||||||
|
Loading…
Reference in New Issue
Block a user