Skip to content

Commit

Permalink
[PIP] Implement Survivor's Med Kit
Browse files Browse the repository at this point in the history
  • Loading branch information
theelk801 committed Apr 8, 2024
1 parent 398e2e2 commit 9ea9621
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
88 changes: 88 additions & 0 deletions Mage.Sets/src/mage/cards/s/SurvivorsMedKit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package mage.cards.s;

import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.token.FoodToken;
import mage.players.Player;
import mage.target.TargetPlayer;

import java.util.UUID;

/**
* @author TheElk801
*/
public final class SurvivorsMedKit extends CardImpl {

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

// {1}, {T}: Choose one that hasn't been chosen --
// * Stimpak -- Draw a card.
Ability ability = new SimpleActivatedAbility(new DrawCardSourceControllerEffect(1), new GenericManaCost(1));
ability.addCost(new TapSourceCost());
ability.withFirstModeFlavorWord("Stimpak");
ability.getModes().setLimitUsageByOnce(true);

// * Fancy Lads Snack Cakes -- Create a Food token.
ability.addMode(new Mode(new CreateTokenEffect(new FoodToken())).withFlavorWord("Fancy Lads Snack Cakes"));

// * RadAway -- Target player loses all rad counters. Sacrifice Survivor's Med Kit.
ability.addMode(new Mode(new SurvivorsMedKitEffect())
.addEffect(new SacrificeSourceEffect())
.addTarget(new TargetPlayer())
.withFlavorWord("RadAway"));
}

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

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

class SurvivorsMedKitEffect extends OneShotEffect {

SurvivorsMedKitEffect() {
super(Outcome.Benefit);
staticText = "target player loses all rad counters";
}

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

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

@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player == null) {
return false;
}
int count = player.getCounters().getCount(CounterType.RAD);
if (count > 0) {
player.removeCounters("rad", count, source, game);
return true;
}
return false;
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Fallout.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ private Fallout() {
cards.add(new SetCardInfo("Sunpetal Grove", 297, Rarity.RARE, mage.cards.s.SunpetalGrove.class));
cards.add(new SetCardInfo("Sunscorched Divide", 153, Rarity.RARE, mage.cards.s.SunscorchedDivide.class));
cards.add(new SetCardInfo("Super Mutant Scavenger", 85, Rarity.UNCOMMON, mage.cards.s.SuperMutantScavenger.class));
cards.add(new SetCardInfo("Survivor's Med Kit", 144, Rarity.UNCOMMON, mage.cards.s.SurvivorsMedKit.class));
cards.add(new SetCardInfo("Swamp", 321, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Swiftfoot Boots", 242, Rarity.UNCOMMON, mage.cards.s.SwiftfootBoots.class));
cards.add(new SetCardInfo("Swords to Plowshares", 173, Rarity.UNCOMMON, mage.cards.s.SwordsToPlowshares.class));
Expand Down

0 comments on commit 9ea9621

Please sign in to comment.