mirror of
https://github.com/correl/mage.git
synced 2024-11-25 11:09:53 +00:00
prepare to move power/toughness out of constructor
This commit is contained in:
parent
70248cdd2b
commit
3a6e84043c
2 changed files with 12 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue