updated a test failure fix

This commit is contained in:
Evan Kranzler 2021-01-30 13:37:29 -05:00
parent 4df7bc157c
commit 175e15ff98
2 changed files with 5 additions and 6 deletions

View file

@ -41,9 +41,6 @@ public class Effects extends ArrayList<Effect> {
String lastRule = null;
int effectNum = 0;
for (Effect effect : this) {
if (effect == null) {
continue;
}
String endString = "";
String nextRule = effect.getText(mode);

View file

@ -33,7 +33,9 @@ public class DoIfCostPaid extends OneShotEffect {
public DoIfCostPaid(Effect effectOnPaid, Effect effectOnNotPaid, Cost cost, boolean optional) {
this(effectOnPaid, cost, null, optional);
this.otherwiseEffects.add(effectOnNotPaid);
if (effectOnNotPaid != null) {
this.otherwiseEffects.add(effectOnNotPaid);
}
}
public DoIfCostPaid(Effect effectOnPaid, Cost cost, String chooseUseText) {
@ -155,8 +157,8 @@ public class DoIfCostPaid extends OneShotEffect {
if (!staticText.isEmpty()) {
return staticText;
}
String otherwiseText = otherwiseEffects.getText(mode);
return (optional ? "you may " : "") + getCostText() + ". If you do, " + executingEffects.getText(mode) + (!otherwiseText.isEmpty() ? " If you don't, " + otherwiseEffects.getText(mode) : "");
return (optional ? "you may " : "") + getCostText() + ". If you do, " + executingEffects.getText(mode)
+ (!otherwiseEffects.isEmpty() ? " If you don't, " + otherwiseEffects.getText(mode) : "");
}
protected String getCostText() {