prepare to move power/toughness out of constructor

This commit is contained in:
xenohedron 2023-05-20 21:07:21 -04:00
parent 70248cdd2b
commit 3a6e84043c
2 changed files with 12 additions and 1 deletions

View file

@ -49,7 +49,7 @@ public final class GideonChampionOfJustice extends CardImpl {
// 0: Until end of turn, Gideon becomes an indestructible Human Soldier creature with power and toughness each equal to the number of loyalty counters on him. He's still a planeswalker. Prevent all damage that would be dealt to him this turn. // 0: Until end of turn, Gideon becomes an indestructible Human Soldier creature with power and toughness each equal to the number of loyalty counters on him. He's still a planeswalker. Prevent all damage that would be dealt to him this turn.
LockedInDynamicValue loyaltyCount = new LockedInDynamicValue(new CountersSourceCount(CounterType.LOYALTY)); LockedInDynamicValue loyaltyCount = new LockedInDynamicValue(new CountersSourceCount(CounterType.LOYALTY));
LoyaltyAbility ability2 = new LoyaltyAbility(new BecomesCreatureSourceEffect( LoyaltyAbility ability2 = new LoyaltyAbility(new BecomesCreatureSourceEffect(
new GideonChampionOfJusticeToken(), "planeswalker", Duration.EndOfTurn, false, false, loyaltyCount, loyaltyCount) new GideonChampionOfJusticeToken(), "planeswalker", Duration.EndOfTurn).withDynamicPT(loyaltyCount, loyaltyCount)
.setText("Until end of turn, {this} becomes a Human Soldier creature with power and toughness each equal to the number of loyalty counters on him and gains indestructible. He's still a planeswalker."), 0); .setText("Until end of turn, {this} becomes a Human Soldier creature with power and toughness each equal to the number of loyalty counters on him and gains indestructible. He's still a planeswalker."), 0);
ability2.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn).setText("prevent all damage that would be dealt to him this turn")); ability2.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn).setText("prevent all damage that would be dealt to him this turn"));
this.addAbility(ability2); this.addAbility(ability2);

View file

@ -146,6 +146,17 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
return false; return false;
} }
public BecomesCreatureSourceEffect withDynamicPT(DynamicValue power, DynamicValue toughness) {
this.power = power;
this.toughness = toughness;
return this;
}
public BecomesCreatureSourceEffect withDurationRuleAtStart(boolean durationRuleAtStart) {
this.durationRuleAtStart = durationRuleAtStart;
return this;
}
private void setText() { private void setText() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (!duration.toString().isEmpty() && durationRuleAtStart) { if (!duration.toString().isEmpty() && durationRuleAtStart) {