[SPM] implement Biorganic Carapace

This commit is contained in:
jmlundeen 2025-09-04 14:12:14 -05:00
parent 37cffc3895
commit d1b11cad4f
3 changed files with 70 additions and 2 deletions

View file

@ -0,0 +1,64 @@
package mage.cards.b;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.ModifiedPredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
*
* @author Jmlundeen
*/
public final class BiorganicCarapace extends CardImpl {
private static final FilterPermanent filter = new FilterControlledCreaturePermanent("each modified creature you control");
static {
filter.add(ModifiedPredicate.instance);
}
public BiorganicCarapace(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}{W}{U}");
this.subtype.add(SubType.EQUIPMENT);
// When this Equipment enters, attach it to target creature you control.
Ability ability = new EntersBattlefieldAbility(new AttachEffect(Outcome.BoostCreature));
ability.addTarget(new TargetControlledCreaturePermanent());
this.addAbility(ability);
// Equipped creature gets +2/+2 and has "Whenever this creature deals combat damage to a player, draw a card for each modified creature you control."
Ability gainedAbility = new DealsCombatDamageTriggeredAbility(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filter)), false);
Ability equipAbility = new SimpleStaticAbility(new BoostEquippedEffect(2, 2));
equipAbility.addEffect(new GainAbilityAttachedEffect(gainedAbility, null)
.concatBy("and"));
this.addAbility(equipAbility);
// Equip {2}
this.addAbility(new EquipAbility(2));
}
private BiorganicCarapace(final BiorganicCarapace card) {
super(card);
}
@Override
public BiorganicCarapace copy() {
return new BiorganicCarapace(this);
}
}

View file

@ -38,6 +38,8 @@ public final class MarvelsSpiderMan extends ExpansionSet {
cards.add(new SetCardInfo("Beetle, Legacy Criminal", 26, Rarity.COMMON, mage.cards.b.BeetleLegacyCriminal.class));
cards.add(new SetCardInfo("Behold the Sinister Six!", 221, Rarity.MYTHIC, mage.cards.b.BeholdTheSinisterSix.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Behold the Sinister Six!", 51, Rarity.MYTHIC, mage.cards.b.BeholdTheSinisterSix.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Biorganic Carapace", 124, Rarity.RARE, mage.cards.b.BiorganicCarapace.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Biorganic Carapace", 269, Rarity.RARE, mage.cards.b.BiorganicCarapace.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Black Cat, Cunning Thief", 222, Rarity.RARE, mage.cards.b.BlackCatCunningThief.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Black Cat, Cunning Thief", 52, Rarity.RARE, mage.cards.b.BlackCatCunningThief.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Carnage, Crimson Chaos", 125, Rarity.RARE, mage.cards.c.CarnageCrimsonChaos.class, NON_FULL_USE_VARIOUS));

View file

@ -143,8 +143,10 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
return staticText;
}
StringBuilder sb = new StringBuilder();
sb.append(attachmentType.verb().toLowerCase());
sb.append(" " + targetObjectName + " ");
if (attachmentType != null) {
sb.append(attachmentType.verb().toLowerCase());
sb.append(" " + targetObjectName + " ");
}
if (duration == Duration.WhileOnBattlefield) {
sb.append("has ");
} else {