mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[TLE] Implement Swampbenders
This commit is contained in:
parent
e38c199177
commit
ebf82309fc
2 changed files with 91 additions and 0 deletions
90
Mage.Sets/src/mage/cards/s/Swampbenders.java
Normal file
90
Mage.Sets/src/mage/cards/s/Swampbenders.java
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class Swampbenders extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(
|
||||
new FilterPermanent(SubType.SWAMP, "Swamps on the battlefield")
|
||||
);
|
||||
|
||||
public Swampbenders(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.DRUID);
|
||||
this.subtype.add(SubType.ALLY);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// Swampbenders's power and toughness are each equal to the number of Swamps on the battlefield.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue)));
|
||||
|
||||
// Lands you control are Swamps in addition to their other types.
|
||||
this.addAbility(new SimpleStaticAbility(new SwampbendersEffect()));
|
||||
}
|
||||
|
||||
private Swampbenders(final Swampbenders card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Swampbenders copy() {
|
||||
return new Swampbenders(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SwampbendersEffect extends ContinuousEffectImpl {
|
||||
|
||||
SwampbendersEffect() {
|
||||
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.AIDontUseIt);
|
||||
staticText = "lands you control are Swamps in addition to their other types.";
|
||||
this.dependendToTypes.add(DependencyType.BecomeNonbasicLand);
|
||||
this.dependencyTypes.add(DependencyType.BecomeSwamp);
|
||||
}
|
||||
|
||||
private SwampbendersEffect(final SwampbendersEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SwampbendersEffect copy() {
|
||||
return new SwampbendersEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Ability ability = new BlackManaAbility();
|
||||
for (Permanent land : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_LAND, source.getControllerId(), game
|
||||
)) {
|
||||
// 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects
|
||||
// So the ability removing has to be done before Layer 6
|
||||
// Lands have their mana ability intrinsically, so that is added in layer 4
|
||||
land.addSubType(game, SubType.SWAMP);
|
||||
if (!land.getAbilities().containsRule(ability)) {
|
||||
land.addAbility(ability, source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -267,6 +267,7 @@ public final class AvatarTheLastAirbenderEternal extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Sunbaked Canyon", 58, Rarity.MYTHIC, mage.cards.s.SunbakedCanyon.class));
|
||||
cards.add(new SetCardInfo("Sundial of the Infinite", 55, Rarity.MYTHIC, mage.cards.s.SundialOfTheInfinite.class));
|
||||
cards.add(new SetCardInfo("Suspicious Bookcase", 170, Rarity.UNCOMMON, mage.cards.s.SuspiciousBookcase.class));
|
||||
cards.add(new SetCardInfo("Swampbenders", 65, Rarity.RARE, mage.cards.s.Swampbenders.class));
|
||||
cards.add(new SetCardInfo("Swiftfoot Boots", 317, Rarity.RARE, mage.cards.s.SwiftfootBoots.class));
|
||||
cards.add(new SetCardInfo("Tarnished Citadel", 59, Rarity.MYTHIC, mage.cards.t.TarnishedCitadel.class));
|
||||
cards.add(new SetCardInfo("Taunting Challenge", 46, Rarity.MYTHIC, mage.cards.t.TauntingChallenge.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue