Conversation
| for (Map.Entry<PerpetualInterface, StaticAbility> e : oldCard.perpetualEffects.entries()) { | ||
| StaticAbility st = e.getValue().copy(this, lki); | ||
| if (!lki) { // change zone sets the timestamp of negative infinite, but -1 is good enough | ||
| st.putParam("Timestamp", String.valueOf(-1)); |
There was a problem hiding this comment.
if you really want to do it correctly this still needs to preserve the relative order
There was a problem hiding this comment.
i added oldTimestamp - currentGameTimestamp
that should shift them into negative
or does this need more fine tuning?
(i think if it changes zones again and again, they should be shifted more back, right?)
There was a problem hiding this comment.
I'll do some testing for it when the PR is more ready
There was a problem hiding this comment.
I see two problems:
- without extra logic this would just reverse the order
- A: 2 & B: 3 => A: -3 & B: -2
- when only changing a single card this way its timestamps could still grow smaller than those of perpetual effects from other cards in a way that switches the order
can't we just add Long.MIN_VALUE the first time it changes?
| } | ||
|
|
||
| private List<PerpetualInterface> perpetual = new ArrayList<>(); | ||
| private Multimap<PerpetualInterface, StaticAbility> perpetualEffects = MultimapBuilder.hashKeys().arrayListValues().build(); |
There was a problem hiding this comment.
not all are transformed yet, the list will be removed later
(i don't know yet if the new one needs to be a Multimap or if a List is enough)
| c.addPerpetual(new PerpetualTypes(timestamp, addType, removeType, remove)); | ||
| c.addPerpetual(new PerpetualTypes(timestamp, addType, removeType, remove), timestamp); | ||
| } | ||
| c.addChangedCardTypes(addType, removeType, addAllCreatureTypes, remove, timestamp, 0, true, false); |
There was a problem hiding this comment.
shouldn't all be else now?
| public interface PerpetualInterface { | ||
| long getTimestamp(); | ||
| void applyEffect(Card c); | ||
| default long getTimestamp() { return -1; } |
There was a problem hiding this comment.
reminder to remove this later
b369294 to
566687d
Compare
|
@tool4ever over the weekend i might need some help to find a way to remove Triggers via ChangedCardTraits and Static Ability especially this one: https://scryfall.com/card/ytdm/8/runeblade-raiser |
Closes #9241
still WIP
need to refactor the other ones into Statics
Also, the removePerpetual Effect for this needs to be deeper refactored:
Because right now, we can't handle
Runeblade RaiserwithIn theory, the CardTraits Changes need a way to remove a specific Trigger (per Id?)