mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
[SNC] Implemented Reservoir Kraken
This commit is contained in:
parent
0dd93ac20a
commit
4995dc2958
2 changed files with 112 additions and 0 deletions
111
Mage.Sets/src/mage/cards/r/ReservoirKraken.java
Normal file
111
Mage.Sets/src/mage/cards/r/ReservoirKraken.java
Normal file
|
@ -0,0 +1,111 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.SourceTappedCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.keyword.WardAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.FishToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class ReservoirKraken extends CardImpl {
|
||||
|
||||
public ReservoirKraken(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
|
||||
this.subtype.add(SubType.KRAKEN);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Ward {2}
|
||||
this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}")));
|
||||
|
||||
// At the beginning of each combat, if Reservoir Kraken is untapped, any opponent may tap an untapped creature they control. If they do, tap Reservoir Kraken and create a 1/1 blue Fish creature token with "This creature can't be blocked."
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(new ReservoirKrakenEffect(), TargetController.ANY, false),
|
||||
SourceTappedCondition.UNTAPPED,
|
||||
"At the beginning of each combat, if {this} is untapped, any opponent may tap an untapped creature they control. If they do, tap {this} and create a 1/1 blue Fish creature token with \"This creature can't be blocked.\""
|
||||
));
|
||||
}
|
||||
|
||||
private ReservoirKraken(final ReservoirKraken card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReservoirKraken copy() {
|
||||
return new ReservoirKraken(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ReservoirKrakenEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control");
|
||||
|
||||
static {
|
||||
filter.add(TappedPredicate.UNTAPPED);
|
||||
}
|
||||
|
||||
public ReservoirKrakenEffect() {
|
||||
super(Outcome.Tap);
|
||||
this.staticText = "any opponent may tap an untapped creature they control. If they do, tap {this} and create a 1/1 blue Fish creature token with \"This creature can't be blocked.\"";
|
||||
}
|
||||
|
||||
private ReservoirKrakenEffect(final ReservoirKrakenEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReservoirKrakenEffect copy() {
|
||||
return new ReservoirKrakenEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean opponentTapped = false;
|
||||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null) {
|
||||
TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(1, 1, filter, true);
|
||||
if (target.canChoose(opponentId, source, game) && opponent.chooseUse(Outcome.AIDontUseIt, "Tap an untapped creature you control?", source, game)) {
|
||||
opponent.chooseTarget(Outcome.Tap, target, source, game);
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null && permanent.tap(source, game)) {
|
||||
opponentTapped = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (opponentTapped) {
|
||||
Permanent kraken = source.getSourcePermanentIfItStillExists(game);
|
||||
if (kraken != null) {
|
||||
kraken.tap(source, game);
|
||||
}
|
||||
new FishToken().putOntoBattlefield(1, game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -152,6 +152,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Raffine's Tower", 254, Rarity.RARE, mage.cards.r.RaffinesTower.class));
|
||||
cards.add(new SetCardInfo("Raffine, Scheming Seer", 213, Rarity.MYTHIC, mage.cards.r.RaffineSchemingSeer.class));
|
||||
cards.add(new SetCardInfo("Refuse to Yield", 27, Rarity.UNCOMMON, mage.cards.r.RefuseToYield.class));
|
||||
cards.add(new SetCardInfo("Reservoir Kraken", 56, Rarity.RARE, mage.cards.r.ReservoirKraken.class));
|
||||
cards.add(new SetCardInfo("Revel Ruiner", 91, Rarity.COMMON, mage.cards.r.RevelRuiner.class));
|
||||
cards.add(new SetCardInfo("Riveteers Charm", 217, Rarity.UNCOMMON, mage.cards.r.RiveteersCharm.class));
|
||||
cards.add(new SetCardInfo("Riveteers Initiate", 120, Rarity.COMMON, mage.cards.r.RiveteersInitiate.class));
|
||||
|
|
Loading…
Reference in a new issue