Commit graph

3 commits

Author SHA1 Message Date
Matt Smith
00dfec6014 8: Refactor formula attributes
- Divided getRollData() into several helper methods to make it more
  organized.
- Cleaned up usage of shorthand checks, but haven't entirely
  consolidated them yet. There's room to improve this, but further
  consolidation would likely require a regex to handle mapping inline
  roll syntax in the formulas to use the `@attr.KEY.value` format when
  `@KEY` is detected. This seemed like a solid compromise for now.
- Refactored the _replaceData() helper method to match the Roll class'
  upcoming syntax, and added TODO comments to replace them once it's
  ready.
2020-08-09 15:30:04 -05:00
Matt Smith
7c676b14ee 9: Add formula (derived) attributes
- Added a new "Formula" attribute type for both actors and items.
- When iterating through attributes, formula attributes are noted in an
  array so that they can be iterated through in a second pass to
  evaluate their referenced attributes. The second iteration just
  handles attribute replacement rather than rolling the formula, that's
  deferred until the attributes are used in an actual roll formula.
- Items also have the same behavior. If an attribute isn't on the item,
  it will fall back to check the parent actor instead.
- Likely areas with issues would be formula attributes that reference
  other formula attributes, or item formula attributes that reference
  actor formula attributes.
2020-08-06 23:21:15 -05:00
Andrew
d405a18f53 Improve Simple Worldbuilding sheet layout and macro syntax 2020-04-18 16:14:51 -07:00