mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[TLA] Implement Secret Tunnel
This commit is contained in:
parent
1cb72d0efb
commit
ee77746db8
2 changed files with 95 additions and 0 deletions
93
Mage.Sets/src/mage/cards/s/SecretTunnel.java
Normal file
93
Mage.Sets/src/mage/cards/s/SecretTunnel.java
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
package mage.cards.s;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
|
import mage.abilities.dynamicvalue.common.GreatestSharedCreatureTypeCount;
|
||||||
|
import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
|
||||||
|
import mage.abilities.keyword.CantBeBlockedSourceAbility;
|
||||||
|
import mage.abilities.mana.ColorlessManaAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class SecretTunnel extends CardImpl {
|
||||||
|
|
||||||
|
public SecretTunnel(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||||
|
|
||||||
|
this.subtype.add(SubType.CAVE);
|
||||||
|
|
||||||
|
// This land can't be blocked.
|
||||||
|
this.addAbility(new CantBeBlockedSourceAbility());
|
||||||
|
|
||||||
|
// {T}: Add {C}.
|
||||||
|
this.addAbility(new ColorlessManaAbility());
|
||||||
|
|
||||||
|
// {4}, {T}: Two target creatures you control that share a creature type can't be blocked this turn.
|
||||||
|
Ability ability = new SimpleActivatedAbility(new CantBeBlockedTargetEffect(), new GenericManaCost(4));
|
||||||
|
ability.addCost(new TapSourceCost());
|
||||||
|
ability.addTarget(new SecretTunnelTarget());
|
||||||
|
this.addAbility(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SecretTunnel(final SecretTunnel card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SecretTunnel copy() {
|
||||||
|
return new SecretTunnel(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SecretTunnelTarget extends TargetPermanent {
|
||||||
|
private static final FilterPermanent filter
|
||||||
|
= new FilterControlledCreaturePermanent("creatures you control that share a creature type");
|
||||||
|
|
||||||
|
SecretTunnelTarget() {
|
||||||
|
super(2, 2, filter, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SecretTunnelTarget(final SecretTunnelTarget target) {
|
||||||
|
super(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canTarget(UUID playerId, UUID id, Ability source, Game game) {
|
||||||
|
if (!super.canTarget(playerId, id, source, game)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getTargets().isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Permanent targetOne = game.getPermanent(getTargets().get(0));
|
||||||
|
Permanent targetTwo = game.getPermanent(id);
|
||||||
|
if (targetOne == null || targetTwo == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return targetOne.shareCreatureTypes(game, targetTwo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canChoose(UUID sourceControllerId, Ability source, Game game) {
|
||||||
|
return GreatestSharedCreatureTypeCount.getValue(sourceControllerId, source, game) >= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SecretTunnelTarget copy() {
|
||||||
|
return new SecretTunnelTarget(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -263,6 +263,8 @@ public final class AvatarTheLastAirbender extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Rumble Arena", 277, Rarity.COMMON, mage.cards.r.RumbleArena.class));
|
cards.add(new SetCardInfo("Rumble Arena", 277, Rarity.COMMON, mage.cards.r.RumbleArena.class));
|
||||||
cards.add(new SetCardInfo("Saber-Tooth Moose-Lion", 194, Rarity.COMMON, mage.cards.s.SaberToothMooseLion.class));
|
cards.add(new SetCardInfo("Saber-Tooth Moose-Lion", 194, Rarity.COMMON, mage.cards.s.SaberToothMooseLion.class));
|
||||||
cards.add(new SetCardInfo("Sandbenders' Storm", 34, Rarity.COMMON, mage.cards.s.SandbendersStorm.class));
|
cards.add(new SetCardInfo("Sandbenders' Storm", 34, Rarity.COMMON, mage.cards.s.SandbendersStorm.class));
|
||||||
|
cards.add(new SetCardInfo("Secret Tunnel", 278, Rarity.RARE, mage.cards.s.SecretTunnel.class, NON_FULL_USE_VARIOUS));
|
||||||
|
cards.add(new SetCardInfo("Secret Tunnel", 392, Rarity.RARE, mage.cards.s.SecretTunnel.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Seismic Sense", 195, Rarity.UNCOMMON, mage.cards.s.SeismicSense.class));
|
cards.add(new SetCardInfo("Seismic Sense", 195, Rarity.UNCOMMON, mage.cards.s.SeismicSense.class));
|
||||||
cards.add(new SetCardInfo("Serpent of the Pass", 70, Rarity.UNCOMMON, mage.cards.s.SerpentOfThePass.class));
|
cards.add(new SetCardInfo("Serpent of the Pass", 70, Rarity.UNCOMMON, mage.cards.s.SerpentOfThePass.class));
|
||||||
cards.add(new SetCardInfo("Serpent's Pass", 279, Rarity.COMMON, mage.cards.s.SerpentsPass.class));
|
cards.add(new SetCardInfo("Serpent's Pass", 279, Rarity.COMMON, mage.cards.s.SerpentsPass.class));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue