-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method of implementing effects for all attributes respecting 4E stacking rules #313
Comments
random aside, you get the best json syntax colouring by tagging the code block as |
I've gone and done the first part of this, where now all ( or at least most) attributes should have |
Love this! It's exciting to be making some progress on this front. Could we add Can we do we specific types for specific attributes? I ask because I'd like to see |
It occurs to me that if we can do specific type/attribute combos, we could probably use this to solve the resistance/vulnerability issue too. Since those values don't use bonus typings (pretty sure that never happens? I could be wrong) we could instead use types of "resistance" and "vulnerability", and the upgrade/downgrade modes to apply the rules correctly. |
Because I've had this rolling around in my head for a while.
I do not think this is a good idea, I do not think it is super practical to implement now, it would need one hell of a migration script.
But it fulfils the following objectives:
But it would require a big alteration to the Actor data model :'(
I write it up to get it out of my head, and in case it sparks further thoughts.
All attributes that are effect modifyable have the following json structure defined in the system model.json. This is important as this defines what gets persisted to the db.
bonuses.manual
are the explicit bonuses you can add though the UI without using the effect system.So not much is actually persisted. Everything else is dynamic, including the
value
attribute, which is the eventual total value.value
is never saved and so is always computed on the fly by theprepareData()
method.All effects that are modifying an attribute are in the form of
attributeName.bonuses.bonusType
. All bonus types that are notuntyped
are set as effect typeUPGRADE
because they do not stack, whileuntyped
are set asADD
because they do. (this is where some nice UX would come into play and do that for you.So assuming we wanted a feat bonus to fort defence it would be form
system.defences.fort.bonuses.feat
type UPGRADE.prepareData()
would go over each attribute, grab the base value, then iterate all the non-manual
entries in the bonuses object and add them. Manual bonuses would have to count as untyped and stack I think, since the player has manually put them in, so they each get added on as well. the result becomes thevalue
for that attribute.So we would have in memory something like this:
(Obviously some things such as AC or NADs have a slightly more complex formula where they are also pulling in other things on top of the bonsues, but they follow as extensions on top of this base system for modifiable attributes.
The weapon/power effects that I wrote could be rewritten easily to operate in a similar manner.
Anyway, it's not a very elegant solution to the problem and I don't think its worth the effort (I definitely wouldn't do it), but written up as /a/ solution.
The text was updated successfully, but these errors were encountered: