mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
[STX] Implemented Extus, Oriq Overlord / Awaken the Blood Avatar
This commit is contained in:
parent
f97b6bf538
commit
dab3dfdc5a
3 changed files with 171 additions and 0 deletions
132
Mage.Sets/src/mage/cards/e/ExtusOriqOverlord.java
Normal file
132
Mage.Sets/src/mage/cards/e/ExtusOriqOverlord.java
Normal file
|
@ -0,0 +1,132 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.MagecraftAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.SacrificeXTargetCost;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeOpponentsEffect;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.ModalDoubleFacesCard;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.BloodAvatarToken;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ExtusOriqOverlord extends ModalDoubleFacesCard {
|
||||
|
||||
private static final FilterCard filter
|
||||
= new FilterCreatureCard("nonlegendary creature card from your graveyard");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(SuperType.LEGENDARY.getPredicate()));
|
||||
}
|
||||
|
||||
public ExtusOriqOverlord(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(
|
||||
ownerId, setInfo,
|
||||
new CardType[]{CardType.CREATURE}, new SubType[]{SubType.HUMAN, SubType.WARLOCK}, "{1}{W}{B}{B}",
|
||||
"Awaken the Blood Avatar",
|
||||
new CardType[]{CardType.SORCERY}, new SubType[]{}, "{6}{B}{R}"
|
||||
);
|
||||
|
||||
// 1.
|
||||
// Extus, Oriq Overlord
|
||||
// Legendary Creature - Human Warlock
|
||||
this.getLeftHalfCard().addSuperType(SuperType.LEGENDARY);
|
||||
this.getLeftHalfCard().setPT(2, 4);
|
||||
|
||||
// Double strike
|
||||
this.getLeftHalfCard().addAbility(DoubleStrikeAbility.getInstance());
|
||||
|
||||
// Magecraft — Whenever you cast or copy an instant or sorcery spell, return target nonlegendary creature card from your graveyard to your hand.
|
||||
Ability ability = new MagecraftAbility(new ReturnFromGraveyardToHandTargetEffect());
|
||||
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
||||
this.getLeftHalfCard().addAbility(ability);
|
||||
|
||||
// 2.
|
||||
// Awaken the Blood Avatar
|
||||
// Sorcery
|
||||
// As an additional cost to cast this spell, you may sacrifice any number of creatures. This spell costs {2} less to cast for each creature sacrificed this way.
|
||||
Cost cost = new SacrificeXTargetCost(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT);
|
||||
cost.setText("As an additional cost to cast this spell, you may sacrifice any number of creatures");
|
||||
this.getRightHalfCard().getSpellAbility().addCost(cost);
|
||||
this.getRightHalfCard().addAbility(new SimpleStaticAbility(
|
||||
Zone.ALL, new AwakenTheBloodAvatarCostReductionEffect()
|
||||
));
|
||||
|
||||
// Each opponent sacrifices a creature. Create a 3/6 black and red Avatar creature token with haste and "Whenever this creature attacks, it deals 3 damage to each opponent."
|
||||
this.getRightHalfCard().getSpellAbility().addEffect(new SacrificeOpponentsEffect(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT
|
||||
));
|
||||
this.getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new BloodAvatarToken()));
|
||||
}
|
||||
|
||||
private ExtusOriqOverlord(final ExtusOriqOverlord card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExtusOriqOverlord copy() {
|
||||
return new ExtusOriqOverlord(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AwakenTheBloodAvatarCostReductionEffect extends CostModificationEffectImpl {
|
||||
|
||||
AwakenTheBloodAvatarCostReductionEffect() {
|
||||
super(Duration.WhileOnStack, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
staticText = "This spell costs {2} less to cast for each creature sacrificed this way";
|
||||
}
|
||||
|
||||
private AwakenTheBloodAvatarCostReductionEffect(final AwakenTheBloodAvatarCostReductionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
SpellAbility spellAbility = (SpellAbility) abilityToModify;
|
||||
for (Cost cost : spellAbility.getCosts()) {
|
||||
if (!(cost instanceof SacrificeXTargetCost)) {
|
||||
continue;
|
||||
}
|
||||
if (game.inCheckPlayableState()) {
|
||||
// allows to cast in getPlayable
|
||||
int reduction = ((SacrificeXTargetCost) cost).getMaxValue(spellAbility, game);
|
||||
CardUtil.adjustCost(spellAbility, reduction * 2);
|
||||
} else {
|
||||
// real cast
|
||||
int reduction = ((SacrificeXTargetCost) cost).getAmount();
|
||||
CardUtil.adjustCost(spellAbility, reduction * 2);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
return abilityToModify instanceof SpellAbility && abilityToModify.getSourceId().equals(source.getSourceId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AwakenTheBloodAvatarCostReductionEffect copy() {
|
||||
return new AwakenTheBloodAvatarCostReductionEffect(this);
|
||||
}
|
||||
}
|
|
@ -111,6 +111,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Expel", 18, Rarity.COMMON, mage.cards.e.Expel.class));
|
||||
cards.add(new SetCardInfo("Explosive Welcome", 100, Rarity.UNCOMMON, mage.cards.e.ExplosiveWelcome.class));
|
||||
cards.add(new SetCardInfo("Exponential Growth", 130, Rarity.RARE, mage.cards.e.ExponentialGrowth.class));
|
||||
cards.add(new SetCardInfo("Extus, Oriq Overlord", 149, Rarity.MYTHIC, mage.cards.e.ExtusOriqOverlord.class));
|
||||
cards.add(new SetCardInfo("Eyetwitch", 70, Rarity.UNCOMMON, mage.cards.e.Eyetwitch.class));
|
||||
cards.add(new SetCardInfo("Fervent Mastery", 101, Rarity.RARE, mage.cards.f.FerventMastery.class));
|
||||
cards.add(new SetCardInfo("Field Trip", 131, Rarity.COMMON, mage.cards.f.FieldTrip.class));
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamagePlayersEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class BloodAvatarToken extends TokenImpl {
|
||||
|
||||
public BloodAvatarToken() {
|
||||
super("Avatar", "3/6 black and red Avatar creature token with haste and \"Whenever this creature attacks, it deals 3 damage to each opponent.\"");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlack(true);
|
||||
color.setRed(true);
|
||||
subtype.add(SubType.AVATAR);
|
||||
power = new MageInt(3);
|
||||
toughness = new MageInt(6);
|
||||
addAbility(HasteAbility.getInstance());
|
||||
addAbility(new AttacksTriggeredAbility(
|
||||
new DamagePlayersEffect(3, TargetController.OPPONENT), false,
|
||||
"Whenever this creature attacks, it deals 3 damage to each opponent."
|
||||
));
|
||||
}
|
||||
|
||||
private BloodAvatarToken(final BloodAvatarToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public BloodAvatarToken copy() {
|
||||
return new BloodAvatarToken(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue