This commit is contained in:
tool4EvEr
2021-10-18 10:21:28 +02:00
parent 1f0e7f7348
commit c6bf9e3c6d
8 changed files with 7 additions and 18 deletions

View File

@@ -1910,11 +1910,7 @@ public class ComputerUtil {
* @return true if the creature dies according to current board position.
*/
public static boolean predictCreatureWillDieThisTurn(final Player ai, final Card creature, final SpellAbility excludeSa) {
final Game game = creature.getGame();
// a creature will die as a result of combat
boolean willDieInCombat = game.getPhaseHandler().inCombat()
&& ComputerUtilCombat.combatantWouldBeDestroyed(creature.getController(), creature, game.getCombat());
final Game game = ai.getGame();
// a creature will [hopefully] die from a spell on stack
boolean willDieFromSpell = false;
@@ -1933,6 +1929,10 @@ public class ComputerUtil {
}
willDieFromSpell = !noStackCheck && predictThreatenedObjects(creature.getController(), excludeSa).contains(creature);
// a creature will die as a result of combat
boolean willDieInCombat = !willDieFromSpell && game.getPhaseHandler().inCombat()
&& ComputerUtilCombat.combatantWouldBeDestroyed(creature.getController(), creature, game.getCombat());
return willDieInCombat || willDieFromSpell;
}

View File

@@ -750,7 +750,6 @@ public class ComputerUtilCard {
for (final Entry<String, Integer> entry : map.entrySet()) {
final String type = entry.getKey();
// Log.debug(type + " - " + entry.getValue());
if (max < entry.getValue()) {
max = entry.getValue();
@@ -784,7 +783,6 @@ public class ComputerUtilCard {
// TODO JAVA 8 use getOrDefault
for (final Card c : list) {
// Changeling are all creature types, they are not interesting for
// counting creature types
if (c.hasStartOfKeyword(Keyword.CHANGELING.toString())) {

View File

@@ -19,7 +19,6 @@ public class GoadAi extends SpellAbilityAi {
@Override
protected boolean checkApiLogic(final Player ai, final SpellAbility sa) {
final Card source = sa.getHostCard();
final Game game = source.getGame();

View File

@@ -25,7 +25,6 @@ public class MustAttackAi extends SpellAbilityAi {
*/
@Override
protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) {
boolean chance;
// TODO - implement AI

View File

@@ -160,7 +160,6 @@ public class MustBlockAi extends SpellAbilityAi {
private List<Card> determineGoodBlockers(final Card attacker, final Player ai, Player defender, SpellAbility sa,
final boolean onlyLethal, final boolean testTapped) {
List<Card> list = Lists.newArrayList();
list = CardLists.filter(defender.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.CREATURES);

View File

@@ -42,8 +42,7 @@ public class PermanentNoncreatureAi extends PermanentAi {
CardCollection targets = CardLists.getTargetableCards(game.getCardsIn(origin), effectExile);
if (sourceName.equals("Suspension Field")
|| sourceName.equals("Detention Sphere")) {
// existing "exile until leaves" enchantments only target
// opponent's permanents
// existing "exile until leaves" enchantments only target opponent's permanents
// TODO: consider replacing the condition with host.hasSVar("OblivionRing")
targets = CardLists.filterControlledBy(targets, ai.getOpponents());
}

View File

@@ -38,9 +38,4 @@ public class RestartGameAi extends SpellAbilityAi {
return false;
}
@Override
protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) {
// This trigger AI is completely unused, but return true just in case
return true;
}
}

View File

@@ -1,6 +1,6 @@
Name:Bounding Wolf
ManaCost:2 G
Types:Creature wolf
Types:Creature Wolf
PT:3/2
K:Flash
K:Reach