- Rudimentary prediction for Insult // Injury double damage effect for the AI (currently done in a way similar to how several other effects are predicted, which is (a) suboptimal - needs to be figured out from the replacement effect itself; (b) needs to be moved out from the Card and Player classes into the AI class, probably ComputerUtilCombat). Feel free to improve.

This commit is contained in:
Agetian
2017-08-08 10:00:04 +00:00
parent c8ba4f0379
commit d2f9eeab12
2 changed files with 21 additions and 0 deletions

View File

@@ -6053,6 +6053,16 @@ public class Card extends GameEntity implements Comparable<Card> {
}
}
// TODO: improve such that this can be predicted from the replacement effect itself
// (+ move this function out into ComputerUtilCombat?)
for (Card c : getGame().getCardsIn(ZoneType.Command)) {
if (c.getName().equals("Insult Effect")) {
if (c.getController().equals(source.getController())) {
restDamage *= 2;
}
}
}
if (getName().equals("Phytohydra")) {
return 0;
}

View File

@@ -721,6 +721,17 @@ public class Player extends GameEntity implements Comparable<Player> {
}
}
}
// TODO: improve such that this can be predicted from the replacement effect itself
// (+ move this function out into ComputerUtilCombat?)
for (Card c : game.getCardsIn(ZoneType.Command)) {
if (c.getName().equals("Insult Effect")) {
if (c.getController().equals(source.getController())) {
restDamage *= 2;
}
}
}
return restDamage;
}