mirror of
https://github.com/correl/mage.git
synced 2024-12-27 20:06:31 +00:00
[J22] Implement Towering Gibbon
This commit is contained in:
parent
01f9b80ea8
commit
2dc421c463
2 changed files with 87 additions and 0 deletions
86
Mage.Sets/src/mage/cards/t/ToweringGibbon.java
Normal file
86
Mage.Sets/src/mage/cards/t/ToweringGibbon.java
Normal file
|
@ -0,0 +1,86 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ToweringGibbon extends CardImpl {
|
||||
|
||||
public ToweringGibbon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
||||
|
||||
this.subtype.add(SubType.APE);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Reach
|
||||
this.addAbility(ReachAbility.getInstance());
|
||||
|
||||
// Towering Gibbon's power is equal to the greatest mana value among creatures you control.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.ALL,
|
||||
new SetBasePowerSourceEffect(
|
||||
ToweringGibbonValue.instance, Duration.EndOfGame
|
||||
).setText("{this}'s power is equal to the greatest mana value among creatures you control")
|
||||
));
|
||||
}
|
||||
|
||||
private ToweringGibbon(final ToweringGibbon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToweringGibbon copy() {
|
||||
return new ToweringGibbon(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum ToweringGibbonValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return game
|
||||
.getBattlefield()
|
||||
.getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE,
|
||||
sourceAbility.getControllerId(), sourceAbility, game
|
||||
).stream()
|
||||
.mapToInt(MageObject::getManaValue)
|
||||
.max()
|
||||
.orElse(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToweringGibbonValue copy() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
}
|
|
@ -63,6 +63,7 @@ public final class Jumpstart2022 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Spectral Sailor", 64, Rarity.UNCOMMON, mage.cards.s.SpectralSailor.class));
|
||||
cards.add(new SetCardInfo("Spellstutter Sprite", 65, Rarity.COMMON, mage.cards.s.SpellstutterSprite.class));
|
||||
cards.add(new SetCardInfo("Thrashing Brontodon", 92, Rarity.UNCOMMON, mage.cards.t.ThrashingBrontodon.class));
|
||||
cards.add(new SetCardInfo("Towering Gibbon", 46, Rarity.UNCOMMON, mage.cards.t.ToweringGibbon.class));
|
||||
cards.add(new SetCardInfo("Trove Warden", 259, Rarity.RARE, mage.cards.t.TroveWarden.class));
|
||||
cards.add(new SetCardInfo("Typhoid Rats", 468, Rarity.COMMON, mage.cards.t.TyphoidRats.class));
|
||||
cards.add(new SetCardInfo("Uktabi Orangutan", 133, Rarity.UNCOMMON, mage.cards.u.UktabiOrangutan.class));
|
||||
|
|
Loading…
Reference in a new issue