Search in sources :

Example 1 with RiptideReplicatorToken

use of mage.game.permanent.token.RiptideReplicatorToken in project mage by magefree.

the class RiptideReplicatorEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
    SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);
    if (subType == null) {
        return false;
    }
    int x = (new CountersSourceCount(CounterType.CHARGE)).calculate(game, source, this);
    Token token = new RiptideReplicatorToken(color, subType, x);
    return token.putOntoBattlefield(1, game, source, source.getControllerId());
}
Also used : CountersSourceCount(mage.abilities.dynamicvalue.common.CountersSourceCount) RiptideReplicatorToken(mage.game.permanent.token.RiptideReplicatorToken) SubType(mage.constants.SubType) ObjectColor(mage.ObjectColor) RiptideReplicatorToken(mage.game.permanent.token.RiptideReplicatorToken) Token(mage.game.permanent.token.Token)

Aggregations

ObjectColor (mage.ObjectColor)1 CountersSourceCount (mage.abilities.dynamicvalue.common.CountersSourceCount)1 SubType (mage.constants.SubType)1 RiptideReplicatorToken (mage.game.permanent.token.RiptideReplicatorToken)1 Token (mage.game.permanent.token.Token)1