From 55da07033c565ebd54ecf002b60533a4b03cb3d4 Mon Sep 17 00:00:00 2001 From: dev7355608 Date: Wed, 9 Aug 2023 04:12:53 +0200 Subject: [PATCH] Update README --- README.md | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/README.md b/README.md index de43256..2493e25 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,101 @@ token.document.setFlag("limits", { }, }); ``` + +## Macros + +### D&D 5e + +Recommended modules: + +- [Vision 5e](https://foundryvtt.com/packages/vision-5e) +- [Walled Templates](https://foundryvtt.com/packages/walledtemplates) + +#### Darkness spell + +```js +// Darkness spell template +await new dnd5e.canvas.AbilityTemplate( + new CONFIG.MeasuredTemplate.documentClass( + { + t: CONST.MEASURED_TEMPLATE_TYPES.CIRCLE, + distance: 15, + fillColor: game.user.color, + flags: { + limits: { + sight: { + basicSight: { enabled: true, range: 0 }, // Darkvision + ghostlyGaze: { enabled: true, range: 0 }, // Ghostly Gaze + lightPerception: { enabled: true, range: 0 }, // Light Perception + }, + light: { enabled: true, range: 0 }, + }, + walledtemplates: { + wallRestriction: "move", + wallsBlock: "recurse", + }, + }, + }, + { parent: canvas.scene } + ) +).drawPreview(); +``` + +#### Fog Cloud spell + +```js +// Fog Cloud spell (level 1) template +await new dnd5e.canvas.AbilityTemplate( + new CONFIG.MeasuredTemplate.documentClass( + { + t: CONST.MEASURED_TEMPLATE_TYPES.CIRCLE, + distance: 20, + fillColor: game.user.color, + flags: { + limits: { + sight: { + blindsight: { enabled: true, range: 0 }, // Blindsight + basicSight: { enabled: true, range: 0 }, // Darkvision + devilsSight: { enabled: true, range: 0 }, // Devil's Sight + lightPerception: { enabled: true, range: 0 }, // Light Perception + seeAll: { enabled: true, range: 0 }, // Truesight + }, + }, + walledtemplates: { + wallRestriction: "move", + wallsBlock: "recurse", + }, + }, + }, + { parent: canvas.scene } + ) +).drawPreview(); +``` + +#### Silence spell + +```js +// Silence spell template +await new dnd5e.canvas.AbilityTemplate( + new CONFIG.MeasuredTemplate.documentClass( + { + t: CONST.MEASURED_TEMPLATE_TYPES.CIRCLE, + distance: 20, + fillColor: game.user.color, + flags: { + limits: { + sight: { + hearing: { enabled: true, range: 0 }, // Hearing + }, + sound: { enabled: true, range: 0 }, + }, + walledtemplates: { + wallRestriction: "move", + wallsBlock: "walled", + }, + }, + }, + { parent: canvas.scene } + ) +).drawPreview(); +```