text generation improvements (#11203)

* update ETB trigger effect text gen

* set replace for common abilities

* fix remaining

* rename method, cleanup

* more fixes, better logic
This commit is contained in:
xenohedron 2023-09-25 21:51:51 -04:00 committed by GitHub
parent 10f2ae0bbc
commit 4e561b6254
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 60 additions and 85 deletions

View file

@ -11,27 +11,18 @@ import mage.game.events.GameEvent;
*/
public class EntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl {
protected boolean ignoreRulesGeneration; // use it with custom rules (if you don't want ETB auto-generated text)
protected String etbFlavorWord = null;
public EntersBattlefieldTriggeredAbility(Effect effect) {
this(effect, false);
}
public EntersBattlefieldTriggeredAbility(Effect effect, boolean optional) {
this(effect, optional, false);
}
public EntersBattlefieldTriggeredAbility(Effect effect, boolean optional, boolean ignoreRulesGeneration) {
super(Zone.ALL, effect, optional); // Zone.All because a creature with trigger can be put into play and be sacrificed during the resolution of an effect (discard Obstinate Baloth with Smallpox)
this.ignoreRulesGeneration = ignoreRulesGeneration;
this.replaceRuleText = true; // default true to replace "{this}" with "it"
setTriggerPhrase("When {this} enters the battlefield, ");
}
protected EntersBattlefieldTriggeredAbility(final EntersBattlefieldTriggeredAbility ability) {
super(ability);
this.ignoreRulesGeneration = ability.ignoreRulesGeneration;
this.etbFlavorWord = ability.etbFlavorWord;
}
@Override