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 Attack implements ICard
11 public String getName() {
16 public IValue returnValue(final IValue iobj, Player proponent, Player opponent)
21 public String getName() {
26 public IValue returnValue(final IValue jobj, Player proponent, Player opponent)
31 public String getName() {
35 public IValue returnValue(final IValue nobj, Player proponent, Player opponent)
37 if(iobj instanceof Value && nobj instanceof Value)
39 int i = ((Value)iobj).getValue();
40 int n = ((Value)nobj).getValue();
42 if(i >= 0 && i <= 255)
44 int v = proponent.getSlot(i).getVitality();
48 if(jobj instanceof Value)
50 int j = ((Value)jobj).getValue();
52 if(j >= 0 && j <= 255)
54 int w = opponent.getSlot(255 - j).getVitality();
58 int wdec = (int) Math.floor(9 * n / 10);
61 opponent.getSlot(255 - j).setVitality(resw < 0 ? 0 : w);
68 throw new ICFPCException();
73 throw new ICFPCException();
78 throw new ICFPCException();
83 throw new ICFPCException();
88 throw new ICFPCException();