mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Misc cleanup (#7009)
This commit is contained in:
@@ -705,7 +705,7 @@ public class GameAction {
|
||||
StaticAbility stAb = eff.addStaticAbility(AbilityUtils.getSVar(cause, cause.getParam("StaticEffect")));
|
||||
stAb.setActiveZone(EnumSet.of(ZoneType.Command));
|
||||
// needed for ETB lookahead like Bronzehide Lion
|
||||
stAb.putParam("AffectedZone", "Battlefield,Hand,Graveyard,Exile,Stack,Library,Command");
|
||||
stAb.putParam("AffectedZone", "All");
|
||||
SpellAbilityEffect.addForgetOnMovedTrigger(eff, "Battlefield");
|
||||
game.getAction().moveToCommand(eff, cause);
|
||||
}
|
||||
|
||||
@@ -107,10 +107,8 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
|
||||
final Zone originZone = game.getZoneOf(c);
|
||||
|
||||
// Fizzle spells so that they are removed from stack (e.g. Summary Dismissal)
|
||||
if (sa.hasParam("Fizzle")) {
|
||||
if (originZone.is(ZoneType.Exile) || originZone.is(ZoneType.Hand) || originZone.is(ZoneType.Stack)) {
|
||||
game.getStack().remove(c);
|
||||
}
|
||||
if (originZone.is(ZoneType.Stack)) {
|
||||
game.getStack().remove(c);
|
||||
}
|
||||
|
||||
if (remLKI) {
|
||||
|
||||
@@ -558,22 +558,15 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (originZone.is(ZoneType.Stack)) {
|
||||
game.getStack().remove(gameCard);
|
||||
}
|
||||
|
||||
Card movedCard = null;
|
||||
Map<AbilityKey, Object> moveParams = AbilityKey.newMap();
|
||||
AbilityKey.addCardZoneTableParams(moveParams, triggerList);
|
||||
|
||||
if (destination.equals(ZoneType.Library)) {
|
||||
// If a card is moved to library from the stack, remove its spells from the stack
|
||||
if (sa.hasParam("Fizzle")) {
|
||||
// TODO only AI still targets as card, try to remove it
|
||||
if (gameCard.isInZone(ZoneType.Exile) || gameCard.isInZone(ZoneType.Hand) || gameCard.isInZone(ZoneType.Stack)) {
|
||||
// This only fizzles spells, not anything else.
|
||||
game.getStack().remove(gameCard);
|
||||
}
|
||||
}
|
||||
|
||||
movedCard = game.getAction().moveToLibrary(gameCard, libraryPosition, sa, moveParams);
|
||||
} else if (destination.equals(ZoneType.Battlefield)) {
|
||||
if (destination.equals(ZoneType.Battlefield)) {
|
||||
moveParams.put(AbilityKey.SimultaneousETB, tgtCards);
|
||||
if (sa.isReplacementAbility()) {
|
||||
ReplacementEffect re = sa.getReplacementEffect();
|
||||
@@ -725,15 +718,6 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
commandCards.add(movedCard); //add to list to reveal the commandzone cards
|
||||
}
|
||||
|
||||
// If a card is Exiled from the stack, remove its spells from the stack
|
||||
if (sa.hasParam("Fizzle")) {
|
||||
if (gameCard.isInZone(ZoneType.Exile) || gameCard.isInZone(ZoneType.Hand)
|
||||
|| gameCard.isInZone(ZoneType.Stack) || gameCard.isInZone(ZoneType.Command)) {
|
||||
// This only fizzles spells, not anything else.
|
||||
game.getStack().remove(gameCard);
|
||||
}
|
||||
}
|
||||
|
||||
if (sa.hasParam("WithCountersType")) {
|
||||
CounterType cType = CounterType.getType(sa.getParam("WithCountersType"));
|
||||
int cAmount = AbilityUtils.calculateAmount(hostCard, sa.getParamOrDefault("WithCountersAmount", "1"), sa);
|
||||
|
||||
@@ -32,6 +32,7 @@ public class ManaEffect extends SpellAbilityEffect {
|
||||
@Override
|
||||
public void resolve(SpellAbility sa) {
|
||||
final Card card = sa.getHostCard();
|
||||
final Game game = card.getGame();
|
||||
final AbilityManaPart abMana = sa.getManaPart();
|
||||
final List<Player> tgtPlayers = getDefinedPlayersOrTargeted(sa);
|
||||
final Player activator = sa.getActivatingPlayer();
|
||||
@@ -39,10 +40,7 @@ public class ManaEffect extends SpellAbilityEffect {
|
||||
// Spells are not undoable
|
||||
sa.setUndoable(sa.isAbility() && sa.isUndoable() && tgtPlayers.size() < 2 && !sa.hasParam("ActivationLimit"));
|
||||
|
||||
final boolean optional = sa.hasParam("Optional");
|
||||
final Game game = activator.getGame();
|
||||
|
||||
if (optional && !activator.getController().confirmAction(sa, null, Localizer.getInstance().getMessage("lblDoYouWantAddMana"), null)) {
|
||||
if (sa.hasParam("Optional") && !activator.getController().confirmAction(sa, null, Localizer.getInstance().getMessage("lblDoYouWantAddMana"), null)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -344,10 +344,8 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
||||
if (zone == null || !this.validHostZones.contains(zone.getZoneType())) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!getHostCard().isInPlay()) { // default
|
||||
return false;
|
||||
}
|
||||
} else if (!getHostCard().isInPlay()) { // default
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user