Commit graph

73 commits

Author SHA1 Message Date
Matt Smith
a490448a15 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-10 03:42:55 +00:00
Matt Smith
d0ec294164 3: Fix issue with adding and removing attributes
- Applied patch by @imposeren to handle bug with removing and adding
  attributes. This patch resolves the issue by refactoring the attribute
  creation logic to use loop to choose a safer default attribute key
  before creation.
2020-08-09 21:03:17 -05:00
Matt Smith
9ae2cce47a 14: Tweak styles, tweak roll template
- Adjusted styles of item buttons.
- Fixed an issue with item buttons when not using shorthand syntax.
- Updated the `roll.toMessage()` call to include the player/actor name
  and the item/attribute name.
2020-08-09 20:25:48 -05:00
Matt Smith
786d4095a9 8: Add rolls to items on actor sheets
- Utilized the revisions made to roll syntax to allow for rollable
  buttons on item lists on actor sheets. Rolls are evaluated using
  `@items.ITEM.KEY`, where ITEM is the item name (slugified), and KEY is
  an attribute key for a formula attribute.
2020-08-09 16:37:16 -05:00
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
3e2a95f5f1 Merge branch '1-add-init-system-setting' into 'master'
Resolve "Add a system setting to configure the preferred initiative formula that should be used"

Closes #1

See merge request foundrynet/worldbuilding!2
2020-07-27 18:14:08 +00:00
Matt Smith
ba02ddee4f Add customizable initiative. 2020-07-27 18:14:08 +00:00
Andrew
c2d939aa1c Merge branch 'master' into 'master'
System name is worldbuilding not dnd5e

See merge request foundrynet/worldbuilding!1
2020-06-11 16:53:04 +00:00
Norman J. Harman Jr
a534ff133c System name is worldbuilding not dnd5e
Guessing the dnd5e was copy paste typo.
2020-05-26 03:07:29 -05:00
Andrew
2293592cf8 Correct update download link point back at 0.35 still 2020-05-12 22:35:46 -07:00
Andrew
d66a64b939 Update the Simple Worldbuilding system for compatibility with 0.5.6 2020-05-12 18:08:48 -07:00
Andrew
d405a18f53 Improve Simple Worldbuilding sheet layout and macro syntax 2020-04-18 16:14:51 -07:00
Andrew
6dbee061d6 Target 034 tag for download URL 2020-04-14 17:25:21 -07:00
Andrew
20e8f8fa20 Update to 0.34 for compatibility with core 0.5.5 2020-04-14 17:22:06 -07:00
Andrew
57b5be22dc Update SWB system for FVTT version 0.5.2 2020-03-30 20:49:30 -07:00
Andrew
c3402a0acf Update the simple worldbuilding system for new manifest properties and to allow decimal initiative 2020-03-02 20:34:14 -08:00
Andrew
df11172628 System compatibility for core 0.4.4 2020-01-17 22:48:11 -08:00
Andrew
be0c47da58 Display an error if trying to save custom attributes with dot notation 2019-11-20 20:45:33 -08:00
Andrew
96b677434b Remove usage of fromEntries 2019-11-18 21:44:02 -08:00
Andrew
fc8331c13c Remove public prefix from system template paths. 2019-11-14 16:42:16 -08:00
Andrew
f8c8e8c731 Initial commit of simple worldbuilding system to standalone repo 2019-11-13 19:39:05 -08:00
Andrew
652a27f421 Initial commit 2019-11-14 03:30:32 +00:00