-
Notifications
You must be signed in to change notification settings - Fork 18
Rest Recovery API
All of the functions below should be preceded with game.restrecovery
, see the examples below.
const actorD = game.actors.getName("Murderhobo McStabby");
await game.restrecovery.setActorConsumableValues(actorD, { food: 1, water: 1 });
await game.restrecovery.setActiveProfile("Desert");
This is just an example, you would have to set up a module profile yourself.
This "Desert" module profile could for example set a higher water consumption per day, and limit short rests to 2 per long rest.
-
getAllProfiles() ⇒
Array.<string>
-
Returns an array containing all the module profile names
-
getAllProfilesData() ⇒
object
-
Returns the module profile object with each ones' settings
-
getProfileData(inProfileName) ⇒
object
-
Returns a given module profile's data if it exists
-
getActiveProfile() ⇒
string
-
Returns the name of the active module profile
-
getActiveProfileData() ⇒
object
-
Returns the data for the active module profile
-
setActiveProfile(inProfileName) ⇒
Promise.<object>
-
Sets the current active module profile
-
updateProfiles(inProfiles) ⇒
Promise.<*>
-
Updates all module profiles with new settings. This may be a partial update (such as only updating some keys of some profiles).
-
updateProfile(inProfileName, inData) ⇒
Promise.<*>
-
Applies new settings on a given module profile. This may be a partial update (such as only updating one key of a given profile).
-
setActorConsumableValues(actor, [food], [water], [starvation]) ⇒
Promise.<boolean>
-
Sets the food, water, and/or starvation levels of a given actor.
Returns an array containing all the module profile names
Returns the module profile object with each ones' settings
Returns a given module profile's data if it exists
Param | Type |
---|---|
inProfileName | string |
Returns the name of the active module profile
Returns the data for the active module profile
Sets the current active module profile
Param | Type |
---|---|
inProfileName | string |
Updates all module profiles with new settings. This may be a partial update (such as only updating some keys of some profiles).
Param | Type |
---|---|
inProfiles | object |
Applies new settings on a given module profile. This may be a partial update (such as only updating one key of a given profile).
Param | Type |
---|---|
inProfileName | string |
inData | object |
Sets the food, water, and/or starvation levels of a given actor.
Param | Type | Description |
---|---|---|
actor | Actor |
|
[food] |
number \ null
|
food |
[water] |
number \ null
|
water |
[starvation] |
number \ null
|
starvation |