mirror of
https://github.com/Relintai/mtg-forge-ios.git
synced 2024-11-14 04:17:19 +01:00
- Attempting to fix Splice onto Arcane AI: when adding splice effects by the AI, actually reconsider the entire SA (with spliced subs) via the canPlay routine (and set targets while at it) before deciding whether to play it or not. Might not be optimal, but at least it seems to stop the AI from wasting splice cards and making them disappear from the game into the void. Improvements are welcome.
git-svn-id: http://svn.slightlymagic.net/forge/trunk@35802 269b9781-a132-4a9b-9d4e-f004f1b56b58
This commit is contained in:
parent
9bcfced7d2
commit
e05a8a0f8f
@ -74,14 +74,19 @@ public class ComputerUtil {
|
||||
final Card source = sa.getHostCard();
|
||||
|
||||
if (sa.isSpell() && !source.isCopiedSpell()) {
|
||||
if (source.getType().hasStringType("Arcane")) {
|
||||
sa = AbilityUtils.addSpliceEffects(sa);
|
||||
AiPlayDecision postSpliceDecision = ((PlayerControllerAi)ai.getController()).getAi().canPlaySa(sa);
|
||||
if (postSpliceDecision != AiPlayDecision.WillPlay) {
|
||||
// for whatever reason the AI doesn't want to play the thing with the subs at this time
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
source.setCastSA(sa);
|
||||
sa.setLastStateBattlefield(game.getLastStateBattlefield());
|
||||
sa.setLastStateGraveyard(game.getLastStateGraveyard());
|
||||
sa.setHostCard(game.getAction().moveToStack(source, sa));
|
||||
|
||||
if (source.getType().hasStringType("Arcane")) {
|
||||
sa = AbilityUtils.addSpliceEffects(sa);
|
||||
}
|
||||
}
|
||||
|
||||
if (sa.getApi() == ApiType.Charm && !sa.isWrapper()) {
|
||||
|
Loading…
Reference in New Issue
Block a user