[CMR] Implemented Toggo, Goblin Weaponsmith

This commit is contained in:
Evan Kranzler 2020-11-05 09:03:48 -05:00
parent edca0c5089
commit c994b82ce3
5 changed files with 88 additions and 2 deletions

View file

@ -35,7 +35,9 @@ public class SacrificeAttachmentCost extends UseAttachedCost {
continue;
}
Permanent attachment = game.getPermanent(attachmentId);
paid = attachment != null && attachment.sacrifice(sourceId, game);
paid = attachment != null
&& attachment.isControlledBy(controllerId)
&& attachment.sacrifice(sourceId, game);
if (paid) {
break;
}

View file

@ -0,0 +1,35 @@
package mage.game.permanent.token;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.SacrificeAttachmentCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityWithAttachmentEffect;
import mage.abilities.keyword.EquipAbility;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.target.common.TargetAnyTarget;
public final class RockToken extends TokenImpl {
public RockToken() {
super("Rock", "artifact equipment token named Rock with \"Equipped creature has '{1}, {T}, Sacrifice Rock: This creature deals 2 damage to any target'\" and equip {1}");
cardType.add(CardType.ARTIFACT);
subtype.add(SubType.EQUIPMENT);
this.addAbility(new SimpleStaticAbility(new GainAbilityWithAttachmentEffect(
"equipped creature has \"{1}, {T}, Sacrifice {this}: This creature deals 2 damage to any target.\"",
new DamageTargetEffect(2), new TargetAnyTarget(), new SacrificeAttachmentCost(), new GenericManaCost(1), new TapSourceCost()
)));
this.addAbility(new EquipAbility(1));
}
public RockToken(final RockToken token) {
super(token);
}
public RockToken copy() {
return new RockToken(this);
}
}