* Do if cost paid - added logs message if the player decided to pay the cost;

This commit is contained in:
Oleg Agafonov 2020-08-14 15:57:47 +04:00
parent b89c1c03ca
commit 9dc3d514bd

View file

@ -20,8 +20,8 @@ public class DoIfCostPaid extends OneShotEffect {
protected Effects executingEffects = new Effects();
protected Effects otherwiseEffects = new Effects(); // used for Imprison
private final Cost cost;
private String chooseUseText;
private boolean optional;
private final String chooseUseText;
private final boolean optional;
public DoIfCostPaid(Effect effectOnPaid, Cost cost) {
this(effectOnPaid, cost, null);
@ -97,6 +97,7 @@ public class DoIfCostPaid extends OneShotEffect {
cost.clearPaid();
int bookmark = game.bookmarkState();
if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
game.informPlayers(player.getLogName() + " paid for " + mageObject.getLogName() + " - " + executingEffects.getText(source.getModes().getMode()));
for (Effect effect : executingEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {
@ -178,4 +179,8 @@ public class DoIfCostPaid extends OneShotEffect {
public DoIfCostPaid copy() {
return new DoIfCostPaid(this);
}
public boolean isOptional() {
return optional;
}
}