mirror of
https://github.com/magefree/mage.git
synced 2026-01-20 18:29:56 -08:00
Merge origin/master
This commit is contained in:
commit
863ceefaef
6 changed files with 270 additions and 65 deletions
|
|
@ -29,11 +29,8 @@ package mage.sets.coldsnap;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardControllerEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.abilities.effects.keyword.RippleEffect;
|
||||
import mage.abilities.keyword.RippleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
|
|
@ -50,7 +47,8 @@ public class SurgingDementia extends CardImpl {
|
|||
this.expansionSetCode = "CSP";
|
||||
|
||||
// Ripple 4
|
||||
this.getSpellAbility().addEffect(new RippleEffect(4));
|
||||
this.addAbility(new RippleAbility(4));
|
||||
|
||||
// Target player discards a card.
|
||||
this.getSpellAbility().getEffects().add(new DiscardTargetEffect(1));
|
||||
this.getSpellAbility().getTargets().add(new TargetPlayer());
|
||||
|
|
|
|||
|
|
@ -27,38 +27,99 @@
|
|||
*/
|
||||
package mage.sets.coldsnap;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.effects.keyword.RippleEffect;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.keyword.RippleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author klayhamn
|
||||
*/
|
||||
public class ThrummingStone extends CardImpl {
|
||||
|
||||
//applies to all spells
|
||||
private static final FilterSpell anySpellFilter = new FilterSpell();
|
||||
//applies to all spells
|
||||
private static final FilterSpell anySpellFilter = new FilterSpell("Spells you cast");
|
||||
|
||||
public ThrummingStone(UUID ownerId) {
|
||||
super(ownerId, 142, "Thrumming Stone", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}");
|
||||
this.expansionSetCode = "CSP";
|
||||
this.supertype.add("Legendary");
|
||||
public ThrummingStone(UUID ownerId) {
|
||||
super(ownerId, 142, "Thrumming Stone", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}");
|
||||
this.expansionSetCode = "CSP";
|
||||
this.supertype.add("Legendary");
|
||||
|
||||
addAbility(new SpellCastControllerTriggeredAbility(new RippleEffect(4, false), anySpellFilter, false, true));
|
||||
}
|
||||
// spells you cast have Ripple 4
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ThrummingStoneGainAbilitySpellsEffect(new RippleAbility(4), anySpellFilter)));
|
||||
}
|
||||
|
||||
public ThrummingStone(final ThrummingStone card) {
|
||||
super(card);
|
||||
}
|
||||
public ThrummingStone(final ThrummingStone card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrummingStone copy() {
|
||||
return new ThrummingStone(this);
|
||||
}
|
||||
@Override
|
||||
public ThrummingStone copy() {
|
||||
return new ThrummingStone(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ThrummingStoneGainAbilitySpellsEffect extends ContinuousEffectImpl {
|
||||
|
||||
private final Ability ability;
|
||||
private final FilterSpell filter;
|
||||
|
||||
|
||||
public ThrummingStoneGainAbilitySpellsEffect(Ability ability, FilterSpell filter) {
|
||||
super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
this.ability = ability;
|
||||
this.filter = filter;
|
||||
staticText = filter.getMessage() + " have " + ability.getRule();
|
||||
}
|
||||
|
||||
public ThrummingStoneGainAbilitySpellsEffect(final ThrummingStoneGainAbilitySpellsEffect effect) {
|
||||
super(effect);
|
||||
this.ability = effect.ability.copy();
|
||||
this.filter = effect.filter.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrummingStoneGainAbilitySpellsEffect copy() {
|
||||
return new ThrummingStoneGainAbilitySpellsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && permanent != null) {
|
||||
for (StackObject stackObject : game.getStack()) {
|
||||
// only spells cast, so no copies of spells
|
||||
if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) {
|
||||
Spell spell = (Spell) stackObject;
|
||||
if (filter.match(spell, game)) {
|
||||
if (!spell.getAbilities().contains(ability)) {
|
||||
game.getState().addOtherAbility(spell.getCard(), ability);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ package mage.sets.commander;
|
|||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -37,6 +38,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
|
@ -53,10 +55,10 @@ public class Stranglehold extends CardImpl {
|
|||
this.expansionSetCode = "CMD";
|
||||
|
||||
// Your opponents can't search libraries.
|
||||
this.getSpellAbility().addEffect(new OpponentsCantSearchLibarariesEffect());
|
||||
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OpponentsCantSearchLibarariesEffect()));
|
||||
|
||||
// If an opponent would begin an extra turn, that player skips that turn instead.
|
||||
this.getSpellAbility().addEffect(new StrangleholdSkipExtraTurnsEffect());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StrangleholdSkipExtraTurnsEffect()));
|
||||
}
|
||||
|
||||
public Stranglehold(final Stranglehold card) {
|
||||
|
|
@ -103,7 +105,7 @@ class OpponentsCantSearchLibarariesEffect extends ContinuousRuleModifyingEffectI
|
|||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return EventType.SEARCH_LIBRARY.equals(event.getType());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue