* Some rework of handling of mana effects.

This commit is contained in:
LevelX2 2018-05-13 22:52:14 +02:00
parent 25b10c4d67
commit 21e5591e29
254 changed files with 1449 additions and 1399 deletions

View file

@ -0,0 +1,49 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.mana;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author magenoxx
*/
public class AddManaToManaPoolSourceControllerEffect extends OneShotEffect {
protected Mana mana;
public AddManaToManaPoolSourceControllerEffect(Mana mana) {
super(Outcome.PutManaInPool);
this.mana = mana;
this.staticText = "Add " + mana.toString() + "";
}
public AddManaToManaPoolSourceControllerEffect(final AddManaToManaPoolSourceControllerEffect effect) {
super(effect);
this.mana = effect.mana;
}
@Override
public AddManaToManaPoolSourceControllerEffect copy() {
return new AddManaToManaPoolSourceControllerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.getManaPool().addMana(mana, game, source);
return true;
}
return false;
}
}