module

A5E Utility Helpers

Endorsements
0
Installs
0.1693%
Comments
0
Latest version1.0.0
Minimum Core9
Compatible Core9
Last updated2 years ago
Created2 years ago
Authors
Languages English
Systems A5e
Dependencies Level Up: Advanced 5th Edition (Official)
Project source Project URL

A small module to provide helper functions for use in the A5E System.

 

Functions

The following functions can be accessed with the namespace A5EUtils.

 

Minor Utility Functions

  • getCanvas(): Canvas --> Returns the canvas object.

 

Distance Utility Functions

  • getDistance(token1: Token, token2: Token, wallsBlock: Boolean): Number --> Returns the distance between 2 tokens in feet.
  • isAdjacent(token1: Token token2: Token, wallsBlock: Boolean): Boolean --> Checks if 2 tokens are within 5 feet of each other.

 

Token Utility Functions

  • getConditions(token: Token, fullObject: Boolean = false): Array || Array --> Returns an array of conditions. Optionally returns an array of condition objects if fullObject is set to true.
  • getConditionImmunities(token: Token): Array --> Returns an array of conditions immunities for a token.
  • getDamageImmunities(token: Token): Array --> Returns an array of damage immunities for a token.

  • getDamageResistances(token: Token): Array --> Returns an array of damage resistances for a token.

  • getDamageVulnerabilities(token: Token): Array --> Returns an array of damage vulnerabilities for a token.

  • getLanguages(token: Token): Array --> Returns the known languages for a token.

  • getSenses(token: Token): Array --> Returns an array of senses for a token.

  • hasCondition(token: Token, condition: String): Boolean --> Checks if a token has a specified condition (The condition string is case insensitive).

  • hasSpellPoints(token: Token): Boolean --> Checks if a token has spell points.

  • hasSpellSlots(token: Token, spellLevel: Number = null): Boolean --> Checks if a token has spell slots. Can optionally check if the token has spell slots of a certain level.

  • isBloodied(token: Token): Boolean --> Checks if the token is below half hp.

  • isWounded(token: Token): Boolean --> Checks if the token is below max hp.

  • isSpellCaster(token: Token): Boolean --> Checks if the token is a spell caster.

  • isUnconscious(token: Token): Boolean --> Checks if the token is unconscious via conditions or if its hp is 0.

 

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x