mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Merge pull request #2447 from Agetian/ai-conduitofworlds
Improve AI handling for Conduit of Worlds
This commit is contained in:
@@ -180,13 +180,21 @@ public class PlayAi extends SpellAbilityAi {
|
|||||||
// Before accepting, see if the spell has a valid number of targets (it should at this point).
|
// 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
|
// 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.
|
// in "Failed to add to stack" error and the card disappearing from the game completely.
|
||||||
|
if (!sa.hasParam("WithoutManaCost") && !ComputerUtilCost.canPayCost(spell, ai, true)) {
|
||||||
|
// if we won't be able to pay the cost, don't choose the card
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return spell.isTargetNumberValid();
|
return spell.isTargetNumberValid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return ComputerUtilCard.getBestAI(tgtCards);
|
final Card best = ComputerUtilCard.getBestAI(tgtCards);
|
||||||
|
if (sa.usesTargeting() && !sa.isTargetNumberValid()) {
|
||||||
|
sa.getTargets().add(best);
|
||||||
|
}
|
||||||
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<Card> getPlayableCards(SpellAbility sa, Player ai) {
|
private static List<Card> getPlayableCards(SpellAbility sa, Player ai) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Name:Conduit of Worlds
|
|||||||
ManaCost:2 G G
|
ManaCost:2 G G
|
||||||
Types:Artifact
|
Types:Artifact
|
||||||
S:Mode$ Continuous | Affected$ Land.YouOwn | MayPlay$ True | AffectedZone$ Graveyard | Description$ You may play lands from your graveyard.
|
S:Mode$ Continuous | Affected$ Land.YouOwn | MayPlay$ True | AffectedZone$ Graveyard | Description$ You may play lands from your graveyard.
|
||||||
A:AB$ Play | Cost$ T | ValidSA$ Spell | SorcerySpeed$ True | TgtPrompt$ Choose target nonland permanent card in your graveyard | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | TgtZone$ Graveyard | ValidTgts$ Permanent.nonLand+YouOwn | RememberPlayed$ True | Optional$ True | SubAbility$ DBEffect | SpellDescription$ Choose target nonland permanent card in your graveyard. If you haven't cast a spell this turn, you may cast that card. If you do, you can't cast additional spells this turn. Activate only as a sorcery.
|
A:AB$ Play | Cost$ T | ValidSA$ Spell | SorcerySpeed$ True | TgtPrompt$ Choose target nonland permanent card in your graveyard | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | TgtZone$ Graveyard | ValidTgts$ Permanent.nonLand+YouOwn | RememberPlayed$ True | Optional$ True | SubAbility$ DBEffect | AILogic$ NeedsChosenCard | SpellDescription$ Choose target nonland permanent card in your graveyard. If you haven't cast a spell this turn, you may cast that card. If you do, you can't cast additional spells this turn. Activate only as a sorcery.
|
||||||
SVar:DBEffect:DB$ Effect | Name$ Conduit of Worlds's Effect | ConditionDefined$ Remembered | ConditionPresent$ Card | StaticAbilities$ STCantBeCast | SubAbility$ DBCleanup
|
SVar:DBEffect:DB$ Effect | Name$ Conduit of Worlds's Effect | ConditionDefined$ Remembered | ConditionPresent$ Card | StaticAbilities$ STCantBeCast | SubAbility$ DBCleanup
|
||||||
SVar:STCantBeCast:Mode$ CantBeCast | EffectZone$ Command | ValidCard$ Card | Caster$ You | Description$ You can't cast additional spells this turn.
|
SVar:STCantBeCast:Mode$ CantBeCast | EffectZone$ Command | ValidCard$ Card | Caster$ You | Description$ You can't cast additional spells this turn.
|
||||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
|||||||
Reference in New Issue
Block a user