mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Merge pull request #2859 from Northmoc/seedouble
see_double.txt and support
This commit is contained in:
@@ -1,14 +1,8 @@
|
|||||||
package forge.game.ability.effects;
|
package forge.game.ability.effects;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.GameEntity;
|
import forge.game.GameEntity;
|
||||||
import forge.game.ability.AbilityKey;
|
import forge.game.ability.AbilityKey;
|
||||||
@@ -21,12 +15,19 @@ import forge.game.card.CardLists;
|
|||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.replacement.ReplacementType;
|
import forge.game.replacement.ReplacementType;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
|
import forge.game.staticability.StaticAbilityCantBeCopied;
|
||||||
import forge.util.Aggregates;
|
import forge.util.Aggregates;
|
||||||
import forge.util.CardTranslation;
|
import forge.util.CardTranslation;
|
||||||
import forge.util.Localizer;
|
|
||||||
import forge.util.Lang;
|
import forge.util.Lang;
|
||||||
|
import forge.util.Localizer;
|
||||||
import forge.util.collect.FCollection;
|
import forge.util.collect.FCollection;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
|
||||||
public class CopySpellAbilityEffect extends SpellAbilityEffect {
|
public class CopySpellAbilityEffect extends SpellAbilityEffect {
|
||||||
|
|
||||||
@@ -74,7 +75,15 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
|
|||||||
controllers = AbilityUtils.getDefinedPlayers(card, sa.getParam("Controller"), sa);
|
controllers = AbilityUtils.getDefinedPlayers(card, sa.getParam("Controller"), sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<SpellAbility> tgtSpells = getTargetSpells(sa);
|
List<SpellAbility> tgtSpells = getTargetSpells(sa);
|
||||||
|
List<SpellAbility> cantCopy = new ArrayList<>();
|
||||||
|
|
||||||
|
for (final SpellAbility tgtSA : tgtSpells) {
|
||||||
|
if (StaticAbilityCantBeCopied.cantBeCopied(tgtSA.getHostCard())) {
|
||||||
|
cantCopy.add(tgtSA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tgtSpells.removeAll(cantCopy);
|
||||||
|
|
||||||
if (tgtSpells.isEmpty() || amount == 0) {
|
if (tgtSpells.isEmpty() || amount == 0) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Forge: Play Magic: the Gathering.
|
||||||
|
* Copyright (C) 2011 Forge Team
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package forge.game.staticability;
|
||||||
|
|
||||||
|
import forge.game.Game;
|
||||||
|
import forge.game.card.Card;
|
||||||
|
import forge.game.zone.ZoneType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class StaticAbility_CantBeCopied.
|
||||||
|
*/
|
||||||
|
public class StaticAbilityCantBeCopied {
|
||||||
|
|
||||||
|
static String MODE = "CantBeCopied";
|
||||||
|
|
||||||
|
public static boolean cantBeCopied(final Card c) {
|
||||||
|
final Game game = c.getGame();
|
||||||
|
for (final Card ca : game.getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES)) {
|
||||||
|
for (final StaticAbility stAb : ca.getStaticAbilities()) {
|
||||||
|
if (!stAb.checkConditions(MODE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (cantBeCopiedCheck(stAb, c)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean cantBeCopiedCheck(final StaticAbility stAb, final Card card) {
|
||||||
|
if (stAb.matchesValidParam("ValidCard", card)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
9
forge-gui/res/cardsfolder/upcoming/see_double.txt
Normal file
9
forge-gui/res/cardsfolder/upcoming/see_double.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Name:See Double
|
||||||
|
ManaCost:2 U U
|
||||||
|
Types:Instant
|
||||||
|
S:Mode$ CantBeCopied | ValidCard$ Card.Self | EffectZone$ Stack | Description$ This spell can't be copied.
|
||||||
|
A:SP$ Charm | MinCharmNum$ 1 | CharmNum$ X | Choices$ CopySpell,CopyCreature | AdditionalDescription$ . If an opponent has eight or more cards in their graveyard, you may choose both.
|
||||||
|
SVar:X:Count$Compare PlayerCountOpponents$HighestCardsInGraveyard GE8.2.1
|
||||||
|
SVar:CopySpell:DB$ CopySpellAbility | ValidTgts$ Card | TargetType$ Spell | MayChooseTarget$ True | SpellDescription$ Copy target spell. You may choose new targets for the copy. (A copy of a permanent spell becomes a token.)
|
||||||
|
SVar:CopyCreature:DB$ CopyPermanent | ValidTgts$ Creature | SpellDescription$ Create a token that's a copy of target creature.
|
||||||
|
Oracle:This spell can't be copied.\nChoose one. If an opponent has eight or more cards in their graveyard, you may choose both.\n• Copy target spell. You may choose new targets for the copy. (A copy of a permanent spell becomes a token.)\n• Create a token that's a copy of target creature.
|
||||||
Reference in New Issue
Block a user