mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Merge branch 'fixsuspend' into 'master'
Suspend Fixes See merge request core-developers/forge!4828
This commit is contained in:
@@ -1354,7 +1354,7 @@ public class AiController {
|
||||
|
||||
public AiPlayDecision canPlayFromEffectAI(Spell spell, boolean mandatory, boolean withoutPayingManaCost) {
|
||||
int damage = ComputerUtil.getDamageForPlaying(player, spell);
|
||||
if (damage >= player.getLife() && !player.cantLoseForZeroOrLessLife() && player.canLoseLife()) {
|
||||
if (!mandatory && damage >= player.getLife() && !player.cantLoseForZeroOrLessLife() && player.canLoseLife()) {
|
||||
return AiPlayDecision.CurseEffects;
|
||||
}
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ public class PermanentAi extends SpellAbilityAi {
|
||||
if (!checkPhaseRestrictions(ai, sa, ai.getGame().getPhaseHandler())) {
|
||||
return false;
|
||||
}
|
||||
return mandatory || checkApiLogic(ai, sa);
|
||||
return checkApiLogic(ai, sa) || mandatory;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ public class PlayAi extends SpellAbilityAi {
|
||||
|
||||
spell = (Spell) spell.copyWithDefinedCost(abCost);
|
||||
}
|
||||
if( AiPlayDecision.WillPlay == ((PlayerControllerAi)ai.getController()).getAi().canPlayFromEffectAI(spell, !isOptional, true)) {
|
||||
if (AiPlayDecision.WillPlay == ((PlayerControllerAi)ai.getController()).getAi().canPlayFromEffectAI(spell, !isOptional, true)) {
|
||||
// Before accepting, see if the spell has a valid number of targets (it should at this point).
|
||||
// Proceeding past this point if the spell is not correctly targeted will result
|
||||
// in "Failed to add to stack" error and the card disappearing from the game completely.
|
||||
|
||||
@@ -704,8 +704,8 @@ public abstract class SpellAbilityEffect {
|
||||
Card host = sa.getHostCard();
|
||||
final Game game = host.getGame();
|
||||
final String duration = sa.getParam("Duration");
|
||||
// in case host was LKI
|
||||
if (host.isLKI()) {
|
||||
// in case host was LKI or still resolving
|
||||
if (host.isLKI() || host.getZone().is(ZoneType.Stack)) {
|
||||
host = game.getCardState(host);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user