forked from External/mage
Implemented Huatli, Heart of the Sun
This commit is contained in:
parent
249b7528ff
commit
892a39a2ed
5 changed files with 117 additions and 30 deletions
50
Mage.Sets/src/mage/cards/h/HuatliHeartOfTheSun.java
Normal file
50
Mage.Sets/src/mage/cards/h/HuatliHeartOfTheSun.java
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
package mage.cards.h;
|
||||
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.GreatestToughnessAmongControlledCreaturesValue;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.ruleModifying.CombatDamageByToughnessEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class HuatliHeartOfTheSun extends CardImpl {
|
||||
|
||||
public HuatliHeartOfTheSun(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{G/W}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUATLI);
|
||||
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(7));
|
||||
|
||||
// Each creature you control assigns combat damage equal to its toughness rather than its power.
|
||||
this.addAbility(new SimpleStaticAbility(new CombatDamageByToughnessEffect(
|
||||
StaticFilters.FILTER_PERMANENT_CREATURE, true
|
||||
)));
|
||||
|
||||
// -3: You gain life equal to the greatest toughness among creatures you control.
|
||||
this.addAbility(new LoyaltyAbility(new GainLifeEffect(
|
||||
GreatestToughnessAmongControlledCreaturesValue.instance,
|
||||
"You gain life equal to the greatest power among creatures you control"
|
||||
), -3));
|
||||
}
|
||||
|
||||
private HuatliHeartOfTheSun(final HuatliHeartOfTheSun card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HuatliHeartOfTheSun copy() {
|
||||
return new HuatliHeartOfTheSun(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.h;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.Mode;
|
||||
|
|
@ -18,11 +16,7 @@ import mage.abilities.effects.common.GainLifeEffect;
|
|||
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.DinosaurToken;
|
||||
|
|
@ -30,8 +24,9 @@ import mage.target.Target;
|
|||
import mage.target.common.TargetCreaturePermanentAmount;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class HuatliWarriorPoet extends CardImpl {
|
||||
|
|
@ -45,18 +40,21 @@ public final class HuatliWarriorPoet extends CardImpl {
|
|||
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
|
||||
|
||||
// +2: You gain life equal to the greatest power among creatures you control.
|
||||
this.addAbility(new LoyaltyAbility(new GainLifeEffect(GreatestPowerAmongControlledCreaturesValue.instance, "You gain life equal to the greatest power among creatures you control"), 2));
|
||||
this.addAbility(new LoyaltyAbility(new GainLifeEffect(
|
||||
GreatestPowerAmongControlledCreaturesValue.instance,
|
||||
"You gain life equal to the greatest power among creatures you control"
|
||||
), 2));
|
||||
|
||||
// 0: Create a 3/3 green Dinosaur creature token with trample.
|
||||
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new DinosaurToken()), 0));
|
||||
|
||||
// -X: Huatli, Warrior Poet deals X damage divided as you choose among any number of target creatures. Creatures dealt damage this way can't block this turn.
|
||||
Ability ability = new LoyaltyAbility(new HuatliWarriorPoetDamageEffect(new HuatliXValue()));
|
||||
ability.addTarget(new TargetCreaturePermanentAmount(new HuatliXValue()));
|
||||
Ability ability = new LoyaltyAbility(new HuatliWarriorPoetDamageEffect(HuatliXValue.instance));
|
||||
ability.addTarget(new TargetCreaturePermanentAmount(HuatliXValue.instance));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public HuatliWarriorPoet(final HuatliWarriorPoet card) {
|
||||
private HuatliWarriorPoet(final HuatliWarriorPoet card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
@ -66,9 +64,8 @@ public final class HuatliWarriorPoet extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class HuatliXValue implements DynamicValue {
|
||||
|
||||
private static final HuatliXValue defaultValue = new HuatliXValue();
|
||||
enum HuatliXValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
|
|
@ -82,7 +79,7 @@ class HuatliXValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return defaultValue;
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -96,7 +93,7 @@ class HuatliXValue implements DynamicValue {
|
|||
}
|
||||
|
||||
public static HuatliXValue getDefault() {
|
||||
return defaultValue;
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -104,12 +101,12 @@ class HuatliWarriorPoetDamageEffect extends OneShotEffect {
|
|||
|
||||
protected DynamicValue amount;
|
||||
|
||||
public HuatliWarriorPoetDamageEffect(DynamicValue amount) {
|
||||
HuatliWarriorPoetDamageEffect(DynamicValue amount) {
|
||||
super(Outcome.Damage);
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public HuatliWarriorPoetDamageEffect(final HuatliWarriorPoetDamageEffect effect) {
|
||||
private HuatliWarriorPoetDamageEffect(final HuatliWarriorPoetDamageEffect effect) {
|
||||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ public final class WarOfTheSpark extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Heartfire", 131, Rarity.COMMON, mage.cards.h.Heartfire.class));
|
||||
cards.add(new SetCardInfo("Herald of the Dreadhorde", 93, Rarity.COMMON, mage.cards.h.HeraldOfTheDreadhorde.class));
|
||||
cards.add(new SetCardInfo("Honor the God-Pharaoh", 132, Rarity.COMMON, mage.cards.h.HonorTheGodPharaoh.class));
|
||||
cards.add(new SetCardInfo("Huatli, Heart of the Sun", 230, Rarity.UNCOMMON, mage.cards.h.HuatliHeartOfTheSun.class));
|
||||
cards.add(new SetCardInfo("Ignite the Beacon", 18, Rarity.RARE, mage.cards.i.IgniteTheBeacon.class));
|
||||
cards.add(new SetCardInfo("Ilharg, the Raze-Boar", 133, Rarity.MYTHIC, mage.cards.i.IlhargTheRazeBoar.class));
|
||||
cards.add(new SetCardInfo("Interplanar Beacon", 247, Rarity.UNCOMMON, mage.cards.i.InterplanarBeacon.class));
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ package mage.abilities.dynamicvalue.common;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
|
@ -17,17 +17,13 @@ public enum GreatestPowerAmongControlledCreaturesValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player player = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (player != null) {
|
||||
int amount = 0;
|
||||
for (Permanent p : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), sourceAbility.getControllerId(), game)) {
|
||||
if (p.getPower().getValue() > amount) {
|
||||
amount = p.getPower().getValue();
|
||||
}
|
||||
}
|
||||
return amount;
|
||||
int amount = 0;
|
||||
for (Permanent p : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, sourceAbility.getControllerId(), game
|
||||
)) {
|
||||
amount = Math.max(p.getPower().getValue(), amount);
|
||||
}
|
||||
return 0;
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum GreatestToughnessAmongControlledCreaturesValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
for (Permanent p : game.getBattlefield().getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, sourceAbility.getControllerId(), game
|
||||
)) {
|
||||
amount = Math.max(p.getToughness().getValue(), amount);
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GreatestToughnessAmongControlledCreaturesValue copy() {
|
||||
return GreatestToughnessAmongControlledCreaturesValue.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "the greatest toughness among creatures you control";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue