pass the source permanent into MagicEquipTargetPicker instead of the card definition

master
melvin 2012-08-25 09:31:48 +08:00
parent cd77cf5cb7
commit 1fd294f0db
2 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ public class MagicEquipActivation extends MagicPermanentActivation {
source,
source.getController(),
MagicTargetChoice.TARGET_CREATURE_YOU_CONTROL,
new MagicEquipTargetPicker(getCardDefinition()),
new MagicEquipTargetPicker(source),
new Object[]{source},
this,
"Attach " + source + " to target creature$ you control.");

View File

@ -12,13 +12,13 @@ public class MagicEquipTargetPicker extends MagicTargetPicker<MagicPermanent> {
private final long givenAbilityFlags;
private final MagicPowerToughness givenPT;
public MagicEquipTargetPicker(final MagicCardDefinition cardDefinition) {
public MagicEquipTargetPicker(final MagicPermanent equipment) {
// determine given ability and given pt of equipment from list of static abilities
long ability = 0;
MagicPowerToughness pt = new MagicPowerToughness(0,0);
for (final MagicStatic mstatic : cardDefinition.getStatics()) {
ability = mstatic.getAbilityFlags(MagicPermanent.NONE, MagicPermanent.NONE, ability);
for (final MagicStatic mstatic : equipment.getCardDefinition().getStatics()) {
ability = mstatic.getAbilityFlags(equipment, MagicPermanent.NONE, ability);
mstatic.modPowerToughness(MagicGame.getInstance(), MagicPermanent.NONE, pt);
}