src/main/java/ru/alphatech/icfpc/cards/Help.java
changeset 83 5940c7605d03
parent 79 0bfd181c663e
child 102 cc814352ab43
equal deleted inserted replaced
82:4c6576c03f93 83:5940c7605d03
     1 package ru.alphatech.icfpc.cards;
     1 package ru.alphatech.icfpc.cards;
     2 
     2 
     3 import ru.alphatech.icfpc.game.ICFPCException;
     3 import ru.alphatech.icfpc.game.ICFPCException;
     4 import ru.alphatech.icfpc.game.IValue;
     4 import ru.alphatech.icfpc.game.IValue;
     5 import ru.alphatech.icfpc.game.Player;
     5 import ru.alphatech.icfpc.game.Player;
       
     6 import ru.alphatech.icfpc.game.Run;
     6 import ru.alphatech.icfpc.game.Value;
     7 import ru.alphatech.icfpc.game.Value;
     7 
     8 
     8 public class Help implements ICard
     9 public class Help implements ICard
     9 {
    10 {
    10 	@Override
    11 	@Override
    52 										
    53 										
    53 										if(j >= 0 && j <= 255)
    54 										if(j >= 0 && j <= 255)
    54 										{
    55 										{
    55 											int w = proponent.getSlot(j).getVitality();
    56 											int w = proponent.getSlot(j).getVitality();
    56 											
    57 											
    57 											if(w > 0)
    58 											if(Run.getAutoMode())
    58 											{
    59 											{
    59 												int winc = (int) Math.floor(11 * n / 10);
    60 												if(w > 0)
    60 												int resw = w + winc;
    61 												{
    61 												
    62 													int winc = (int) Math.floor(11 * n / 10);
    62 												proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw);
    63 													int resw = w - winc;
       
    64 													
       
    65 													proponent.getSlot(j).setVitality(resw < 0 ? 0 : resw);
       
    66 												}
    63 											}
    67 											}
       
    68 											else
       
    69 											{
       
    70 												if(w > 0)
       
    71 												{
       
    72 													int winc = (int) Math.floor(11 * n / 10);
       
    73 													int resw = w + winc;
       
    74 													
       
    75 													proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw);
       
    76 												}
       
    77 											}											
    64 											
    78 											
    65 											return new I();
    79 											return new I();
    66 										}
    80 										}
    67 										else
    81 										else
    68 										{
    82 										{