forked from External/mage
[BRO] Implement Thran Power Suit
This commit is contained in:
parent
cb47569748
commit
e886124fcd
2 changed files with 91 additions and 0 deletions
90
Mage.Sets/src/mage/cards/t/ThranPowerSuit.java
Normal file
90
Mage.Sets/src/mage/cards/t/ThranPowerSuit.java
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.keyword.WardAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ThranPowerSuit extends CardImpl {
|
||||
|
||||
public ThranPowerSuit(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||
|
||||
this.subtype.add(SubType.EQUIPMENT);
|
||||
|
||||
// Equipped creature gets +1/+1 for each Aura and Equipment attached to it and has ward {2}.
|
||||
Ability ability = new SimpleStaticAbility(new BoostEquippedEffect(
|
||||
ThranPowerSuitValue.instance, ThranPowerSuitValue.instance
|
||||
));
|
||||
ability.addEffect(new GainAbilityAttachedEffect(new WardAbility(
|
||||
new GenericManaCost(2), false
|
||||
), AttachmentType.EQUIPMENT).setText("and has ward {2}"));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Equip {2}
|
||||
this.addAbility(new EquipAbility(2));
|
||||
}
|
||||
|
||||
private ThranPowerSuit(final ThranPowerSuit card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThranPowerSuit copy() {
|
||||
return new ThranPowerSuit(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum ThranPowerSuitValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Permanent sourcePermanent = sourceAbility.getSourcePermanentOrLKI(game);
|
||||
if (sourcePermanent == null) {
|
||||
return 0;
|
||||
}
|
||||
Permanent permanent = game.getPermanent(sourcePermanent.getAttachedTo());
|
||||
return permanent == null ? 0 : permanent
|
||||
.getAttachments()
|
||||
.stream()
|
||||
.map(game::getPermanentOrLKIBattlefield)
|
||||
.filter(Objects::nonNull)
|
||||
.map(p -> p.hasSubtype(SubType.EQUIPMENT, game) || p.hasSubtype(SubType.AURA, game))
|
||||
.mapToInt(b -> b ? 1 : 0)
|
||||
.sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThranPowerSuitValue copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "Aura and Equipment attached to it";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
|
|
@ -250,6 +250,7 @@ public final class TheBrothersWar extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Third Path Savant", 67, Rarity.COMMON, mage.cards.t.ThirdPathSavant.class));
|
||||
cards.add(new SetCardInfo("Thopter Architect", 29, Rarity.UNCOMMON, mage.cards.t.ThopterArchitect.class));
|
||||
cards.add(new SetCardInfo("Thopter Mechanic", 68, Rarity.UNCOMMON, mage.cards.t.ThopterMechanic.class));
|
||||
cards.add(new SetCardInfo("Thran Power Suit", 253, Rarity.UNCOMMON, mage.cards.t.ThranPowerSuit.class));
|
||||
cards.add(new SetCardInfo("Thran Spider", 254, Rarity.RARE, mage.cards.t.ThranSpider.class));
|
||||
cards.add(new SetCardInfo("Thran Vigil", 114, Rarity.UNCOMMON, mage.cards.t.ThranVigil.class));
|
||||
cards.add(new SetCardInfo("Thraxodemon", 115, Rarity.COMMON, mage.cards.t.Thraxodemon.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue