From 3a6e84043c46a42238a656bf04173f2664ad4e0a Mon Sep 17 00:00:00 2001 From: xenohedron Date: Sat, 20 May 2023 21:07:21 -0400 Subject: [PATCH] prepare to move power/toughness out of constructor --- .../src/mage/cards/g/GideonChampionOfJustice.java | 2 +- .../continuous/BecomesCreatureSourceEffect.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java b/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java index 856964869f8..a98a12c6241 100644 --- a/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java +++ b/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java @@ -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. LockedInDynamicValue loyaltyCount = new LockedInDynamicValue(new CountersSourceCount(CounterType.LOYALTY)); 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); ability2.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn).setText("prevent all damage that would be dealt to him this turn")); this.addAbility(ability2); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java index 3d356f925ed..e95dbeaa933 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java @@ -146,6 +146,17 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements 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() { StringBuilder sb = new StringBuilder(); if (!duration.toString().isEmpty() && durationRuleAtStart) {