mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Fixed Lightning Storm and possibly other similar cards with abilities that can be activated from stack not registering in the Flashback zone correctly when going to stack.
- Currently a bit hacky (involves force-updating the flashback zone for view on adding a card to stack if there are externally activatable cards on stack at the moment the spell is added to stack), feel free to improve. - There are still some visual glitches related to flashback and cards activated on stack - after the spell is cast, the spell sometimes visually "lingers" in the flashback zone for some time and then gets removed from there with time. Not sure how to fix.
This commit is contained in:
@@ -267,6 +267,10 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
view.updateOpponents(this);
|
||||
}
|
||||
|
||||
public void updateFlashbackForView() {
|
||||
view.updateFlashbackForPlayer(this);
|
||||
}
|
||||
|
||||
//get single opponent for player if only one, otherwise returns null
|
||||
//meant to be used after game ends for the sake of achievements
|
||||
public Player getSingleOpponent() {
|
||||
|
||||
@@ -337,6 +337,10 @@ public class PlayerView extends GameEntityView {
|
||||
}
|
||||
}
|
||||
|
||||
void updateFlashbackForPlayer(Player p) {
|
||||
set(TrackableProperty.Flashback, CardView.getCollection(p.getCardsIn(ZoneType.Flashback)));
|
||||
}
|
||||
|
||||
public int getMana(final byte color) {
|
||||
Integer count = getMana().get(color);
|
||||
return count != null ? count.intValue() : 0;
|
||||
|
||||
@@ -47,10 +47,12 @@ import forge.game.card.CardLists;
|
||||
import forge.game.card.CardPredicates;
|
||||
import forge.game.card.CardPredicates.Presets;
|
||||
import forge.game.cost.Cost;
|
||||
import forge.game.event.EventValueChangeType;
|
||||
import forge.game.event.GameEventCardStatsChanged;
|
||||
import forge.game.event.GameEventSpellAbilityCast;
|
||||
import forge.game.event.GameEventSpellRemovedFromStack;
|
||||
import forge.game.event.GameEventSpellResolved;
|
||||
import forge.game.event.GameEventZone;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.player.PlayerController.ManaPaymentPurpose;
|
||||
import forge.game.replacement.ReplacementEffect;
|
||||
@@ -415,6 +417,15 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
|
||||
game.getTriggerHandler().runTrigger(TriggerType.BecomesTarget, runParams, false);
|
||||
}
|
||||
|
||||
game.fireEvent(new GameEventZone(ZoneType.Stack, sp.getActivatingPlayer(), EventValueChangeType.Added, source));
|
||||
|
||||
if (sp.getActivatingPlayer() != null && !game.getCardsPlayerCanActivateInStack().isEmpty()) {
|
||||
// This is a bit of a hack that forces the update of externally activatable cards in flashback zone (e.g. Lightning Storm).
|
||||
for (Player p : game.getPlayers()) {
|
||||
p.updateFlashbackForView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final int size() {
|
||||
|
||||
Reference in New Issue
Block a user