forked from External/mage
[MKC] Implement Experiment Twelve, changes to TargetPermanentPowerCount (#11901)
This commit is contained in:
parent
9893032a36
commit
fc5ee90bf8
3 changed files with 64 additions and 8 deletions
|
|
@ -4,7 +4,6 @@ package mage.abilities.dynamicvalue.common;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
|
@ -16,12 +15,9 @@ public enum TargetPermanentPowerCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Permanent sourcePermanent = game.getPermanent(sourceAbility.getFirstTarget());
|
||||
if (sourcePermanent == null) {
|
||||
sourcePermanent = (Permanent) game.getLastKnownInformation(sourceAbility.getFirstTarget(), Zone.BATTLEFIELD);
|
||||
}
|
||||
if (sourcePermanent != null) {
|
||||
return sourcePermanent.getPower().getValue();
|
||||
Permanent targetPermanent = effect.getTargetPointer().getFirstTargetPermanentOrLKI(game, sourceAbility);
|
||||
if (targetPermanent != null) {
|
||||
return targetPermanent.getPower().getValue();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue