diff -r 497185ce6691 -r 51bfc33c0566 src/main/java/ru/alphatech/icfpc/cards/Revive.java --- a/src/main/java/ru/alphatech/icfpc/cards/Revive.java Sun Jun 19 15:10:18 2011 +0400 +++ b/src/main/java/ru/alphatech/icfpc/cards/Revive.java Sun Jun 19 15:10:41 2011 +0400 @@ -8,17 +8,22 @@ public class Revive implements ICard { @Override - public IValue returnValue(IValue value, Player proponent, Player opponent) + public IValue returnValue(IValue iobj, Player proponent, Player opponent) { - if (value.getClass().equals(Value.class)) + if (iobj instanceof Value) { - int i = ((Value)value).getValue(); - if (i >= 0 && i < 256) + int i = ((Value)iobj).getValue(); + + if (i >= 0 && i <= 255) { - if (proponent.getSlot(i).getVitality() <= 0) + int v = proponent.getSlot(i).getVitality(); + + if (v <= 0) { proponent.getSlot(i).setVitality(1); } + + return new I(); } else { @@ -29,6 +34,5 @@ { throw new ICFPCException(); } - return new I(); } }