forked from External/mage
Restructured Mage module
This commit is contained in:
parent
727d62babb
commit
46eb6c0525
1502 changed files with 11 additions and 9 deletions
|
|
@ -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.common;
|
||||
|
||||
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() + " to your mana pool";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue