mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
Add string rule logic to TriggeredAbilityImpl (#10370)
* Add string rule logic to TriggeredAbilityImpl * Fix string logic in TriggeredAbilityImpl * Revert adjustment that fixes some problems but causes others
This commit is contained in:
parent
913d5dfee8
commit
7b9243f640
1 changed files with 18 additions and 2 deletions
|
@ -201,8 +201,10 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
newRule.insert(4, "may ");
|
||||
superRule = newRule.toString();
|
||||
}
|
||||
} else if (this.getTargets().isEmpty()
|
||||
} else if (!ruleLow.startsWith("{this}")
|
||||
&& (this.getTargets().isEmpty()
|
||||
|| ruleLow.startsWith("attach")
|
||||
|| ruleLow.startsWith("change")
|
||||
|| ruleLow.startsWith("counter")
|
||||
|| ruleLow.startsWith("destroy")
|
||||
|| ruleLow.startsWith("sacrifice")
|
||||
|
@ -210,15 +212,29 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
|| ruleLow.startsWith("exile")
|
||||
|| ruleLow.startsWith("gain")
|
||||
|| ruleLow.startsWith("goad")
|
||||
|| ruleLow.startsWith("have")
|
||||
|| ruleLow.startsWith("move")
|
||||
|| ruleLow.startsWith("prevent")
|
||||
|| ruleLow.startsWith("put")
|
||||
|| ruleLow.startsWith("remove")
|
||||
|| ruleLow.startsWith("return")
|
||||
|| ruleLow.startsWith("shuffle")
|
||||
|| ruleLow.startsWith("turn")
|
||||
|| ruleLow.startsWith("tap")
|
||||
|| ruleLow.startsWith("untap")) {
|
||||
|| ruleLow.startsWith("untap"))) {
|
||||
sb.append("you may ");
|
||||
} else if (!ruleLow.startsWith("its controller may")) {
|
||||
sb.append("you may have ");
|
||||
superRule = superRule
|
||||
.replaceAll(" becomes ", " become ")
|
||||
.replaceAll(" blocks ", " block ")
|
||||
.replaceAll(" deals ", " deal ")
|
||||
.replaceAll(" discards ", " discard ")
|
||||
.replaceAll(" gains ", " gain ")
|
||||
.replaceAll(" gets ", " get ")
|
||||
.replaceAll(" loses ", " lose ")
|
||||
.replaceAll(" mills ", " mill ")
|
||||
.replaceAll(" sacrifices ", " sacrifice ");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue