Fixed a problem of TributeAbility.

This commit is contained in:
LevelX2 2014-01-21 00:45:09 +01:00
parent f3992bd2d5
commit 4834dce33a
2 changed files with 7 additions and 3 deletions

View file

@ -53,6 +53,10 @@ public class TributeNotPaidCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
return !(Boolean) game.getState().getValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString());
Object tribute = game.getState().getValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString());
if (tribute != null) {
return ((String)tribute).equals("no");
}
return false;
}
}

View file

@ -117,9 +117,9 @@ class TributeEffect extends OneShotEffect<TributeEffect> {
sb.append(" (add ").append(tributeValue).append(" +1/+1 counters to it)?");
if (opponent.chooseUse(outcome, sb.toString(), game)) {
sourcePermanent.addCounters(CounterType.P1P1.createInstance(tributeValue), game);
game.getState().setValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString(), Boolean.TRUE);
game.getState().setValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString(), "yes");
} else {
game.getState().setValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString(), Boolean.FALSE);
game.getState().setValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString(), "no");
}
return true;
}