diff -r 0e21db22ecec -r 743564afa994 src/main/java/ru/alphatech/icfpc/cards/Dec.java --- a/src/main/java/ru/alphatech/icfpc/cards/Dec.java Sun Jun 19 10:50:46 2011 +0400 +++ b/src/main/java/ru/alphatech/icfpc/cards/Dec.java Sun Jun 19 12:12:55 2011 +0400 @@ -1,5 +1,6 @@ package ru.alphatech.icfpc.cards; +import ru.alphatech.icfpc.game.ICFPCException; import ru.alphatech.icfpc.game.IValue; import ru.alphatech.icfpc.game.Player; import ru.alphatech.icfpc.game.Value; @@ -11,18 +12,24 @@ { if(value.getClass().equals(Value.class)) { - if (((Value)value).getValue() < 256 && ((Value)value).getValue() > -1) + int i = ((Value)value).getValue(); + + if (i > 0 && i < 256) { - opponent.getSlot(((Value)value).getValue()).setVitality(opponent.getSlot(((Value)value).getValue()).getVitality() - 1); - return new ICard() + int v = proponent.getSlot(255 - i).getVitality(); + if (v < 65535 && v > 0) { - @Override - public IValue returnValue(IValue value, Player proponent, Player opponent) - { - return value; - } - }; + proponent.getSlot(255 - i).setVitality(proponent.getSlot(255 - i).getVitality() - 1); + } } + else + { + throw new ICFPCException(); + } + } + else + { + throw new ICFPCException(); } return new Value(-100);