mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 20:29:19 -08:00
* Nemesis of Mortals - Fixed wrong cost calculation of monstrosity ability.
This commit is contained in:
parent
fcb50dd475
commit
608f7bd3e3
3 changed files with 39 additions and 20 deletions
|
|
@ -30,7 +30,9 @@ package mage.sets.theros;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.MonstrosityAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -61,20 +63,32 @@ public class NemesisOfMortals extends CardImpl<NemesisOfMortals> {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new NemesisOfMortalsEffect()));
|
||||
|
||||
// {7}{G}{G}: Monstrosity 5. This ability costs {1} less to activate for each creature card in your graveyard.
|
||||
this.addAbility(new MonstrosityAbility("{7}{G}{G}", 5));
|
||||
Ability ability = new MonstrosityAbility("{7}{G}{G}", 5);
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
effect.setText("Monstrosity 5. This ability costs {1} less to activate for each creature card in your graveyard");
|
||||
}
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
Player player = game.getPlayer(this.getOwnerId());
|
||||
int creatureCount = player.getGraveyard().count(new FilterCreatureCard(), game);
|
||||
int cost = 4 - creatureCount;
|
||||
String adjustedCost = "{G}{G}";
|
||||
if (cost > 0) {
|
||||
adjustedCost = "{" + String.valueOf(cost) + "}" + adjustedCost;
|
||||
if (ability instanceof SpellAbility || ability instanceof MonstrosityAbility) {
|
||||
Player player = game.getPlayer(this.getOwnerId());
|
||||
int creatureCount = player.getGraveyard().count(new FilterCreatureCard(), game);
|
||||
int genericMana;
|
||||
if (ability instanceof MonstrosityAbility) {
|
||||
genericMana = 7 - creatureCount;
|
||||
} else {
|
||||
genericMana = 4 - creatureCount;
|
||||
}
|
||||
StringBuilder adjustedCost = new StringBuilder();
|
||||
if (genericMana > 0) {
|
||||
adjustedCost.append("{").append(genericMana).append("}");
|
||||
}
|
||||
adjustedCost.insert(0,"{G}{G}");
|
||||
ability.getManaCostsToPay().clear();
|
||||
ability.getManaCostsToPay().load(adjustedCost.toString());
|
||||
}
|
||||
ability.getManaCostsToPay().clear();
|
||||
ability.getManaCostsToPay().load(adjustedCost);
|
||||
}
|
||||
|
||||
public NemesisOfMortals(final NemesisOfMortals card) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.sets.theros;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||
import mage.abilities.effects.common.LoseLifeControllerEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceEffect;
|
||||
import mage.abilities.effects.common.ScryEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue