From 56a5db497e804bfd290cd8fac1d952277d576afe Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sun, 6 Sep 2015 14:43:12 +0300 Subject: [PATCH] Fix AddPoisonCounterTargetEffect ignoring setText(). Implement cards: Crypt Cobra, Suq'Ata Assassin, and Swamp Mosquito --- .../mage/sets/alliances/SwampMosquito1.java | 69 ++++++++++++++++++ .../mage/sets/alliances/SwampMosquito2.java | 51 ++++++++++++++ .../src/mage/sets/mirage/CryptCobra.java | 66 +++++++++++++++++ .../mage/sets/timeshifted/SwampMosquito.java | 54 ++++++++++++++ .../src/mage/sets/visions/SuqAtaAssassin.java | 70 +++++++++++++++++++ .../counter/AddPoisonCounterTargetEffect.java | 5 +- 6 files changed, 314 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/alliances/SwampMosquito1.java create mode 100644 Mage.Sets/src/mage/sets/alliances/SwampMosquito2.java create mode 100644 Mage.Sets/src/mage/sets/mirage/CryptCobra.java create mode 100644 Mage.Sets/src/mage/sets/timeshifted/SwampMosquito.java create mode 100644 Mage.Sets/src/mage/sets/visions/SuqAtaAssassin.java diff --git a/Mage.Sets/src/mage/sets/alliances/SwampMosquito1.java b/Mage.Sets/src/mage/sets/alliances/SwampMosquito1.java new file mode 100644 index 00000000000..de42480ab1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SwampMosquito1.java @@ -0,0 +1,69 @@ +/* + * 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.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.counter.AddPoisonCounterTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SwampMosquito1 extends CardImpl { + + public SwampMosquito1(UUID ownerId) { + super(ownerId, 30, "Swamp Mosquito", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Insect"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever Swamp Mosquito attacks and isn't blocked, defending player gets a poison counter. + Effect effect = new AddPoisonCounterTargetEffect(1); + effect.setText("defending player gets a poison counter"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true)); + } + + public SwampMosquito1(final SwampMosquito1 card) { + super(card); + } + + @Override + public SwampMosquito1 copy() { + return new SwampMosquito1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/SwampMosquito2.java b/Mage.Sets/src/mage/sets/alliances/SwampMosquito2.java new file mode 100644 index 00000000000..9b44a183cb3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SwampMosquito2.java @@ -0,0 +1,51 @@ +/* + * 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.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class SwampMosquito2 extends SwampMosquito1 { + + public SwampMosquito2(UUID ownerId) { + super(ownerId); + this.cardNumber = 31; + } + + public SwampMosquito2(final SwampMosquito2 card) { + super(card); + } + + @Override + public SwampMosquito2 copy() { + return new SwampMosquito2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/CryptCobra.java b/Mage.Sets/src/mage/sets/mirage/CryptCobra.java new file mode 100644 index 00000000000..95459bda11f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/CryptCobra.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.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.counter.AddPoisonCounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CryptCobra extends CardImpl { + + public CryptCobra(UUID ownerId) { + super(ownerId, 12, "Crypt Cobra", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Snake"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Crypt Cobra attacks and isn't blocked, defending player gets a poison counter. + Effect effect = new AddPoisonCounterTargetEffect(1); + effect.setText("defending player gets a poison counter"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true)); + } + + public CryptCobra(final CryptCobra card) { + super(card); + } + + @Override + public CryptCobra copy() { + return new CryptCobra(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/SwampMosquito.java b/Mage.Sets/src/mage/sets/timeshifted/SwampMosquito.java new file mode 100644 index 00000000000..93773da7604 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/SwampMosquito.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.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SwampMosquito extends mage.sets.alliances.SwampMosquito1 { + + public SwampMosquito(UUID ownerId) { + super(ownerId); + this.cardNumber = 49; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public SwampMosquito(final SwampMosquito card) { + super(card); + } + + @Override + public SwampMosquito copy() { + return new SwampMosquito(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/SuqAtaAssassin.java b/Mage.Sets/src/mage/sets/visions/SuqAtaAssassin.java new file mode 100644 index 00000000000..b011b65da73 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/SuqAtaAssassin.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.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.counter.AddPoisonCounterTargetEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SuqAtaAssassin extends CardImpl { + + public SuqAtaAssassin(UUID ownerId) { + super(ownerId, 19, "Suq'Ata Assassin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Human"); + this.subtype.add("Assassin"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Fear + this.addAbility(FearAbility.getInstance()); + // Whenever Suq'Ata Assassin attacks and isn't blocked, defending player gets a poison counter. + Effect effect = new AddPoisonCounterTargetEffect(1); + effect.setText("defending player gets a poison counter"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true)); + } + + public SuqAtaAssassin(final SuqAtaAssassin card) { + super(card); + } + + @Override + public SuqAtaAssassin copy() { + return new SuqAtaAssassin(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/counter/AddPoisonCounterTargetEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddPoisonCounterTargetEffect.java index c8a68acd925..420d8dc4490 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddPoisonCounterTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddPoisonCounterTargetEffect.java @@ -74,6 +74,9 @@ public class AddPoisonCounterTargetEffect extends OneShotEffect { @Override public String getText(Mode mode) { + if(staticText != null && !staticText.isEmpty()) { + return staticText; + } return "Target " + mode.getTargets().get(0).getTargetName() + " gets " + Integer.toString(amount) + " poison counter(s)."; } -} \ No newline at end of file +}