Merge pull request #4066 from theelk801/master

Fixed bugs, implemented crap
This commit is contained in:
theelk801 2017-09-26 22:39:11 -04:00 committed by GitHub
commit 444e7b7cef
17 changed files with 470 additions and 44 deletions

View file

@ -63,7 +63,10 @@ class ApproachOfTheSecondSunEffect extends OneShotEffect {
if (controller != null && spell != null) { if (controller != null && spell != null) {
ApproachOfTheSecondSunWatcher watcher ApproachOfTheSecondSunWatcher watcher
= (ApproachOfTheSecondSunWatcher) game.getState().getWatchers().get(ApproachOfTheSecondSunWatcher.class.getSimpleName()); = (ApproachOfTheSecondSunWatcher) game.getState().getWatchers().get(ApproachOfTheSecondSunWatcher.class.getSimpleName());
if (watcher != null && watcher.getApproachesCast(controller.getId()) > 1 && spell.getFromZone() == Zone.HAND) { if (watcher != null
&& !spell.isCopiedSpell()
&& watcher.getApproachesCast(controller.getId()) > 1
&& spell.getFromZone() == Zone.HAND) {
// Win the game // Win the game
controller.won(game); controller.won(game);
} else { } else {
@ -71,6 +74,9 @@ class ApproachOfTheSecondSunEffect extends OneShotEffect {
controller.gainLife(7, game); controller.gainLife(7, game);
// Put this into the library as the 7th from the top // Put this into the library as the 7th from the top
if (spell.isCopiedSpell()) {
return true;
}
Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard(); Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard();
if (spellCard != null) { if (spellCard != null) {
List<Card> top6 = new ArrayList<>(); List<Card> top6 = new ArrayList<>();

View file

@ -98,38 +98,26 @@ class ConspyEffect extends ContinuousEffectImpl {
for (UUID cardId : controller.getGraveyard()) { for (UUID cardId : controller.getGraveyard()) {
Card card = game.getCard(cardId); Card card = game.getCard(cardId);
if (card.isCreature() && !card.hasSubtype(choice, game)) { if (card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card, game).getSubtype().add(choice);
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
game.getState().getCreateCardAttribute(card).getSubtype().add(choice);
} }
} }
// on Hand // on Hand
for (UUID cardId : controller.getHand()) { for (UUID cardId : controller.getHand()) {
Card card = game.getCard(cardId); Card card = game.getCard(cardId);
if (card.isCreature() && !card.hasSubtype(choice, game)) { if (card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card, game).getSubtype().add(choice);
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
game.getState().getCreateCardAttribute(card).getSubtype().add(choice);
} }
} }
// in Exile // in Exile
for (Card card : game.getState().getExile().getAllCards(game)) { for (Card card : game.getState().getExile().getAllCards(game)) {
if (card.isCreature() && !card.hasSubtype(choice, game)) { if (card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card, game).getSubtype().add(choice);
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
game.getState().getCreateCardAttribute(card).getSubtype().add(choice);
} }
} }
// in Library (e.g. for Mystical Teachings) // in Library (e.g. for Mystical Teachings)
for (Card card : controller.getLibrary().getCards(game)) { for (Card card : controller.getLibrary().getCards(game)) {
if (card.getOwnerId().equals(controller.getId()) && card.isCreature() && !card.hasSubtype(choice, game)) { if (card.getOwnerId().equals(controller.getId()) && card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card, game).getSubtype().add(choice);
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
game.getState().getCreateCardAttribute(card).getSubtype().add(choice);
} }
} }
// commander in command zone // commander in command zone
@ -137,10 +125,7 @@ class ConspyEffect extends ContinuousEffectImpl {
if (game.getState().getZone(commanderId) == Zone.COMMAND) { if (game.getState().getZone(commanderId) == Zone.COMMAND) {
Card card = game.getCard(commanderId); Card card = game.getCard(commanderId);
if (card.isCreature() && !card.hasSubtype(choice, game)) { if (card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card, game).getSubtype().add(choice);
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
game.getState().getCreateCardAttribute(card).getSubtype().add(choice);
} }
} }
} }
@ -152,10 +137,7 @@ class ConspyEffect extends ContinuousEffectImpl {
&& stackObject.isCreature() && stackObject.isCreature()
&& !stackObject.hasSubtype(choice, game)) { && !stackObject.hasSubtype(choice, game)) {
Card card = ((Spell) stackObject).getCard(); Card card = ((Spell) stackObject).getCard();
for (SubType s : card.getSubtype(game)) { game.getState().getCreateCardAttribute(card, game).getSubtype().add(choice);
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
game.getState().getCreateCardAttribute(card).getSubtype().add(choice);
} }
} }
// creatures you control // creatures you control

View file

@ -88,7 +88,7 @@ class AshesOfTheFallenEffect extends ContinuousEffectImpl {
for (UUID cardId : controller.getGraveyard()) { for (UUID cardId : controller.getGraveyard()) {
Card card = game.getCard(cardId); Card card = game.getCard(cardId);
if (card != null && card.isCreature() && !card.hasSubtype(subtype, game)) { if (card != null && card.isCreature() && !card.hasSubtype(subtype, game)) {
game.getState().getCreateCardAttribute(card).getSubtype().add(subtype); game.getState().getCreateCardAttribute(card, game).getSubtype().add(subtype);
} }
} }
return true; return true;
@ -101,4 +101,3 @@ class AshesOfTheFallenEffect extends ContinuousEffectImpl {
return new AshesOfTheFallenEffect(this); return new AshesOfTheFallenEffect(this);
} }
} }

View file

@ -156,7 +156,7 @@ class ConspiracyEffect extends ContinuousEffectImpl {
if (object instanceof Card) { if (object instanceof Card) {
Card card = (Card) object; Card card = (Card) object;
setChosenSubtype( setChosenSubtype(
game.getState().getCreateCardAttribute(card).getSubtype(), game.getState().getCreateCardAttribute(card, game).getSubtype(),
subtype); subtype);
} else { } else {
setChosenSubtype(object.getSubtype(game), subtype); setChosenSubtype(object.getSubtype(game), subtype);

View file

@ -0,0 +1,82 @@
/*
* 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.cards.d;
import java.util.UUID;
import mage.constants.SubType;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.CantActivateAbilitiesAttachedEffect;
import mage.constants.Outcome;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
/**
*
* @author TheElk801
*/
public class DetainmentSpell extends CardImpl {
public DetainmentSpell(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature's activated abilities can't be activated.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantActivateAbilitiesAttachedEffect()));
// {1}{W}: Attach Detainment Spell to target creature.
ability = new SimpleActivatedAbility(new AttachEffect(Outcome.BoostCreature, "Attach {this} to target creature"), new ManaCostsImpl("{1}{W}"));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public DetainmentSpell(final DetainmentSpell card) {
super(card);
}
@Override
public DetainmentSpell copy() {
return new DetainmentSpell(this);
}
}

View file

@ -0,0 +1,84 @@
/*
* 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.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author TheElk801
*/
public class FlowstoneChanneler extends CardImpl {
public FlowstoneChanneler(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SPELLSHAPER);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// {1}{R}, {tap}, Discard a card: Target creature gets +1/-1 and gains haste until end of turn.
Effect effect = new BoostTargetEffect(1, -1, Duration.EndOfTurn);
effect.setText("Target creature gets +1/-1");
Ability ability = new SimpleActivatedAbility(effect, new ManaCostsImpl("{1}{R}"));
effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
effect.setText("and gains haste until end of turn");
ability.addEffect(effect);
ability.addTarget(new TargetCreaturePermanent());
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardTargetCost(new TargetCardInHand()));
this.addAbility(ability);
}
public FlowstoneChanneler(final FlowstoneChanneler card) {
super(card);
}
@Override
public FlowstoneChanneler copy() {
return new FlowstoneChanneler(this);
}
}

View file

@ -121,7 +121,7 @@ class EverythingIsColorlessEffect extends ContinuousEffectImpl {
} }
// exile // exile
for (Card card : game.getExile().getAllCards(game)) { for (Card card : game.getExile().getAllCards(game)) {
game.getState().getCreateCardAttribute(card).getColor().setColor(colorless); game.getState().getCreateCardAttribute(card, game).getColor().setColor(colorless);
} }
// command // command
for (CommandObject commandObject : game.getState().getCommand()) { for (CommandObject commandObject : game.getState().getCommand()) {
@ -132,15 +132,15 @@ class EverythingIsColorlessEffect extends ContinuousEffectImpl {
if (player != null) { if (player != null) {
// hand // hand
for (Card card : player.getHand().getCards(game)) { for (Card card : player.getHand().getCards(game)) {
game.getState().getCreateCardAttribute(card).getColor().setColor(colorless); game.getState().getCreateCardAttribute(card, game).getColor().setColor(colorless);
} }
// library // library
for (Card card : player.getLibrary().getCards(game)) { for (Card card : player.getLibrary().getCards(game)) {
game.getState().getCreateCardAttribute(card).getColor().setColor(colorless); game.getState().getCreateCardAttribute(card, game).getColor().setColor(colorless);
} }
// graveyard // graveyard
for (Card card : player.getGraveyard().getCards(game)) { for (Card card : player.getGraveyard().getCards(game)) {
game.getState().getCreateCardAttribute(card).getColor().setColor(colorless); game.getState().getCreateCardAttribute(card, game).getColor().setColor(colorless);
} }
} }
} }

View file

@ -109,7 +109,7 @@ class PaintersServantEffect extends ContinuousEffectImpl {
} }
// Exile // Exile
for (Card card : game.getExile().getAllCards(game)) { for (Card card : game.getExile().getAllCards(game)) {
game.getState().getCreateCardAttribute(card).getColor().addColor(color); game.getState().getCreateCardAttribute(card, game).getColor().addColor(color);
} }
// Command // Command
for (CommandObject commandObject : game.getState().getCommand()) { for (CommandObject commandObject : game.getState().getCommand()) {
@ -123,15 +123,15 @@ class PaintersServantEffect extends ContinuousEffectImpl {
if (player != null) { if (player != null) {
// Hand // Hand
for (Card card : player.getHand().getCards(game)) { for (Card card : player.getHand().getCards(game)) {
game.getState().getCreateCardAttribute(card).getColor().addColor(color); game.getState().getCreateCardAttribute(card, game).getColor().addColor(color);
} }
// Library // Library
for (Card card : player.getLibrary().getCards(game)) { for (Card card : player.getLibrary().getCards(game)) {
game.getState().getCreateCardAttribute(card).getColor().addColor(color); game.getState().getCreateCardAttribute(card, game).getColor().addColor(color);
} }
// Graveyard // Graveyard
for (Card card : player.getGraveyard().getCards(game)) { for (Card card : player.getGraveyard().getCards(game)) {
game.getState().getCreateCardAttribute(card).getColor().addColor(color); game.getState().getCreateCardAttribute(card, game).getColor().addColor(color);
} }
} }
} }

View file

@ -0,0 +1,107 @@
/*
* 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.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author TheElk801
*/
public class SternJudge extends CardImpl {
public SternJudge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// {tap}: Each player loses 1 life for each Swamp he or she controls.
this.addAbility(new SimpleActivatedAbility(new SternJudgeEffect(), new TapSourceCost()));
}
public SternJudge(final SternJudge card) {
super(card);
}
@Override
public SternJudge copy() {
return new SternJudge(this);
}
}
class SternJudgeEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterPermanent("Swamp");
static {
filter.add(new SubtypePredicate(SubType.SWAMP));
}
SternJudgeEffect() {
super(Outcome.Benefit);
this.staticText = "Each player loses 1 life for each Swamp he or she controls.";
}
SternJudgeEffect(final SternJudgeEffect effect) {
super(effect);
}
@Override
public SternJudgeEffect copy() {
return new SternJudgeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID playerId : game.getState().getPlayersInRange(source.getSourceId(), game)) {
Player player = game.getPlayer(source.getSourceId());
if (player != null) {
int lifeToLose = game.getBattlefield().getAllActivePermanents(filter, playerId, game).size();
player.loseLife(lifeToLose, game, false);
}
}
return true;
}
}

View file

@ -0,0 +1,87 @@
/*
* 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.cards.t;
import java.util.UUID;
import mage.constants.SubType;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.AttachedToMatchesFilterCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.constants.Outcome;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterAttackingCreature;
/**
*
* @author TheElk801
*/
public class TahngarthsRage extends CardImpl {
public TahngarthsRage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +3/+0 as long as it's attacking. Otherwise, it gets -2/-1.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD,
new ConditionalContinuousEffect(
new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield),
new BoostEnchantedEffect(-2, -1, Duration.WhileOnBattlefield),
new AttachedToMatchesFilterCondition(new FilterAttackingCreature()),
"Enchanted creature gets +3/+0 as long as it's attacking. Otherwise, it gets -2/-1."
)
));
}
public TahngarthsRage(final TahngarthsRage card) {
super(card);
}
@Override
public TahngarthsRage copy() {
return new TahngarthsRage(this);
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.cards.v;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author TheElk801
*/
public class VolrathsGardens extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control");
static {
filter.add(Predicates.not(new TappedPredicate()));
}
public VolrathsGardens(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
// {2}, Tap an untapped creature you control: You gain 2 life. Activate this ability only any time you could cast a sorcery.
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), new GenericManaCost(2));
ability.addCost(new TapTargetCost(new TargetControlledPermanent(filter)));
this.addAbility(ability);
}
public VolrathsGardens(final VolrathsGardens card) {
super(card);
}
@Override
public VolrathsGardens copy() {
return new VolrathsGardens(this);
}
}

View file

@ -173,6 +173,7 @@ public class Stronghold extends ExpansionSet {
cards.add(new SetCardInfo("Venerable Monk", 121, Rarity.COMMON, mage.cards.v.VenerableMonk.class)); cards.add(new SetCardInfo("Venerable Monk", 121, Rarity.COMMON, mage.cards.v.VenerableMonk.class));
cards.add(new SetCardInfo("Verdant Touch", 73, Rarity.RARE, mage.cards.v.VerdantTouch.class)); cards.add(new SetCardInfo("Verdant Touch", 73, Rarity.RARE, mage.cards.v.VerdantTouch.class));
cards.add(new SetCardInfo("Victual Sliver", 143, Rarity.UNCOMMON, mage.cards.v.VictualSliver.class)); cards.add(new SetCardInfo("Victual Sliver", 143, Rarity.UNCOMMON, mage.cards.v.VictualSliver.class));
cards.add(new SetCardInfo("Volrath's Gardens", 74, Rarity.RARE, mage.cards.v.VolrathsGardens.class));
cards.add(new SetCardInfo("Volrath's Laboratory", 136, Rarity.RARE, mage.cards.v.VolrathsLaboratory.class)); cards.add(new SetCardInfo("Volrath's Laboratory", 136, Rarity.RARE, mage.cards.v.VolrathsLaboratory.class));
cards.add(new SetCardInfo("Volrath's Shapeshifter", 48, Rarity.RARE, mage.cards.v.VolrathsShapeshifter.class)); cards.add(new SetCardInfo("Volrath's Shapeshifter", 48, Rarity.RARE, mage.cards.v.VolrathsShapeshifter.class));
cards.add(new SetCardInfo("Volrath's Stronghold", 137, Rarity.RARE, mage.cards.v.VolrathsStronghold.class)); cards.add(new SetCardInfo("Volrath's Stronghold", 137, Rarity.RARE, mage.cards.v.VolrathsStronghold.class));

View file

@ -318,6 +318,7 @@ public class Tempest extends ExpansionSet {
cards.add(new SetCardInfo("Swamp", 335, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Swamp", 335, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Swamp", 336, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Swamp", 336, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Swamp", 337, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Swamp", 337, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Tahngarth's Rage", 209, Rarity.UNCOMMON, mage.cards.t.TahngarthsRage.class));
cards.add(new SetCardInfo("Talon Sliver", 262, Rarity.COMMON, mage.cards.t.TalonSliver.class)); cards.add(new SetCardInfo("Talon Sliver", 262, Rarity.COMMON, mage.cards.t.TalonSliver.class));
cards.add(new SetCardInfo("Telethopter", 301, Rarity.UNCOMMON, mage.cards.t.Telethopter.class)); cards.add(new SetCardInfo("Telethopter", 301, Rarity.UNCOMMON, mage.cards.t.Telethopter.class));
cards.add(new SetCardInfo("Thalakos Dreamsower", 92, Rarity.UNCOMMON, mage.cards.t.ThalakosDreamsower.class)); cards.add(new SetCardInfo("Thalakos Dreamsower", 92, Rarity.UNCOMMON, mage.cards.t.ThalakosDreamsower.class));

View file

@ -73,6 +73,7 @@ public class TimeSpiral extends ExpansionSet {
cards.add(new SetCardInfo("Deep-Sea Kraken", 56, Rarity.RARE, mage.cards.d.DeepSeaKraken.class)); cards.add(new SetCardInfo("Deep-Sea Kraken", 56, Rarity.RARE, mage.cards.d.DeepSeaKraken.class));
cards.add(new SetCardInfo("Dementia Sliver", 236, Rarity.UNCOMMON, mage.cards.d.DementiaSliver.class)); cards.add(new SetCardInfo("Dementia Sliver", 236, Rarity.UNCOMMON, mage.cards.d.DementiaSliver.class));
cards.add(new SetCardInfo("Demonic Collusion", 103, Rarity.RARE, mage.cards.d.DemonicCollusion.class)); cards.add(new SetCardInfo("Demonic Collusion", 103, Rarity.RARE, mage.cards.d.DemonicCollusion.class));
cards.add(new SetCardInfo("Detainment Spell", 12, Rarity.COMMON, mage.cards.d.DetainmentSpell.class));
cards.add(new SetCardInfo("Divine Congregation", 13, Rarity.COMMON, mage.cards.d.DivineCongregation.class)); cards.add(new SetCardInfo("Divine Congregation", 13, Rarity.COMMON, mage.cards.d.DivineCongregation.class));
cards.add(new SetCardInfo("Draining Whelk", 57, Rarity.RARE, mage.cards.d.DrainingWhelk.class)); cards.add(new SetCardInfo("Draining Whelk", 57, Rarity.RARE, mage.cards.d.DrainingWhelk.class));
cards.add(new SetCardInfo("Dralnu, Lich Lord", 237, Rarity.RARE, mage.cards.d.DralnuLichLord.class)); cards.add(new SetCardInfo("Dralnu, Lich Lord", 237, Rarity.RARE, mage.cards.d.DralnuLichLord.class));
@ -100,6 +101,7 @@ public class TimeSpiral extends ExpansionSet {
cards.add(new SetCardInfo("Flamecore Elemental", 154, Rarity.COMMON, mage.cards.f.FlamecoreElemental.class)); cards.add(new SetCardInfo("Flamecore Elemental", 154, Rarity.COMMON, mage.cards.f.FlamecoreElemental.class));
cards.add(new SetCardInfo("Fledgling Mawcor", 63, Rarity.UNCOMMON, mage.cards.f.FledglingMawcor.class)); cards.add(new SetCardInfo("Fledgling Mawcor", 63, Rarity.UNCOMMON, mage.cards.f.FledglingMawcor.class));
cards.add(new SetCardInfo("Flickering Spirit", 17, Rarity.COMMON, mage.cards.f.FlickeringSpirit.class)); cards.add(new SetCardInfo("Flickering Spirit", 17, Rarity.COMMON, mage.cards.f.FlickeringSpirit.class));
cards.add(new SetCardInfo("Flowstone Channeler", 155, Rarity.COMMON, mage.cards.f.FlowstoneChanneler.class));
cards.add(new SetCardInfo("Fool's Demise", 64, Rarity.UNCOMMON, mage.cards.f.FoolsDemise.class)); cards.add(new SetCardInfo("Fool's Demise", 64, Rarity.UNCOMMON, mage.cards.f.FoolsDemise.class));
cards.add(new SetCardInfo("Forest", 298, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forest", 298, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Forest", 299, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forest", 299, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));

View file

@ -163,6 +163,7 @@ public class Torment extends ExpansionSet {
cards.add(new SetCardInfo("Slithery Stalker", 84, Rarity.UNCOMMON, mage.cards.s.SlitheryStalker.class)); cards.add(new SetCardInfo("Slithery Stalker", 84, Rarity.UNCOMMON, mage.cards.s.SlitheryStalker.class));
cards.add(new SetCardInfo("Sonic Seizure", 115, Rarity.COMMON, mage.cards.s.SonicSeizure.class)); cards.add(new SetCardInfo("Sonic Seizure", 115, Rarity.COMMON, mage.cards.s.SonicSeizure.class));
cards.add(new SetCardInfo("Soul Scourge", 85, Rarity.COMMON, mage.cards.s.SoulScourge.class)); cards.add(new SetCardInfo("Soul Scourge", 85, Rarity.COMMON, mage.cards.s.SoulScourge.class));
cards.add(new SetCardInfo("Stern Judge", 16, Rarity.UNCOMMON, mage.cards.s.SternJudge.class));
cards.add(new SetCardInfo("Strength of Isolation", 17, Rarity.UNCOMMON, mage.cards.s.StrengthOfIsolation.class)); cards.add(new SetCardInfo("Strength of Isolation", 17, Rarity.UNCOMMON, mage.cards.s.StrengthOfIsolation.class));
cards.add(new SetCardInfo("Strength of Lunacy", 86, Rarity.UNCOMMON, mage.cards.s.StrengthOfLunacy.class)); cards.add(new SetCardInfo("Strength of Lunacy", 86, Rarity.UNCOMMON, mage.cards.s.StrengthOfLunacy.class));
cards.add(new SetCardInfo("Stupefying Touch", 48, Rarity.UNCOMMON, mage.cards.s.StupefyingTouch.class)); cards.add(new SetCardInfo("Stupefying Touch", 48, Rarity.UNCOMMON, mage.cards.s.StupefyingTouch.class));

View file

@ -21,10 +21,10 @@ public class CardAttribute implements Serializable {
protected ObjectColor color; protected ObjectColor color;
protected SubTypeList subtype; protected SubTypeList subtype;
public CardAttribute(Card card) { public CardAttribute(Card card, Game game) {
color = card.getColor(null).copy(); color = card.getColor(null).copy();
subtype = new SubTypeList(); subtype = new SubTypeList();
subtype.addAll(subtype); subtype.addAll(card.getSubtype(game));
} }
public CardAttribute(CardAttribute cardAttribute) { public CardAttribute(CardAttribute cardAttribute) {

View file

@ -1079,8 +1079,8 @@ public class GameState implements Serializable, Copyable<GameState> {
return cardAttribute.get(cardId); return cardAttribute.get(cardId);
} }
public CardAttribute getCreateCardAttribute(Card card) { public CardAttribute getCreateCardAttribute(Card card, Game game) {
CardAttribute cardAtt = cardAttribute.computeIfAbsent(card.getId(), k -> new CardAttribute(card)); CardAttribute cardAtt = cardAttribute.computeIfAbsent(card.getId(), k -> new CardAttribute(card, game));
return cardAtt; return cardAtt;
} }