OhhLoz / Harvester

A QoL FoundryVTT module to improve the harvesting and looting experience.
GNU General Public License v3.0
2 stars 2 forks source link

All Releases Forge Installs

Better Harvesting and Looting

A QoL FoundryVTT module to improve the harvesting and looting experience.

IMPORTANT NOTE: To make the module work with the requestor module you have to set the module setting of the latter with key Module Permissions with the value Request: Anyone. Accept: Only if GM or self

This work includes material taken from the System Reference Document 5.1 (“SRD 5.1”) by Wizards of the Coast LLC and available at https://dnd.wizards.com/resources/systems-reference-document. The SRD 5.1 is licensed under the Creative Commons Attribution 4.0 International License available at https://creativecommons.org/licenses/by/4.0/legalcode.

Installation

It's always easiest to install modules from the in game add-on browser.

To install this module manually:

  1. Inside the Foundry "Configuration and Setup" screen, click "Add-on Modules"
  2. Click "Install Module"
  3. In the "Manifest URL" field, paste the following url: https://raw.githubusercontent.com/OhhLoz/Harvester/master/src/module.json
  4. Click 'Install' and wait for installation to complete
  5. Don't forget to enable the module in game using the "Manage Module" button

socketlib

This module uses the socketlib library for wrapping utility methods. It is a hard dependency

requestor

This module uses the requestor library for a better visual display experience for the user. It is a hard dependency

Better Rolltables

This module uses the Better Rolltables for more flexibility with harvesting. It is an optional dependency and it is recommended for the best experience and compatibility with other modules.

Item Piles

This module uses the Item Piles for convenience with sharing. It is an optional dependency and it is recommended for the best experience and compatibility with other modules.

NOTE i need really help with a good documentation of this module, please someone help me...

Harvester Feature

This action allows the Harvesting action to be linked to a standard rolltable retrieve the result items.

In the standard Harvest Rolltable sheet, the "association" field is the name of the token monster with the name of the rolltable! So "Name of The Monster" === "Name of the Rolltable" (case insensitive).

If you have any doubt about the matching try out the api method and open a issue:

game.modules.get("harvester").api.testWithRegex("Shadow Demon", "Shadow Demon Arcane")) => boolean

The re are two module settings to add some preferences to the search of the term:

IMPORTANT: By default we try to guess with some regex what you want for example if you loot a "Shadow Demon" it will positively validate a rolltable with "Shadow Demon Arcane", but not the reverse and will not validate "Shadow Demon Psych" with "Shadow Demon Arcane", here a table of examples:

Source Target Result
Shadow Shadow Demon BBB true
Shadow Demon Shadow Demon Arcane false
Shadow Demon Arcane Shadow Demon Arcane true
Shadow Demon Arcane Shadow Demon true
Shadow Demon BBB Shadow Demon true
Shadow Demon BBB Shadow Demon Arcane false
Shadow Demon Warrior Shadow Demon Arcane false
Shadow Demon Guard Shadow Demon Arcane false
Shadow Demon Cro Shadow Demon true
Shadow Demon Witchdoctor Shadow Demon true
Shadow Demon BBB (.?)Shadow Demon Arcane(.?) false
Shadow Demon Arcane (.?)Shadow Demon Arcane(.?) true
Shadow Demon (.?)Shadow Demon(.?) true
Shadow Demon BBB (.?)Shadow Demon(.?) true
Shadow Demon Arcane (.?)Shadow Demon(.?) true
Example 1
Name of the monster: Wolf
Name of the rolltable: Wolf or Harvester | Wolf
Result: get any monster 'Wolf' with a BRT Rolltbale with the same name or subset of names 'Wolf'
Example 2
Name of the monster: Wolf
Name of the rolltable: as regex: /^Wolf/ or /^Harvester | Wolf/
Result: get any monster 'Wolf' with a Rolltbale with the same name or subset of names 'Wolf'

REMEMBER YOU MUST PUT THE NEW ROLLTABLE IN THE HARVESTER COMPENDIUM "harvester.harvester" or in the Rolltable directory of the world itself (for now).

Harvester Feature with Item Piles and Better Rolltables

This action allows the Harvesting action to be linked to a BRT rolltable retrieve the result items and display it with the "Item Piles" module for retrieval.

Given the various needs there are three modes offeature behavior

Looting Feature

This action allows the Looting action to be linked to a rolltable to retrieve the result currencies and display on the chat.

Every rolltable applies inline roll for the currency data on text table result.

NOTE: Every text table result in a type BRT Loot tables is treated as a currencyData formula and converted in a item piles supported formula.

This feature support many format from old and other modules here a list:

As a example a text like this:

{(2d8+1)*10[cp], 2d8+1 [sp]}

is converted runtime in this

20cp 16sp

Integration with the module Better Rolltables Feature

In the BRT Harvest Rolltable sheet, the "Source Reference" field is the one used by this module to connect the monster to the rolltable! So "Source Reference" === "Name of The Monster" OR a regex.

Example 1
Name of the monster: Wolf
Source Reference on the BRT rolltable as simple strig: Wolf
Result: get any monster 'Wolf' with a BRT Rolltbale with source reference 'Wolf'
Example 2
Name of the monster: Wolf
Source Reference on the BRT rolltable as regex: /^Wolf/ 
Result: get any monster 'Wolf' with a BRT Rolltable with source reference stating with the string 'Wolf'

BRT now support multi skill integration, just set an array of skills on the source reference field on the BRT rolltable

and launch the harvester action!

REMEMBER YOU MUST PUT THE NEW ROLLTABLE IN THE BRT COMPENDIUM "better-rolltables.brt-harvest-harvester" or in the Rolltable directory of the world itself (for now).

Build

Install all packages

npm install

dev

dev will let you develop your own code with hot reloading on the browser

npm run dev

build

build will build and set up a symlink between dist and your dataPath.

npm run build

build:watch

build:watch will build and watch for changes, rebuilding automatically.

npm run build:watch

prettier-format

prettier-format launch the prettier plugin based on the configuration here

npm run-script prettier-format

lint

lint launch the eslint process based on the configuration here

npm run-script lint

lint:fix

lint:fix launch the eslint process with the fix argument

npm run-script lint:fix

build:json

build:json unpack LevelDB pack on src/packs to the json db sources in src/packs/_sourcevery useful for backup your items and manually fix some hard issue with some text editor

npm run-script build:json

build:clean

build:clean clean packs json sources in src/packs/_source. NOTE: usually this command is launched after the command build:json and after make some modifications on the json source files with some text editor, but before the build:db

npm run-script build:clean

build:db

build:db packs the json db sources in src/packs/_source to LevelDB pack on src/packs with the new jsons. NOTE: usually this command is launched after the command build:json and after make some modifications on the json source files with some text editor

npm run-script build:db

Changelog

Issues

Any issues, bugs, or feature requests are always welcome to be reported directly to the Issue Tracker

Licenses

This package is under an GPL-3.0 license and the Foundry Virtual Tabletop Limited License Agreement for module development.

Credit

Thanks to anyone who helps me with this code! I appreciate the user community's feedback on this project!