From d0e356d09e30a11c1e072415a5088f829d5c0a04 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 16 Jan 2022 21:32:01 -0500 Subject: Worked on features --- features/aberrant_ground.json | 30 +++++++- features/acid_absorption.json | 14 ++++ features/adhesive.json | 18 +++++ features/readme.md | 170 ++++++++++++++++++++++++++++++++++++------ 4 files changed, 206 insertions(+), 26 deletions(-) create mode 100644 features/acid_absorption.json create mode 100644 features/adhesive.json (limited to 'features') diff --git a/features/aberrant_ground.json b/features/aberrant_ground.json index a7f99de..4e72225 100644 --- a/features/aberrant_ground.json +++ b/features/aberrant_ground.json @@ -1,3 +1,27 @@ -[ - -] +{ + "name": "aberrant ground", + "text": "The ground in a 10-foot radius around the {NAME} is doughlike difficult terrain. Each creature that starts its turn in that area must succeed on a DC {(8,PROF,STR,+,+)} Strength saving throw or have its speed reduced to 0 until the start of its next turn.", + "subfeatures": [ + { + "trigger": [ "N end of turn", "self" ], + "conditions": [], + "effects": [{ + "target": "self", + "effect": [ "Terrain in X ft radius is difficult", 10 ], + "duration": "Start of next turn" + }] + }, + { + "trigger": [ "N start of turn", "creature" ], + "conditions": [ + [ "N is within radius X of N", "creature", 10, "self" ], + [ "N succeeds dc X ABILITY save by at least X", "creature", "(8,PROF,STR,+,+)", "STR", 0 ] + ], + "effects": [{ + "target": "creature", + "effect": [ "Set movement speed to X", 0 ], + "duration": "Start of next turn" + }] + } + ] +} diff --git a/features/acid_absorption.json b/features/acid_absorption.json new file mode 100644 index 0000000..52eb2b7 --- /dev/null +++ b/features/acid_absorption.json @@ -0,0 +1,14 @@ +{ + "name": "acid absorption", + "text": "Whenever the {NAME} is subjected to acid damage, it takes no damage and instead regains a number of hit points equal to the acid damage dealt.", + "subfeatures": [ + { + "trigger": [ "N takes damage", "self" ], + "conditions": [[ "Damage received was type TYPE", "acid" ]], + "effects": [{ + "target": "self", + "effect": [ "Regain X hp", "V0" ] + }] + } + ] +} diff --git a/features/adhesive.json b/features/adhesive.json new file mode 100644 index 0000000..19c39e9 --- /dev/null +++ b/features/adhesive.json @@ -0,0 +1,18 @@ +{ + "name": "adhesive", + "text": "(Object form only) The {NAME} adheres to anything that touches it. A Huge or smaller creature adhered to the {NAME} is also grappled by it (escape DC {(8,STR,PROF,+,+)}). Ability checks made to escape this grapple have disadvantage.", + "subfeatures": [ + { + "trigger": [ "N touches N", "creature", "self" ], + "conditions": [ + [ "N has property PROPERTY", "self", "Form", "Object" ], + [ "not N has property Property", "other", "Size", "Gargantuan" ] + ] + "effects": [ + "target": "creature", + "effect": [ "Acquire condition CONDITION", "grappled" ] + ] + } + ] + +} diff --git a/features/readme.md b/features/readme.md index 6c90a31..ebc16cc 100644 --- a/features/readme.md +++ b/features/readme.md @@ -2,9 +2,32 @@ Many features are complex. Here we lay out the format used when writing a feature. +The overall structure of a feature is a dictionary as follows: + + * "name": NAME + * "text": TEXT + * "subfeatures": SUBFEATURES + +In addition to the hardcoded data provided in the feature, certain variables may be given at runtime. + ## Variables -Many features are very similar between creatures except for certain variables. The feature reads, as parameters, NAME as the creature's name, and V1, V2, ... VN for each numeric variable that is a parameter to the feature. +Many features are very similar between creatures except for certain variables. When instantiated programatically, the feature is given the following: + + * NAME: The name of the creature with this feature + * V0, V1, ... VN: Zero-indexed list of integer variables + +Certain portions of features accept these as parameters, either inline as in TEXT, or in the place of hardcoded variables for conditions or effects. + +In addition to these, certain attributes of the creature having this feature may be probed such as STR, DEX, CON, INT, WIS, CHA, or PROF. + +Finally, simple math can be provided in postfix notation surounded by parentheses. For example, to set a save DC equal to 8+int+prof: (8,INT,PROF,+,+). + +## TEXT + +This is explanatory text. It accepts embedded variables in the form {VARNAME}. For example, the text "The {NAME}'s weapon attacks are magical. When the {NAME} hits with any weapon, the weapon deals an extra {V0}d{V1} radiant damage.", when applied to a "deva" with runtime variables (4, 8), we get: + +"The deva's weapon attacks are magical. When the deva hits with any weapon, the weapon deals an extra 4d8 radiant damage." ## Subfeatures @@ -12,30 +35,16 @@ Each feature consists of a list of "subfeatures", which are treated as independe Each subfeature is a dictionary with the following elements: - * "name": NAME - * "text": TEXT - * "nouns": NOUNS * "trigger": TRIGGER * "conditions": CONDITIONS * "effects": EFFECTS - * "duration": DURATION * "recharge": RECHARGE -We detail the values below. - -### NAME - -This is the name of the feature - -### TEXT +Several of the elements accept various nouns. -This is explanatory text. It accepts embedded variables in the form {VARNAME}. For example, the text "The {NAME}'s weapon attacks are magical. When the {NAME} hits with any weapon, the weapon deals an extra {V1}d{V2} radiant damage.", when applied with (deva, 4, 8), we get: +## NOUNS -"The deva's weapon attacks are magical. When the deva hits with any weapon, the weapon deals an extra 4d8 radiant damage." - -### NOUNS - -The nouns involved are any entities this feature affects. NOUNS is a list containing any of: +Nouns embedded into subfeature elements may be any of: * "self" * "creature" @@ -45,18 +54,19 @@ The nouns involved are any entities this feature affects. NOUNS is a list contai * "point in space" * NAME -Where NAME is interpreted by the game as a specific creature or object. These are N1, N2, etc. for all N in the array. Index starts at 1. +Where NAME is interpreted by the game as a specific creature or object with a matching name. ### TRIGGER -TRIGGER is any of the following: +TRIGGER is a list containing any of the following followed by nouns corresponding to instances of N: - * "passive" + * "on init" * "action" * "bonus action" * "free action" - * "{} start of turn" - * "N takes damage" + * "N start of turn" + * "N end of turn" + * "N takes damage" (pushes damage amount to variables list) * "N moves" * "N makes check against N" * "N forces N to save" @@ -65,3 +75,117 @@ TRIGGER is any of the following: * "N attacks N" * "N hits N" * "N touches N" + +### CONDITIONS + +CONDITIONS is a list of lists, all of which must evaluate True for effects to be applied. Each condition list is formatted [ CONDITION, variables ] where CONDITION is any of the following, prepend "not " to invert: + + * "N has property PROPERTY" + * "N is hostile to N" + * "N is allied to N" + * "N wishes it to be so" + * "N succeeds dc X ABILITY save by at least X" + * "N fails dc X ABILITY save by at least X" + * "N is within radius X of N" + * "N can see N" + * "N has completed >= X turns" + * "N is at full hp" + * "N has >= X hp" + * "Damage received >= X" + * "Damage received was a critical hit" + * "Damage received was type TYPE" + * "N has condition CONDITION" + * "N has condition CONDITION given by N" + * "N and N are on same plane of existence" + * "N is on plane PLANE" + * "N moved X distance straight toward N" + * "N has X movement remaining" + * "N made attack ATTACK" + * "N has underside exposed" + * "First time N uses feature on N during turn" + * "N is flying" + * "N is under effects of spell SPELL" + * "N has spell from school SCHOOL cast on it" + * "N is on terrain TERRAIN" + * "N is inside an object" + * "N is in lighting LIGHTING (sunlight, dim light, darkness, magical darkness)" + * "N can understand >= X languages" + * "N and N share a language" + * "N has >= X heads" + * "N has X spell slots remaining" + * "N had advantage on most recent die roll" + * "N had disadvantage on most recent die roll" + * "N used a weapon on most recent attack" + * "N is surprised" + * "N is bound by N" + * "N is aware of N" + * "N and N are in the same web" + +### EFFECTS + +EFFECTS is a list of dictionaries containing the following: + + * "target": NOUN + * "effect": [EFFECT, variables] + * "duration": DURATION + +Where EFFECT is any of the following (UNDER CONSTRUCTION DENOTED BY x): + + * Terrain in X ft radius is difficult + * Set movement speed to X +x * Increase movement speed by X +x * Increase jump distance by X +x * Increase jump height by X + * Acquire condition CONDITION +x * End condition CONDITION +x * Acquire/override property PROPERTY +x * Death +x * Surprised +x * Pushed X feet in DIRECTION direction +x * Immune to feature FEATURE +x * Immune to spells with trait SPELL\_TRAIT +x * Disadvantage on rolls ROLL\_CLASS +x * Advantage on rolls ROLL\_CLASS +x * Automatic fail on rolls ROLL\_CLASS +x * Automatic succeed on rolls ROLL\_CLASS +x * Automatic critical hit +x * Move X distance +x * Deal X damage +x * Disable other feature +x * Know distance/direction to creature/object within X distance +x * Reduce incoming damage by X + * Regain X hp +x * Weapon/armor corrodes +x * Ignite flammable objects +x * Expend spell slot +x * Special movement +x * Plane shift +x * Grant spell effect +x * Transparency (perpetual hidenness?) +x * Prescribed actions (randomized), any of: +x - Nothing +x - Moves in random direction +x - Attacks random creature within reach +x * Telepathic command +x * Learns creature's desires +x * Spell storing +x * Creates X diameter tunnel + +The duration of an effect may be omitted for instantaneous effects and is any of the following: + + * "End of turn" + * "Start of next turn" + * "End of next turn" + * Until action is taken to end +x * TIME??? +x * Repeated saves??? +x * Repeated saves at advantage/disadvantage with condition??? +x * Until certain spell is cast??? +x * Until other effect expires??? + +### RECHARGE + +The recharge of a feature may be omitted to indicate that it is unlimited. Otherwise, it is a list of the following two items: + + * Integer indicating number of times the feature can be used + * Any of "turn", "long rest", "short rest" indicating when spent uses are restored -- cgit v1.2.3