Skip to content

[DFT] Implement Lifecraft Engine #13294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions Mage.Sets/src/mage/cards/l/LifecraftEngine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package mage.cards.l;

import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.continuous.BoostAllOfChosenSubtypeEffect;
import mage.abilities.keyword.CrewAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;

import java.util.List;
import java.util.UUID;

/**
*
* @author jackd149
*/
public final class LifecraftEngine extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must be filter = StaticFilters.FILTER_CONTROLLED_CREATURE or filter = new FilterControlledCreaturePermanent due "Each creature you control of the chosen type"

public LifecraftEngine(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");

this.subtype.add(SubType.VEHICLE);
this.power = new MageInt(4);
this.toughness = new MageInt(4);

// As this Vehicle enters, choose a creature type.
this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature)));

// Vehicle creatures you control are the chosen creature type in addition to their other types.
this.addAbility(new SimpleStaticAbility(new LifecraftEngineAddSubTypeAllEffect()));

// Each creature you control of the chosen type other than this Vehicle gets +1/+1.
BoostAllOfChosenSubtypeEffect effect = new BoostAllOfChosenSubtypeEffect(1, 1, Duration.WhileOnBattlefield, filter, true);
effect.setText("Each creature you control of the chosen type other than this Vehicle gets +1/+1.");
this.addAbility(new SimpleStaticAbility(effect));

// Crew 3
this.addAbility(new CrewAbility(3));
}

private LifecraftEngine(final LifecraftEngine card) {
super(card);
}

@Override
public LifecraftEngine copy() {
return new LifecraftEngine(this);
}
}

class LifecraftEngineAddSubTypeAllEffect extends ContinuousEffectImpl {
static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();

static {
filter.add(SubType.VEHICLE.getPredicate());
}
public LifecraftEngineAddSubTypeAllEffect() {
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit);

staticText = "Vehicle creatures you control are the chosen type in addition to their other types.";
}

private LifecraftEngineAddSubTypeAllEffect(final LifecraftEngineAddSubTypeAllEffect effect) {
super(effect);
}

@Override
public LifecraftEngineAddSubTypeAllEffect copy() {
return new LifecraftEngineAddSubTypeAllEffect(this);
}

@Override
public boolean apply(Game game, Ability source) {
UUID controllerId = source.getControllerId();
Player controller = game.getPlayer(controllerId);
SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);
if (controller == null || subType == null) {
return false;
}

List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(
filter, controllerId, game);
for (Permanent creature : creatures) {
if (creature != null) {
creature.addSubType(game, subType);
}
}
return true;
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Aetherdrift.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private Aetherdrift() {
cards.add(new SetCardInfo("Kickoff Celebrations", 135, Rarity.COMMON, mage.cards.k.KickoffCelebrations.class));
cards.add(new SetCardInfo("Lagorin, Soul of Alacria", 211, Rarity.UNCOMMON, mage.cards.l.LagorinSoulOfAlacria.class));
cards.add(new SetCardInfo("Leonin Surveyor", 18, Rarity.COMMON, mage.cards.l.LeoninSurveyor.class));
cards.add(new SetCardInfo("Lifecraft Engine", 234, Rarity.RARE, mage.cards.l.LifecraftEngine.class));
cards.add(new SetCardInfo("Lightning Strike", 136, Rarity.COMMON, mage.cards.l.LightningStrike.class));
cards.add(new SetCardInfo("Lightshield Parry", 19, Rarity.COMMON, mage.cards.l.LightshieldParry.class));
cards.add(new SetCardInfo("Lightwheel Enhancements", 20, Rarity.COMMON, mage.cards.l.LightwheelEnhancements.class));
Expand Down