mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Refactor - moved ChromaOutrageShamanCount to shared area
This commit is contained in:
parent
b17b5c9e1a
commit
0ee3d6c662
3 changed files with 42 additions and 32 deletions
|
|
@ -0,0 +1,40 @@
|
|||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.cards.Card;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* Created by Eric on 9/24/2016.
|
||||
*/
|
||||
public class ChromaOutrageShamanCount implements DynamicValue {
|
||||
|
||||
private int chroma;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
chroma = 0;
|
||||
for (Card card : game.getBattlefield().getAllActivePermanents(new FilterControlledPermanent(), sourceAbility.getControllerId(), game)) {
|
||||
chroma += card.getManaCost().getMana().getRed();
|
||||
}
|
||||
return chroma;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return new ChromaOutrageShamanCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue