[TLA] Implement Boomerang Basics

This commit is contained in:
theelk801 2025-11-04 12:38:20 -05:00
parent c3f359c5e8
commit d968fb9f70
2 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,74 @@
package mage.cards.b;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetNonlandPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BoomerangBasics extends CardImpl {
public BoomerangBasics(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}");
this.subtype.add(SubType.LESSON);
// Return target nonland permanent to its owner's hand. If you controlled that permanent, draw a card.
this.getSpellAbility().addEffect(new BoomerangBasicsEffect());
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
}
private BoomerangBasics(final BoomerangBasics card) {
super(card);
}
@Override
public BoomerangBasics copy() {
return new BoomerangBasics(this);
}
}
class BoomerangBasicsEffect extends OneShotEffect {
BoomerangBasicsEffect() {
super(Outcome.Benefit);
staticText = "return target nonland permanent to its owner's hand. If you controlled that permanent, draw a card";
}
private BoomerangBasicsEffect(final BoomerangBasicsEffect effect) {
super(effect);
}
@Override
public BoomerangBasicsEffect copy() {
return new BoomerangBasicsEffect(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;
}
boolean flag = permanent.isControlledBy(player.getId());
player.moveCards(permanent, Zone.HAND, source, game);
if (flag) {
game.processAction();
player.drawCards(1, source, game);
}
return true;
}
}

View file

@ -53,6 +53,7 @@ public final class AvatarTheLastAirbender extends ExpansionSet {
cards.add(new SetCardInfo("Beetle-Headed Merchants", 86, Rarity.COMMON, mage.cards.b.BeetleHeadedMerchants.class));
cards.add(new SetCardInfo("Bender's Waterskin", 255, Rarity.COMMON, mage.cards.b.BendersWaterskin.class));
cards.add(new SetCardInfo("Boiling Rock Prison", 267, Rarity.COMMON, mage.cards.b.BoilingRockPrison.class));
cards.add(new SetCardInfo("Boomerang Basics", 46, Rarity.UNCOMMON, mage.cards.b.BoomerangBasics.class));
cards.add(new SetCardInfo("Bumi Bash", 125, Rarity.COMMON, mage.cards.b.BumiBash.class));
cards.add(new SetCardInfo("Bumi, Unleashed", 211, Rarity.MYTHIC, mage.cards.b.BumiUnleashed.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Bumi, Unleashed", 348, Rarity.MYTHIC, mage.cards.b.BumiUnleashed.class, NON_FULL_USE_VARIOUS));