Eranziel / foundryvtt-lancer

A Foundry VTT game system for LANCER RPG.
GNU General Public License v3.0
103 stars 61 forks source link

[FEATURE] Automated effect timings to conditions (start of next turn, end of next turn, etc) #715

Open FPTheFluffyPawed opened 1 month ago

FPTheFluffyPawed commented 1 month ago

Is your feature request related to a problem? Please describe. As of right now in v11, via Condition Lab, effects can have a duration to them assigned automatically. Right now (I believe) Foundry handles effect timing via round count and turn count. It is finnicky right now to work around Foundry's effect timing since it is adjusted to D&D's natural order of turn count instead of Lancer's popcorn initiative.

Describe the solution you'd like I used Condition Lab for this, but I think the way to work around this is by changing how Round and Turn works. In an ideal world, every effect would just have a dropdown that chooses when the effect ends with the usual options "on round end, on end of next turn, on start of next turn", etc, but considering how Foundry works, it'd probably require a form of manual on how to accurantely utilize the round and turn input labels to achieve the desired effects.

Like, setting "round 1, turn 1" duration on an effect means it ends on end of next turn, or "round 1, turn 2" makes it equal to "start of next round's turn", etc... It's weird, but I think there can be some use cases for it.

Describe alternatives you've considered I only tested with 2 tokens in a combat encounter, but right now, to achieve the usual "On Next Turn End" effect, I just assign an effect (while it is the token's current turn) with a duration of 1 round, 1 turn. This makes it so that on their next turn on next round, the effect will appropriately "expire". When a token has multiple activations, I don't assign the round duration, as that seems to automatically expire whenever it is a new activation in the same round (but if they have 1 activation only, the effect will expire since it is still the same round). I didn't try out other stuff, but what matters is that other effects don't really count down when another turn starts, which I believe was an issue in v10.

Additional context I used Condition Lab, so I didn't try any of this with base Foundry. It's probably for the best Condition Lab is used since it'd allow for custom descriptions as well.

Discord contact info If you are willing to answer questions regarding this feature request on Discord, or if you want to be notified when it is fixed, please leave your Discord ID here. fpthefluffypawed

BoltsJ commented 1 month ago

So this requires multiple pieces

  1. Overriding the way core foundry handles effect timers. Core foundry compares the turn numbers and lancer doesn't care about turn numbers for what I will call obvious reason. On the up side, conditions that expire all expire at the beginning or the end of the unit's next turn, at least in the core book
  2. Core foundry does not handle deletion of expiring status effects at all. We would need to set up the suspension/deletion of effects in the combat tracker.
  3. We would need to signify which effects have expirations in the status effect config. This is made slightly trickier because we merge in compendium data on the effects, so we would need to ensure that any flag/system data does not get overridden.
  4. Hook this into the automation settings. (Semi-relatedly automation settings need some work done since some options are unnecessary and some don't work right)

And there's also a fairly high possibility that this won't play nice with condition lab, and I'm not sure if anything can be done for that since condition lab seems pretty unpredictable when it's touching statuses.