mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Fix for Turnabout
-NOTE Apparently the "TargetedPlayerCtrl" property doesn't actually work. It seems like 14 other scripts use this property
This commit is contained in:
@@ -3,7 +3,7 @@ ManaCost:2 U U
|
||||
Types:Instant
|
||||
Text:no text
|
||||
A:SP$ ChooseType | Cost$ 2 U U | Type$ Card | ValidTypes$ Artifact,Creature,Land | SubAbility$ DBTapOrUntapAll | SpellDescription$ Choose artifact, creature, or land. Tap all untapped permanents of the chosen type target player controls, or untap all tapped permanents of that type that player controls.
|
||||
SVar:DBTapOrUntapAll:DB$ TapOrUntapAll | ValidTgts$ Player | ValidCards$ Card.ChosenType+TargetedPlayerCtrl | ValidMessage$ permanents of the chosen type target player controls
|
||||
SVar:DBTapOrUntapAll:DB$ TapOrUntapAll | ValidTgts$ Player | ValidCards$ Card.ChosenType | ValidMessage$ permanents of the chosen type target player controls
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/turnabout.jpg
|
||||
|
||||
@@ -5,10 +5,12 @@ import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import forge.Card;
|
||||
import forge.CardLists;
|
||||
import forge.Singletons;
|
||||
import forge.card.abilityfactory.AbilityFactory;
|
||||
import forge.card.abilityfactory.SpellEffect;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.GuiChoose;
|
||||
|
||||
@@ -42,11 +44,17 @@ public class TapOrUntapAllEffect extends SpellEffect {
|
||||
@Override
|
||||
public void resolve(SpellAbility sa) {
|
||||
List<Card> validCards = getTargetCards(sa);
|
||||
|
||||
List<Player> targetedPlayers = getTargetPlayersEmptyAsDefault(sa);
|
||||
|
||||
if (sa.hasParam("ValidCards")) {
|
||||
validCards = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield);
|
||||
validCards = AbilityFactory.filterListByType(validCards, sa.getParam("ValidCards"), sa);
|
||||
}
|
||||
|
||||
if (!targetedPlayers.isEmpty()) {
|
||||
validCards = CardLists.filterControlledBy(validCards, targetedPlayers);
|
||||
}
|
||||
|
||||
// Default to tapping for AI
|
||||
TapOrUntap toTap = TapOrUntap.TAP;
|
||||
|
||||
Reference in New Issue
Block a user