mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Clean up
This commit is contained in:
@@ -1910,11 +1910,7 @@ public class ComputerUtil {
|
|||||||
* @return true if the creature dies according to current board position.
|
* @return true if the creature dies according to current board position.
|
||||||
*/
|
*/
|
||||||
public static boolean predictCreatureWillDieThisTurn(final Player ai, final Card creature, final SpellAbility excludeSa) {
|
public static boolean predictCreatureWillDieThisTurn(final Player ai, final Card creature, final SpellAbility excludeSa) {
|
||||||
final Game game = creature.getGame();
|
final Game game = ai.getGame();
|
||||||
|
|
||||||
// a creature will die as a result of combat
|
|
||||||
boolean willDieInCombat = game.getPhaseHandler().inCombat()
|
|
||||||
&& ComputerUtilCombat.combatantWouldBeDestroyed(creature.getController(), creature, game.getCombat());
|
|
||||||
|
|
||||||
// a creature will [hopefully] die from a spell on stack
|
// a creature will [hopefully] die from a spell on stack
|
||||||
boolean willDieFromSpell = false;
|
boolean willDieFromSpell = false;
|
||||||
@@ -1933,6 +1929,10 @@ public class ComputerUtil {
|
|||||||
}
|
}
|
||||||
willDieFromSpell = !noStackCheck && predictThreatenedObjects(creature.getController(), excludeSa).contains(creature);
|
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;
|
return willDieInCombat || willDieFromSpell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -750,7 +750,6 @@ public class ComputerUtilCard {
|
|||||||
|
|
||||||
for (final Entry<String, Integer> entry : map.entrySet()) {
|
for (final Entry<String, Integer> entry : map.entrySet()) {
|
||||||
final String type = entry.getKey();
|
final String type = entry.getKey();
|
||||||
// Log.debug(type + " - " + entry.getValue());
|
|
||||||
|
|
||||||
if (max < entry.getValue()) {
|
if (max < entry.getValue()) {
|
||||||
max = entry.getValue();
|
max = entry.getValue();
|
||||||
@@ -784,7 +783,6 @@ public class ComputerUtilCard {
|
|||||||
|
|
||||||
// TODO JAVA 8 use getOrDefault
|
// TODO JAVA 8 use getOrDefault
|
||||||
for (final Card c : list) {
|
for (final Card c : list) {
|
||||||
|
|
||||||
// Changeling are all creature types, they are not interesting for
|
// Changeling are all creature types, they are not interesting for
|
||||||
// counting creature types
|
// counting creature types
|
||||||
if (c.hasStartOfKeyword(Keyword.CHANGELING.toString())) {
|
if (c.hasStartOfKeyword(Keyword.CHANGELING.toString())) {
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ public class GoadAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean checkApiLogic(final Player ai, final SpellAbility sa) {
|
protected boolean checkApiLogic(final Player ai, final SpellAbility sa) {
|
||||||
|
|
||||||
final Card source = sa.getHostCard();
|
final Card source = sa.getHostCard();
|
||||||
final Game game = source.getGame();
|
final Game game = source.getGame();
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ public class MustAttackAi extends SpellAbilityAi {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) {
|
protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) {
|
||||||
|
|
||||||
boolean chance;
|
boolean chance;
|
||||||
|
|
||||||
// TODO - implement AI
|
// TODO - implement AI
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ public class MustBlockAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
private List<Card> determineGoodBlockers(final Card attacker, final Player ai, Player defender, SpellAbility sa,
|
private List<Card> determineGoodBlockers(final Card attacker, final Player ai, Player defender, SpellAbility sa,
|
||||||
final boolean onlyLethal, final boolean testTapped) {
|
final boolean onlyLethal, final boolean testTapped) {
|
||||||
|
|
||||||
List<Card> list = Lists.newArrayList();
|
List<Card> list = Lists.newArrayList();
|
||||||
list = CardLists.filter(defender.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.CREATURES);
|
list = CardLists.filter(defender.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.CREATURES);
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ public class PermanentNoncreatureAi extends PermanentAi {
|
|||||||
CardCollection targets = CardLists.getTargetableCards(game.getCardsIn(origin), effectExile);
|
CardCollection targets = CardLists.getTargetableCards(game.getCardsIn(origin), effectExile);
|
||||||
if (sourceName.equals("Suspension Field")
|
if (sourceName.equals("Suspension Field")
|
||||||
|| sourceName.equals("Detention Sphere")) {
|
|| sourceName.equals("Detention Sphere")) {
|
||||||
// existing "exile until leaves" enchantments only target
|
// existing "exile until leaves" enchantments only target opponent's permanents
|
||||||
// opponent's permanents
|
|
||||||
// TODO: consider replacing the condition with host.hasSVar("OblivionRing")
|
// TODO: consider replacing the condition with host.hasSVar("OblivionRing")
|
||||||
targets = CardLists.filterControlledBy(targets, ai.getOpponents());
|
targets = CardLists.filterControlledBy(targets, ai.getOpponents());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,9 +38,4 @@ public class RestartGameAi extends SpellAbilityAi {
|
|||||||
return false;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
Name:Bounding Wolf
|
Name:Bounding Wolf
|
||||||
ManaCost:2 G
|
ManaCost:2 G
|
||||||
Types:Creature wolf
|
Types:Creature Wolf
|
||||||
PT:3/2
|
PT:3/2
|
||||||
K:Flash
|
K:Flash
|
||||||
K:Reach
|
K:Reach
|
||||||
|
|||||||
Reference in New Issue
Block a user