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

Difference between revisions of "Script:Numenera Natha"

From Roll20 Wiki

Jump to: navigation, search
m
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{script overview
 
{{script overview
 
|name=Numenera_Natha
 
|name=Numenera_Natha
|author={{user profile|75857|Natha}}
+
|author=[[Natha]]
|version=4.0
+
|version=4.8
|lastmodified=2014-03-24
+
|lastmodified=2017-02-10
 
}}
 
}}
  
This script is meant to be used with Natha's Numenera character sheets (the red buttons in particular).
+
This script is meant to be used with [[Natha]]'s '''Numenera Tabbed''' character sheets (the red buttons in particular).
 
The functions included in the script are aimed at making Numenera rolls, and updating the relative character stat Pools.
 
The functions included in the script are aimed at making Numenera rolls, and updating the relative character stat Pools.
  
* [https://github.com/Roll20/roll20-character-sheets/tree/master/Numenera_NathasNumenera_English English sheet "Numenera (tabbed)"]
+
* {{repo|Roll20/roll20-character-sheets/tree/master/Numenera_NathasNumenera_English English sheet "Numenera (tabbed)"}}
* [https://github.com/Roll20/roll20-character-sheets/tree/master/Numenera_NathasNumenera_French French sheet "Numenera (French)"]
+
* {{repo|Roll20/roll20-character-sheets/tree/master/Numenera_NathasNumenera_French French sheet "Numenera (French)"}}
  
  
'''Sheet must be in version 4+''': chat outputs and error messages are managed through the '''sheet's templates'''.
+
'''Sheet must be in version 4.5+''': chat outputs and error messages are managed through the '''sheet's templates'''.
  
 
== Chat commands ==
 
== Chat commands ==
 +
 +
=== !nathanum-macroroll token_or_character_id|stat name|Difficulty|Cost|Assets|Effort on Roll|Effort on Damage|Bonus|Skill level ===
 +
'''New! Stat roll that can be called easier by macros.'''
 +
 +
Calls statRoll(character-objet,name-of-the-attibute,who-rolled, difficulty, Stat-expense,Assets,Effort-on-Roll,Effort-on-damage,Bonus-to-roll,Skill-level).
 +
(see the comments of the function below for details).
 +
 +
MIGHT ROLL MACRO EXAMPLE:
 +
''!nathanum-macroroll @{selected|token_id}|might|?{Difficulty|0}|?{Cost|0}|?{Assets|0}|?{Effort on Roll|0}|?{Effort on Damage|0}|?{Bonus|0}|?{Skill Level (-1 to 2)|0}''
 +
 +
SPEED ROLL MACRO EXAMPLE:
 +
''!nathanum-macroroll @{selected|token_id}|speed|?{Difficulty|0}|?{Cost|0}|?{Assets|0}|?{Effort on Roll|0}|?{Effort on Damage|0}|?{Bonus|0|?{Skill Level (-1 to 2)|0}}''
 +
 +
INTELLECT ROLL MACRO EXAMPLE:
 +
''!nathanum-macroroll @{selected|token_id}|intellect|?{Difficulty|0}|?{Cost|0}|?{Assets|0}|?{Effort on Roll|0}|?{Effort on Damage|0}|?{Bonus|0}|?{Skill Level (-1 to 2)|0}''
  
 
=== !nathanum-numeneroll character_id|attribute ===
 
=== !nathanum-numeneroll character_id|attribute ===
Stat roll.
+
Stat roll (called from the sheet mainly, as it requires a character id).
  
''Example: !nathanum-numeneroll @{character_id}|speed''
+
Examples:
  
Calls statRoll(character-objet,name-of-the-attibute,who-rolled)
+
''!nathanum-numeneroll @{character_id}|might''
  
(see the comments of the function below for details).
+
''!nathanum-numeneroll @{character_id}|speed''
 +
 
 +
''!nathanum-numeneroll @{character_id}|intellect''
 +
 
 +
 
 +
Calls statRollFromSheet(character-objet,name-of-the-attibute,who-rolled), see the comments of the function below for details.
  
 
=== !nathanum-recoveryroll character_id ===
 
=== !nathanum-recoveryroll character_id ===
Line 76: Line 96:
  
 
=== General notes: ===
 
=== General notes: ===
Functions statRoll, recoveryRoll, initRoll and restChar are for players (or GM), and can be called by clicking the RED buttons on the sheet.
+
Functions statRollFromSheet, recoveryRoll, initRoll and restChar are for players (or GM), and can be called by clicking the RED buttons on the sheet.
  
Function checkCharStates is called by all the functions that modify stat pools (might, speed and intellect attributes) or when stat pools are manually modified (on the sheet or character).
+
Function checkCharStates is called by all the functions that modify stat pools (might, speed and intellect attributes, and Special Damage) or when stat pools are manually modified (on the sheet or character).
  
 
Function npcDamage is for the GM and meant to be called via macros with an NPC token selected (these characters require HEALTH and ARMOR attributes).
 
Function npcDamage is for the GM and meant to be called via macros with an NPC token selected (these characters require HEALTH and ARMOR attributes).
Line 85: Line 105:
  
 
=== checkCharStates(character-object): ===
 
=== checkCharStates(character-object): ===
Checks and/or changes the character's damage track and token markers, based on her current stat pools attributes.
+
Checks and/or changes the character's damage track and token markers, based on her current stat pools attributes, and special damage.
  
 
No chat output.
 
No chat output.
Line 100: Line 120:
  
 
The function:
 
The function:
* Rolls 1d20, adds the optional efforts (multiplied by 3) and bonus,
+
* Rolls 1d20, adds the optional efforts (multiplied by 3), skill level (multiplied by 3) and bonus,
 
* Expends the optional speed points from effort and initial cost (using edge),
 
* Expends the optional speed points from effort and initial cost (using edge),
 
* Then add the character, or its token (if on the map on the object layer), to the tracker, or replace the initiative value if it's already in the tracker
 
* Then add the character, or its token (if on the map on the object layer), to the tracker, or replace the initiative value if it's already in the tracker
Line 110: Line 130:
 
Chat output uses the "nathaNumInit" roll template.
 
Chat output uses the "nathaNumInit" roll template.
  
=== statRoll(character-objet,name-of-the-attibute,who-rolled): ===
+
=== statRollFromSheet(character-objet,name-of-the-attibute,who-rolled): ===
Might/speed/intellect roll (with eventual roll effort, additionnal cost, damage effort and bonus) against a difficulty (optional).
+
Gets the necessary parameters for this function as attributes from the character sheet (except the stat name).
  
Every necessary parameters for this function are attributes of the character sheet (except the stat name).
+
And then calls statRoll(character-objet,name-of-the-attibute,who-rolled, difficulty, Stat-expense,Assets,Effort-on-Roll,Effort-on-damage,Bonus-to-roll,Skill-level).
 +
 
 +
=== statRoll(character-objet,name-of-the-attibute,who-rolled, difficulty, Stat-expense,Assets,Effort-on-Roll,Effort-on-damage,Bonus-to-roll,,Skill-level): ===
 +
Might/speed/intellect roll (with eventual roll effort, additionnal cost, damage effort, bonus and skill level) against a difficulty (optional).
  
 
Difficulty is the level of difficulty, not the target number.
 
Difficulty is the level of difficulty, not the target number.
Line 124: Line 147:
  
 
Damage track and token state are checked/updated by calling checkCharStates().
 
Damage track and token state are checked/updated by calling checkCharStates().
 +
 +
Skill level should go from -1 (Inability) to +2 (Specialized).
  
 
Chat output uses the "nathaNumRoll" roll template.
 
Chat output uses the "nathaNumRoll" roll template.
Line 136: Line 161:
 
And sets "death" marker if health is 0 or less.
 
And sets "death" marker if health is 0 or less.
  
The Mook or Non Player Character must have the following attributes :
+
The Non Player Character must have the following attributes :
 
* LEVEL (token bar1)
 
* LEVEL (token bar1)
 
* HEALTH (token bar2)
 
* HEALTH (token bar2)

Latest revision as of 15:45, 18 April 2021

API ScriptAuthor: Natha
Version: 4.8
Last Modified: 2017-02-10
Code: Numenera_Natha
Dependencies: None
Conflicts: None

This script is meant to be used with Natha's Numenera Tabbed character sheets (the red buttons in particular). The functions included in the script are aimed at making Numenera rolls, and updating the relative character stat Pools.


Sheet must be in version 4.5+: chat outputs and error messages are managed through the sheet's templates.

Contents

[edit] Chat commands

[edit]  !nathanum-macroroll token_or_character_id|stat name|Difficulty|Cost|Assets|Effort on Roll|Effort on Damage|Bonus|Skill level

New! Stat roll that can be called easier by macros.

Calls statRoll(character-objet,name-of-the-attibute,who-rolled, difficulty, Stat-expense,Assets,Effort-on-Roll,Effort-on-damage,Bonus-to-roll,Skill-level). (see the comments of the function below for details).

MIGHT ROLL MACRO EXAMPLE: !nathanum-macroroll @{selected|token_id}|might|?{Difficulty|0}|?{Cost|0}|?{Assets|0}|?{Effort on Roll|0}|?{Effort on Damage|0}|?{Bonus|0}|?{Skill Level (-1 to 2)|0}

SPEED ROLL MACRO EXAMPLE: !nathanum-macroroll @{selected|token_id}|speed|?{Difficulty|0}|?{Cost|0}|?{Assets|0}|?{Effort on Roll|0}|?{Effort on Damage|0}|?{Bonus|0|?{Skill Level (-1 to 2)|0}}

INTELLECT ROLL MACRO EXAMPLE: !nathanum-macroroll @{selected|token_id}|intellect|?{Difficulty|0}|?{Cost|0}|?{Assets|0}|?{Effort on Roll|0}|?{Effort on Damage|0}|?{Bonus|0}|?{Skill Level (-1 to 2)|0}

[edit]  !nathanum-numeneroll character_id|attribute

Stat roll (called from the sheet mainly, as it requires a character id).

Examples:

!nathanum-numeneroll @{character_id}|might

!nathanum-numeneroll @{character_id}|speed

!nathanum-numeneroll @{character_id}|intellect


Calls statRollFromSheet(character-objet,name-of-the-attibute,who-rolled), see the comments of the function below for details.

[edit]  !nathanum-recoveryroll character_id

Recovery roll (see the comments of the function below for details).

Example: !nathanum-recoveryroll @{character_id}

Calls recoveryRoll(character-object).

(see the comments of the function below for details).

[edit]  !nathanum-initroll character_id

Initiative roll.

Example: !nathanum-initroll @{character_id}

Calls initRoll(character-object).

(see the comments of the function below for details).

[edit]  !nathanum-restchar character_id OR token_id

Full rest/reset of the character.

Example with token id: !nathanum-restchar @{selected|token_id}

Example with character id: !nathanum-restchar @{character_id}

Calls restChar(character-object).

(see the comments of the function below for details).

[edit]  !nathanum-checkchar character_id

Verifies and sets damage track and token markers according to stat pools.

Example: !nathanum-checkchar @{character_id}

Calls checkCharStates(character object).

(see the comments of the function below for details).

[edit]  !nathanum-npcdmg token_id|damage-dealt|apply-armor

Apply damage (or healing if damage-dealt is negative ...) to Numenera NPC/Creature.

Example: !nathanum-npcdmg @{selected|token_id}|?{Damage +/-|0}|?{Apply Armor (y/n)|y}

Calls npcDamage(character-object,token-object,damage-dealt, apply-armor).

(see the comments of the function below for details).

[edit] Functions

[edit] General notes:

Functions statRollFromSheet, recoveryRoll, initRoll and restChar are for players (or GM), and can be called by clicking the RED buttons on the sheet.

Function checkCharStates is called by all the functions that modify stat pools (might, speed and intellect attributes, and Special Damage) or when stat pools are manually modified (on the sheet or character).

Function npcDamage is for the GM and meant to be called via macros with an NPC token selected (these characters require HEALTH and ARMOR attributes).

Errors and/or alert messages (insufficient stat pool points for example) are output in the chat using the "nathaNumMsg" roll template.

[edit] checkCharStates(character-object):

Checks and/or changes the character's damage track and token markers, based on her current stat pools attributes, and special damage.

No chat output.

[edit] restChar(character-object):

Complete rest/reset of the character.

Chat output uses the "nathaNumRecovery" roll template.

[edit] initRoll(character-object):

BEWARE: Not the standard Numenera initiative roll!

The initiative roll is meant to be sorted/compared to (Level*3) of the NPCs/Creatures.

The function:

  • Rolls 1d20, adds the optional efforts (multiplied by 3), skill level (multiplied by 3) and bonus,
  • Expends the optional speed points from effort and initial cost (using edge),
  • Then add the character, or its token (if on the map on the object layer), to the tracker, or replace the initiative value if it's already in the tracker

Every necessary parameters for this function are attributes of the character sheet.

Damage track and token state are checked/updated by calling checkCharStates().

Chat output uses the "nathaNumInit" roll template.

[edit] statRollFromSheet(character-objet,name-of-the-attibute,who-rolled):

Gets the necessary parameters for this function as attributes from the character sheet (except the stat name).

And then calls statRoll(character-objet,name-of-the-attibute,who-rolled, difficulty, Stat-expense,Assets,Effort-on-Roll,Effort-on-damage,Bonus-to-roll,Skill-level).

[edit] statRoll(character-objet,name-of-the-attibute,who-rolled, difficulty, Stat-expense,Assets,Effort-on-Roll,Effort-on-damage,Bonus-to-roll,,Skill-level):

Might/speed/intellect roll (with eventual roll effort, additionnal cost, damage effort, bonus and skill level) against a difficulty (optional).

Difficulty is the level of difficulty, not the target number.

The target number is calculated by the function.

If difficulty equals 0, the roll still happens, but is not confronted to any difficulty: instead of calculating success, it calculates the highest difficulty beaten.

Unless d20 rolls a natural 20, pool points cost is calculted (using edge) and expended, if necessary and if possible (not enough stat Pool points ends in an error message).

Damage track and token state are checked/updated by calling checkCharStates().

Skill level should go from -1 (Inability) to +2 (Specialized).

Chat output uses the "nathaNumRoll" roll template.

[edit] recoveryRoll(character-object):

Rolls a recovery rolls and advances the recovery track.

Chat output uses the "nathaNumRecovery" roll template.

[edit] npcDamage(character-object,token-object,damage-dealt, apply-armor):

Applies damage (or healing if damage-dealt is negative) to a Numenera NPC/Creature. And sets "death" marker if health is 0 or less.

The Non Player Character must have the following attributes :

  • LEVEL (token bar1)
  • HEALTH (token bar2)
  • ARMOR (token bar3)

Armor will diminish damage unless the "apply-armor" parameter equals 'n'.

Chat output uses the plain old "sendChat" function (no template), visible to GM only.