Merge pull request #3750 from Zzooouhh/master

Implement Words of Waste, Words of Wilding and fix #3740 for the cycle
This commit is contained in:
LevelX2 2017-07-28 10:59:36 +02:00 committed by GitHub
commit 99f206d536
6 changed files with 255 additions and 8 deletions

View file

@ -98,12 +98,14 @@ class WordsOfWarEffect extends ReplacementEffectImpl {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (player != null) {
player.damage(2, source.getSourceId(), game, false, true);
this.used = true;
discard();
return true;
}
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) {
permanent.damage(2, source.getSourceId(), game, false, true);
this.used = true;
discard();
return true;
}
@ -118,6 +120,9 @@ class WordsOfWarEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return source.getControllerId().equals(event.getPlayerId());
if (!this.used) {
return source.getControllerId().equals(event.getPlayerId());
}
return false;
}
}

View file

@ -0,0 +1,115 @@
/*
* 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.w;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
import mage.constants.TargetController;
import mage.abilities.dynamicvalue.common.StaticValue;
/**
*
* @author L_J
*/
public class WordsOfWaste extends CardImpl {
public WordsOfWaste(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}");
// {1}: The next time you would draw a card this turn, each opponent discards a card instead.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WordsOfWasteEffect(), new ManaCostsImpl("{1}")));
}
public WordsOfWaste(final WordsOfWaste card) {
super(card);
}
@Override
public WordsOfWaste copy() {
return new WordsOfWaste(this);
}
}
class WordsOfWasteEffect extends ReplacementEffectImpl {
public WordsOfWasteEffect() {
super(Duration.EndOfTurn, Outcome.Discard);
staticText = "The next time you would draw a card this turn, each opponent discards a card instead.";
}
public WordsOfWasteEffect(final WordsOfWasteEffect effect) {
super(effect);
}
@Override
public WordsOfWasteEffect copy() {
return new WordsOfWasteEffect(this);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
new DiscardEachPlayerEffect(new StaticValue(1), false, TargetController.OPPONENT).apply(game, source);
this.used = true;
discard();
return true;
}
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DRAW_CARD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (!this.used) {
return source.getControllerId().equals(event.getPlayerId());
}
return false;
}
}

View file

@ -0,0 +1,116 @@
/*
* 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.w;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.game.permanent.token.BearToken;
import mage.constants.TargetController;
import mage.abilities.dynamicvalue.common.StaticValue;
/**
*
* @author L_J
*/
public class WordsOfWilding extends CardImpl {
public WordsOfWilding(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}");
// {1}: The next time you would draw a card this turn, create a 2/2 green Bear creature token instead.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WordsOfWildingEffect(), new ManaCostsImpl("{1}")));
}
public WordsOfWilding(final WordsOfWilding card) {
super(card);
}
@Override
public WordsOfWilding copy() {
return new WordsOfWilding(this);
}
}
class WordsOfWildingEffect extends ReplacementEffectImpl {
public WordsOfWildingEffect() {
super(Duration.EndOfTurn, Outcome.Discard);
staticText = "The next time you would draw a card this turn, create a 2/2 green Bear creature token instead.";
}
public WordsOfWildingEffect(final WordsOfWildingEffect effect) {
super(effect);
}
@Override
public WordsOfWildingEffect copy() {
return new WordsOfWildingEffect(this);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
new CreateTokenEffect(new BearToken()).apply(game, source);
this.used = true;
discard();
return true;
}
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DRAW_CARD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (!this.used) {
return source.getControllerId().equals(event.getPlayerId());
}
return false;
}
}

View file

@ -29,16 +29,17 @@ package mage.cards.w;
import java.util.List;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -107,6 +108,7 @@ class WordsOfWindEffect extends ReplacementEffectImpl {
}
}
}
this.used = true;
discard();
return true;
}
@ -118,6 +120,9 @@ class WordsOfWindEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return source.getControllerId().equals(event.getPlayerId());
if (!this.used) {
return source.getControllerId().equals(event.getPlayerId());
}
return false;
}
}
}

View file

@ -92,6 +92,7 @@ class WordsOfWorshipEffect extends ReplacementEffectImpl {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.gainLife(5, game);
this.used = true;
discard();
return true;
}
@ -105,6 +106,9 @@ class WordsOfWorshipEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return source.getControllerId().equals(event.getPlayerId());
if (!this.used) {
return source.getControllerId().equals(event.getPlayerId());
}
return false;
}
}
}

View file

@ -312,6 +312,8 @@ public class Onslaught extends ExpansionSet {
cards.add(new SetCardInfo("Wirewood Savage", 304, Rarity.COMMON, mage.cards.w.WirewoodSavage.class));
cards.add(new SetCardInfo("Wooded Foothills", 330, Rarity.RARE, mage.cards.w.WoodedFoothills.class, new CardGraphicInfo(new ObjectColor("RG"), null, false)));
cards.add(new SetCardInfo("Words of War", 244, Rarity.RARE, mage.cards.w.WordsOfWar.class));
cards.add(new SetCardInfo("Words of Waste", 182, Rarity.RARE, mage.cards.w.WordsOfWaste.class));
cards.add(new SetCardInfo("Words of Wilding", 305, Rarity.RARE, mage.cards.w.WordsOfWilding.class));
cards.add(new SetCardInfo("Words of Wind", 122, Rarity.RARE, mage.cards.w.WordsOfWind.class));
cards.add(new SetCardInfo("Words of Worship", 61, Rarity.RARE, mage.cards.w.WordsOfWorship.class));
cards.add(new SetCardInfo("Wretched Anurid", 183, Rarity.COMMON, mage.cards.w.WretchedAnurid.class));