aboutsummaryrefslogtreecommitdiff
path: root/features/readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'features/readme.md')
-rw-r--r--features/readme.md292
1 files changed, 191 insertions, 101 deletions
diff --git a/features/readme.md b/features/readme.md
index fda276b..73fbdec 100644
--- a/features/readme.md
+++ b/features/readme.md
@@ -10,6 +10,22 @@ The overall structure of a feature is a dictionary as follows:
In addition to the hardcoded data provided in the feature, certain variables may be given at runtime.
+## NOUNS
+
+Nouns embedded into subfeature elements may be any of:
+
+ * "self"
+ * "creature"
+ * "creatures" (i.e., all creatures for whom "effect conditions" are true)
+ * "object"
+ * "structure"
+ * "point in space"
+ * "any"
+ * "terrain"
+ * NAME
+
+Where NAME is interpreted by the game as a specific creature or object with a matching name.
+
## Variables
Many features are very similar between creatures except for certain variables. When instantiated programatically, the feature is given the following:
@@ -19,7 +35,7 @@ Many features are very similar between creatures except for certain variables. W
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:
+In addition to these, certain attributes of the creature having this feature may be probed (as they are intrinsic, modifications are reverted at the end of a duration) such as:
* STR
* DEX
* CON
@@ -28,12 +44,127 @@ In addition to these, certain attributes of the creature having this feature may
* CHA
* PROF
* MAXHP
+ * HP
* MOVESPEED
+ * MOVEREMAIN
* SPELLDC
+ * SIZE (stored as a scalar, e.g., 5 for Medium or 2.5 for Tiny)
+ * OBJECT\_TYPE (-1: creature, 0: misc item, 1: weapon, 2: armor, 3: shield)
+ * OBJECT\_AC
+ * CR
+ * PLANE = 0 (each value is a different plane)
+ * DAMAGE (Returns a damage object regarding the most recent time this was hit):
+ * AMOUNT
+ * CRITICAL
+ * TYPE
+ * ATTACK (Returns an attack object regarding the most recent attack this made):
+ * MELEE
+ * ADVANTAGE
+ * DISADVANTAGE
+ * WEAPON (0 is none, else weapon ID)
+ * TURNS (number of completed turns since rolling initiative)
+ * FLYING
+ * TERRAIN (current terain)
+ * LIGHTING (i.e., sunlight, dim light, darkness, magical darkness)
+ * LANGUAGECOUNT
+ * SURPRISED
+ * METAL (i.e., made of metal)
+ * TERRAIN\_IS\_DIFFICULT (only applies to terrain)
+
+Furthermore, this list is expanded with the following properties and conditions (default values provided) (note: for conditions other than EXHAUSTED, e.g., GRAPPLED, the value is the ID of the source of the condition):
+ * BLINDED = 0
+ * CHARMED = 0
+ * DEAFENED = 0
+ * FRIGHTENED = 0
+ * GRAPPLED = 0
+ * INCAPACITATED = 0
+ * INVISIBLE = 0
+ * PARALYZED = 0
+ * PETRIFIED = 0
+ * POISONED = 0
+ * PRONE = 0
+ * RESTRAINED = 0
+ * STUNNED = 0
+ * UNCONSCIOUS = 0
+ * EXHAUSTED = 0 (ranges up to 6)
+ * REGAINS\_HP = 1
+ * CAN\_STOP\_IN\_HOSTILE\_SPACE = 0
+ * MIN\_SPACE\_WITHOUT\_SQUEEZING = SIZE
+ * BREATHES\_AIR = 1
+ * BREATHES\_WATER = 0
+ * BREATH\_HOLD\_MINUTES = (1,CON,+,.5,max)
+ * CARRY\_CAPACITY = (2,SIZE,2.5,-,SIZE,0,ifelse,5,-,5,/,^,15,\*,STR,\*)
+ * BERSERK = 0
+ * TELEPATHIC = 0 (0 = no, 1 = yes, .5 = one-way)
+ * DASH = 0 (0 = action, 1 = bns action)
+ * DISENGAGE = 0
+ * HIDE = 0
+ * SEES\_MAGICAL\_DARKNESS = 0
+ * SEES\_ETHEREAL = 0
+ * DETECTS\_LIES = 0
+ * LEAVES\_CORPSE = 1
+ * HOLDS\_INVENTORY = 1
+ * PROVOKES\_OPPORTUNITY\_ATTACKS = 1
+ * IGNORES\_DIFFICULT\_TERRAIN = 0
+ * PASSES\_THROUGH\_CREATURES\_AS\_DIFFICULT\_TERRAIN = 0
+ * IGNORES\_WEBS = 0
+ * REACTIONS = 1
+ * BRIGHT\_LIGHT = 0
+ * DIM\_LIGHT = 0
+ * PERFECT\_MAP\_RECALL = 0
+ * MIMIC\_SOUNDS\_VOICES\_INSIGHT\_DC = (PERFORMANCE,DECEPTION,max)
+ * SPEAKS\_WITH\_BEASTS = 0
+ * SPEAKS\_WITH\_PLANTS = 0
+ * SPIDER\_CLIMB = 0
+ * BOILS\_WATER = 0
+ * FORM\_STATE = 0 (0 is true form, others are defined in features)
+ * MUNDANE\_OBJECT\_WHEN\_STILL = 0
+ * CAN\_SMELL = 1
+ * ALIGNMENT = 11 (00: LG, 11: NN, 22: CE, etc.)
+ * ANTIMAGIC\_INCAPACITATES = 0
+ * ALIVE = 1
+ * BLINDSIGHT = 0
+ * RUST = 0
+ * EXPOSED = 0 (underside is exposed)
+ * HEADS = 1
+ * SPELLSLOTS = 0 (num remaining)
+ * NV1, NV2, ... (variables saved to N private only to this feature, all initially 0)
The above attributes by default apply to self (i.e., self.STR), however, they may also be used for another creature (i.e., creature.STR).
-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,+,+).
+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,+,+), or to set breath time to max(.5, 1+CON): (1,CON,+,.5,max). Additionally, boolean expressions may be imbedded, using "|" for "or", "&" for "and", "!" for not (which only consumes one operand), comparitors (i.e., "<", ">", "<=", ">=", "=="), and an "ifelse" expresion, with 0 being false and any else being true. The following rules are respected; note order matters:
+
+ * (X,Y,&) -> 0 if Y == 0, else X
+ * (X,Y,|) -> Y if X == 0, else X
+ * (X,!) -> 1 if X == 0, else 0
+ * (X,Y,<) -> 1 if X < Y, else 0
+ * (X,Y,Z,ifelse) -> if X != 0 then Y, else Z
+ * (X,consume) -> removes X from the stack
+ * (X,duplicate) -> X, X
+ * (X,Y,store) -> X, and stores X to variable Y
+
+More complex conditions are below, potentially resulting in complex "types":
+
+ * bool: 0 is false, 1 is true
+ * creature: stored as creature ID
+ * TYPE: various constants for skills, abilities, damage types, etc.
+
+Syntax is "operator": operand1, operand2,... -> resultType; description (if necessary)
+
+ * "hostile": N1, N2 -> bool; N1 is hostile to N2 (one-directional)
+ * "allied": N1, N2; N1 is allied to N2 (one-directional)
+ * "approves": N; N agrees to the effect
+ * "roll": N, TYPE -> int; TYPE is an ability or skill
+ * "distance": N1, N2 -> int; units of feet
+ * "sees": N1, N2 -> bool; N1 can see N2
+ * "movedto": N1, N2 -> int; distance (feet) N1 moved directly toward N2 this turn
+ * "underspell": N, SPELL -> bool; N is currently under the effects of SPELL; SPELL can alternatively be of school SCHOOL
+ * "N is in lighting LIGHTING" (sunlight, dim light, darkness, magical darkness)
+ * "understand": N1, N2 -> bool; N1 and N2 share a language
+ * "bound": N1, N2 -> bool; N1 is bound by N2
+ * "aware": N1, N2 -> bool; N1 as aware of N2
+ * "webshare": N1, N2 -> bool; N1 and N2 are in the same web
+ * "carried": N1, N2 -> bool; N1 is worn or carried by N2
## TEXT
@@ -54,93 +185,45 @@ Each subfeature is a dictionary with the following elements:
Several of the elements accept various nouns.
-## NOUNS
-
-Nouns embedded into subfeature elements may be any of:
-
- * "self"
- * "creature"
- * "object"
- * "structure"
- * "target"
- * "point in space"
- * NAME
-
-Where NAME is interpreted by the game as a specific creature or object with a matching name.
-
### TRIGGER
TRIGGER is a list containing any of the following followed by nouns corresponding to instances of N:
- * "passive" (evaluated on initialization)
- * "action"
- * "bonus action"
- * "free action"
- * "legendary action costing X"
- * "N start of turn"
- * "N end of turn"
- * "N takes damage" (pushes damage amount, damage type to variables list)
- * "N moves"
- * "N makes check against N" (pushes ROLLCLASS to variables list)
- * "N forces N to save" (pushes ROLLCLASS to variables list)
- * "N rolls a d20" (pushes ROLLCLASS to variables list)
- * "N targets N by a spell" (pushes spell name to variables list)
- * "N attacks N"
- * "N hits N"
- * "N touches N"
+The subfeature activates when TRIGGER is true. The TRIGGER uses any condition, with the following exclusive conditions:
+
+ * "passive": -> bool; evaluated on initialization
+ * "action": -> bool; taken by creature on turn
+ * "bonus": -> bool; bonus action
+ * "free": -> bool; free action
+ * "legendary": X -> bool; legendary action costing X
+ * "turnstart": N -> bool; N start of turn
+ * "turnend": N -> bool; N end of turn
+ * "damaged": N -> bool; N takes damage
+ * "moves": N -> bool; N moves
+ * "checkagainst": N1, N2 -> ROLLCLASS; N1 makes check against N2
+ * "forcesave": N1, N2 -> ROLLCLASS; N1 forces N2 to save
+ * "rolls": N, X -> bool; N rolls a dX
+ * "targetspell": N1, N2 -> SPELL; N1 targets N2 by a spell
+ * "attacks": N1, N2 -> ATTACK; N1 attacks N2
+ * "hits": N1, N2 -> DAMAGE; N1 hits N2
+ * "touches": N1, N2 -> bool; N1 touches N2
Where ROLLCLASS is any of:
* "attack"
* "grapple"
* "escape grapple"
* "shove"
+ * "frightened"
...
-### 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 = VALUE"
- * "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" (0 is a success)
- * "N fails dc X ABILITY save by at least X" (0 is a fail)
- * "N is within radius X of N"
- * "N can see N"
- * "N has completed >= X turns"
- * "N has COND X hp" (COND any of ">=", ">", "<=", "<", "==")
- * "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"
- * "N had disadvantage"
- * "N used a weapon"
- * "N is surprised"
- * "N is bound by N"
- * "N is aware of N"
- * "N and N are in the same web"
- * "N == N"
- * "N is in AOE" where AOE is denoted in any of the following:
+### CONDITION
+
+CONDITION is a string containing the conditional which, if it evaluates to true (i.e., not 0), then the effect occurs.
+
+### AOE
+
+AOE is
+ * "in": N, AOE -> bool; N is in an AOE
* "line LENGTH WIDTH"
* "cone LENGTH"
@@ -149,44 +232,48 @@ CONDITIONS is a list of lists, all of which must evaluate True for effects to be
EFFECTS is a list of dictionaries containing the following:
* "target": NOUN
+ * "condition": CONDITION
* "effect": [EFFECT, variables]
- * "effect conditions": [[ CONDITION, variables ]]
* "duration": DURATION
+(Note: Unlike subfeature conditions, effect conditions apply to each target individually, i.e., for target = creatures, we can apply condition on each creature.)
+
Where EFFECT is any of the following (UNDER CONSTRUCTION DENOTED BY x):
- * Terrain in X ft radius is difficult
- * Set movement speed to X
- * Move up to X ft toward N
+ * "Move up to X ft toward N"
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
- * Set property PROPERTY to X
+ * "Set N = N"
+ * "Destroyed"
x * Death
x * Surprised
x * Pushed X feet in DIRECTION direction
x * Immune to feature FEATURE
x * Immune to spells with trait SPELL\_TRAIT
- * Impose disadvantage
+ * "Impose disadvantage"
* "Impose disadvantage on TYPE" (any of "attack rolls", "ability checks", "saving throws")
- * Grant advantage
- * Grant critical hit
+ * "Grant advantage"
+ * "Grant critical hit"
x * Advantage on rolls ROLL\_CLASS
x * Automatic fail on rolls ROLL\_CLASS
x * Automatic succeed on rolls ROLL\_CLASS
x * Move X distance
x * Deal X damage
- * Inflict XdX TYPE damage
- * Inflict XdX TYPE damage, dc X ABILITY save halves
- * Deal +X weapon die damage
- * Damage dealt is magical
- * Take action ACTION
+ * "Inflict XdX TYPE damage"
+ * "Inflict XdX TYPE damage, dc X ABILITY save halves"
+ * "Deal +X weapon die damage"
+ * "Damage dealt is magical"
+ * "Take action ACTION"
+ * "cantrip"
+ * "cast spell"
+ * "attack"
+ * specific feature
x * Disable other feature
x * Know distance/direction to creature/object within X distance
- * Reduce incoming damage by X
- * Regain X hp
+ * "Reduce incoming damage by X"
+ * "Regain X hp"
+ * "Polymorph N into creature <= X cr"
x * Weapon/armor corrodes
x * Ignite flammable objects
x * Expend spell slot
@@ -205,13 +292,16 @@ x * Creates X diameter tunnel
The conditions on an effect may be omitted if not applicable, and are the same as conditions for a trigger.
-The duration of an effect may be omitted for instantaneous effects and is any of the following:
+The duration of an effect may be omitted for instantaneous effects and is a condition, including the contents of TRIGGER, plus the following:
- * "End of turn"
- * "Start of next turn"
- * "End of next turn"
- * "Until action is taken to end"
- * TIME (formatted "X units", where units is any of sec, min, hr, day, month, year)
+x * "End of turn"
+x * "Start of next turn"
+x * "End of self next turn"
+x * "End of target next turn"
+x * "Until action is taken to end"
+x * TIME (formatted "X units", where units is any of sec, min, hr, day, month, year)
+x * "Until lesser restoration is cast" (implies at least lesser)
+x * "Until overridden or dead"
x * Repeated saves???
x * Repeated saves at advantage/disadvantage with condition???
x * Until certain spell is cast???
@@ -222,4 +312,4 @@ x * Until other effect expires???
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", "X-Y" (for integers X and Y) indicating when spent uses are restored
+ * Any of "turn", "long rest", "short rest", "X-Y" (for integers X and Y) indicating range on a d6 where spent uses are restored