forked from External/mage
refactor: end step triggered abilities (#13047)
* simplify BeginningOfEndStepTriggeredAbility * more simplifications * move to common class * find and replace to common class * simplify again * align parameter order * package reorg * simplify BeginningOfCombatTriggeredAbility constructors * simplify BeginningOfFirstMainTriggeredAbility constructors * text fixes * update docs
This commit is contained in:
parent
587a68a837
commit
5b0eba7068
675 changed files with 1426 additions and 1979 deletions
|
|
@ -250,13 +250,15 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
|
||||
if (interveningIfCondition != null) {
|
||||
String conditionText = interveningIfCondition.toString();
|
||||
if (replaceRuleText && triggerPhrase != null && triggerPhrase.contains("{this}")) {
|
||||
conditionText = conditionText.replace("{this}", "it");
|
||||
if (!conditionText.isEmpty()) { // e.g. CaseSolveAbility
|
||||
if (replaceRuleText && triggerPhrase != null && triggerPhrase.contains("{this}")) {
|
||||
conditionText = conditionText.replace("{this}", "it");
|
||||
}
|
||||
if (!conditionText.startsWith("if ")) {
|
||||
sb.append("if ");
|
||||
}
|
||||
sb.append(conditionText).append(", ");
|
||||
}
|
||||
if (!conditionText.startsWith("if ")) {
|
||||
sb.append("if ");
|
||||
}
|
||||
sb.append(conditionText).append(", ");
|
||||
}
|
||||
|
||||
String superRule = super.getRule(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue