mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Fixed a problem of TributeAbility.
This commit is contained in:
parent
f3992bd2d5
commit
4834dce33a
2 changed files with 7 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue