-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to use Lazy GM's encounter difficulty system (#192)
* feat: Add setting for XP system This doesn't currently do anything, but will be used for choosing different ways to calculate XP for encounters. Put it under "Encounters" in settings, but not in the builder part of the data, as this isn't specific to the encounter builder. * refactor: Generalize encounter difficulty utility functions This is to prepare for more customizable encounter XP systems. - Move all XP-calculation related things to encounter-difficulty.ts - Remove duplicated logic between encounter builder and other encounters - Use DifficultyReport for XP-related calculations. In the future we can swap out the contents of this and how it's generated based on the current XP system. Incidentally, this fixes some a discrepency between the encounter builder and other encounters: - other encounters will now show 'Trivial' for encounters below the Easy XP threshold, same as the encounter builder * feat: Add XP system for DnD 5e Lazy GM This alters the encounter builder, encounters, and encounter table to all use the Lazy GM's (https://slyflourish.com/the_lazy_encounter_benchmark.html) system for benchmarking encounters. - The encounter and encounter table now show CR for each creature rather than XP - The encounter builder will show total XP as well as the CR threshold for deadly, and the total CR BREAKING CHANGE: this changes the tracker difficulty result to not always populate `adjustedXp`. Now, non-DnD5e systems will use `totalXp` for the total, while DnD 5e will use `adjustedXp`. * feat: Add XP system for DnD 5e Lazy GM This alters the encounter builder, encounters, and encounter table to all use the Lazy GM's (https://slyflourish.com/the_lazy_encounter_benchmark.html) system for benchmarking encounters. - The encounter and encounter table now show CR for each creature rather than XP - The encounter builder will show total XP as well as the CR threshold for deadly, and the total CR BREAKING CHANGE: this changes the tracker difficulty result to not always populate `adjustedXp`. Now, non-DnD5e systems will use `totalXp` for the total, while DnD 5e will use `adjustedXp`. * feat: Add XP system for DnD 5e Lazy GM This alters the encounter builder, encounters, and encounter table to all use the Lazy GM's (https://slyflourish.com/the_lazy_encounter_benchmark.html) system for benchmarking encounters. - The encounter and encounter table now show CR for each creature rather than XP - The encounter builder will show total XP as well as the CR threshold for deadly, and the total CR BREAKING CHANGE: this changes the tracker difficulty result to not always populate `adjustedXp`. Now, non-DnD5e systems will use `totalXp` for the total, while DnD 5e will use `adjustedXp`. * refactor: Add a base RpgSystem and a dnd5e impl Also rename the xpSystem setting to rpgSystem to allow for future extensions for other purposes eg initiative. Still keep it in labelled as "XP Tracker" in the UI though. Delete encounter-difficulty.ts and put difficulty-related functions under rpg-system instead. Also for now remove the lazy GM setting, to be re-added in a later commit. * refactor: Add back in Lazy GM's system Also add calls to formatDifficultyValue() in several places that I initially forgot, and add an optional arg for whether the formatted value should include units or not. * fix: Fix a division by zero * fix: make formatDifficultyValue respect withUnits * refactor: Add a getFromCreatureOrBeastiary function * feat: Add method for what to show in creature row in builder - Add a getAdditionalCreatureDifficultyStats for what should be shown when a creature is added to the builder. This allows systems to show the stats that are relevant to their difficulty calculations. - Fix some null issues that I missed when refactoring to use getFromCreatureOrBestiary. And also a spelling mistake in that method name. - Move the method to convert CR num to string into utils so it can be used by both RPG systems - Minor formatting fixes * refactor: minor formatting fix * fix: fixes issue where an empty player list causes error --------- Co-authored-by: Kelly Stewart <miscoined@google.com> Co-authored-by: Jeremy Valentine <38669521+valentine195@users.noreply.github.com>
- Loading branch information
1 parent
8434eba
commit 2c39c7b
Showing
21 changed files
with
559 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.