mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
[ZNR] fixed issues with Thieving Skydiver cost limitations and text (#7046)
This commit is contained in:
parent
bd5c3293d8
commit
45a2532a89
4 changed files with 28 additions and 13 deletions
|
@ -4,9 +4,6 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
import mage.abilities.costs.VariableCost;
|
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
|
||||||
import mage.abilities.costs.mana.VariableManaCost;
|
|
||||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||||
import mage.abilities.dynamicvalue.common.GetKickerXValue;
|
import mage.abilities.dynamicvalue.common.GetKickerXValue;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
@ -40,20 +37,18 @@ public final class ThievingSkydiver extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// Kicker {X}. X can't be 0.
|
// Kicker {X}. X can't be 0.
|
||||||
Ability ability = new KickerAbility(new ManaCostsImpl<>("{X}"));
|
KickerAbility kickerAbility = new KickerAbility("{X}");
|
||||||
for (VariableCost cost : ability.getManaCosts().getVariableCosts()) {
|
kickerAbility.getKickerCosts().stream().forEach(cost -> {
|
||||||
if (cost instanceof VariableManaCost) {
|
cost.setMinimumCost(1);
|
||||||
((VariableManaCost) cost).setMinX(1);
|
cost.setReminderText(". X can't be 0.");
|
||||||
break;
|
});
|
||||||
}
|
this.addAbility(kickerAbility);
|
||||||
}
|
|
||||||
this.addAbility(ability);
|
|
||||||
|
|
||||||
// Flying
|
// Flying
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// When Thieving Skydiver enters the battlefield, if it was kicked, gain control of target artifact with converted mana cost X or less. If that artifact is an Equipment, attach it to Thieving Skydiver.
|
// When Thieving Skydiver enters the battlefield, if it was kicked, gain control of target artifact with converted mana cost X or less. If that artifact is an Equipment, attach it to Thieving Skydiver.
|
||||||
ability = new ConditionalInterveningIfTriggeredAbility(
|
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||||
new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.Custom), false),
|
new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.Custom), false),
|
||||||
KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, " +
|
KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, " +
|
||||||
"gain control of target artifact with converted mana cost X or less. " +
|
"gain control of target artifact with converted mana cost X or less. " +
|
||||||
|
|
|
@ -25,6 +25,10 @@ public interface OptionalAdditionalCost extends Cost, Copyable<OptionalAdditiona
|
||||||
*/
|
*/
|
||||||
String getReminderText();
|
String getReminderText();
|
||||||
|
|
||||||
|
void setReminderText(String reminderText);
|
||||||
|
|
||||||
|
void setMinimumCost(int minimumCost);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a text suffix for the game log, that can be added to the cast
|
* Returns a text suffix for the game log, that can be added to the cast
|
||||||
* message.
|
* message.
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package mage.abilities.costs;
|
package mage.abilities.costs;
|
||||||
|
|
||||||
|
import mage.abilities.costs.mana.VariableManaCost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
|
@ -71,6 +73,20 @@ public class OptionalAdditionalCostImpl extends CostsImpl<Cost> implements Optio
|
||||||
return replace;
|
return replace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setReminderText(String reminderText) {
|
||||||
|
this.reminderText = reminderText;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMinimumCost(int minimumCost) {
|
||||||
|
for (VariableCost cost : this.getVariableCosts()) {
|
||||||
|
if (cost instanceof VariableManaCost) {
|
||||||
|
((VariableManaCost) cost).setMinX(minimumCost);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a text suffix for the game log, that can be added to the cast
|
* Returns a text suffix for the game log, that can be added to the cast
|
||||||
* message.
|
* message.
|
||||||
|
|
|
@ -247,7 +247,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
||||||
sb.append(' ').append(remarkText);
|
sb.append(' ').append(remarkText);
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString().replace(" .",".");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue