Search in sources :

Example 1 with GiantWarriorToken

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

the class FeudkillersVerdictEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        controller.gainLife(10, game, source);
        boolean moreLife = false;
        for (UUID opponentId : game.getOpponents(source.getControllerId())) {
            Player opponent = game.getPlayer(opponentId);
            if (opponent != null) {
                if (controller.getLife() > opponent.getLife()) {
                    moreLife = true;
                    break;
                }
            }
        }
        if (moreLife) {
            return new CreateTokenEffect(new GiantWarriorToken(), 1).apply(game, source);
        }
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) GiantWarriorToken(mage.game.permanent.token.GiantWarriorToken) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) UUID(java.util.UUID)

Aggregations

UUID (java.util.UUID)1 CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 GiantWarriorToken (mage.game.permanent.token.GiantWarriorToken)1 Player (mage.players.Player)1