mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[TLA] Implement Sokka, Swordmaster
This commit is contained in:
parent
0445d65777
commit
f0370c4759
2 changed files with 99 additions and 0 deletions
97
Mage.Sets/src/mage/cards/s/SokkaSwordmaster.java
Normal file
97
Mage.Sets/src/mage/cards/s/SokkaSwordmaster.java
Normal file
|
|
@ -0,0 +1,97 @@
|
||||||
|
package mage.cards.s;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.SpellAbility;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.effects.common.AttachEffect;
|
||||||
|
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||||
|
import mage.abilities.keyword.VigilanceAbility;
|
||||||
|
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.*;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class SokkaSwordmaster extends CardImpl {
|
||||||
|
|
||||||
|
public SokkaSwordmaster(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||||
|
|
||||||
|
this.supertype.add(SuperType.LEGENDARY);
|
||||||
|
this.subtype.add(SubType.HUMAN);
|
||||||
|
this.subtype.add(SubType.WARRIOR);
|
||||||
|
this.subtype.add(SubType.ALLY);
|
||||||
|
this.power = new MageInt(3);
|
||||||
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
|
// Vigilance
|
||||||
|
this.addAbility(VigilanceAbility.getInstance());
|
||||||
|
|
||||||
|
// Equipment spells you cast cost {1} less to cast for each Ally you control.
|
||||||
|
this.addAbility(new SimpleStaticAbility(new SokkaSwordmasterEffect()).addHint(AffinityType.ALLIES.getHint()));
|
||||||
|
|
||||||
|
// At the beginning of combat on your turn, attach up to one target Equipment you control to Sokka.
|
||||||
|
Ability ability = new BeginningOfCombatTriggeredAbility(
|
||||||
|
new AttachEffect(Outcome.BoostCreature, "attach up to one target Equipment you control to {this}"
|
||||||
|
));
|
||||||
|
ability.addTarget(new TargetPermanent(
|
||||||
|
0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT
|
||||||
|
));
|
||||||
|
this.addAbility(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SokkaSwordmaster(final SokkaSwordmaster card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SokkaSwordmaster copy() {
|
||||||
|
return new SokkaSwordmaster(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SokkaSwordmasterEffect extends CostModificationEffectImpl {
|
||||||
|
|
||||||
|
SokkaSwordmasterEffect() {
|
||||||
|
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||||
|
staticText = "Equipment spells you cast cost {1} less to cast for each Ally you control";
|
||||||
|
}
|
||||||
|
|
||||||
|
private SokkaSwordmasterEffect(final SokkaSwordmasterEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||||
|
CardUtil.reduceCost(abilityToModify, game.getBattlefield().count(AffinityType.ALLIES.getFilter(), source.getControllerId(), source, game));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||||
|
return Optional
|
||||||
|
.ofNullable(abilityToModify)
|
||||||
|
.filter(SpellAbility.class::isInstance)
|
||||||
|
.filter(spellAbility -> spellAbility.isControlledBy(source.getControllerId()))
|
||||||
|
.map(SpellAbility.class::cast)
|
||||||
|
.map(spellAbility -> spellAbility.getCharacteristics(game))
|
||||||
|
.filter(card -> card.hasSubtype(SubType.EQUIPMENT, game))
|
||||||
|
.isPresent();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SokkaSwordmasterEffect copy() {
|
||||||
|
return new SokkaSwordmasterEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -247,6 +247,8 @@ public final class AvatarTheLastAirbenderEternal extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Sokka and Suki", 71, Rarity.RARE, mage.cards.s.SokkaAndSuki.class));
|
cards.add(new SetCardInfo("Sokka and Suki", 71, Rarity.RARE, mage.cards.s.SokkaAndSuki.class));
|
||||||
cards.add(new SetCardInfo("Sokka's Charge", 66, Rarity.RARE, mage.cards.s.SokkasCharge.class));
|
cards.add(new SetCardInfo("Sokka's Charge", 66, Rarity.RARE, mage.cards.s.SokkasCharge.class));
|
||||||
cards.add(new SetCardInfo("Sokka's Sword Training", 84, Rarity.COMMON, mage.cards.s.SokkasSwordTraining.class));
|
cards.add(new SetCardInfo("Sokka's Sword Training", 84, Rarity.COMMON, mage.cards.s.SokkasSwordTraining.class));
|
||||||
|
cards.add(new SetCardInfo("Sokka, Swordmaster", 174, Rarity.MYTHIC, mage.cards.s.SokkaSwordmaster.class, NON_FULL_USE_VARIOUS));
|
||||||
|
cards.add(new SetCardInfo("Sokka, Swordmaster", 83, Rarity.MYTHIC, mage.cards.s.SokkaSwordmaster.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Sokka, Wolf Cove's Protector", 219, Rarity.UNCOMMON, mage.cards.s.SokkaWolfCovesProtector.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Sokka, Wolf Cove's Protector", 219, Rarity.UNCOMMON, mage.cards.s.SokkaWolfCovesProtector.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Sokka, Wolf Cove's Protector", 274, Rarity.UNCOMMON, mage.cards.s.SokkaWolfCovesProtector.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Sokka, Wolf Cove's Protector", 274, Rarity.UNCOMMON, mage.cards.s.SokkaWolfCovesProtector.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Sol Ring", 316, Rarity.RARE, mage.cards.s.SolRing.class));
|
cards.add(new SetCardInfo("Sol Ring", 316, Rarity.RARE, mage.cards.s.SolRing.class));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue