mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Temporarily reverting a change to the way ordering SAs is handled (breaks auto-yield) and improved my original change a bit to fix its logic, feel free to revert this to continue work on this project.
This commit is contained in:
@@ -146,17 +146,13 @@ public abstract class Trigger extends TriggerReplacementBase {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public final String toString() {
|
public final String toString() {
|
||||||
return toString(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public final String toString(boolean active) {
|
|
||||||
if (this.mapParams.containsKey("TriggerDescription") && !this.isSuppressed()) {
|
if (this.mapParams.containsKey("TriggerDescription") && !this.isSuppressed()) {
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
String desc = this.mapParams.get("TriggerDescription");
|
String desc = this.mapParams.get("TriggerDescription");
|
||||||
desc = desc.replace("CARDNAME", active ? getHostCard().toString() : getHostCard().getName());
|
desc = desc.replace("CARDNAME", getHostCard().getName());
|
||||||
if (getHostCard().getEffectSource() != null) {
|
if (getHostCard().getEffectSource() != null) {
|
||||||
desc = desc.replace("EFFECTSOURCE", active ? getHostCard().getEffectSource().toString() : getHostCard().getEffectSource().getName());
|
desc = desc.replace("EFFECTSOURCE", getHostCard().getEffectSource().getName());
|
||||||
}
|
}
|
||||||
sb.append(desc);
|
sb.append(desc);
|
||||||
if (!this.triggerRemembered.isEmpty()) {
|
if (!this.triggerRemembered.isEmpty()) {
|
||||||
|
|||||||
@@ -191,20 +191,12 @@ public class WrappedAbility extends Ability {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toUnsuppressedString() {
|
public String toUnsuppressedString() {
|
||||||
String strg = this.getStackDescription();
|
return regtrig.toString();
|
||||||
/* use augmented stack description as string for wrapped things */
|
|
||||||
String card = regtrig.getHostCard().toString();
|
|
||||||
if (!strg.contains(card) && strg.contains(" this ")) {
|
|
||||||
/* a hack for Evolve and similar that don't have CARDNAME */
|
|
||||||
return card + ": " + strg;
|
|
||||||
} else {
|
|
||||||
return strg;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStackDescription() {
|
public String getStackDescription() {
|
||||||
final StringBuilder sb = new StringBuilder(regtrig.replaceAbilityText(regtrig.toString(true), this));
|
final StringBuilder sb = new StringBuilder(regtrig.replaceAbilityText(toUnsuppressedString(), this));
|
||||||
if (usesTargeting()) {
|
if (usesTargeting()) {
|
||||||
sb.append(" (Targeting ");
|
sb.append(" (Targeting ");
|
||||||
for (final GameObject o : this.getTargets().getTargets()) {
|
for (final GameObject o : this.getTargets().getTargets()) {
|
||||||
|
|||||||
@@ -1200,9 +1200,16 @@ public class PlayerControllerHuman
|
|||||||
final String firstStr = orderedSAs.get(0).toString();
|
final String firstStr = orderedSAs.get(0).toString();
|
||||||
boolean needPrompt = false;
|
boolean needPrompt = false;
|
||||||
String saLookupKey = firstStr;
|
String saLookupKey = firstStr;
|
||||||
|
if (orderedSAs.get(0).getHostCard() != null) {
|
||||||
|
saLookupKey += " - " + orderedSAs.get(0).getHostCard().getId();
|
||||||
|
}
|
||||||
char delim = (char)5;
|
char delim = (char)5;
|
||||||
for (int i = 1; i < orderedSAs.size(); i++) {
|
for (int i = 1; i < orderedSAs.size(); i++) {
|
||||||
final String saStr = orderedSAs.get(i).toString();
|
SpellAbility currentSa = orderedSAs.get(i);
|
||||||
|
String saStr = currentSa.toString();
|
||||||
|
if (currentSa.getHostCard() != null) {
|
||||||
|
saStr += " - " + currentSa.getHostCard().getId();
|
||||||
|
}
|
||||||
if (!needPrompt && !saStr.equals(firstStr)) {
|
if (!needPrompt && !saStr.equals(firstStr)) {
|
||||||
needPrompt = true; //prompt by default unless all abilities are the same
|
needPrompt = true; //prompt by default unless all abilities are the same
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user