module

Concentration Notifier

Endorsements
1
Installs
0.43%
Comments
0
Latest version10.0.9
Minimum Core10
Compatible Core9
Last updated2 days ago
Created8 months ago
Authors
Languages English
Português (Brasil)
Systems Dnd5e
Project source Project URL

Concentration Notifier

This is a module for the D&D5e system helping Dungeon Masters and players track concentration. At its core, a chat message will notify all active clients (respecting chat settings) when an actor starts concentrating on an item or loses concentration on an item.

When an actor casts a spell that has the Concentration component, an effect is created on the actor.

  • A checkbox is added to the item details for non-spell items to let users create other kinds of items that should also require concentration.

An actor who is concentrating on something and takes damage will receive a message with two buttons; one for rolling a saving throw to maintain concentration, and one button for convenience to remove the concentration effect.

  • The delete button will create a prompt for the user. This prompt can be skipped by holding Shift.
  • 'Taking damage' in this case means any negative change in current hit points or temporary hit points.
  • The message also has a link to the item and shows the DC for the saving throw (standard calculation of half damage taken, rounded down, to a minimum of 10).

The active effect used to track concentration is named after the item, e.g., 'Bless' or 'Concentration - Bless'.

  • The format can be toggled between the two in the module's settings.

If an actor who is already concentrating on an item uses a different item that requires concentration (or for spells the same item but at a different level), the active effect will get swapped.

  • The effect to track concentration otherwise has a duration equal to the item's duration, as set in the details of the item.
Character Flags

The module supplies new fields (found under Special Traits). These fields work with Active Effects.

Concentration Ability (flags.dnd5e.concentrationAbility)

Change the ability that is used for the actor's concentration saves. For example, use Wisdom instead of Constitution by putting wis in this field.

Concentration Advantage (flags.dnd5e.concentrationAdvantage)

Set the default of concentration saves to be rolled with advantage.

Concentration Bonus (flags.dnd5e.concentrationBonus)

Give an actor a bonus to concentration saves, such as @abilities.int.mod or 1d6. Good for Wizard Bladesingers. This field respects roll data.

Reliable Concentration (flags.dnd5e.concentrationReliable)

Change concentration saves such that rolls on the d20s cannot go below 10.

Helper Functions

The Actor document is supplied with the new function Actor#rollConcentrationSave, which accepts the usual arguments (same as rollAbilitySave) but makes use of the above flags automatically. This is also the function that is called when a user clicks the prompted saving throw in the chat log.

Additionally, these functions are found in the global namespace CN (here caster refers to a token placeable, token document, or an actor document):

CN.isActorConcentrating(caster)

Returns the effect if the actor is concentrating on any item, otherwise false.

CN.isActorConcentratingOnItem(caster, item)

returns the effect if the actor is concentrating on the given item, otherwise false.

CN.isEffectConcentration(effect)

Returns true or false if the effect is a concentration effect.

CN.breakConcentration(caster)

Ends all concentration effects on the actor. Returns the array of deleted effects. This function is asynchronous.

CN.waitForConcentrationStart(caster, {item, max_wait=10000}={})

Will wait for the actor to receive any concentration effect (or specific to the item, if provided). Useful for halting scripts in edge cases. The optional integer denotes the maximum number of ms to wait for. Returns the effect if one exists, otherwise false. This function is asynchronous.

CN.promptConcentrationSave(caster, {saveDC=10, message}={})

Displays a message for the actor like when they would have taken damage, using the DC provided (default 10). The message contents can be overridden. Returns the chat message created. This function is asynchronous.

CN.redisplayCard(caster)

Displays the chat card of the item being concentrated on, at the level it was cast. This function is asynchronous.

Effect Flags

The effect placed on an actor to denote concentration contains some useful data, intended to make script writing easier for persistently active spells such as call lightning or moonbeam:

  • flags.concentrationnotifier.data.itemData, with all the details of the item being concentrated on.
  • flags.concentrationnotifier.data.castData, with the item's base level, the level at which it was cast, and its uuid.
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x