mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- LifeGainAi: Do not use the "don't sac possible blockers" code path if the cost is "sac self" and the card is not a creature (e.g. Woodweaver's Puzzleknot).
This commit is contained in:
@@ -83,9 +83,16 @@ public class LifeGainAi extends SpellAbilityAi {
|
|||||||
} else {
|
} else {
|
||||||
// don't sac possible blockers
|
// don't sac possible blockers
|
||||||
if (!ph.getPhase().equals(PhaseType.COMBAT_DECLARE_BLOCKERS) || !game.getCombat().getDefenders().contains(ai)) {
|
if (!ph.getPhase().equals(PhaseType.COMBAT_DECLARE_BLOCKERS) || !game.getCombat().getDefenders().contains(ai)) {
|
||||||
if (!ComputerUtilCost.checkSacrificeCost(ai, abCost, source, false)) {
|
boolean skipCheck = false;
|
||||||
return false;
|
// if it's a sac self cost and the effect source is not a creature, skip this check
|
||||||
}
|
// (e.g. Woodweaver's Puzzleknot)
|
||||||
|
skipCheck |= ComputerUtilCost.isSacrificeSelfCost(abCost) && !source.isCreature();
|
||||||
|
|
||||||
|
if (!skipCheck) {
|
||||||
|
if (!ComputerUtilCost.checkSacrificeCost(ai, abCost, source, false)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,8 +160,6 @@ public class LifeGainAi extends SpellAbilityAi {
|
|||||||
* a {@link forge.game.spellability.SpellAbility} object.
|
* a {@link forge.game.spellability.SpellAbility} object.
|
||||||
* @param mandatory
|
* @param mandatory
|
||||||
* a boolean.
|
* a boolean.
|
||||||
* @param af
|
|
||||||
* a {@link forge.game.ability.AbilityFactory} object.
|
|
||||||
*
|
*
|
||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user