1.1 --- a/src/main/java/ru/alphatech/icfpc/cards/Help.java Sun Jun 19 17:30:18 2011 +0400
1.2 +++ b/src/main/java/ru/alphatech/icfpc/cards/Help.java Sun Jun 19 17:32:15 2011 +0400
1.3 @@ -3,21 +3,37 @@
1.4 import ru.alphatech.icfpc.game.ICFPCException;
1.5 import ru.alphatech.icfpc.game.IValue;
1.6 import ru.alphatech.icfpc.game.Player;
1.7 +import ru.alphatech.icfpc.game.Run;
1.8 import ru.alphatech.icfpc.game.Value;
1.9
1.10 public class Help implements ICard
1.11 {
1.12 @Override
1.13 + public String getName() {
1.14 + return "help";
1.15 + }
1.16 +
1.17 + @Override
1.18 public IValue returnValue(final IValue iobj, Player proponent, Player opponent)
1.19 {
1.20 return new ICard()
1.21 {
1.22 @Override
1.23 + public String getName() {
1.24 + return "";
1.25 + }
1.26 +
1.27 + @Override
1.28 public IValue returnValue(final IValue jobj, Player proponent, Player opponent)
1.29 {
1.30 return new ICard()
1.31 {
1.32 @Override
1.33 + public String getName() {
1.34 + return "";
1.35 + }
1.36 +
1.37 + @Override
1.38 public IValue returnValue(final IValue nobj, Player proponent, Player opponent)
1.39 {
1.40 if(iobj instanceof Value && nobj instanceof Value)
1.41 @@ -39,13 +55,26 @@
1.42 {
1.43 int w = proponent.getSlot(j).getVitality();
1.44
1.45 - if(w > 0)
1.46 + if(Run.getAutoMode())
1.47 {
1.48 - int winc = (int) Math.floor(11 * n / 10);
1.49 - int resw = w + winc;
1.50 -
1.51 - proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw);
1.52 + if(w > 0)
1.53 + {
1.54 + int winc = (int) Math.floor(11 * n / 10);
1.55 + int resw = w - winc;
1.56 +
1.57 + proponent.getSlot(j).setVitality(resw < 0 ? 0 : resw);
1.58 + }
1.59 }
1.60 + else
1.61 + {
1.62 + if(w > 0)
1.63 + {
1.64 + int winc = (int) Math.floor(11 * n / 10);
1.65 + int resw = w + winc;
1.66 +
1.67 + proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw);
1.68 + }
1.69 + }
1.70
1.71 return new I();
1.72 }