Cards done. Only interpretation of zero card is under question mark.
1 package ru.alphatech.icfpc.cards;
3 import ru.alphatech.icfpc.game.ICFPCException;
4 import ru.alphatech.icfpc.game.IValue;
5 import ru.alphatech.icfpc.game.Player;
6 import ru.alphatech.icfpc.game.Value;
8 public class Help implements ICard
11 public IValue returnValue(final IValue iobj, Player proponent, Player opponent)
16 public IValue returnValue(final IValue jobj, Player proponent, Player opponent)
21 public IValue returnValue(final IValue nobj, Player proponent, Player opponent)
23 if(iobj instanceof Value && nobj instanceof Value)
25 int i = ((Value)iobj).getValue();
26 int n = ((Value)nobj).getValue();
28 if(i >= 0 && i <= 255)
30 int v = proponent.getSlot(i).getVitality();
34 if(jobj instanceof Value)
36 int j = ((Value)jobj).getValue();
38 if(j >= 0 && j <= 255)
40 int w = proponent.getSlot(j).getVitality();
44 int winc = (int) Math.floor(11 * n / 10);
47 proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw);
54 throw new ICFPCException();
59 throw new ICFPCException();
64 throw new ICFPCException();
69 throw new ICFPCException();
74 throw new ICFPCException();