mirror of
https://github.com/correl/mage.git
synced 2025-04-08 17:00:07 -09:00
Merge origin/master
This commit is contained in:
commit
97b2b2feac
4 changed files with 85 additions and 136 deletions
Mage.Sets/src/mage/cards
Mage/src/main/java/mage/abilities/effects
|
@ -118,8 +118,12 @@ class DarigaazReincarnatedDiesEffect extends ReplacementEffectImpl {
|
||||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null && permanent != null) {
|
if (controller != null && permanent != null) {
|
||||||
|
Card permCard = game.getCard(permanent.getId());
|
||||||
|
if (permCard == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true)
|
return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true)
|
||||||
&& permanent.addCounters(CounterType.EGG.createInstance(), source, game);
|
&& permCard.addCounters(CounterType.EGG.createInstance(3), source, game);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,14 +32,12 @@ import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
|
import mage.abilities.effects.GainAbilitySpellsEffect;
|
||||||
import mage.abilities.effects.common.DamageTargetEffect;
|
import mage.abilities.effects.common.DamageTargetEffect;
|
||||||
import mage.abilities.keyword.LifelinkAbility;
|
import mage.abilities.keyword.LifelinkAbility;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -49,10 +47,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.game.stack.Spell;
|
import mage.game.stack.Spell;
|
||||||
import mage.game.stack.StackObject;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.common.TargetCreatureOrPlayer;
|
import mage.target.common.TargetCreatureOrPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,68 +127,4 @@ class FiresongAndSunspeakerTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "Whenever a white instant or sorcery spell causes you to gain life, Firesong and Sunspeaker deals 3 damage to target creature or player.";
|
return "Whenever a white instant or sorcery spell causes you to gain life, Firesong and Sunspeaker deals 3 damage to target creature or player.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class GainAbilitySpellsEffect extends ContinuousEffectImpl {
|
|
||||||
|
|
||||||
private final Ability ability;
|
|
||||||
private final FilterObject filter;
|
|
||||||
|
|
||||||
public GainAbilitySpellsEffect(Ability ability, FilterObject filter) {
|
|
||||||
super(Duration.Custom, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
|
||||||
this.ability = ability;
|
|
||||||
this.filter = filter;
|
|
||||||
staticText = filter.getMessage() + " have " + ability.getRule();
|
|
||||||
}
|
|
||||||
|
|
||||||
public GainAbilitySpellsEffect(final GainAbilitySpellsEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
this.ability = effect.ability;
|
|
||||||
this.filter = effect.filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GainAbilitySpellsEffect copy() {
|
|
||||||
return new GainAbilitySpellsEffect(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 (Card card : game.getExile().getAllCards(game)) {
|
|
||||||
if (card.getOwnerId().equals(source.getControllerId()) && filter.match(card, game)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Card card : player.getLibrary().getCards(game)) {
|
|
||||||
if (filter.match(card, game)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Card card : player.getHand().getCards(game)) {
|
|
||||||
if (filter.match(card, game)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Card card : player.getGraveyard().getCards(game)) {
|
|
||||||
if (filter.match(card, game)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (StackObject stackObject : game.getStack()) {
|
|
||||||
if (stackObject.getControllerId().equals(source.getControllerId())) {
|
|
||||||
Card card = game.getCard(stackObject.getSourceId());
|
|
||||||
if (card != null && filter.match(card, game)) {
|
|
||||||
if (!card.getAbilities().contains(ability)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -36,6 +36,7 @@ import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
|
import mage.abilities.effects.GainAbilitySpellsEffect;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
import mage.abilities.keyword.LifelinkAbility;
|
import mage.abilities.keyword.LifelinkAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
@ -102,70 +103,6 @@ public class SoulfireGrandMaster extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class GainAbilitySpellsEffect extends ContinuousEffectImpl {
|
|
||||||
|
|
||||||
private final Ability ability;
|
|
||||||
private final FilterObject filter;
|
|
||||||
|
|
||||||
public GainAbilitySpellsEffect(Ability ability, FilterObject filter) {
|
|
||||||
super(Duration.Custom, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
|
||||||
this.ability = ability;
|
|
||||||
this.filter = filter;
|
|
||||||
staticText = filter.getMessage() + " have " + ability.getRule();
|
|
||||||
}
|
|
||||||
|
|
||||||
public GainAbilitySpellsEffect(final GainAbilitySpellsEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
this.ability = effect.ability;
|
|
||||||
this.filter = effect.filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GainAbilitySpellsEffect copy() {
|
|
||||||
return new GainAbilitySpellsEffect(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 (Card card : game.getExile().getAllCards(game)) {
|
|
||||||
if (card.getOwnerId().equals(source.getControllerId()) && filter.match(card, game)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Card card : player.getLibrary().getCards(game)) {
|
|
||||||
if (filter.match(card, game)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Card card : player.getHand().getCards(game)) {
|
|
||||||
if (filter.match(card, game)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Card card : player.getGraveyard().getCards(game)) {
|
|
||||||
if (filter.match(card, game)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (StackObject stackObject : game.getStack()) {
|
|
||||||
if (stackObject.getControllerId().equals(source.getControllerId())) {
|
|
||||||
Card card = game.getCard(stackObject.getSourceId());
|
|
||||||
if (card != null && filter.match(card, game)) {
|
|
||||||
if (!card.getAbilities().contains(ability)) {
|
|
||||||
game.getState().addOtherAbility(card, ability);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SoulfireGrandMasterCastFromHandReplacementEffect extends ReplacementEffectImpl {
|
class SoulfireGrandMasterCastFromHandReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard();
|
private static final FilterCard filter = new FilterCard();
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
package mage.abilities.effects;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Layer;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubLayer;
|
||||||
|
import mage.filter.FilterObject;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.game.stack.StackObject;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
|
public class GainAbilitySpellsEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
|
private final Ability ability;
|
||||||
|
private final FilterObject filter;
|
||||||
|
|
||||||
|
public GainAbilitySpellsEffect(Ability ability, FilterObject filter) {
|
||||||
|
super(Duration.Custom, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||||
|
this.ability = ability;
|
||||||
|
this.filter = filter;
|
||||||
|
staticText = filter.getMessage() + " have " + ability.getRule();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GainAbilitySpellsEffect(final GainAbilitySpellsEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
this.ability = effect.ability;
|
||||||
|
this.filter = effect.filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GainAbilitySpellsEffect copy() {
|
||||||
|
return new GainAbilitySpellsEffect(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 (Card card : game.getExile().getAllCards(game)) {
|
||||||
|
if (card.getOwnerId().equals(source.getControllerId()) && filter.match(card, game)) {
|
||||||
|
game.getState().addOtherAbility(card, ability);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Card card : player.getLibrary().getCards(game)) {
|
||||||
|
if (filter.match(card, game)) {
|
||||||
|
game.getState().addOtherAbility(card, ability);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Card card : player.getHand().getCards(game)) {
|
||||||
|
if (filter.match(card, game)) {
|
||||||
|
game.getState().addOtherAbility(card, ability);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Card card : player.getGraveyard().getCards(game)) {
|
||||||
|
if (filter.match(card, game)) {
|
||||||
|
game.getState().addOtherAbility(card, ability);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (StackObject stackObject : game.getStack()) {
|
||||||
|
if (stackObject.getControllerId().equals(source.getControllerId())) {
|
||||||
|
Card card = game.getCard(stackObject.getSourceId());
|
||||||
|
if (card != null && filter.match(card, game)) {
|
||||||
|
if (!card.getAbilities().contains(ability)) {
|
||||||
|
game.getState().addOtherAbility(card, ability);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue