mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +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.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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())) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ public class MustAttackAi extends SpellAbilityAi {
|
||||
*/
|
||||
@Override
|
||||
protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) {
|
||||
|
||||
boolean chance;
|
||||
|
||||
// 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,
|
||||
final boolean onlyLethal, final boolean testTapped) {
|
||||
|
||||
List<Card> list = Lists.newArrayList();
|
||||
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);
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name:Bounding Wolf
|
||||
ManaCost:2 G
|
||||
Types:Creature wolf
|
||||
Types:Creature Wolf
|
||||
PT:3/2
|
||||
K:Flash
|
||||
K:Reach
|
||||
|
||||
Reference in New Issue
Block a user