mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Fix the AI incorrectly considering valid targets in RearrangeTopOfLibraryAi.
This commit is contained in:
@@ -35,7 +35,8 @@ public class RearrangeTopOfLibraryAi extends SpellAbilityAi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do it once per turn, generally (may be improved later)
|
// Do it once per turn, generally (may be improved later)
|
||||||
if (AiCardMemory.isRememberedCardByName(aiPlayer, source.getName(), AiCardMemory.MemorySet.ACTIVATED_THIS_TURN)) {
|
if (!sa.isTrigger()
|
||||||
|
&& AiCardMemory.isRememberedCardByName(aiPlayer, source.getName(), AiCardMemory.MemorySet.ACTIVATED_THIS_TURN)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,8 +47,8 @@ public class RearrangeTopOfLibraryAi extends SpellAbilityAi {
|
|||||||
sa.resetTargets();
|
sa.resetTargets();
|
||||||
|
|
||||||
Player opp = ComputerUtil.getOpponentFor(aiPlayer);
|
Player opp = ComputerUtil.getOpponentFor(aiPlayer);
|
||||||
final boolean canTgtAI = aiPlayer.canBeTargetedBy(sa);
|
final boolean canTgtAI = sa.canTarget(aiPlayer);
|
||||||
final boolean canTgtHuman = opp.canBeTargetedBy(sa);
|
final boolean canTgtHuman = sa.canTarget(opp);
|
||||||
|
|
||||||
if (canTgtHuman && canTgtAI) {
|
if (canTgtHuman && canTgtAI) {
|
||||||
// TODO: maybe some other consideration rather than random?
|
// TODO: maybe some other consideration rather than random?
|
||||||
|
|||||||
Reference in New Issue
Block a user