diff -r 0f4c762f56f7 -r 9555608af847 src/main/java/ru/alphatech/icfpc/cards/Help.java --- a/src/main/java/ru/alphatech/icfpc/cards/Help.java Sun Jun 19 17:30:18 2011 +0400 +++ b/src/main/java/ru/alphatech/icfpc/cards/Help.java Sun Jun 19 17:32:15 2011 +0400 @@ -3,21 +3,37 @@ import ru.alphatech.icfpc.game.ICFPCException; import ru.alphatech.icfpc.game.IValue; import ru.alphatech.icfpc.game.Player; +import ru.alphatech.icfpc.game.Run; import ru.alphatech.icfpc.game.Value; public class Help implements ICard { @Override + public String getName() { + return "help"; + } + + @Override public IValue returnValue(final IValue iobj, Player proponent, Player opponent) { return new ICard() { @Override + public String getName() { + return ""; + } + + @Override public IValue returnValue(final IValue jobj, Player proponent, Player opponent) { return new ICard() { @Override + public String getName() { + return ""; + } + + @Override public IValue returnValue(final IValue nobj, Player proponent, Player opponent) { if(iobj instanceof Value && nobj instanceof Value) @@ -39,13 +55,26 @@ { int w = proponent.getSlot(j).getVitality(); - if(w > 0) + if(Run.getAutoMode()) { - int winc = (int) Math.floor(11 * n / 10); - int resw = w + winc; - - proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw); + if(w > 0) + { + int winc = (int) Math.floor(11 * n / 10); + int resw = w - winc; + + proponent.getSlot(j).setVitality(resw < 0 ? 0 : resw); + } } + else + { + if(w > 0) + { + int winc = (int) Math.floor(11 * n / 10); + int resw = w + winc; + + proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw); + } + } return new I(); }