From 4b2f9fd6373394e23beabd87fbe7f82d2a050f8a Mon Sep 17 00:00:00 2001 From: p4535992 Date: Sat, 2 Mar 2024 14:24:05 +0100 Subject: [PATCH] add example with roll formula many people didn't know that --- docs/api.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index ad8e87da..ac556692 100644 --- a/docs/api.md +++ b/docs/api.md @@ -889,6 +889,9 @@ game.itempiles.API.updateCurrencies(tokenOrActor, "10gp"); // Set the value on the GP currency with the quantity 10 and on the SP currency with the quantity 5 to the target game.itempiles.API.updateCurrencies(tokenOrActor, "10gp 5sp"); +// Set the value on the GP currency with the quantity 1d4 and on the SP currency with the quantity 1d3 to the target +game.itempiles.API.updateCurrencies(actor, "1d4gp 1d3sp") + ``` --- @@ -918,7 +921,10 @@ const tokenOrActor = game.actors.getName("Bharash"); game.itempiles.API.addCurrencies(tokenOrActor, "10gp"); // Add 10 GP and 5 SP to the target -game.itempiles.API.removeCurrencies(tokenOrActor, "10gp 5sp"); +game.itempiles.API.addCurrencies(tokenOrActor, "10gp 5sp"); + +// Add 1d4 GP to the target +game.itempiles.API.addCurrencies(tokenOrActor, "1d4gp"); ``` @@ -952,6 +958,9 @@ game.itempiles.API.removeCurrencies(tokenOrActor, "10gp"); // Remove 10 GP and 5 SP from the target game.itempiles.API.removeCurrencies(tokenOrActor, "10gp 5sp"); +// Remove 1d4 GP from the target +game.itempiles.API.removeCurrencies(tokenOrActor, "1d4gp"); + ``` ---