Zombie cards behavior.
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.Run;
7 import ru.alphatech.icfpc.game.Value;
9 public class Dec implements ICard
12 public String getName() {
17 public IValue returnValue(IValue iobj, Player proponent, Player opponent)
19 if(iobj instanceof Value)
21 int i = ((Value)iobj).getValue();
23 if (i >= 0 && i <= 255)
25 int v = proponent.getSlot(255 - i).getVitality();
29 if(v > 0 && v < 65535)
31 proponent.getSlot(255 - i).setVitality(v + 1);
38 proponent.getSlot(255 - i).setVitality(v - 1);
46 throw new ICFPCException();
51 throw new ICFPCException();