New AttachedPermanentToughnessValue, updated DamageAttachedControllerEffect to take DynamicValue (ex. to work with AttachedPermanentToughnessValue), and updated Creature Bond to use AttachedPermanentToughnessValue and DamageAttachedControllerEffect. Corrected Gaea's Liege, Kor Scythemaster, Soltari Lancer, and Spirit of the Night to use SourceAttackingCondition. Rmoved the AttackingCondition we creature for Gaea's Liege since it duplicated the already existing SourceAttackingCondition. For the other three using SourceAttackingCondition and the minor changes to the code for them should make their code more efficient.

This commit is contained in:
MTGfan 2016-11-26 03:57:46 -05:00
parent cd6917be93
commit 36d6c006ca
8 changed files with 136 additions and 168 deletions

View file

@ -0,0 +1,41 @@
/*
* 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.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author MTGfan
*/
public class AttachedPermanentToughnessValue implements DynamicValue {
@Override
public int calculate(Game game, Ability source, Effect effect) {
Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());
Permanent enchanted = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo());
return enchanted.getToughness().getValue();
}
@Override
public AttachedPermanentToughnessValue copy(){
return new AttachedPermanentToughnessValue();
}
@Override
public String toString() {
return "equal to";
}
@Override
public String getMessage() {
return "that creature's toughness";
}
}