From 07cab82ed6dd01b40512a7e3750f0de91c253864 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 5 Sep 2015 16:38:42 +0300 Subject: [PATCH] Add AttacksAndIsNotBlockedTriggeredAbility. Implement cards: Abyssal Nightstalker, Farrel's Zealot, Ophidian, and Zealot il-Vec --- .../sets/anthologyjacevschandra/Ophidian.java | 52 ++++++++++ .../sets/fallenempires/FarrelsZealot1.java | 70 ++++++++++++++ .../sets/fallenempires/FarrelsZealot2.java | 52 ++++++++++ .../sets/fallenempires/FarrelsZealot3.java | 52 ++++++++++ .../mage/sets/fridaynightmagic/Ophidian.java | 54 +++++++++++ .../src/mage/sets/jacevschandra/Ophidian.java | 52 ++++++++++ .../sets/masterseditionii/FarrelsZealot.java | 54 +++++++++++ .../portalsecondage/AbyssalNightstalker.java | 66 +++++++++++++ .../src/mage/sets/timespiral/ZealotIlVec.java | 78 +++++++++++++++ .../mage/sets/vintagemasters/Ophidian.java | 68 +++++++++++++ .../src/mage/sets/weatherlight/Ophidian.java | 52 ++++++++++ ...ttacksAndIsNotBlockedTriggeredAbility.java | 96 +++++++++++++++++++ .../AssignNoCombatDamageSourceEffect.java | 22 ++++- 13 files changed, 763 insertions(+), 5 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/anthologyjacevschandra/Ophidian.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot1.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot2.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot3.java create mode 100644 Mage.Sets/src/mage/sets/fridaynightmagic/Ophidian.java create mode 100644 Mage.Sets/src/mage/sets/jacevschandra/Ophidian.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/FarrelsZealot.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/AbyssalNightstalker.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/ZealotIlVec.java create mode 100644 Mage.Sets/src/mage/sets/vintagemasters/Ophidian.java create mode 100644 Mage.Sets/src/mage/sets/weatherlight/Ophidian.java create mode 100644 Mage/src/mage/abilities/common/AttacksAndIsNotBlockedTriggeredAbility.java diff --git a/Mage.Sets/src/mage/sets/anthologyjacevschandra/Ophidian.java b/Mage.Sets/src/mage/sets/anthologyjacevschandra/Ophidian.java new file mode 100644 index 00000000000..3816fda1c85 --- /dev/null +++ b/Mage.Sets/src/mage/sets/anthologyjacevschandra/Ophidian.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.anthologyjacevschandra; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Ophidian extends mage.sets.vintagemasters.Ophidian { + + public Ophidian(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "DD3"; + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot1.java b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot1.java new file mode 100644 index 00000000000..808050be6d3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot1.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FarrelsZealot1 extends CardImpl { + + public FarrelsZealot1(UUID ownerId) { + super(ownerId, 139, "Farrel's Zealot", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Human"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Farrel's Zealot attacks and isn't blocked, you may have it deal 3 damage to target creature. If you do, Farrel's Zealot assigns no combat damage this turn. + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new DamageTargetEffect(3), true); + ability.addEffect(new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn, true)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FarrelsZealot1(final FarrelsZealot1 card) { + super(card); + } + + @Override + public FarrelsZealot1 copy() { + return new FarrelsZealot1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot2.java b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot2.java new file mode 100644 index 00000000000..f87feed1cdc --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FarrelsZealot2 extends FarrelsZealot1 { + + public FarrelsZealot2(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + } + + public FarrelsZealot2(final FarrelsZealot2 card) { + super(card); + } + + @Override + public FarrelsZealot2 copy() { + return new FarrelsZealot2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot3.java b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot3.java new file mode 100644 index 00000000000..af5d84df989 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot3.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FarrelsZealot3 extends FarrelsZealot1 { + + public FarrelsZealot3(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + } + + public FarrelsZealot3(final FarrelsZealot3 card) { + super(card); + } + + @Override + public FarrelsZealot3 copy() { + return new FarrelsZealot3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fridaynightmagic/Ophidian.java b/Mage.Sets/src/mage/sets/fridaynightmagic/Ophidian.java new file mode 100644 index 00000000000..495eb7f297b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fridaynightmagic/Ophidian.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fridaynightmagic; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Ophidian extends mage.sets.vintagemasters.Ophidian { + + public Ophidian(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "FNMP"; + this.rarity = Rarity.UNCOMMON; + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/jacevschandra/Ophidian.java b/Mage.Sets/src/mage/sets/jacevschandra/Ophidian.java new file mode 100644 index 00000000000..2e3c2045e10 --- /dev/null +++ b/Mage.Sets/src/mage/sets/jacevschandra/Ophidian.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.jacevschandra; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Ophidian extends mage.sets.vintagemasters.Ophidian { + + public Ophidian(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "DD2"; + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/FarrelsZealot.java b/Mage.Sets/src/mage/sets/masterseditionii/FarrelsZealot.java new file mode 100644 index 00000000000..f3dbcb9a019 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/FarrelsZealot.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FarrelsZealot extends mage.sets.fallenempires.FarrelsZealot1 { + + public FarrelsZealot(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.UNCOMMON; + } + + public FarrelsZealot(final FarrelsZealot card) { + super(card); + } + + @Override + public FarrelsZealot copy() { + return new FarrelsZealot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/AbyssalNightstalker.java b/Mage.Sets/src/mage/sets/portalsecondage/AbyssalNightstalker.java new file mode 100644 index 00000000000..9514f3b27e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/AbyssalNightstalker.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; + +/** + * + * @author LoneFox + */ +public class AbyssalNightstalker extends CardImpl { + + public AbyssalNightstalker(UUID ownerId) { + super(ownerId, 1, "Abyssal Nightstalker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "PO2"; + this.subtype.add("Nightstalker"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Abyssal Nightstalker attacks and isn't blocked, defending player discards a card. + Effect effect = new DiscardTargetEffect(1); + effect.setText("defending player discards a card"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true)); + } + + public AbyssalNightstalker(final AbyssalNightstalker card) { + super(card); + } + + @Override + public AbyssalNightstalker copy() { + return new AbyssalNightstalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ZealotIlVec.java b/Mage.Sets/src/mage/sets/timespiral/ZealotIlVec.java new file mode 100644 index 00000000000..47fa6319572 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ZealotIlVec.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.PreventCombatDamageBySourceEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ZealotIlVec extends CardImpl { + + public ZealotIlVec(UUID ownerId) { + super(ownerId, 47, "Zealot il-Vec", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Rebel"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // Whenever Zealot il-Vec attacks and isn't blocked, you may have it deal 1 damage to target creature. If you do, prevent all combat damage Zealot il-Vec would deal this turn. + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new DamageTargetEffect(1), true); + Effect effect = new PreventCombatDamageBySourceEffect(Duration.EndOfTurn); + effect.setText("if you do, prevent all combat damage {this} would deal this turn"); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + } + + public ZealotIlVec(final ZealotIlVec card) { + super(card); + } + + @Override + public ZealotIlVec copy() { + return new ZealotIlVec(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/Ophidian.java b/Mage.Sets/src/mage/sets/vintagemasters/Ophidian.java new file mode 100644 index 00000000000..4061bbe1385 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/Ophidian.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Ophidian extends CardImpl { + + public Ophidian(UUID ownerId) { + super(ownerId, 84, "Ophidian", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "VMA"; + this.subtype.add("Snake"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Whenever Ophidian attacks and isn't blocked, you may draw a card. If you do, Ophidian assigns no combat damage this turn. + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new DrawCardSourceControllerEffect(1), true); + ability.addEffect(new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn, true)); + this.addAbility(ability); + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Ophidian.java b/Mage.Sets/src/mage/sets/weatherlight/Ophidian.java new file mode 100644 index 00000000000..02ac97ce9ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Ophidian.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Ophidian extends mage.sets.vintagemasters.Ophidian { + + public Ophidian(UUID ownerId) { + super(ownerId); + this.cardNumber = 45; + this.expansionSetCode = "WTH"; + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage/src/mage/abilities/common/AttacksAndIsNotBlockedTriggeredAbility.java b/Mage/src/mage/abilities/common/AttacksAndIsNotBlockedTriggeredAbility.java new file mode 100644 index 00000000000..d03ae849027 --- /dev/null +++ b/Mage/src/mage/abilities/common/AttacksAndIsNotBlockedTriggeredAbility.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +public class AttacksAndIsNotBlockedTriggeredAbility extends TriggeredAbilityImpl { + + private boolean setTargetPointer; + + public AttacksAndIsNotBlockedTriggeredAbility(Effect effect) { + this(effect, false, false); + } + + public AttacksAndIsNotBlockedTriggeredAbility(Effect effect, boolean optional) { + this(effect, optional, false); + } + + public AttacksAndIsNotBlockedTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) { + super(Zone.BATTLEFIELD, effect, optional); + this.setTargetPointer = setTargetPointer; + } + + public AttacksAndIsNotBlockedTriggeredAbility(final AttacksAndIsNotBlockedTriggeredAbility ability) { + super(ability); + this.setTargetPointer = ability.setTargetPointer; + } + + @Override + public AttacksAndIsNotBlockedTriggeredAbility copy() { + return new AttacksAndIsNotBlockedTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_BLOCKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent sourcePermanent = game.getPermanent(getSourceId()); + if(sourcePermanent.isAttacking()) { + for(CombatGroup combatGroup: game.getCombat().getGroups()) { + if(combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) { + if(setTargetPointer) { + for(Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(game.getCombat().getDefendingPlayerId(getSourceId(), game))); + } + } + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} attacks and isn't blocked, " + super.getRule(); + } +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java index f7615c0db32..7146608ba73 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java @@ -45,13 +45,21 @@ import static mage.game.events.GameEvent.EventType.DAMAGE_PLAYER; public class AssignNoCombatDamageSourceEffect extends ReplacementEffectImpl { + private boolean partOfOptionalEffect; + public AssignNoCombatDamageSourceEffect(Duration duration) { + this(duration, false); + } + + public AssignNoCombatDamageSourceEffect(Duration duration, boolean partOfOptionalEffect) { super(duration, Outcome.PreventDamage); + this.partOfOptionalEffect = partOfOptionalEffect; staticText = setText(); } public AssignNoCombatDamageSourceEffect(final AssignNoCombatDamageSourceEffect effect) { super(effect); + this.partOfOptionalEffect = effect.partOfOptionalEffect; } @Override @@ -88,19 +96,23 @@ public class AssignNoCombatDamageSourceEffect extends ReplacementEffectImpl { } private String setText() { - StringBuilder sb = new StringBuilder("{this} assigns no combat damage"); + String text = ""; + if(partOfOptionalEffect) { + text = "If you do, "; + } + text += "{this} assigns no combat damage"; switch(duration) { case EndOfTurn: - sb.append("this turn"); + text += " this turn"; break; case EndOfCombat: - sb.append("this combat"); + text += " this combat"; break; default: if (duration.toString().length() > 0) { - sb.append(" ").append(duration.toString()); + text += " " + duration.toString(); } } - return sb.toString(); + return text; } }