improve text generation for intervening if triggers

This commit is contained in:
xenohedron 2025-06-14 00:46:07 -04:00
parent 76c0124052
commit 1b8602bd15
7 changed files with 10 additions and 6 deletions

View file

@ -55,7 +55,7 @@ public final class KangeeAerieKeeper extends CardImpl {
// When Kangee, Aerie Keeper enters the battlefield, if it was kicked, put X feather counters on it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(
CounterType.FEATHER.createInstance(), GetXValue.instance, true
)).withInterveningIf(KickedCondition.ONCE));
)).withInterveningIf(KickedCondition.ONCE).withRuleTextReplacement(true));
// Other Bird creatures get +1/+1 for each feather counter on Kangee, Aerie Keeper.
this.addAbility(new SimpleStaticAbility(new BoostAllEffect(

View file

@ -40,7 +40,7 @@ public final class RalsStaticaster extends CardImpl {
// Whenever Ral's Staticaster attacks, if you control a Ral planeswalker, Ral's Staticaster gets +1/+0 for each card in your hand until end of turn.
this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(
CardsInControllerHandCount.ANY, StaticValue.get(0), Duration.EndOfTurn
)).withInterveningIf(condition));
).setText("this creature gets +1/+0 for each card in your hand until end of turn")).withInterveningIf(condition));
}
private RalsStaticaster(final RalsStaticaster card) {

View file

@ -45,7 +45,7 @@ public final class RisonaAsariCommander extends CardImpl {
// Whenever Risona, Asari Commander deals combat damage to a player, if it doesn't have an indestructible counter on it, put an indestructible counter on it.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new AddCountersSourceEffect(
CounterType.INDESTRUCTIBLE.createInstance()), false
).withInterveningIf(RisonaAsariCommanderCondition.instance));
).withInterveningIf(RisonaAsariCommanderCondition.instance).withRuleTextReplacement(true));
// Whenever combat damage is dealt to you, remove an indestructible counter from Risona.
this.addAbility(new RisonaAsariCommanderTriggeredAbility());

View file

@ -37,7 +37,8 @@ public final class SoulhunterRakshasa extends CardImpl {
// When Soulhunter Rakshasa enters the battlefield, if you cast it from your hand, it deals 1 damage to target opponent for each Swamp you control.
Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(xValue))
.withInterveningIf(CastFromHandSourcePermanentCondition.instance);
.withInterveningIf(CastFromHandSourcePermanentCondition.instance)
.withRuleTextReplacement(true);
ability.addTarget(new TargetOpponent());
this.addAbility(ability, new CastFromHandWatcher());
}

View file

@ -31,7 +31,9 @@ public final class TerritorialAllosaurus extends CardImpl {
this.addAbility(new KickerAbility("{2}{G}"));
// When Territorial Allosaurus enters the battlefield, if it was kicked, it fights another target creature.
Ability ability = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect()).withInterveningIf(KickedCondition.ONCE);
Ability ability = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect())
.withInterveningIf(KickedCondition.ONCE)
.withRuleTextReplacement(true);
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_ANOTHER_TARGET_CREATURE));
this.addAbility(ability);
}

View file

@ -34,7 +34,7 @@ public final class TyrantOfValakut extends CardImpl {
// When Tyrant of Valakut enters the battlefield, if its surge cost was paid, it deals 3 damage to any target.
Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3))
.withInterveningIf(SurgedCondition.instance);
.withInterveningIf(SurgedCondition.instance).withRuleTextReplacement(true);
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
}

View file

@ -218,6 +218,7 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
@Override
public TriggeredAbility withInterveningIf(Condition interveningIfCondition) {
this.interveningIfCondition = interveningIfCondition;
this.replaceRuleText = false;
return this;
}