Skip to content

Detects whether a character with the wild magic feat casts a spell and adds a reminder to the chat.

License

Notifications You must be signed in to change notification settings

nirurin/wild-magic-surge-5e

 
 

Repository files navigation

Latest Release Download Count Forge Installs Foundry Hub Endorsements Foundry Hub Comments Total alerts Language grade: JavaScript

ko-fi

Wild Magic Surge 5e

This module provide various bits of functionality to help automate the Wild Magic Surge feat.

Prerequisites

Ensure your Player Character has the Wild Magic Surge feat added to the character sheet. It will not run on any characters that do not have this set.

When they cast a spell at Level 1 or higher it will trigger the check for a surge based on your options selected from the settings. All options are explained below.

Features

  • Prompt to roll on a 1st level or higher spell slot used with the Wild Magic Surge feat
  • Whisper results to GM
  • Auto roll for Wild Magic Surge
  • Auto roll Custom Roll Table for effect
  • Tides of Chaos auto recharge
  • Custom dice roll check for surge (default is 1d20 and a roll of 1)
  • Ability to set your own roll evaluation dependent on the spell level used
  • Hooks for custom macros and other modules to use

Hooks

I have added in hooks for the following events. This allows other developers or macro users to listen for events from the result of a Wild Magic Surge and add their own custom scripts.

wild-magic-surge-5e.CheckForSurge

Example

Hooks.on("wild-magic-surge-5e.CheckForSurge", () => {
  console.log('I must prompt to get them to roll a d20!')
});

Runs when you set the module to prompt you when a spell is used by a PC with the Wild Magic Feat. Returns true.

wild-magic-surge-5e.IsWildMagicSurge

Example

Hooks.on("wild-magic-surge-5e.IsWildMagicSurge", (isWildMagicSurge) => {
  console.log(isWildMagicSurge)
});

Runs when you set the module to auto roll a check for you. The result of the roll will trigger this hook and return whether it is a surge and the roll value.

true = The PC has triggered a Wild Magic Surge

{
  surge: true,
  result: 1,
}

false = The PC has not triggered a Wild Magic Surge

{
  surge: false,
  result: 12,
}

Options

Settings

Choose between the following options

  • Default: On a roll of 1, trigger a Wild Magic Surge (Default and can be configured in the Dice Formula options)
  • Incremental Check: Every time a spell is cast, the threshold is increased by 1 for a Surge. Once triggered the threshold is reset back to 1.
  • Spell Level Dependent Rolls: Wild Magic Surge triggers dependent on spell level (Set options below).

Whisper chat results to GM

Whisper chat results to GM

Whisper all message to the GM in case you want to be nice and fudge the rolls.

Whisper chat results to GM

Auto Roll a check for Wild Magic Surge instead of just a reminder to roll

The additional option Auto Roll for a Wild Magic Surge instead of just the prompt will auto roll in the background for you and post the result in the Chat.

Based on your settings, it will show a prompt that a Wild Magic Surge has occured or not.

This message is configurable should you wish.

Auto Roll a check for Wild Magic Surge instead of just a reminder to roll

Enable Auto Roll on a Wild Magic Surge Table

This option takes things a step further and will roll a Roll Table on a Wild Magic Surge.

You can configure a Custom Roll Table by replacing the default name in the settings with your own version.

Enable Auto Roll on a Wild Magic Surge Table

Tides of Chaos Recharge

Another option allows you to recharge Tides of Chaos automatically on a Wild Magic Surge.

Tides of Chaos Recharge

Dice Formula

Set a custom dice formula you want to roll to check for a Wild Magic Surge. The default is 1d20.

Dice Formula

The target result of the dice roll

What is the dice roll result you want to check against. The default is 1.

The target result of the dice roll

Roll result boolean expression

Based on the target dice roll, should the result be less/greater than or equal to the result to trigger the Wild Magic Surge. The default is =.

Roll result boolean expression

Setup varying Wild Magic Surge triggers dependent on spell level

Adds the ability to set your own roll evaluation dependent on the spell level used.

For example

  • A lvl 1 spell only triggers wild magic if a 1 is rolled on the d20
  • A lvl 4 spell triggers if a 4 or lower is rolled
  • A lvl 9 triggers if a 9 or lower is rolled

Special thanks to Jackolas126 for this suggestion.

Setup varying Wild Magic Surge triggers dependent on spell level

Installation

To install, follow these instructions:

  • Inside Foundry, select the Game Modules tab in the Configuration and Setup menu.
  • Click the Install Module button and enter the following URL: https://github.com/johnnolan/wild-magic-surge-5e/releases/latest/download/module.json
  • Click Install and wait for installation to complete.

Alternatively, use the integrated module manager in Foundry.

Foundry modules page: https://foundryvtt.com/packages/wild-magic-surge-5e

Requirements

This module requires the dnd5e game system to work. Your character will also need to have a Feat set in their character called Wild Magic Surge.

Contact

For issues, please raise a bug in Github giving as much detail as you can. I will try and fix things depending on fatherhood responsibilities https://github.com/johnnolan/wild-magic-surge-5e/issues

You can also find me lurking around on the Foundry VTT Discord https://discord.gg/foundryvtt. My Discord Tag is JB#2780.

About

Detects whether a character with the wild magic feat casts a spell and adds a reminder to the chat.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%