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 Help implements ICard
12 public String getName() {
17 public IValue returnValue(final IValue iobj, Player proponent, Player opponent)
22 public String getName() {
27 public IValue returnValue(final IValue jobj, Player proponent, Player opponent)
32 public String getName() {
37 public IValue returnValue(final IValue nobj, Player proponent, Player opponent)
39 if(iobj instanceof Value && nobj instanceof Value)
41 int i = ((Value)iobj).getValue();
42 int n = ((Value)nobj).getValue();
44 if(i >= 0 && i <= 255)
46 int v = proponent.getSlot(i).getVitality();
50 if(jobj instanceof Value)
52 int j = ((Value)jobj).getValue();
54 if(j >= 0 && j <= 255)
56 int w = proponent.getSlot(j).getVitality();
62 int winc = (int) Math.floor(11 * n / 10);
65 proponent.getSlot(j).setVitality(resw < 0 ? 0 : resw);
72 int winc = (int) Math.floor(11 * n / 10);
75 proponent.getSlot(j).setVitality(resw > 65535 ? 65535 : resw);
83 throw new ICFPCException();
88 throw new ICFPCException();
93 throw new ICFPCException();
98 throw new ICFPCException();
103 throw new ICFPCException();