Closed aaclayton closed 3 years ago
Originally in GitLab by @DavidHtx1
mentioned in issue tposney/dae#78
Originally in GitLab by @Forien
Ok, so I must have misunderstood this bit:
duration: {
combat: game.combat._id,
rounds: 10
}
But I think I get it now. Can't wait!
Thanks for the feedback @Forien - it's not too late because this will be ongoing work throughout 0.7.x
.
Owned Items are not in scope for this set of changes, that will be part 2 coming in #3394 as part of 0.7.2
, so I won't comment on that much except to say that's also what I envision happening with Owned Items, they provide the structure that becomes an Active Effect applied to some actor (either yourself or someone else).
Regarding duration - I think the core implementation of Active Effects has to deal with core concepts only. Providing some basic structure for effect duration that is linked to combat rounds is enough of a universal need to do it in core. Core Combat
has the concept of encounters (_id
s), turns, and rounds - so core active effects can also think about those 3 things.
Beyond that - technicalities about whether the effect expires at the start of the round, the end of the round, the middle of the round, what happens when it ends, etc... those are all implementation details left to the game system and modules to work out.
Originally in GitLab by @Forien
I think it's a little late for that, but reading description I have some thoughts:
marked this issue as related to #3394
marked this issue as related to #3393
marked this issue as related to #3392
marked this issue as related to #3391
marked this issue as related to #3390
marked this issue as related to #3389
marked this issue as related to #3388
Originally in GitLab by @tposney
Another thought. It would be nice for modules to be able to register a callback (sort of thing) for active effects so that modules can participate in the prepareData actions or the in the item effect activation activities. I started to type this but then realised I am struggling to find an excellent example of why calculations would be changed other than through active effects.
Originally in GitLab by @tposney
Combat Turn Duration for Effects Not sure what round/turn would mean for effect duration. If it is the 3rd turn of the 2nd round that could be a problem since actors can be added to the tracker, or the order changed with re-rolls, so a simple number would not work.
Originally in GitLab by @tposney
Okay, I struggled with wokring out what level of comments to make, so apologies if these are all at the wrong lebel.
Actor Effects:
attributes.ac.value = 13 + @abilities.dex.mod.
The @notation works well. The downside is that it introduces an implied hierarchy of calculations, e.g.
abilities.dex + 3
Dexterity -> Dexterity Mod -> AC.
Would you consider having a target id as well as a source id? That would facilitate dealing with losing conentration/dieing to cancel effects as all the effects you created are stored on actor. I would assume the effect is duplicated on the target actor.
What about systems like simple world building, where attributes don't exist until they are defined in the game world. What sort of error checking/validation could/should be applied to the effects data. DE knows all of the fields that are valid to modify (breaks for simple world building), from the template data and the actor.getRollData() return values.
It turns out that being able to reference a macro as an active effect is really useful/powerful. Storing the macro within the active effect is also really useful. It should be possible to reference the source and destination context and item within the macro. The macro would be called twice, once when activated and once when cancelled. This can solve lots of the edge cases for effects.
Owned Item Effects.
Are owned item effects effects that modify an actor's data or the owned item's data? Do you want to be able to support effects like flame blade (+ to damage for a specific item)?
An interpretation is that an effect is a set of transformations applied in the scope of a source and destination context, where the source context is one set of actor data (actor.getRollData()?) and the destination context is the Actor.data. For actor effects the source and desination contexts are always trivially implied. For item effects the contexts are only defined at the time of application to an actor and can vary depending on how the item effect is applied, to self or a target. And so don't contain the actor reference, application of the effect creates an actor effect, but need to deal with removing the effect because the item is no longer present.
Under what conditions are owned item effects triggered? It seems that the equipped/attuned, equipped, always active model seems to cover the required cases with the exception of on use. If there is a more general source/target for owned item effects then on use could be an extra activation condition, applyOnRoll.
UI
What is displayed on the character sheet? Modified or pre-effects values and what does editing the field mean (presumably changes the base data)
Updates that don't do a diff can be a problem if the modified data is displayed.
Key Events and Workflow
Random Aside. I noticed you closed the "saving throws should use save bonus rather than save mod", how do you have an active effect which is +3 to dex saving throws?
mentioned in issue dnd5e#502
Originally in GitLab by @tposney
Is there a projected version for this?
Originally in GitLab by @tposney
Would love to retire dynamic items. Please remember effects like melee/ranged/spell attack rolls which currently have no actor level data, only per item. Also, adding resistances/immunities should tie into damage application from the chat log.
Overview and Requirements
ActiveEffect
is a new EmbeddedEntity type supported onActor
entities.ActiveEffect
is a new EmbeddedEntity type supported onItem
entities.Active Effect Data Model
Example 1 - Bless
Example 2 - Headband of Intellect
Active Effect CRUD API
Actor Data Preparation Workflow
Due to the changes introduced by the ActiveEffect embedded entity there are a few important changes for the way that Actor data is prepared in
0.7.1
and beyond.Firstly, we need to keep track of the original un-modified Actor data which is stored as
Actor#_data
. This un-modified data is then prepared and modified by active effects to becomeActor#data
which is used as normal. When updates occur, those updates are diff'ed against the un-modified_data
object.The
prepareData()
method of the Actor has been re-structured to follow this workflow:This includes new methods:
prepareActorData
: Derive any data attributes which are specific to the Actor itselfprepareEmbeddedEntities
: Prepare OwnedItem and ActiveEffect instancesapplyItemEffects
: Apply any transformations to the Actor data which are caused by OwnedItemsapplyActiveEffects
: Apply any transformations to the Actor data which are caused by ActiveEffectsBackwards Compatible Shim
If you want to release a system version which can work for both 0.7.1 and 0.6.5, put the following
prepareData()
method in your system Actor class and structure the workflow accordingly.Active Effect Application
Each
ActiveEffect
instance is applied to the Actor which owns it during theapplyActiveEffects()
function. Any effects which useADD
,MULTIPLY
, orOVERRIDE
modes are automatically applied (unless the system overrides the logic) while effects which apply aCUSTOM
mode are funneled to the_applyCustomEffect()
method. This method can either (1) be overriden by the system implementation OR (2) be hooked into by modules which can handle special custom effect types.Remaining Work and Open Questions Below
How to handle Owned Item effects?
How to deal with active effects on owned items. There isn't a precedent for embedded entities having embedded entities. It is possible, but arguably/possibly not desirable. This will be a common use case though so it needs a solution.
Option 1: Item don't contain full Active Effects, only the basis for them
In this case an ActiveEffect on an item would be different than one on an actor - it would only have the structural data of the
mode
,data
, andduration
which would be expanded to become a true active effect when applied to a character.Option 2: Item effects don't exist
There are just Actor effects and those effects denote an
OwnedItem#uuid
as theirsource
.Option 3: ??? something better ???
Key Events and Workflows