Skip to content

Commit 22b4899

Browse files
tool4EvErtool4EvEr
authored andcommitted
Clean up
1 parent 278d72f commit 22b4899

File tree

3 files changed

+8
-30
lines changed

3 files changed

+8
-30
lines changed

forge-game/src/main/java/forge/game/GameAction.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,13 @@ private void handleStaticEffect(Card copied, SpellAbility cause) {
738738
}
739739
}
740740

741-
Integer timestamp = cause.getSVarInt("StaticEffectTimestamp");
741+
Long timestamp;
742+
// check if player ordered it manually
743+
if (cause.hasSVar("StaticEffectTimestamp")) {
744+
timestamp = Long.parseLong(cause.getSVar("StaticEffectTimestamp"));
745+
} else {
746+
timestamp = game.getNextTimestamp();
747+
}
742748
String name = "Static Effect #" + timestamp;
743749
// check if this isn't the first card being moved
744750
Optional<Card> opt = IterableUtil.tryFind(cause.getActivatingPlayer().getZone(ZoneType.Command).getCards(), CardPredicates.nameEquals(name));

forge-game/src/main/java/forge/game/GameActionUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ public static CardCollectionView orderCardsByTheirOwners(Game game, CardCollecti
857857
subList.add(c);
858858
}
859859
}
860-
if (sa.getActivatingPlayer() == p && sa.hasParam("StaticEffect")) {
860+
if (sa != null && sa.getActivatingPlayer() == p && sa.hasParam("StaticEffect")) {
861861
String name = "Static Effect of " + sa.getHostCard();
862862
// create helper card for ordering
863863
eff = new DetachedCardEffect(sa.getHostCard(), name);

forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -529,11 +529,6 @@ private void changeKnownOriginResolve(final SpellAbility sa) {
529529
}
530530
}
531531

532-
// if the player didn't order the effect above use default
533-
if (sa.hasParam("StaticEffect") && !sa.hasSVar("StaticEffectTimestamp")) {
534-
sa.setSVar("StaticEffectTimestamp", String.valueOf(game.getNextTimestamp()));
535-
}
536-
537532
for (final Card tgtC : tgtCards) {
538533
if (sa.hasSVar("StaticEffectUntilCardID") && sa.getSVarInt("StaticEffectUntilCardID") == tgtC.getId()) {
539534
sa.setSVar("StaticEffectTimestamp", String.valueOf(game.getNextTimestamp()));
@@ -661,19 +656,6 @@ private void changeKnownOriginResolve(final SpellAbility sa) {
661656
}
662657
}
663658

664-
if (sa.hasAdditionalAbility("AnimateSubAbility")) {
665-
// need LKI before Animate does apply
666-
if (!moveParams.containsKey(AbilityKey.CardLKI)) {
667-
moveParams.put(AbilityKey.CardLKI, CardCopyService.getLKICopy(gameCard));
668-
}
669-
670-
final SpellAbility animate = sa.getAdditionalAbility("AnimateSubAbility");
671-
hostCard.addRemembered(gameCard);
672-
AbilityUtils.resolve(animate);
673-
hostCard.removeRemembered(gameCard);
674-
animate.setSVar("unanimateTimestamp", String.valueOf(game.getTimestamp()));
675-
}
676-
677659
// need to be facedown before it hits the battlefield in case of Replacement Effects or Trigger
678660
if (sa.hasParam("FaceDown")) {
679661
gameCard.turnFaceDown(true);
@@ -1286,16 +1268,6 @@ else if (destination.equals(ZoneType.Battlefield)) {
12861268
if (sa.hasParam("Tapped")) {
12871269
c.setTapped(true);
12881270
}
1289-
if (sa.hasAdditionalAbility("AnimateSubAbility")) {
1290-
// need LKI before Animate does apply
1291-
moveParams.put(AbilityKey.CardLKI, CardCopyService.getLKICopy(c));
1292-
1293-
final SpellAbility animate = sa.getAdditionalAbility("AnimateSubAbility");
1294-
source.addRemembered(c);
1295-
AbilityUtils.resolve(animate);
1296-
source.removeRemembered(c);
1297-
animate.setSVar("unanimateTimestamp", String.valueOf(game.getTimestamp()));
1298-
}
12991271
if (sa.hasParam("GainControl")) {
13001272
final String g = sa.getParam("GainControl");
13011273
Player newController = g.equals("True") ? sa.getActivatingPlayer() :

0 commit comments

Comments
 (0)