[DSC] Implement Experimental Lab // Staff Room

This commit is contained in:
theelk801 2025-12-08 09:54:09 -05:00
parent 98f7613d20
commit bee3614f65
3 changed files with 107 additions and 12 deletions

View file

@ -0,0 +1,80 @@
package mage.cards.e;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
import mage.abilities.common.UnlockThisDoorTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.keyword.ManifestDreadEffect;
import mage.cards.CardSetInfo;
import mage.cards.RoomCard;
import mage.constants.Outcome;
import mage.constants.SetTargetPointer;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ExperimentalLabStaffRoom extends RoomCard {
public ExperimentalLabStaffRoom(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, "{3}{G}", "{2}{G}");
// Experimental Lab
// When you unlock this door, manifest dread, then put two +1/+1 counters and a trample counter on that creature.
this.getLeftHalfCard().addAbility(new UnlockThisDoorTriggeredAbility(new ManifestDreadEffect(
CounterType.P1P1.createInstance(2), CounterType.TRAMPLE.createInstance()
), false, true));
// Staff Room
// Whenever a creature you control deals combat damage to a player, turn that creature face up or put a +1/+1 counter on it.
this.getRightHalfCard().addAbility(new DealsDamageToAPlayerAllTriggeredAbility(
new StaffRoomEffect(), StaticFilters.FILTER_CONTROLLED_CREATURE,
false, SetTargetPointer.PERMANENT, true
));
}
private ExperimentalLabStaffRoom(final ExperimentalLabStaffRoom card) {
super(card);
}
@Override
public ExperimentalLabStaffRoom copy() {
return new ExperimentalLabStaffRoom(this);
}
}
class StaffRoomEffect extends OneShotEffect {
StaffRoomEffect() {
super(Outcome.Benefit);
staticText = "turn that creature face up or put a +1/+1 counter on it";
}
private StaffRoomEffect(final StaffRoomEffect effect) {
super(effect);
}
@Override
public StaffRoomEffect copy() {
return new StaffRoomEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (player == null || permanent == null) {
return false;
}
return permanent.isFaceDown(game)
&& player.chooseUse(Outcome.BoostCreature, "Turn " + permanent.getIdName() + " creature face-up?", source, game)
&& permanent.turnFaceUp(source, game, source.getControllerId())
|| permanent.addCounters(CounterType.P1P1.createInstance(), source, game);
}
}

View file

@ -114,6 +114,7 @@ public final class DuskmournHouseOfHorrorCommander extends ExpansionSet {
cards.add(new SetCardInfo("Evolving Wilds", 274, Rarity.COMMON, mage.cards.e.EvolvingWilds.class));
cards.add(new SetCardInfo("Exhume", 370, Rarity.MYTHIC, mage.cards.e.Exhume.class));
cards.add(new SetCardInfo("Exotic Orchard", 275, Rarity.RARE, mage.cards.e.ExoticOrchard.class));
cards.add(new SetCardInfo("Experimental Lab // Staff Room", 33, Rarity.RARE, mage.cards.e.ExperimentalLabStaffRoom.class));
cards.add(new SetCardInfo("Explosive Vegetation", 177, Rarity.UNCOMMON, mage.cards.e.ExplosiveVegetation.class));
cards.add(new SetCardInfo("Extravagant Replication", 117, Rarity.RARE, mage.cards.e.ExtravagantReplication.class));
cards.add(new SetCardInfo("Ezuri's Predation", 178, Rarity.RARE, mage.cards.e.EzurisPredation.class));

View file

@ -14,29 +14,32 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInLibrary;
import mage.util.CardUtil;
import java.util.Optional;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author TheElk801
*/
public class ManifestDreadEffect extends OneShotEffect {
private final Counter counter;
private final List<Counter> counters = new ArrayList<>();
public ManifestDreadEffect() {
this((Counter) null);
}
public ManifestDreadEffect(Counter counter) {
public ManifestDreadEffect(Counter... counters) {
super(Outcome.Benefit);
this.counter = counter;
staticText = "manifest dread" + (counter != null ? ", then put " + counter.getDescription() + " on that creature" : "");
for (Counter counter : counters) {
this.counters.add(counter);
}
staticText = this.makeText();
}
private ManifestDreadEffect(final ManifestDreadEffect effect) {
super(effect);
this.counter = Optional.ofNullable(effect.counter).map(Counter::copy).orElse(null);
for (Counter counter : effect.counters) {
this.counters.add(counter.copy());
}
}
@Override
@ -52,9 +55,9 @@ public class ManifestDreadEffect extends OneShotEffect {
}
Permanent permanent = doManifestDread(player, source, game);
if (permanent == null) {
return false;
return true;
}
if (counter != null) {
for (Counter counter : counters) {
permanent.addCounters(counter, source, game);
}
return true;
@ -91,4 +94,15 @@ public class ManifestDreadEffect extends OneShotEffect {
game.fireEvent(new ManifestedDreadEvent(permanent, source, player.getId(), cards, game));
return permanent;
}
private String makeText() {
StringBuilder sb = new StringBuilder("manifest dread");
if (this.counters.isEmpty()) {
return sb.toString();
}
sb.append(", then put ");
sb.append(CardUtil.concatWithAnd(counters.stream().map(Counter::getDescription).collect(Collectors.toList())));
sb.append(" on that creature");
return sb.toString();
}
}