Difference between revisions of "Script:Numenera Natha"
From Roll20 Wiki
(→General notes:) |
Andreas J. (Talk | contribs) m |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{script overview | {{script overview | ||
|name=Numenera_Natha | |name=Numenera_Natha | ||
− | |author= | + | |author=[[Natha]] |
− | |version=4. | + | |version=4.8 |
− | |lastmodified= | + | |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. | ||
− | * | + | * {{repo|Roll20/roll20-character-sheets/tree/master/Numenera_NathasNumenera_English English sheet "Numenera (tabbed)"}} |
− | * | + | * {{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 === | + | === !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.''' | '''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). | + | 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). | (see the comments of the function below for details). | ||
MIGHT ROLL MACRO EXAMPLE: | 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}'' | + | ''!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: | 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}'' | + | ''!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: | 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}'' | + | ''!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 (called from the sheet mainly, as it requires a character id). | Stat roll (called from the sheet mainly, as it requires a character id). | ||
− | + | Examples: | |
+ | |||
''!nathanum-numeneroll @{character_id}|might'' | ''!nathanum-numeneroll @{character_id}|might'' | ||
+ | |||
''!nathanum-numeneroll @{character_id}|speed'' | ''!nathanum-numeneroll @{character_id}|speed'' | ||
+ | |||
''!nathanum-numeneroll @{character_id}|intellect'' | ''!nathanum-numeneroll @{character_id}|intellect'' | ||
+ | |||
Calls statRollFromSheet(character-objet,name-of-the-attibute,who-rolled), see the comments of the function below for details. | Calls statRollFromSheet(character-objet,name-of-the-attibute,who-rolled), see the comments of the function below for details. | ||
Line 94: | Line 98: | ||
Functions statRollFromSheet, 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 101: | 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 116: | 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 129: | Line 133: | ||
Gets the necessary parameters for this function as attributes from the character sheet (except the stat name). | 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). | + | 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): === | + | === 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 | + | 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 143: | 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 155: | Line 161: | ||
And sets "death" marker if health is 0 or less. | And sets "death" marker if health is 0 or less. | ||
− | The | + | 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
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.
[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.