src/main/java/ru/alphatech/icfpc/cards/Help.java
changeset 79 0bfd181c663e
parent 74 b277f6c31f5f
child 102 cc814352ab43
     1.1 --- a/src/main/java/ru/alphatech/icfpc/cards/Help.java	Sun Jun 19 17:02:10 2011 +0400
     1.2 +++ b/src/main/java/ru/alphatech/icfpc/cards/Help.java	Sun Jun 19 17:12:05 2011 +0400
     1.3 @@ -3,6 +3,7 @@
     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 @@ -54,13 +55,26 @@
    1.12  										{
    1.13  											int w = proponent.getSlot(j).getVitality();
    1.14  											
    1.15 -											if(w > 0)
    1.16 +											if(Run.getAutoMode())
    1.17  											{
    1.18 -												int winc = (int) Math.floor(11 * n / 10);
    1.19 -												int resw = w + winc;
    1.20 -												
    1.21 -												proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw);
    1.22 +												if(w > 0)
    1.23 +												{
    1.24 +													int winc = (int) Math.floor(11 * n / 10);
    1.25 +													int resw = w - winc;
    1.26 +													
    1.27 +													proponent.getSlot(j).setVitality(resw < 0 ? 0 : resw);
    1.28 +												}
    1.29  											}
    1.30 +											else
    1.31 +											{
    1.32 +												if(w > 0)
    1.33 +												{
    1.34 +													int winc = (int) Math.floor(11 * n / 10);
    1.35 +													int resw = w + winc;
    1.36 +													
    1.37 +													proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw);
    1.38 +												}
    1.39 +											}											
    1.40  											
    1.41  											return new I();
    1.42  										}