mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
[REX] Implement Grim Giganotosaurus (#12103)
* Implement Grim Giganotosaurus * Refactor MonstrosityAbility to take cost adjuster * Update Nemesis of Mortals' monstrous ability and add test for cost reduction
This commit is contained in:
parent
9d7bf27d38
commit
b0d7daa85e
5 changed files with 147 additions and 13 deletions
|
|
@ -2,7 +2,9 @@ package mage.abilities.keyword;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.CostAdjuster;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.hint.common.MonstrousHint;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -44,15 +46,21 @@ public class MonstrosityAbility extends ActivatedAbilityImpl {
|
|||
|
||||
private final int monstrosityValue;
|
||||
|
||||
public MonstrosityAbility(String manaString, int monstrosityValue) {
|
||||
this(manaString, monstrosityValue, null, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param manaString
|
||||
* @param monstrosityValue use Integer.MAX_VALUE for monstrosity X.
|
||||
* @param costAdjuster
|
||||
* @param costAdjusterText Clarifies the cost adjusting condition(s).
|
||||
*/
|
||||
public MonstrosityAbility(String manaString, int monstrosityValue) {
|
||||
super(Zone.BATTLEFIELD, new BecomeMonstrousSourceEffect(monstrosityValue), new ManaCostsImpl<>(manaString));
|
||||
public MonstrosityAbility(String manaString, int monstrosityValue, CostAdjuster costAdjuster, String costAdjusterText) {
|
||||
super(Zone.BATTLEFIELD, new BecomeMonstrousSourceEffect(monstrosityValue, costAdjusterText), new ManaCostsImpl<>(manaString));
|
||||
this.monstrosityValue = monstrosityValue;
|
||||
|
||||
this.addHint(MonstrousHint.instance);
|
||||
setCostAdjuster(costAdjuster);
|
||||
}
|
||||
|
||||
protected MonstrosityAbility(final MonstrosityAbility ability) {
|
||||
|
|
@ -74,8 +82,12 @@ public class MonstrosityAbility extends ActivatedAbilityImpl {
|
|||
class BecomeMonstrousSourceEffect extends OneShotEffect {
|
||||
|
||||
public BecomeMonstrousSourceEffect(int monstrosityValue) {
|
||||
this(monstrosityValue, "");
|
||||
}
|
||||
|
||||
public BecomeMonstrousSourceEffect(int monstrosityValue, String costAdjusterText) {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = setText(monstrosityValue);
|
||||
this.staticText = setText(monstrosityValue, costAdjusterText);
|
||||
}
|
||||
|
||||
protected BecomeMonstrousSourceEffect(final BecomeMonstrousSourceEffect effect) {
|
||||
|
|
@ -110,9 +122,9 @@ class BecomeMonstrousSourceEffect extends OneShotEffect {
|
|||
return true;
|
||||
}
|
||||
|
||||
private String setText(int monstrosityValue) {
|
||||
private String setText(int monstrosityValue, String costAdjusterText) {
|
||||
return "Monstrosity " + (monstrosityValue == Integer.MAX_VALUE ? "X" : monstrosityValue) +
|
||||
". <i>(If this creature isn't monstrous, put " +
|
||||
". " + costAdjusterText + "<i>(If this creature isn't monstrous, put " +
|
||||
(monstrosityValue == Integer.MAX_VALUE ? "X" : CardUtil.numberToText(monstrosityValue)) +
|
||||
" +1/+1 counters on it and it becomes monstrous.)</i>";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue