mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Treasonous Ogre - Fixed available mana generation (#6698).
This commit is contained in:
parent
67dd45c1c7
commit
516a4104f1
3 changed files with 73 additions and 3 deletions
|
|
@ -0,0 +1,48 @@
|
|||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ControllerLifeDividedValue implements DynamicValue {
|
||||
|
||||
private final Integer divider;
|
||||
|
||||
public ControllerLifeDividedValue(Integer divider) {
|
||||
this.divider = divider;
|
||||
}
|
||||
|
||||
public ControllerLifeDividedValue(final ControllerLifeDividedValue dynamicValue) {
|
||||
this.divider = dynamicValue.divider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player p = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (p != null) {
|
||||
return p.getLife() / divider;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ControllerLifeDividedValue copy() {
|
||||
return new ControllerLifeDividedValue(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue