forked from External/mage
Some changes to mana handling to handle {C} mana.
This commit is contained in:
parent
7a3c0bb884
commit
782190bac3
185 changed files with 700 additions and 566 deletions
|
|
@ -29,13 +29,13 @@ public class AffinityEffect extends CostModificationEffectImpl {
|
|||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
SpellAbility spellAbility = (SpellAbility)abilityToModify;
|
||||
Mana mana = spellAbility.getManaCostsToPay().getMana();
|
||||
if (mana.getColorless() > 0) {
|
||||
if (mana.getGeneric() > 0) {
|
||||
int count = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
|
||||
int newCount = mana.getColorless() - count;
|
||||
int newCount = mana.getGeneric() - count;
|
||||
if (newCount < 0) {
|
||||
newCount = 0;
|
||||
}
|
||||
mana.setColorless(newCount);
|
||||
mana.setGeneric(newCount);
|
||||
spellAbility.getManaCostsToPay().load(mana.toString());
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue