- Added Plunge into Darkness

This commit is contained in:
swordshine
2013-12-25 08:14:19 +00:00
parent 9262ad4d82
commit 69a9f0fe43
3 changed files with 31 additions and 2 deletions

View File

@@ -916,14 +916,23 @@ public class AiController {
public int chooseNumber(SpellAbility sa, String title, int min, int max) {
//TODO: AILogic
if ("GainLife".equals(sa.getParam("AILogic"))) {
final String logic = sa.getParam("AILogic");
if ("GainLife".equals(logic)) {
if (player.getLife() < 5 || player.getCardsIn(ZoneType.Hand).size() >= player.getMaxHandSize()) {
return min;
}
}
if ("Min".equals(sa.getParam("AILogic"))) {
else if ("Min".equals(logic)) {
return min;
}
else if ("DigACard".equals(logic)) {
int random = MyRandom.getRandom().nextInt(Math.min(4, max)) + 1;
if (player.getLife() < random + 5) {
return min;
} else {
return random;
}
}
return max;
}