mirror of
https://github.com/correl/mage.git
synced 2025-04-14 09:09:38 -09:00
[NCC] Implemented Cabaretti Confluence
This commit is contained in:
parent
22a50c424e
commit
914b69bda9
3 changed files with 123 additions and 53 deletions
Mage.Sets/src/mage
Mage/src/main/java/mage/constants
96
Mage.Sets/src/mage/cards/c/CabarettiConfluence.java
Normal file
96
Mage.Sets/src/mage/cards/c/CabarettiConfluence.java
Normal file
|
@ -0,0 +1,96 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class CabarettiConfluence extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(TargetController.SOURCE_TARGETS.getControllerPredicate());
|
||||
}
|
||||
|
||||
public CabarettiConfluence(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}{G}{W}");
|
||||
|
||||
// Choose three. You may choose the same mode more than once.
|
||||
this.getSpellAbility().getModes().setMinModes(3);
|
||||
this.getSpellAbility().getModes().setMaxModes(3);
|
||||
this.getSpellAbility().getModes().setEachModeMoreThanOnce(true);
|
||||
|
||||
// • Create a token that's a copy of target creature you control. It gains haste. Sacrifice it at the beginning of the next end step.
|
||||
this.getSpellAbility().addEffect(new CabarettiConfluenceEffect());
|
||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||
|
||||
// • Exile target artifact or enchantment.
|
||||
this.getSpellAbility().addMode(new Mode(new ExileTargetEffect())
|
||||
.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT)));
|
||||
|
||||
// • Creatures target player controls gets +1/+1 and gain first strike until end of turn.
|
||||
this.getSpellAbility().addMode(new Mode(new BoostAllEffect(
|
||||
1, 1, Duration.EndOfTurn, filter, false
|
||||
).setText("creatures target player controls gets +1/+1")).addEffect(new GainAbilityAllEffect(
|
||||
FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter
|
||||
).setText("and gain first strike until end of turn")));
|
||||
}
|
||||
|
||||
private CabarettiConfluence(final CabarettiConfluence card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CabarettiConfluence copy() {
|
||||
return new CabarettiConfluence(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CabarettiConfluenceEffect extends OneShotEffect {
|
||||
|
||||
CabarettiConfluenceEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "create a token that's a copy of target creature you control. " +
|
||||
"It gains haste. Sacrifice it at the beginning of the next end step";
|
||||
}
|
||||
|
||||
private CabarettiConfluenceEffect(final CabarettiConfluenceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CabarettiConfluenceEffect copy() {
|
||||
return new CabarettiConfluenceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect();
|
||||
effect.addAdditionalAbilities(HasteAbility.getInstance());
|
||||
effect.apply(game, source);
|
||||
effect.sacrificeTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -56,6 +56,7 @@ public final class NewCapennaCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Boxing Ring", 91, Rarity.RARE, mage.cards.b.BoxingRing.class));
|
||||
cards.add(new SetCardInfo("Bribe Taker", 55, Rarity.RARE, mage.cards.b.BribeTaker.class));
|
||||
cards.add(new SetCardInfo("Brokers Confluence", 68, Rarity.RARE, mage.cards.b.BrokersConfluence.class));
|
||||
cards.add(new SetCardInfo("Cabaretti Confluence", 69, Rarity.RARE, mage.cards.c.CabarettiConfluence.class));
|
||||
cards.add(new SetCardInfo("Caldaia Guardian", 56, Rarity.RARE, mage.cards.c.CaldaiaGuardian.class));
|
||||
cards.add(new SetCardInfo("Call the Coppercoats", 195, Rarity.RARE, mage.cards.c.CallTheCoppercoats.class));
|
||||
cards.add(new SetCardInfo("Call the Skybreaker", 333, Rarity.RARE, mage.cards.c.CallTheSkybreaker.class));
|
||||
|
|
|
@ -68,29 +68,22 @@ public enum TargetController {
|
|||
|
||||
switch (targetOwner) {
|
||||
case YOU:
|
||||
if (card.isOwnedBy(playerId)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return card.isOwnedBy(playerId);
|
||||
case OPPONENT:
|
||||
if (!card.isOwnedBy(playerId)
|
||||
&& game.getPlayer(playerId).hasOpponent(card.getOwnerId(), game)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return !card.isOwnedBy(playerId)
|
||||
&& game.getPlayer(playerId).hasOpponent(card.getOwnerId(), game);
|
||||
case NOT_YOU:
|
||||
if (!card.isOwnedBy(playerId)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return !card.isOwnedBy(playerId);
|
||||
case ENCHANTED:
|
||||
Permanent permanent = input.getSource().getSourcePermanentIfItStillExists(game);
|
||||
return permanent != null && input.getObject().isOwnedBy(permanent.getAttachedTo());
|
||||
case SOURCE_TARGETS:
|
||||
return card.isOwnedBy(input.getSource().getFirstTarget());
|
||||
case ANY:
|
||||
return true;
|
||||
default:
|
||||
throw new UnsupportedOperationException("TargetController not supported");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -117,24 +110,17 @@ public enum TargetController {
|
|||
|
||||
switch (targetPlayer) {
|
||||
case YOU:
|
||||
if (player.getId().equals(playerId)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return player.getId().equals(playerId);
|
||||
case OPPONENT:
|
||||
if (!player.getId().equals(playerId) &&
|
||||
game.getPlayer(playerId).hasOpponent(player.getId(), game)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return !player.getId().equals(playerId) &&
|
||||
game.getPlayer(playerId).hasOpponent(player.getId(), game);
|
||||
case NOT_YOU:
|
||||
if (!player.getId().equals(playerId)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return !player.getId().equals(playerId);
|
||||
case SOURCE_TARGETS:
|
||||
return player.equals(input.getSource().getFirstTarget());
|
||||
default:
|
||||
throw new UnsupportedOperationException("TargetController not supported");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -158,39 +144,26 @@ public enum TargetController {
|
|||
|
||||
switch (controller) {
|
||||
case YOU:
|
||||
if (object.isControlledBy(playerId)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return object.isControlledBy(playerId);
|
||||
case TEAM:
|
||||
if (!game.getPlayer(playerId).hasOpponent(object.getControllerId(), game)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return !game.getPlayer(playerId).hasOpponent(object.getControllerId(), game);
|
||||
case OPPONENT:
|
||||
if (!object.isControlledBy(playerId)
|
||||
&& game.getPlayer(playerId).hasOpponent(object.getControllerId(), game)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return !object.isControlledBy(playerId)
|
||||
&& game.getPlayer(playerId).hasOpponent(object.getControllerId(), game);
|
||||
case NOT_YOU:
|
||||
if (!object.isControlledBy(playerId)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return !object.isControlledBy(playerId);
|
||||
case ACTIVE:
|
||||
if (object.isControlledBy(game.getActivePlayerId())) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return object.isControlledBy(game.getActivePlayerId());
|
||||
case ENCHANTED:
|
||||
Permanent permanent = input.getSource().getSourcePermanentIfItStillExists(game);
|
||||
return permanent != null && input.getObject().isControlledBy(permanent.getAttachedTo());
|
||||
case SOURCE_TARGETS:
|
||||
return object.isControlledBy(input.getSource().getFirstTarget());
|
||||
case ANY:
|
||||
return true;
|
||||
default:
|
||||
throw new UnsupportedOperationException("TargetController not supported");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue