forked from External/mage
[MRD] Auriok Bladewarden
This commit is contained in:
parent
3e28957657
commit
53d70ffbe3
2 changed files with 114 additions and 0 deletions
|
|
@ -0,0 +1,40 @@
|
|||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
public class SourcePermanentPowerCount implements DynamicValue {
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
Permanent sourcePermanent = game.getPermanent(sourceAbility.getSourceId());
|
||||
if (sourcePermanent == null) {
|
||||
sourcePermanent = (Permanent) game.getLastKnownInformation(sourceAbility.getSourceId(), Constants.Zone.BATTLEFIELD);
|
||||
}
|
||||
if (sourcePermanent != null)
|
||||
return sourcePermanent.getPower().getValue();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue clone() {
|
||||
return new SourcePermanentPowerCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "point of power that {source} had";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue