From ff150332835f34368a494195789b94c25b60997f Mon Sep 17 00:00:00 2001 From: BlueElectivire Date: Sun, 27 Jun 2021 20:29:24 +0300 Subject: [PATCH 1/4] Implemented [[Crown of Awe]] ONS number 16 --- Mage.Sets/src/mage/cards/c/CrownOfAwe.java | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CrownOfAwe.java diff --git a/Mage.Sets/src/mage/cards/c/CrownOfAwe.java b/Mage.Sets/src/mage/cards/c/CrownOfAwe.java new file mode 100644 index 0000000000..c70b748d53 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CrownOfAwe.java @@ -0,0 +1,105 @@ +package mage.cards.c; + +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author BlueElectivire + */ +public final class CrownOfAwe extends CardImpl { + + public CrownOfAwe(UUID ownerId, CardSetInfo setInfo){ + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + + this.suptype.add(subtype.AURA); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted Creature has protection from black and from red. + ability = new SimpleStaticAbility(new GainAbilityAttachedEffect(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED), + AttachmentType.AURA, Duration.WhileOnBattlefield)); + this.addAbility(ability); + + // Sacrifice Crown of Awe: Enchanted creature and other creatures that share a creature type with it gain protection from black and from red until end of turn. + ability = new SimpleActivatedAbility(new CrownOfAweEffect(), new SacrificeSourceCost()); + this.addAbility(ability); + } + + private CrownOfAwe(final CrownOfAwe card){ + super(card); + } + + @Override + public CrownOfAwe copy(){ + return new CrownOfAwe(this); + } +} + +public final class CrownOfAweEffect extends OneShotEffect { + + private static class CrownOfAwePredicate implements Predicate { + private final Card card; + + private CrownOfAwePredicate(Card card){ + this.card = card; + } + + @Override + public boolean apply(Card input, Game game){ + return input.shareCreatureTypes(game, card); + } + } + + public CrownOfAweEffect() { + super(Outcome.Benefit); + this.staticText = "Sacrifice Crown of Awe: Enchanted creature and other creatures that share a creature type with it gain protection from black and from red until end of turn."; + } + + public CrownOfAweEffect(final CrownOfAweEffect effect) { + super(effect); + } + + @Override + public CrownOfAweEffect copy() { + return new CrownOfAweEffect(this); + } + + @Override + public boolean apply(Game game, Ability Source) { + // Enchanted creature + ContinuousEffect effect = new GainAbilityAttachedEffect(ProtectionAbility.from(Objectcolor.BLACK, Objectcolor.RED).getInstance(), AttachmentType.AURA, Duration.EndOfTurn); + game.addEffect(effect, source); + + // and other creatures that share a creature type with it + Permanent enchantedCreature = game.getPermanent(source.getSourcePermanentOrLKI(game).getAttachedTo()); + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(new CrownOfAwePredicate(enchantedCreature)); + filter.add(Predicates.not(new MageObjectReferencePredicate(new MageObjectReference(enchantedCreature, game)))); + game.addEffect(effect, source); + + // have protection from black and from red until end of turn. + return true; + } +} \ No newline at end of file From a4d32b262951bdde3863f2462f3d9818dbfff837 Mon Sep 17 00:00:00 2001 From: BlueElectivire Date: Sun, 27 Jun 2021 20:35:11 +0300 Subject: [PATCH 2/4] Added Crown of Awe to the onslaught set. --- Mage.Sets/src/mage/sets/Onslaught.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage.Sets/src/mage/sets/Onslaught.java b/Mage.Sets/src/mage/sets/Onslaught.java index e002766313..cc79d7f83a 100644 --- a/Mage.Sets/src/mage/sets/Onslaught.java +++ b/Mage.Sets/src/mage/sets/Onslaught.java @@ -86,6 +86,7 @@ public final class Onslaught extends ExpansionSet { cards.add(new SetCardInfo("Cover of Darkness", 133, Rarity.RARE, mage.cards.c.CoverOfDarkness.class)); cards.add(new SetCardInfo("Crafty Pathmage", 77, Rarity.COMMON, mage.cards.c.CraftyPathmage.class)); cards.add(new SetCardInfo("Crowd Favorites", 15, Rarity.UNCOMMON, mage.cards.c.CrowdFavorites.class)); + cards.add(new SetCardInfo("Crown of Awe", 16, Rarity.COMMON, mage.cards.c.CrownOfAwe.class)); cards.add(new SetCardInfo("Crown of Fury", 196, Rarity.COMMON, mage.cards.c.CrownOfFury.class)); cards.add(new SetCardInfo("Crude Rampart", 17, Rarity.UNCOMMON, mage.cards.c.CrudeRampart.class)); cards.add(new SetCardInfo("Cruel Revival", 135, Rarity.COMMON, mage.cards.c.CruelRevival.class)); From f5b28c960923b7b6bf403ed2447b7155aee6010b Mon Sep 17 00:00:00 2001 From: BlueElectivire Date: Mon, 28 Jun 2021 00:34:36 +0300 Subject: [PATCH 3/4] Small mistake fixes for crown of awe. --- Mage.Sets/src/mage/cards/c/CrownOfAwe.java | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CrownOfAwe.java b/Mage.Sets/src/mage/cards/c/CrownOfAwe.java index c70b748d53..0f92dd1093 100644 --- a/Mage.Sets/src/mage/cards/c/CrownOfAwe.java +++ b/Mage.Sets/src/mage/cards/c/CrownOfAwe.java @@ -1,22 +1,33 @@ package mage.cards.c; -import mage.ObjectColor; +import mage.MageObjectReference; import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; -import mage.abilities.keyword.ProtectionAbility; +import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.MageObjectReferencePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.ObjectColor; +import mage.abilities.keyword.ProtectionAbility; import mage.constants.AttachmentType; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.constants.Zone; -import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; import java.util.UUID; @@ -25,10 +36,10 @@ import java.util.UUID; */ public final class CrownOfAwe extends CardImpl { - public CrownOfAwe(UUID ownerId, CardSetInfo setInfo){ + public CrownOfAwe(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); - this.suptype.add(subtype.AURA); + this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); @@ -57,7 +68,7 @@ public final class CrownOfAwe extends CardImpl { } } -public final class CrownOfAweEffect extends OneShotEffect { +class CrownOfAweEffect extends OneShotEffect { private static class CrownOfAwePredicate implements Predicate { private final Card card; @@ -87,9 +98,9 @@ public final class CrownOfAweEffect extends OneShotEffect { } @Override - public boolean apply(Game game, Ability Source) { + public boolean apply(Game game, Ability source) { // Enchanted creature - ContinuousEffect effect = new GainAbilityAttachedEffect(ProtectionAbility.from(Objectcolor.BLACK, Objectcolor.RED).getInstance(), AttachmentType.AURA, Duration.EndOfTurn); + ContinuousEffect effect = new GainAbilityAttachedEffect(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED), AttachmentType.AURA, Duration.EndOfTurn); game.addEffect(effect, source); // and other creatures that share a creature type with it From a6e675f253eef9168d8af272b77f6f02f5197c8f Mon Sep 17 00:00:00 2001 From: BlueElectivire Date: Tue, 29 Jun 2021 01:57:45 +0300 Subject: [PATCH 4/4] changes requested by theelk801 --- Mage.Sets/src/mage/cards/c/CrownOfAwe.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CrownOfAwe.java b/Mage.Sets/src/mage/cards/c/CrownOfAwe.java index 0f92dd1093..bdadc29a46 100644 --- a/Mage.Sets/src/mage/cards/c/CrownOfAwe.java +++ b/Mage.Sets/src/mage/cards/c/CrownOfAwe.java @@ -43,15 +43,15 @@ public final class CrownOfAwe extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); // Enchanted Creature has protection from black and from red. ability = new SimpleStaticAbility(new GainAbilityAttachedEffect(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED), AttachmentType.AURA, Duration.WhileOnBattlefield)); - this.addAbility(ability); + this.addAbility(ability); // Sacrifice Crown of Awe: Enchanted creature and other creatures that share a creature type with it gain protection from black and from red until end of turn. ability = new SimpleActivatedAbility(new CrownOfAweEffect(), new SacrificeSourceCost()); @@ -85,7 +85,7 @@ class CrownOfAweEffect extends OneShotEffect { public CrownOfAweEffect() { super(Outcome.Benefit); - this.staticText = "Sacrifice Crown of Awe: Enchanted creature and other creatures that share a creature type with it gain protection from black and from red until end of turn."; + this.staticText = "Sacrifice {this}: Enchanted creature and other creatures that share a creature type with it gain protection from black and from red until end of turn."; } public CrownOfAweEffect(final CrownOfAweEffect effect) {