Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Script:Conditions

From Roll20 Wiki

Jump to: navigation, search
API ScriptAuthor: manveti
Version: 0.6
Last Modified: 2015-08-04
Code: Conditions
Dependencies: None
Conflicts: None

Conditions tracks attribute-modifying conditions on characters. It allows the user to define named conditions consisting of sets of attribute modifiers, or to apply simple anonymous modifications to any attribute.

It is recommended that this script be used in conjunction with the CommandShell module, which will improve output formatting and command discovery, and will enable whitespace in condition descriptions.


Contents

Syntax

!condition help [command]
!condition create <name> [options]
!condition copy <condition> <name> [options]
!condition rename <old name> <new name>
!condition edit <name> [options]
!condition delete <name>
!condition list [name]
!condition icons
!condition addeffect <condition> <attribute> <effect> [options]
!condition editeffect <condition> <attribute> <effect> [options]
!condition removeeffect <condition> <attribute>
!condition aply <condition> [options]
!condition remove <condition> [options]
!condition applyanon <attribute> <effect> [options]
!condition removeanon <attribute> [effect index] [options]
!condition clear [options]
!condition active [options]
!condition attrs [options]
Formally:

S → condition command arguments
command → help
command → create
command → copy
command → rename
command → edit
command → delete
command → list
command → icons
command → addeffect
command → editeffect
command → removeeffect
command → apply
command → remove
command → applyanon
command → removeanon
command → clear
command → active
command → attrs
arguments → ε
argumentsstring arguments
argumentsoption arguments
option → -string
option → --string
option → -string string
option → --string string

Parameter Values
command Command (create, copy, rename, edit, delete, list, icons, addeffect, editeffect, removeeffect, apply, remove, applyanon, removeanon, clear, active, or attrs) for which to display command-specific help.
name, condition, old name, new name Name of condition which will be affected by command.
attribute Name of character attribute modified by the effect.
effect Effect to apply to attribute.

Effects are divided into several types. Each type of effect stacks with all other effect types. The effect types are listed here, in the order in which they are applied:

Additive factors add a percentage of the base attribute value. They are applied first, and are specified as follows:
+ X%    Add X% to the base attribute
- X%    Subtract X% from the base attribute
Multiplicative factors multiply the resulting attribute value. They are applied second, and are specified as follows:
  • X    Multiply modified attribute by X
/ X    Divide modified attribute by X
  • X%    Multiply modified attribute by X / 100
/ X%    Divide modified attribute by X / 100
Offsets add a constant value to the attribute. They are applied third, and are specified as follows:
+ X    Add X to the modified attribute
- X    Subtract X from the modified attribute
Caps limit the attribute to a specific range. They are applied fourth, with maximum being applied before minimum:
< X    If modified attribute greater than X, reduce it to X
> X    If modified attribute less than X, increase it to X
Constants set the attribute to a specific value. They are applied last, and are specified as follows:
= X    Set attribute to X.
options !condition create, !condition copy, and !condition edit accept the following options:
  • -i I, --icon I: Name of the icon to display on tokens affected by the relevant condition. Specify "null" when copying or editing a condition to remove existing icon. Use !condition icons for a list of available icons.
  • -d D, --desc D: Description of condition. Note that CommandShell is required in order to use spaces in the description.


!condition addeffect, !condition editeffect, and !condition applyanon accept the following option:

  • -s C, --stack C: Add the effect to the stacking class C. Only the largest modifier of each type from any given stacking class will apply. Specify "null" when copying or editing an effect to remove existing stacking class (effects without a class stack with any other effects).


!condition apply, !condition remove, !condition applyanon, !condition removeanon, !condition clear, !condition active, and !condition attrs accept the following option:

  • -c C, --character C: The ID, token ID, or name of the character to which the command applies. May be specified more than once to apply to multiple characters. If not specified, all characters represented by selected tokens will be used.

Usage Notes

Modifications made to attributes which have active effects will modify the base value, automatically causing the attribute's effective value to be recomputed. For example, if a character has a "Strength" attribute with a value of 20, and a "Strength +4" effect is applied, the character journal will show a value of 24. If the value in the character journal is manually set to 21, Conditions will use 21 as the new base, recompute the value, and update the journal to show the new value of 25.

Examples

!condition create Entangled -i cobweb
Creates a new condition named "Entangled" which will use the "cobweb" icon.
!condition edit Entangled -d "Target's movement is being impeded"
Adds a description for the "Entangled" condition. NOTE: Quoted arguments require the CommandShell module.
!condition addeffect Entangled Speed / 2
The "Entangled" condition will halve affected characters' "Speed" attribute.
!condition addeffect Entangled Dexterity < 8
Characters effected by the "Entangled" condition will have their "Dexterity" attribute capped at 8.
!condition apply Entangled
With one or more tokens selected, will apply the "Entangled" effect to each character represented by a selected token.
!condition apply -c 'Bob "Spider Food" Jones' Entangled
Applies the "Entangled" effect to a single character. NOTE: Quoted arguments require the CommandShell module.
!condition applyanon -c Speedy Speed +50% -s enhancement
Applies an anonymous 50% boost to the "Speed" attribute of all characters named "Speedy". The bonus will not stack with other bonuses in the "enhancement" stacking class.

Changelog

v0.6 (2015-08-04)

  • Set/clear status icons when token added or represents changed


v0.5 (2015-07-23)

  • Add support for inline rolls in arguments


v0.4 (2015-07-07)

  • Fix display of condition descriptions


v0.3 (2015-07-06)

  • Clear status icons when clearing all conditions


v0.2 (2015-07-04)

  • Fix -c arg handling.
  • List each anonymous condition with its index so it's easier to remove the right one.


v0.1 (2015-07-02)

  • Initial release