mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Merge branch 'master' into 'master'
AttachAi: do not play the second copy of a legendary enchantment. See merge request core-developers/forge!1116
This commit is contained in:
@@ -4,6 +4,7 @@ import com.google.common.base.Predicate;
|
|||||||
import com.google.common.base.Predicates;
|
import com.google.common.base.Predicates;
|
||||||
import forge.ai.*;
|
import forge.ai.*;
|
||||||
import forge.game.GameObject;
|
import forge.game.GameObject;
|
||||||
|
import forge.game.GlobalRuleChange;
|
||||||
import forge.game.ability.AbilityFactory;
|
import forge.game.ability.AbilityFactory;
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
import forge.game.ability.ApiType;
|
import forge.game.ability.ApiType;
|
||||||
@@ -56,6 +57,16 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ai.getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)
|
||||||
|
&& source.getType().isLegendary()
|
||||||
|
&& ai.isCardInPlay(source.getName())) {
|
||||||
|
// Don't play the second copy of a legendary enchantment already in play
|
||||||
|
|
||||||
|
// TODO: Add some extra checks for where the AI may want to cast a replacement aura
|
||||||
|
// on another creature and keep it when the original enchanted creature is useless
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (ai.getGame().getPhaseHandler().getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS)
|
if (ai.getGame().getPhaseHandler().getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS)
|
||||||
&& !"Curse".equals(sa.getParam("AILogic"))) {
|
&& !"Curse".equals(sa.getParam("AILogic"))) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user