From 12edc49172b70eaeb599b23f3933d41d25e4067b Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 10 Apr 2025 00:00:15 -0700 Subject: [PATCH 01/13] Update dltool.js Added configuration system for player permissions --- Dynamic Lighting Tool/dltool.js | 164 ++++++++++++++++++++++++++++---- 1 file changed, 143 insertions(+), 21 deletions(-) diff --git a/Dynamic Lighting Tool/dltool.js b/Dynamic Lighting Tool/dltool.js index 719da9e6a1..6404e66430 100644 --- a/Dynamic Lighting Tool/dltool.js +++ b/Dynamic Lighting Tool/dltool.js @@ -1,3 +1,11 @@ +//#################################### +// Dynamic Lighting Tool +// Also available through one-click +// https://app.roll20.net/forum/post/11316788/script-dltool-a-dynamic-lighting-control-panel-and-troubleshooter +// Video https://youtu.be/hANQr07uhFM?si=RBdG1kaXJygZiUeV&t=228 +//author: KeithCurtis +//#################################### + var API_Meta = API_Meta || {}; API_Meta.dltool = { offset: Number.MAX_SAFE_INTEGER, @@ -6,14 +14,21 @@ API_Meta.dltool = { try { throw new Error(''); } catch (e) { - API_Meta.dltool.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (7)); + API_Meta.dltool.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (15)); } } /* globals checkLightLevel */ on('ready', () => { - const version = '1.0.8'; + const version = '1.0.9'; log('-=> Dynamic Lighting Tool v' + version + ' is loaded. Base command is !dltool'); + if (!_.has(state, 'DLTool')) { + state.DLTool = { + playercCanVision: false, + playercCanLight: false, + playercCanChecklist: false, + }; +} const processInlinerolls = (msg) => { if(msg.hasOwnProperty('inlinerolls')){ @@ -51,6 +66,9 @@ on('ready', () => { const L = (o) => Object.keys(o).forEach(k => log(`${k} is ${o[k]}`)); const decodeUnicode = (str) => str.replace(/%u[0-9a-fA-F]{2,4}/g, (m) => String.fromCharCode(parseInt(m.slice(2), 16))); + //tests for existence of ProdWiz in the sandbox + const isProd = state.hasOwnProperty('Roll20Pro'); + let cmdName = "!dltool"; let theCommand = ''; @@ -67,12 +85,13 @@ on('ready', () => { const onButtonLarge = `
`; const offButtonLarge = `
`; let offStyle = `'background-color:#333; color:#ccc; text-decoration: none; text-transform: uppercase; font-weight:bold; font-size: 10px; border:0px solid transparent; border-radius:3px; margin: 2px 2px; padding:1px 6px; display:inline-block'`; - let onStyle = `'background-color:#3b0; color:#fff; text-decoration: none; text-transform: uppercase; font-weight:bold; font-size: 10px; border:0px solid transparent; border-radius:3px; margin: 2px 3px; padding:1px 6px; display:inline-block'`; + let onStyle = `'background-color:#3b0; color:#fff; text-decoration: none; text-transform: uppercase; font-weight:bold; font-size: 10px; border:0px solid transparent; border-radius:3px; margin: 2px 2px; padding:1px 6px; display:inline-block'`; let disableStyle = `'background-color:#888; color:#fff; text-decoration: none; text-transform: uppercase; font-weight:bold; font-size: 10px; border:0px solid transparent; border-radius:3px; margin: 2px 3px; padding:1px 6px; display:inline-block'`; const openSection = `
`; const openHeader = `
`; const openSubhead = `
`; const openPageHead = `
`; + const openRolll20Subhead = `
`; const openReport = `
`; const closeReport = `
`; const manualWarning = `S`; @@ -87,24 +106,25 @@ on('ready', () => { //BUTTON: TOGGLE FOR PAGE PROPERTIES const toggle = (size, value, pageProperty) => { + //if (pageProperty === "daylight_mode_enabled"){log ("daylight_mode_enabled = " + value)}; let toggleButton = ''; if (size === "large" && (value === true || value === "true" || value === "basic")) { - toggleButton = onButtonLarge; + toggleButton = onButtonLarge } if (size === "large" && value === false) { - toggleButton = offButtonLarge; + toggleButton = offButtonLarge } if (size === "small" && (value === true || value === "true" || value === "basic")) { - toggleButton = onButtonSmall; + toggleButton = onButtonSmall } if (size === "small" && value === false) { - toggleButton = offButtonSmall; + toggleButton = offButtonSmall } if (undefined === pageProperty) { pageProperty = ''; } - let finalButton = `${toggleButton}`; + let finalButton = `${toggleButton}`; if (pageProperty === "explorer_mode") { finalButton = `${((value === "basic") ? onButtonSmall : offButtonSmall)}`; } @@ -114,6 +134,7 @@ on('ready', () => { //BUTTON: COLOR PICKETR CALLING BUTTON const colorButton = (pageOrToken, property, value) => { if (null === value) value = "transparent"; + if (property === "gridcolor" && !value.includes("#")) value = "#"+value; let finalButton = ` `; return finalButton; @@ -138,6 +159,21 @@ on('ready', () => { return finalButton; }; + //BUTTON: TOGGLE FOR CONFIG PROPERTIES + const toggleConfig = (value, configPropertyName) => { + let toggleButton = ''; + let buttonCode; + if (value=== true){ + toggleButton = onButtonSmall; + buttonCode = "!dltool --"+configPropertyName; +}else { + toggleButton = offButtonSmall; + buttonCode = "!dltool --"+configPropertyName; + } + let finalButton = `${toggleButton}`; + return finalButton; + }; + //BUTTON: GENERIC FOR DLTOOL const dlButton = (label, link) => { @@ -307,14 +343,16 @@ on('ready', () => { }; //UTILITY INFO BLOCK - const utilityInfo = openSection + + let gmUtilityInfo = openSection + ((tokenData !== '') ? dlButton("Why can't this token see?", "!dltool --report|checklist") : dlButton("Why can't this token see?", "!dltool --report|checklist")) + + dlButton("Config", "!dltool --report|config") + dlButton("Other things to check for", "!dltool --checklist") + dlButton("Help Center", "https://help.roll20.net/hc/en-us/articles/360045793374-Dynamic-Lighting-Requirements-Best-Practices") + `  ` + dlButton("DL Report ", "!dltool --report") + ` | ` + dlButton("Vision", "!dltool --report|vision") + dlButton("Light", "!dltool --report|light") + dlButton("Page", "!dltool --report|page") + dlButton(" + ", "!dltool --report|extra") + + (isProd? "
Prod Wiz: "+dlButton("Main Menu ", "!prod") + " " +dlButton("Map Menu ", "!prod map") : "")+ `
`; - +let utilityInfo = gmUtilityInfo; on('chat:message', (msg) => { if ('api' !== msg.type) { @@ -361,6 +399,25 @@ on('ready', () => { return finalButton; }; + + //BUTTON: GRID PRESETS + const gridButton = (label, cellwidth, color, transparency, code) => { + let finalButton = ""; + let conditionalStyle = onStyle; + + if (pageData.get("grid_opacity") === transparency) { + conditionalStyle = onStyle; + + + finalButton = `${label}`; + } else { + finalButton = `${label}`; + } + return finalButton; + }; + + + const cellWidthButton = (label, value, code) => { let finalButton = ""; let conditionalStyle = onStyle; @@ -504,11 +561,11 @@ on('ready', () => { openSection + openSubhead + 'Token Vision Checklist
' + - ((tokenData.get("has_bright_light_vision")) ? label(`${go}${tokenName} has vision, but may require a light source. ` + ((lightData) ? `${tokenName} is in ${(lightData.total * 100).toFixed()}% total light` : ''), `Although this token has sight, it still may require a light source from itself or an outside source, or for page settings to grant daylight.`) : label(`${stop}${tokenName} has its vision turned off. It cannot see.` + `
` + ((playerIsGM(msg.playerid)) ? toggleToken(tokenData.get("has_bright_light_vision"), "has_bright_light_vision", "!token-mod --set has_bright_light_vision|off has_night_vision|off", "!token-mod --set has_bright_light_vision|on has_limit_field_of_vision|false") + ' Vision' : '') + '
', `Without sight turned on, a token cannot utilize dynamic lighting. This is the recommended setting for most NPCs. Too many tokens with sight on the VTT can lead to confusing areas of apparent brightness for the GM`)) + `
` + + ((tokenData.get("has_bright_light_vision")) ? label(`${go}${tokenName} has vision, but may require a light source. ` + ((lightData) ? `${tokenName} is in ${(lightData.total * 100).toFixed()}% total light` : ''), `Although this token has sight, it still may require a light source from itself or an outside source, or for page settings to grant daylight.`) : label(`${stop}${tokenName} has its vision turned off. It cannot see.` + `
` + ((playerIsGM(msg.playerid) || state.DLTool.playersCanChecklist) ? toggleToken(tokenData.get("has_bright_light_vision"), "has_bright_light_vision", "!token-mod --set has_bright_light_vision|off has_night_vision|off", "!token-mod --set has_bright_light_vision|on has_limit_field_of_vision|false") + ' Vision' : '') + '
', `Without sight turned on, a token cannot utilize dynamic lighting. This is the recommended setting for most NPCs. Too many tokens with sight on the VTT can lead to confusing areas of apparent brightness for the GM`)) + `
` + ((tokenData.get("night_vision_distance") !== 0) ? - ((tokenData.get("has_night_vision")) ? label(`${go}${tokenName} has ${tokenData.get("night_vision_distance")}ft of Night Vision, and does not require a light source`, `You may still need to check if it has a non-zero distance on its night vision. Certain modes may affect how it interacts with existing light. For instance, Nocturnal mode can change dim light to bright within the token's Night Vision range.`) : label(`${caution}${tokenName} has Night Vision turned off. It cannot see without a light source.`, `Night Vision allows a token to see without a light source.`) + `
` + ((playerIsGM(msg.playerid)) ? toggleToken(tokenData.get("has_night_vision"), "has_night_vision", "!token-mod --set has_bright_light_vision|on has_night_vision|off", "!token-mod --set has_bright_light_vision|on has_night_vision|on night_vision_effect|nocturnal") + ' Night Vision' : '') + '
') : + ((tokenData.get("has_night_vision")) ? label(`${go}${tokenName} has ${tokenData.get("night_vision_distance")}ft of Night Vision, and does not require a light source`, `You may still need to check if it has a non-zero distance on its night vision. Certain modes may affect how it interacts with existing light. For instance, Nocturnal mode can change dim light to bright within the token's Night Vision range.`) : label(`${caution}${tokenName} has Night Vision turned off. It cannot see without a light source.`, `Night Vision allows a token to see without a light source.`) + `
` + ((playerIsGM(msg.playerid) || state.DLTool.playersCanChecklist) ? toggleToken(tokenData.get("has_night_vision"), "has_night_vision", "!token-mod --set has_bright_light_vision|on has_night_vision|off", "!token-mod --set has_bright_light_vision|on has_night_vision|on night_vision_effect|nocturnal") + ' Night Vision' : '') + '
') : ((tokenData.get("has_night_vision")) ? label(`${stop}${tokenName} has Night Vision, but the distance is set for ${tokenData.get("night_vision_distance")}ft. It can see light sources, but if you wish it to see in the dark, you must specify a distance.`, `Certain modes may affect how it interacts with existing light. For instance, Nocturnal mode can change dim light to bright within the token's Night Vision range.`) : label(`${caution}${tokenName} has Night Vision turned off. It cannot see without a light source.`, `Night Vision allows a token to see without a light source.`)) ) + `
` + @@ -522,7 +579,7 @@ on('ready', () => { `${caution}This token has no specified controller. Only the GM can use it for dynamic lighting vision, by pressing Cmd/Ctrl-L.`) ) + `
` + ((tokenData.get("lightColor") !== "transparent" && tokenData.get("has_night_vision")) ? label(`${caution}${tokenName} is emitting tinted light, but also has Night Vision. Night Vision trumps tinted light, and the color will not appear within its limits.`, `Colored light should be used sparingly. It interacts in unexpected ways with other light sources and with night vision. Colored vision is not recommended.`) + `
` : ``) + - ((tokenData.get("limit_field_of_vision_total") < 360 && tokenData.get("has_limit_field_of_vision")) ? label(`${caution}${tokenName} has a limited field of vision. It is directional and may not show entire area around token. If the directional value is set to 0, the token will not be able to see anything. ` + ((playerIsGM(msg.playerid)) ? `You can turn OFF limited field of view with this switch, but due to a Roll20 bug, you will need to open and close the token settings manually for it to take effect.
` + toggleToken(tokenData.get("has_limit_field_of_vision"), "has_limit_field_of_vision", "!token-mod --set has_limit_field_of_vision|off", "!token-mod --set has_limit_field_of_vision|on") + ' Turn off Limited Field of View  ' : ``), `Turn this off to restore a full field of view to the token.`) + `
` : ``) + + ((tokenData.get("limit_field_of_vision_total") < 360 && tokenData.get("has_limit_field_of_vision")) ? label(`${caution}${tokenName} has a limited field of vision. It is directional and may not show entire area around token. If the directional value is set to 0, the token will not be able to see anything. ` + ((playerIsGM(msg.playerid) || state.DLTool.playersCanChecklist) ? `You can turn OFF limited field of view with this switch, but due to a Roll20 bug, you will need to open and close the token settings manually for it to take effect.
` + toggleToken(tokenData.get("has_limit_field_of_vision"), "has_limit_field_of_vision", "!token-mod --set has_limit_field_of_vision|off", "!token-mod --set has_limit_field_of_vision|on") + ' Turn off Limited Field of View  ' : ``), `Turn this off to restore a full field of view to the token.`) + `
` : ``) + ((tokenData.get("layer") === "walls") ? `${caution}This token is on the Dynamic Lighting layer.
Dynamic Lighting will only work for the GM, by using Cmd/Ctrl-L, but players are only able to access tokens on the Token layer.
Light emitted by tokens on the Dynamic Lighting Layer can be seen by tokens on the Token layer. ${dlButton("Move token to Token Layer", "!token-mod --set layer|objects")}
` : '') + @@ -536,10 +593,10 @@ on('ready', () => { ) + // ID of page the sender is on : ID of GMPlayers on this page - ((getPageForPlayer(msg.playerid) === getPageForPlayer(getGMPlayers(getPageForPlayer(msg.playerid)))) ? `` : `${caution} GM is either not logged in, or is not on the same page this token is on. If testing vision or light for token against the GM's report, please make sure that both GM and player are on the same page, and that the token has not been split from the party.
`) + + // ((getPageForPlayer(msg.playerid) === getPageForPlayer(getGMPlayers(getPageForPlayer(msg.playerid)))) ? `` : `${caution} GM is either not logged in, or is not on the same page this token is on. If testing vision or light for token against the GM's report, please make sure that both GM and player are on the same page, and that the token has not been split from the party.
`) + - ((playerIsGM(msg.playerid)) ? dlButton("Token settings don't stick?", "!dltool --default") : '') + + (((playerIsGM(msg.playerid) || state.DLTool.playersCanChecklist)) ? dlButton("Token settings don't stick?", "!dltool --default") : '') + `${HR}Key:
` + @@ -643,9 +700,9 @@ on('ready', () => { toggle("small", pageData.get("lightupdatedrop"), "lightupdatedrop") + ' Update on Drop' + ' ' + toggle("small", pageData.get("explorer_mode"), "explorer_mode") + ' Explorer Mode' + '
' + HR + `${label("Daylight Presets:", "When Daylight Mode is on, tokens with Vision do not need specific light sources in able to see. These presets simulate regular daylight, a moonlit night, and a starlit night. Can also be used for buildings or dungeons with dim interiors.")} ` + - `` + daylightButton("Day", 100, "!dltool --daylight_mode_enabled|true" + repeatCommand + " --daylightModeOpacity|100") + `` + - `` + daylightButton("Moon", 50, "!dltool --daylight_mode_enabled|true" + repeatCommand + " --daylightModeOpacity|50") + `` + - `` + daylightButton("Star", 20, "!dltool --daylight_mode_enabled|true" + repeatCommand + " --daylightModeOpacity|20") + `` + + `` + daylightButton("Day", 100, "!dltool --daylight_mode_enabled|true" + " !dltool --daylightModeOpacity|100") + `` + + `` + daylightButton("Moon", 50, "!dltool --daylight_mode_enabled|true" + " !dltool --daylightModeOpacity|50") + `` + + `` + daylightButton("Star", 20, "!dltool --daylight_mode_enabled|true" + " !dltool --daylightModeOpacity|20") + `` + `
`; @@ -710,6 +767,15 @@ on('ready', () => { `` + cellWidthButton("6", "0.16666", "!dltool --snapping_increment|0.16666") + `` + `` + cellWidthButton("7", "0.142857", "!dltool --snapping_increment|0.142857") + `` + `` + cellWidthButton("8", "0.125", "!dltool --snapping_increment|0.125") + `` + + '
Cell Width: ' + + setValue(pageData.get("snapping_increment"), "snapping_increment", "!dltool-mod --snapping_increment|?{Input positive number?|1}") + + (isProd ? + HR + + openRolll20Subhead + `Roll 20 CNV
`+ + dlButton("Toggle Buddy", "!prod map buddy") + dlButton("Split Path", "!pathSplit") +'
' + + `${label("Grid Presets:", "Grid Presets.")}
` + + gridButton("standard","1", "#COCOCO", "0.5", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|C0C0C0" + " !dltool-mod --grid_opacity|0.5") + gridButton("weak","1", "#000000", "0.1", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|000000" + " !dltool-mod --grid_opacity|0.1") + gridButton("medium","1", "#000000", "0.1", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|000000" + " !dltool-mod --grid_opacity|0.3") + gridButton("Strong","1", "#000000", "0.5", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|000000" + " !dltool-mod --grid_opacity|0.5") + `
` + gridButton("Invisible","1", "#000000", "0", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|000000" + " !dltool-mod --grid_opacity|0") + gridButton("Template","0.125", "000000", "0.25", "!dltool --snapping_increment|0.125" + " !dltool --gridcolor|FF00FF" + " !dltool --grid_opacity|0.25") + : "")+ `
`; @@ -720,10 +786,37 @@ on('ready', () => { 'Often a map will have a printed scale that does not correspond to a grid setting. This is typically true of city and overland maps. To set the page scale to correspond to the printed scale, first use the Measurement Tool to measure the printed scale. You may need to hold down the alt/opt key to avoid snapping and get a precise measurement. Remember this number, then press the button below and enter that number into the dialog box.
' + dlButton("set scale", "!dltool-mod --scale_number|[[(round((" + pageData.get("scale_number") + "/?{Input value measured from printed scale})*?{Input value as displayed on printed scale}*100))/100]]") + " " + setValue(pageData.get("scale_units"), "scale_units", "!dltool-mod --scale_units|?{Input type of unit, example: mi for miles|mi}") + ' ' + ``; + + configInfo = + openSection + + openSubhead + 'Configuration' + + 'Use the buttons below to grant specific permissions to the players in your campaign.
' + + toggleConfig(state.DLTool.playersCanSight, "playersCanSight") + "Players can set their token's Vision
" + + toggleConfig(state.DLTool.playersCanLight, "playersCanLight") + "Players can set their token's Light
" + + toggleConfig(state.DLTool.playersCanChecklist, "playersCanChecklist") + "Players can use active Checklist
" + + ``; + //Blanks out info for players if not allowed. + tokenInfo = (!state.DLTool.playersCanSight && !playerIsGM(msg.playerid) ? '' : tokenInfo); + lightInfo = (!state.DLTool.playersCanLight && !playerIsGM(msg.playerid) ? '' : lightInfo); + pageInfo = (!playerIsGM(msg.playerid) ? '' : pageInfo); + pagePlusInfo = (!playerIsGM(msg.playerid) ? '' : pagePlusInfo); + if (playerIsGM(msg.playerid)) { + utilityInfo = gmUtilityInfo; + } else { + utilityInfo = openSection + + ((tokenData !== '') ? dlButton("Why can't this token see?", "!dltool --report|checklist") : dlButton("Why can't this token see?", "!dltool --report|checklist")) + '
' + + dlButton("DL Report ", "!dltool --report") + ` | ` + + (!state.DLTool.playersCanSight && !playerIsGM(msg.playerid) ? '' : dlButton("Vision", "!dltool --report|vision")) + + (!state.DLTool.playersCanLight && !playerIsGM(msg.playerid) ? '' : dlButton("Light", "!dltool --report|light")) + + `` + }; + + //Determines which report to send + if (undefined === theOption) { lines = openHeader + 'Dynamic Lighting Tool' + `` + tokenInfo + lightInfo + pageInfo + utilityInfo + @@ -756,6 +849,11 @@ on('ready', () => { scaleInfo + utilityInfo + ''; break; + case "config": + lines = openHeader + 'Dynamic Lighting Tool' + `` + + ((playerIsGM(msg.playerid) || msg.playerid === "API") ? configInfo + gmUtilityInfo : "You must be a GM in order to configure this script") + + ''; + break; default: lines = openHeader + 'Dynamic Lighting Tool' + `` + checklistTokenInfo + utilityInfo + @@ -764,9 +862,11 @@ on('ready', () => { } - let toWhom = '/w gm '; + let toWhom = (msg.playerid !=='API' ? '/w "' + getObj("player",msg.playerid).get("_displayname") + '" ' : '/w gm '); - if (!playerIsGM(msg.playerid)) { + + /* + if (!playerIsGM(msg.playerid)) { lines = openHeader + 'Dynamic Lighting Tool' + `` + checklistTokenInfo + @@ -774,6 +874,7 @@ on('ready', () => { toWhom = '/w ' + getObj("player", msg.playerid).get("_displayname") + ' '; } + */ sendChat('DL Tool', toWhom + openReport + lines + closeReport, null, { noarchive: true @@ -800,6 +901,7 @@ on('ready', () => { `${openSection}${openSubhead}Three Ways to Set a Default Token${spacer}1) From the Token Settings
Open the token's Token Settings panel. Click the "Update Default Token" button.
${HR}2) From the Journal
Open the journal for the character the token represents. Click the "Edit" button in the upper right corner. On the edit screen, there are three buttons.
${pictos('L')} Edit Token Properties: Calls up the Token Settings panel for making other changes you wish to become new defaults.

${pictos('L')} Use Selected Token: Sets the selected token as the new default token for that journal.
${pictos('L')} Apply Token Defaults: Overwrites all tokens in play that represent this character to the new defaults. Caution: if you have edited tokens on the board (say, by numbering them), this can overwrite those changes.${HR}3) ${dlButton("Save Token as Default", "!token-mod --set defaulttoken")}`; //theMessage = '' + theMessage + ''; + sendChat('DLTool', '/w gm ' + openReport + theMessage + utilityInfo + closeReport, null, { noarchive: true }); @@ -824,12 +926,32 @@ on('ready', () => { } - sendChat('DLTool', '/w gm ' + openReport + openHeader + 'Dynamic Lighting Tool' + openSection + theMessage + closeReport + utilityInfo + closeReport, null, { noarchive: true }); } break; + + case 'playersCanSight': + if (true){ + if (state.DLTool.playersCanSight ? state.DLTool.playersCanSight=false : state.DLTool.playersCanSight=true); + } + sendChat('DLTool', '!dltool --report|config'); + break; + + case 'playersCanLight': + if (true){ + if (state.DLTool.playersCanLight ? state.DLTool.playersCanLight=false : state.DLTool.playersCanLight=true); + } + sendChat('DLTool', '!dltool --report|config'); + break; + + case 'playersCanChecklist': + if (true){ + if (state.DLTool.playersCanChecklist ? state.DLTool.playersCanChecklist=false : state.DLTool.playersCanChecklist=true); + } + sendChat('DLTool', '!dltool --report|config'); + break; case 'fog_opacity': From 8c8df8df93148e5a4cb8900fed28809a5f936e8c Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 10 Apr 2025 00:02:20 -0700 Subject: [PATCH 02/13] Create dltool.js Added configuration system for player permissions --- Dynamic Lighting Tool/1.0.9/dltool.js | 1152 +++++++++++++++++++++++++ 1 file changed, 1152 insertions(+) create mode 100644 Dynamic Lighting Tool/1.0.9/dltool.js diff --git a/Dynamic Lighting Tool/1.0.9/dltool.js b/Dynamic Lighting Tool/1.0.9/dltool.js new file mode 100644 index 0000000000..13325562d7 --- /dev/null +++ b/Dynamic Lighting Tool/1.0.9/dltool.js @@ -0,0 +1,1152 @@ +//#################################### +// Dynamic Lighting Tool +// Also available through one-click +// https://app.roll20.net/forum/post/11316788/script-dltool-a-dynamic-lighting-control-panel-and-troubleshooter +// Video https://youtu.be/hANQr07uhFM?si=RBdG1kaXJygZiUeV&t=228 +//author: KeithCurtis +//#################################### + +var API_Meta = API_Meta || {}; +API_Meta.dltool = { + offset: Number.MAX_SAFE_INTEGER, + lineCount: -1 +}; { + try { + throw new Error(''); + } catch (e) { + API_Meta.dltool.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (15)); + } +} +/* globals checkLightLevel */ +on('ready', () => { + const version = '1.0.8'; + log('-=> Dynamic Lighting Tool v' + version + ' is loaded. Base command is !dltool'); + + if (!_.has(state, 'DLTool')) { + state.DLTool = { + playercCanVision: false, + playercCanLight: false, + playercCanChecklist: false, + }; +} + + const processInlinerolls = (msg) => { + if(msg.hasOwnProperty('inlinerolls')){ + return msg.inlinerolls + .reduce((m,v,k) => { + let ti=v.results.rolls.reduce((m2,v2) => { + if(v2.hasOwnProperty('table')){ + m2.push(v2.results.reduce((m3,v3) => [...m3,(v3.tableItem||{}).name],[]).join(", ")); + } + return m2; + },[]).join(', '); + return [...m,{k:`$[[${k}]]`, v:(ti.length && ti) || v.results.total || 0}]; + },[]) + .reduce((m,o) => m.replace(o.k,o.v), msg.content); + } else { + return msg.content; + } + }; + + const getPageForPlayer = (playerid) => { + let player = getObj('player', playerid); + if (playerIsGM(playerid)) { + return player.get('lastpage') || Campaign().get('playerpageid'); + } + + let psp = Campaign().get('playerspecificpages'); + if (psp[playerid]) { + return psp[playerid]; + } + + return Campaign().get('playerpageid'); + }; + + + + const L = (o) => Object.keys(o).forEach(k => log(`${k} is ${o[k]}`)); + const decodeUnicode = (str) => str.replace(/%u[0-9a-fA-F]{2,4}/g, (m) => String.fromCharCode(parseInt(m.slice(2), 16))); + //tests for existence of ProdWiz in the sandbox + const isProd = state.hasOwnProperty('Roll20Pro'); + + + let cmdName = "!dltool"; + let theCommand = ''; + let theOption = ''; + let lines = ''; + let pageInfo = ''; + let tokenInfo = ''; + let lightInfo = ''; + let tokenData = ''; + let repeatCommand = ` !dltool`; + + const onButtonSmall = `
`; + const offButtonSmall = `
`; + const onButtonLarge = `
`; + const offButtonLarge = `
`; + let offStyle = `'background-color:#333; color:#ccc; text-decoration: none; text-transform: uppercase; font-weight:bold; font-size: 10px; border:0px solid transparent; border-radius:3px; margin: 2px 2px; padding:1px 6px; display:inline-block'`; + let onStyle = `'background-color:#3b0; color:#fff; text-decoration: none; text-transform: uppercase; font-weight:bold; font-size: 10px; border:0px solid transparent; border-radius:3px; margin: 2px 2px; padding:1px 6px; display:inline-block'`; + let disableStyle = `'background-color:#888; color:#fff; text-decoration: none; text-transform: uppercase; font-weight:bold; font-size: 10px; border:0px solid transparent; border-radius:3px; margin: 2px 3px; padding:1px 6px; display:inline-block'`; + const openSection = `
`; + const openHeader = `
`; + const openSubhead = `
`; + const openPageHead = `
`; + const openRolll20Subhead = `
`; + const openReport = `
`; + const closeReport = `
`; + const manualWarning = `S`; + + + const spacer = `
`; + const stop = `
`; + const caution = `
`; + const go = `
`; + const HR = `
`; + + + //BUTTON: TOGGLE FOR PAGE PROPERTIES + const toggle = (size, value, pageProperty) => { + //if (pageProperty === "daylight_mode_enabled"){log ("daylight_mode_enabled = " + value)}; + let toggleButton = ''; + if (size === "large" && (value === true || value === "true" || value === "basic")) { + toggleButton = onButtonLarge + } + if (size === "large" && value === false) { + toggleButton = offButtonLarge + } + if (size === "small" && (value === true || value === "true" || value === "basic")) { + toggleButton = onButtonSmall + } + if (size === "small" && value === false) { + toggleButton = offButtonSmall + } + + if (undefined === pageProperty) { + pageProperty = ''; + } + let finalButton = `${toggleButton}`; + if (pageProperty === "explorer_mode") { + finalButton = `${((value === "basic") ? onButtonSmall : offButtonSmall)}`; + } + return finalButton; + }; + + //BUTTON: COLOR PICKETR CALLING BUTTON + const colorButton = (pageOrToken, property, value) => { + if (null === value) value = "transparent"; + if (property === "gridcolor" && !value.includes("#")) value = "#"+value; + let finalButton = ` `; + return finalButton; + + }; + + //BUTTON: TOGGLE FOR TOKEN PROPERTIES + const toggleToken = (value, tokenProperty, offCode, onCode) => { + let toggleButton = ''; + let buttonCode; + if (value === true || value === "true" || value === "on") { + toggleButton = onButtonSmall; + buttonCode = offCode; + } else { + toggleButton = offButtonSmall; + buttonCode = onCode; + } + + if (undefined === tokenProperty) { + tokenProperty = ''; + } + let finalButton = `${toggleButton}`; + return finalButton; + }; + + //BUTTON: TOGGLE FOR CONFIG PROPERTIES + const toggleConfig = (value, configPropertyName) => { + let toggleButton = ''; + let buttonCode; + if (value=== true){ + toggleButton = onButtonSmall; + buttonCode = "!dltool --"+configPropertyName; +}else { + toggleButton = offButtonSmall; + buttonCode = "!dltool --"+configPropertyName; + } + let finalButton = `${toggleButton}`; + return finalButton; + }; + + + //BUTTON: GENERIC FOR DLTOOL + const dlButton = (label, link) => { + let finalButton = `${label}`; + return finalButton; + }; + + //BUTTON: SMALL INLINE BUTTON -- dropped, but keep if needed in future +/* const dlSmallButton = (label, link) => { + let finalButton = `${label}`; + return finalButton; + }; +*/ + + //BUTTON: TOKEN LIGHT PRESETS + const lightButton = (label, dimLight, brightLight, arc, onCode) => { + let totalLight = dimLight + brightLight; + let cautionText = ((label.includes("Bullseye")) ? " Due to a bug in the Roll20 Mod Script system, you may need to open and close the token settings manually for the changes to take effect." : ""); + let finalButton = ``; + let conditionalStyle = onStyle; + let conditonalLink = `!token-mod --set emits_bright_light|off emits_low_light|off light_angle|360${repeatCommand} --report`; + if (tokenData.get("low_light_distance") === totalLight && tokenData.get("bright_light_distance") === brightLight && tokenData.get("directional_bright_light_total") === arc) { + if (tokenData.get("emits_bright_light") === false) { + conditionalStyle = disableStyle; + conditonalLink = "!token-mod --set emits_bright_light|on emits_low_light|on light_angle|360" + repeatCommand + " --report"; + } + finalButton = `${label}`; + } else { + finalButton = `${label}`; + } + return finalButton; + }; + + const visionButton = (label, has_bright_light_vision, has_night_vision, night_vision_distance, hoverText) => { + let finalButton = ``; + let conditonalLink = `!token-mod --set emits_bright_light|off emits_low_light|off light_angle|360${repeatCommand} --report`; + + + if (tokenData.get("has_bright_light_vision") === has_bright_light_vision && tokenData.get("has_night_vision") === has_night_vision && tokenData.get("night_vision_distance") === night_vision_distance) { + conditonalLink = "!token-mod --set has_bright_light_vision|false has_night_vision|false " + repeatCommand; + finalButton = `${label}`; + } else { + conditonalLink = "!token-mod --set has_bright_light_vision|" + has_bright_light_vision + " has_night_vision|" + has_night_vision + " night_vision_distance|" + night_vision_distance + ((night_vision_distance === 60) ? " night_vision_effect|nocturnal" : " ") + repeatCommand; + finalButton = `${label}`; + + } + + + + return finalButton; + }; + + + + //SET VALUE BUTTON FOR ANY + const setValue = (value, property, setCode) => { + + //Edge cases and Roll20 bug correctors + if (value === '') { + value = "0"; + } + if (value === null) { + value = "None"; + } + if (value === undefined) { + value = " - "; + } + + let openTitle = ""; + let closeTitle = ""; + if (property === "night_vision_effect") { + + switch (value) { + case "None": + openTitle = ``; + closeTitle = ``; + break; + case "Nocturnal": + openTitle = ``; + closeTitle = ``; + break; + default: { + let dimmingDistance = parseFloat(tokenData.get('night_vision_effect').replace(/^Dimming_/, '')) || 0; + dimmingDistance = Math.round(dimmingDistance * tokenData.get('night_vision_distance')); + openTitle = ``; + closeTitle = `
` + + `Dimming Distance starts at: ${openTitle}${dimmingDistance}${closeTitle}`; + value = "Dimming"; + } + } + } + + if (property === "fog_opacity" || property === "daylightModeOpacity" || property === "dim_light_opacity") { + value = value * 100; //for display. We want the user to see percentages, not decimals + } + + + + let finalButton = `${openTitle}${value}${closeTitle}`; + return finalButton; + }; + + //GENERATES A LABEL WITH HOVERTEXT + const label = (phrase, helptext) => { + let finalLabel = `${phrase}`; + return finalLabel; + }; + + + //GENERATES PICTOS CHARACTER + const pictos = (character, color) => { + let pictosChar = `${character}`; + return pictosChar; + }; + + //GENERATES Arc of Light + const lightArc = (degrees) => { + let imgPosition = `style= "position:relative; top:-2px;" `; + let finalButton = ""; + if (degrees < 361) { + finalButton = ``; + } + if (degrees < 290) { + + finalButton = ``; + } + if (degrees < 220) { + finalButton = ``; + } + if (degrees < 150) { + finalButton = ``; + } + if (degrees === 0) { + finalButton = ``; + } + + + return finalButton; + }; + + + const getGMPlayers = (pageid) => findObjs({ + type: 'player' + }) + .filter((p) => playerIsGM(p.id)) + .filter((p) => undefined === pageid || p.get('lastpage') === pageid) + .map(p => p.id); + + + + + //BECAUSE ROLL20 + const stringToBoolean = function(string) { + switch (string.toLowerCase().trim()) { + case "true": + case "yes": + case "1": + return true; + case "false": + case "no": + case "0": + case null: + return false; + default: + return Boolean(string); + } + }; + + //UTILITY INFO BLOCK + let gmUtilityInfo = openSection + + ((tokenData !== '') ? dlButton("Why can't this token see?", "!dltool --report|checklist") : dlButton("Why can't this token see?", "!dltool --report|checklist")) + + dlButton("Config", "!dltool --report|config") + + dlButton("Other things to check for", "!dltool --checklist") + + dlButton("Help Center", "https://help.roll20.net/hc/en-us/articles/360045793374-Dynamic-Lighting-Requirements-Best-Practices") + `  ` + + dlButton("DL Report ", "!dltool --report") + ` | ` + dlButton("Vision", "!dltool --report|vision") + dlButton("Light", "!dltool --report|light") + dlButton("Page", "!dltool --report|page") + dlButton(" + ", "!dltool --report|extra") + + (isProd? "
Prod Wiz: "+dlButton("Main Menu ", "!prod") + " " +dlButton("Map Menu ", "!prod map") : "")+ + `
`; + +let utilityInfo = gmUtilityInfo; + + on('chat:message', (msg) => { + if ('api' !== msg.type) { + return; + } + + msg.content = processInlinerolls(msg); + + let msgTxt = msg.content; + repeatCommand = ` !dltool`; + let pageData = getObj('page', getPageForPlayer(msg.playerid)); + if (msg.content.match(/report\|extra/m)) { + repeatCommand = ` !dltool --report|extra`; + } + if (msg.content.match(/report\|setscale/m)) { + repeatCommand = ` !dltool --report|setscale`; + } + if (msg.content.match(/report\|light/m)) { + repeatCommand = ` !dltool --report|light`; + } + if (msg.content.match(/report\|vision/m)) { + repeatCommand = ` !dltool --report|vision`; + } + if (msg.content.match(/report\|page/m)) { + repeatCommand = ` !dltool --report|page`; + } + //let repeatCommandChecklist = ` !dltool --report|checklist`; + + + //BUTTON: DAYLIGHT PRESETS + const daylightButton = (label, value, code) => { + let finalButton = ""; + let conditionalStyle = onStyle; + + if (pageData.get("daylightModeOpacity") * 100 === value) { + if (pageData.get("daylight_mode_enabled") === false) { + conditionalStyle = disableStyle; + } + + finalButton = `${label}`; + } else { + finalButton = `${label}`; + } + return finalButton; + }; + + + //BUTTON: GRID PRESETS + const gridButton = (label, cellwidth, color, transparency, code) => { + let finalButton = ""; + let conditionalStyle = onStyle; + + if (pageData.get("grid_opacity") === transparency) { + conditionalStyle = onStyle; + + + finalButton = `${label}`; + } else { + finalButton = `${label}`; + } + return finalButton; + }; + + + + const cellWidthButton = (label, value, code) => { + let finalButton = ""; + let conditionalStyle = onStyle; + + if (pageData.get("snapping_increment") === value) { + if (pageData.get("snapping_increment") !== value) { + conditionalStyle = disableStyle; + } + finalButton = `${label}`; + } else { + finalButton = `${label}`; + } + return finalButton; + }; + + + + + //MESSAGE HANDLING + // if ((msg.type == "api" && msgTxt.indexOf(cmdName) !== -1 && playerIsGM(msg.playerid)) || (msgTxt === "!dltool --pcchecklist")) { + if (msg.type == "api" && msgTxt.indexOf(cmdName) !== -1) { + let APIMessage = msg.content; + if (APIMessage === "!dltool" || APIMessage === "!dltools") { + APIMessage = "!dltool --report"; + } + let args = APIMessage.split(/\s--/); + + // let commands = args[1].split(/\s+/); + + let commands = args[1].match(/(?:[^\s"]+|"[^"]*")+/g); + + + + let theMessage = args[2]; + let checkLightButton = ""; + tokenData = ''; + if (msg.selected) { + tokenData = getObj('graphic', msg.selected[0]._id); + if(!tokenData) { + tokenData =''; + } + } + pageData.set('force_lighting_refresh', true); + + + commands.forEach(c => { + theCommand = c.split(/\|/)[0]; + theOption = c.split(/\|/)[1]; + + let checklistTokenInfo; + let pagePlusInfo; + let scaleInfo; + + //CASES FOR COMMANDS + + switch (theCommand) { + + //CASE - REPORT + case 'report': { + + //FULL REPORT + + //VISION SECTON + if (tokenData !== '') { + let lightData = ''; + if (typeof checkLightLevel !== "undefined") { + lightData = checkLightLevel.isLitBy(tokenData.get("id")); + checkLightButton = HR + + "" + `` + "Token is in " + (lightData.total * 100).toFixed() + "% total light " + + dlButton("Report", "!checklight"); + + } else { + checkLightButton = '
' + dlButton("Check Amount of Light on the Token", "!dltool --message --If you want this functionality, you will need to install checkLightLevel, an external script by Oosh. You can find it in One Click install on your Mod page."); + } + let controllerNames = ""; + let controllers = ''; + let char = false; + if (tokenData.get("represents")) { + char = ((tokenData.get("represents")) ? getObj("character", tokenData.get("represents")) : false); + } else { + char = false; + } + if (char) { + controllers = char.get("controlledby").split(","); + if (char.get("controlledby")) { + controllers.forEach(c => { + controllerNames = controllerNames + ((c === "all") ? "All players" : getObj("player", c).get("_displayname")) + " • "; + }); + } + } else { + controllers = tokenData.get("controlledby").split(","); + if (tokenData.get("controlledby")) { + controllers.forEach(c => { + controllerNames = controllerNames + ((c === "all") ? "All players" : getObj("player", c).get("_displayname")) + " • "; + }); + + } + } + + + controllerNames = controllerNames + "•"; + controllerNames = controllerNames.split(" • •")[0].replace(/\s•\s/g, ", ").replace(/•/, ""); + if (controllerNames === '')(controllerNames = "None (GM only by default)"); + let tokenName = (tokenData.get("name") || "unnamed"); + + //REGULAR REPORT + tokenInfo = + openSection + + openSubhead + 'Token Vision
' + + openPageHead + '"' + tokenName + '" ' + ((char) ? ' (' + char.get("name") + ')' : '(generic)') + '
Controllers: ' + controllerNames + '
' + + toggleToken(tokenData.get("has_bright_light_vision"), "has_bright_light_vision", "!token-mod --set has_bright_light_vision|off has_night_vision|off", "!token-mod --set has_bright_light_vision|on has_limit_field_of_vision|false") + ' Vision  ' + '
' + + toggleToken(tokenData.get("has_night_vision"), "has_night_vision", "!token-mod --set has_bright_light_vision|on has_night_vision|off", "!token-mod --set has_bright_light_vision|on has_night_vision|on night_vision_effect|nocturnal") + ' Night Vision ' + + setValue(tokenData.get("night_vision_distance"), "night_vision_distance", "!token-mod --set has_bright_light_vision|on has_night_vision|on night_vision_effect|nocturnal night_vision_distance|?{Input new Night Vision distance in feet}") + "ft " + + ((tokenData.get("has_night_vision") && tokenData.get("night_vision_distance") < 1) ? `*` : "") + + '
' + + + + ' Tint:' + setValue(tokenData.get("night_vision_tint"), "night_vision_tint", "!token-mod --set night_vision_tint|?{Use sparingly. May interact poorly with colored light. Input in hex, rgb or hsv format.|transparent}") + " " + + colorButton("token", "night_vision_tint", tokenData.get('night_vision_tint')) + + + //`
 
` + + + + ` Mode: ` + setValue(tokenData.get("night_vision_effect"), "night_vision_effect", "!token-mod --set night_vision_effect|?{Choose Mode|None,None|Nocturnal,Nocturnal|Dimming,Dimming } ") + `
` + + + + toggleToken(tokenData.get("has_limit_field_of_vision"), "has_limit_field_of_vision", "!token-mod --set has_limit_field_of_vision|off", "!token-mod --set has_limit_field_of_vision|on") + ' Field of Vision  ' + + ` ` + setValue(tokenData.get("limit_field_of_vision_total"), "limit_field_of_vision_total", "!token-mod --set limit_field_of_vision_total|?{Input arc of light in degrees}") + "° Arc " + + lightArc(tokenData.get("limit_field_of_vision_total")) + ` ${manualWarning}` + '
' + + checkLightButton + HR + + `${label("Vision Presets:", "These buttons will handle the most common vision cases for DnD 5e.")}
` + + visionButton("normal", true, false, tokenData.get("night_vision_distance"), "Standard vision for humans and other characters without darkvision") + " | " + visionButton("Darkvision 60ft", true, true, 60, "Standard darkvision for most characters with this trait") + visionButton("90", true, true, 90, "Many monsters have 90ft of darkvision. Example: Trolls or Night Hags") + visionButton("120", true, true, 120, "Enhanced darkvision used by races such as Drow or Duergar") + + `
`; + + + //CHECKLIST REPORT + + let lightOnTOken = ((lightData) ? lightData.total : -1); + + checklistTokenInfo = + openSection + + openSubhead + 'Token Vision Checklist
' + + + ((tokenData.get("has_bright_light_vision")) ? label(`${go}${tokenName} has vision, but may require a light source. ` + ((lightData) ? `${tokenName} is in ${(lightData.total * 100).toFixed()}% total light` : ''), `Although this token has sight, it still may require a light source from itself or an outside source, or for page settings to grant daylight.`) : label(`${stop}${tokenName} has its vision turned off. It cannot see.` + `
` + ((playerIsGM(msg.playerid) || state.DLTool.playersCanChecklist) ? toggleToken(tokenData.get("has_bright_light_vision"), "has_bright_light_vision", "!token-mod --set has_bright_light_vision|off has_night_vision|off", "!token-mod --set has_bright_light_vision|on has_limit_field_of_vision|false") + ' Vision' : '') + '
', `Without sight turned on, a token cannot utilize dynamic lighting. This is the recommended setting for most NPCs. Too many tokens with sight on the VTT can lead to confusing areas of apparent brightness for the GM`)) + `
` + + + + ((tokenData.get("night_vision_distance") !== 0) ? + ((tokenData.get("has_night_vision")) ? label(`${go}${tokenName} has ${tokenData.get("night_vision_distance")}ft of Night Vision, and does not require a light source`, `You may still need to check if it has a non-zero distance on its night vision. Certain modes may affect how it interacts with existing light. For instance, Nocturnal mode can change dim light to bright within the token's Night Vision range.`) : label(`${caution}${tokenName} has Night Vision turned off. It cannot see without a light source.`, `Night Vision allows a token to see without a light source.`) + `
` + ((playerIsGM(msg.playerid) || state.DLTool.playersCanChecklist) ? toggleToken(tokenData.get("has_night_vision"), "has_night_vision", "!token-mod --set has_bright_light_vision|on has_night_vision|off", "!token-mod --set has_bright_light_vision|on has_night_vision|on night_vision_effect|nocturnal") + ' Night Vision' : '') + '
') : + ((tokenData.get("has_night_vision")) ? label(`${stop}${tokenName} has Night Vision, but the distance is set for ${tokenData.get("night_vision_distance")}ft. It can see light sources, but if you wish it to see in the dark, you must specify a distance.`, `Certain modes may affect how it interacts with existing light. For instance, Nocturnal mode can change dim light to bright within the token's Night Vision range.`) : label(`${caution}${tokenName} has Night Vision turned off. It cannot see without a light source.`, `Night Vision allows a token to see without a light source.`)) + ) + `
` + + + + ((tokenData.get("represents") && typeof getObj('character', tokenData.get("represents")) !== "undefined") ? + ((controllerNames !== "None (GM only by default)") ? + `${go}This token represents the character ${char.get("name")}, and is under the control of the following players: ${controllerNames}. They are the only ones who can use this token for dynamic lighting.` : + label(`${caution}This token represents the character ${char.get("name")}, but has no specified controller. Only the GM can use it for dynamic lighting vision, by pressing Cmd/Ctrl-L.`, `It does not represent a character sheet. If you are setting up a PC, be sure to assign the sheet to the token before saving this as the default token for the sheet. Saving as default should always be the last step. If this is meant to be an NPC it is fine as-is, but you may want to consider assigning control to the GM to avoid some transparency issues when using Exploration Mode.`)) : + ((controllerNames !== "None (GM only by default)") ? + `${caution}This generic token is under the control of the following players: ${controllerNames}. They are the only ones who can use this token for dynamic lighting. It does not represent a character sheet. If you are setting up a PC, be sure to make all settings and assign the sheet to the token before saving this as the default token for the sheet. Saving as default should always be the last step.` : + `${caution}This token has no specified controller. Only the GM can use it for dynamic lighting vision, by pressing Cmd/Ctrl-L.`) + ) + `
` + + ((tokenData.get("lightColor") !== "transparent" && tokenData.get("has_night_vision")) ? label(`${caution}${tokenName} is emitting tinted light, but also has Night Vision. Night Vision trumps tinted light, and the color will not appear within its limits.`, `Colored light should be used sparingly. It interacts in unexpected ways with other light sources and with night vision. Colored vision is not recommended.`) + `
` : ``) + + ((tokenData.get("limit_field_of_vision_total") < 360 && tokenData.get("has_limit_field_of_vision")) ? label(`${caution}${tokenName} has a limited field of vision. It is directional and may not show entire area around token. If the directional value is set to 0, the token will not be able to see anything. ` + ((playerIsGM(msg.playerid) || state.DLTool.playersCanChecklist) ? `You can turn OFF limited field of view with this switch, but due to a Roll20 bug, you will need to open and close the token settings manually for it to take effect.
` + toggleToken(tokenData.get("has_limit_field_of_vision"), "has_limit_field_of_vision", "!token-mod --set has_limit_field_of_vision|off", "!token-mod --set has_limit_field_of_vision|on") + ' Turn off Limited Field of View  ' : ``), `Turn this off to restore a full field of view to the token.`) + `
` : ``) + + + + ((tokenData.get("layer") === "walls") ? `${caution}This token is on the Dynamic Lighting layer.
Dynamic Lighting will only work for the GM, by using Cmd/Ctrl-L, but players are only able to access tokens on the Token layer.
Light emitted by tokens on the Dynamic Lighting Layer can be seen by tokens on the Token layer. ${dlButton("Move token to Token Layer", "!token-mod --set layer|objects")}
` : '') + + ((tokenData.get("layer") === "gmlayer") ? `${stop}This token is on the GM layer.
Dynamic Lighting will not function on the GM layer, nor will any light sources provide light.
Players are only able to access tokens on the Token layer. ${dlButton("Move token to Token Layer", "!token-mod --set layer|objects")}
` : '') + + ((tokenData.get("layer") === "map") ? `${caution}This token is on the Map layer.
Dynamic Lighting will only work for the GM, by using Cmd/Ctrl-L.
Light emitted by tokens on the Dynamic Lighting Layer can be seen by tokens on the Token layer.
Players are only able to access tokens on the Token layer. ${dlButton("Move token to Token Layer", "!token-mod --set layer|objects")}
` : '') + + ((pageData.get("dynamic_lighting_enabled")) ? `${go}Dynamic Lighting is on. All Dynamic Lighting features should be available.` : `${stop}Dynamic Lighting is OFF for this page. No Dynamic Lighting features will function until this is turned on.` + ((playerIsGM(msg.playerid)) ? `
` + toggle("small", pageData.get("dynamic_lighting_enabled"), "dynamic_lighting_enabled") + ' Dynamic Lighting (May require game refresh)
' : ``)) + `
` + + + ((playerIsGM(msg.playerid)) ? + ((pageData.get("dynamic_lighting_enabled") && pageData.get("daylight_mode_enabled")) ? `${go}Daylight Mode is on. No tokens need a specific light source. Daylight Opacity level has been set for ${Math.round(pageData.get("daylightModeOpacity") * 100)}%. Low levels indicate a darker overall light.` : ((lightOnTOken === 0 && !tokenData.get("has_night_vision")) ? stop : caution) + `Daylight Mode is off. Any token without Night Vision will need to have line of sight to a specific light source. ` + ((lightData) ? `${tokenName} is in ${(lightData.total * 100).toFixed()}% total light${((tokenData.get("has_night_vision")) ? ", but has Night Vision." : ", and has no Night Vision. " + `
` + toggleToken(tokenData.get("has_night_vision"), "has_night_vision", "!token-mod --set has_bright_light_vision|on has_night_vision|off", "!token-mod --set has_bright_light_vision|on has_night_vision|on night_vision_effect|nocturnal") + ` Night Vision
`)} ` : '') + `
` + toggle("small", pageData.get("daylight_mode_enabled"), "daylight_mode_enabled") + ' Day Mode
') + `
` : + ((pageData.get("dynamic_lighting_enabled") && pageData.get("daylight_mode_enabled")) ? `${go}Daylight Mode is on. No tokens need a specific light source. Daylight Opacity level has been set for ${Math.round(pageData.get("daylightModeOpacity") * 100)}%. Low levels indicate a darker overall light.` : ((lightOnTOken === 0 && !tokenData.get("has_night_vision")) ? stop : caution) + `Daylight Mode is off. Any token without Night Vision will need to have line of sight to a specific light source. ` + ((lightData) ? `${tokenName} is in ${(lightData.total * 100).toFixed()}% total light${((tokenData.get("has_night_vision")) ? ", but has Night Vision." : ", and has no Night Vision. " )} ` : '')) + `
` + ) + + + // ID of page the sender is on : ID of GMPlayers on this page + // ((getPageForPlayer(msg.playerid) === getPageForPlayer(getGMPlayers(getPageForPlayer(msg.playerid)))) ? `` : `${caution} GM is either not logged in, or is not on the same page this token is on. If testing vision or light for token against the GM's report, please make sure that both GM and player are on the same page, and that the token has not been split from the party.
`) + + + + (((playerIsGM(msg.playerid) || state.DLTool.playersCanChecklist)) ? dlButton("Token settings don't stick?", "!dltool --default") : '') + + + + `${HR}Key:
` + + `${go} No problem.
` + + `${caution} Caution. This may give problems in some circumstances.
` + + `${stop} Problem that will likely prevent this token from using Dynamic Lighting.
` + + ``; + + checklistTokenInfo = checklistTokenInfo.replace(/ !dltool/g, " !dltool --report|checklist"); + + } else { + tokenInfo = `
No token is selected.
`; + checklistTokenInfo = `
No token is selected.
Please select a token and try again.
`; + } + + + //LIGHT SECTON + if (tokenData !== '') { + + lightInfo = openSection + + openSubhead + 'Token Light' + + spacer.replace(`margin:5px`, `margin:2px`) + + toggleToken(tokenData.get("emits_bright_light"), "emits_bright_light", "!token-mod --set emits_bright_light|off emits_low_light|off light_angle|360", "!token-mod --set emits_bright_light|on emits_low_light|on light_angle|360") + ' Light  ' + + `
` + '
' + + spacer.replace(`margin:5px`, `margin:1px`) + + 'Bright: ' + setValue(tokenData.get("bright_light_distance"), "bright_light_distance", "!token-mod --set emits_bright_light|on bright_light_distance|?{Input Bright light in feet}") + "ft " + + ' | Dim: ' + setValue(tokenData.get("low_light_distance") - tokenData.get("bright_light_distance"), "low_light_distance", "!token-mod --set emits_low_light|on low_light_distance|?{Input Bright light in feet}") + "ft " + + `Intensity: ${setValue(tokenData.get("dim_light_opacity"), "dim_light_opacity", "!token-mod --set dim_light_opacity|?{Set Brightness of Dim light|75}")}%` + + + + `
` + HR + + + //############ Use this section when Roll20 ads directional dim and bright light to the GUI + /* + `${label("Directional Light: ", "This section limits the arc of emited light, like a flashlight beam. You can set different values for bright and dim light. Due to a Roll20 bug, you may need to open an close the settings for the token for the change to take effect.")}
` + + toggleToken(tokenData.get("has_directional_bright_light"), "has_directional_bright_light", "!token-mod --set has_directional_bright_light|off", "!token-mod --set has_directional_bright_light|on") + ' Bright ' + + ` ` + setValue(tokenData.get("directional_bright_light_total"), "directional_bright_light_total", "!token-mod --set directional_bright_light_total|?{Input arc of light in degrees}") + "°" + + lightArc(tokenData.get("directional_bright_light_total")) + "   " + + toggleToken(tokenData.get("has_directional_dim_light"), "has_directional_dim_light", "!token-mod --set has_directional_dim_light|off", "!token-mod --set has_directional_dim_light|on") + ' Dim ' + + ` ` + setValue(tokenData.get("directional_dim_light_total"), "directional_dim_light_total", "!token-mod --set directional_dim_light_total|?{Input arc of light in degrees}") + "°" + + lightArc(tokenData.get("directional_dim_light_total")) + + */ + //############ Use this section when Roll20 ads directional dima and bright light to the GUI + + //############ Remove this section when Roll20 ads directional dima and bright light to the GUI + toggleToken(tokenData.get("has_directional_bright_light"), "has_directional_bright_light", "!token-mod --set has_directional_bright_light|off", "!token-mod --set has_directional_bright_light|on") + ' Directional Light ' + + ` ` + setValue(tokenData.get("directional_bright_light_total"), "directional_bright_light_total", "!token-mod --set directional_bright_light_total|?{Input arc of light in degrees}") + "° Arc " + + lightArc(tokenData.get("directional_bright_light_total")) + ' ' + manualWarning + '' + + //############ Use this section when Roll20 ads directional dima and bright light to the GUI + + + + '
' + + + `
` + + ' Color:' + setValue(tokenData.get("lightColor"), "lightColor", "!token-mod --set lightColor|?{Use sparingly. Input in hex, rgb or hsv format.|transparent}") + " " + + colorButton("token", "lightColor", tokenData.get('lightColor')) + + + '  Multiplier:' + setValue(tokenData.get("light_sensitivity_multiplier"), "light_sensitivity_multiplier", "!token-mod --set light_sensitivity_multiplier|?{Sometimes called Low Light Vision. 100% is recommended for most RPG systems|100}") + "% " + + `
` + `
` + + + HR + + `${label("Light Presets: ", "Presets for most common cases. These are geared toward 5e definitions, but are simple to redefine in the code. Clicking a preset name will also toggle the state of light being on or off. The preset will restored if you toggle the master token light switch off and on.")}
` + + lightButton("Spotlight", 0, 5, 360, "!token-mod --set emits_bright_light|on bright_light_distance|5 low_light_distance|0 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + lightButton("Candle", 5, 2, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|2 low_light_distance|5 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + lightButton("Lamp", 15, 15, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|15 low_light_distance|15 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + lightButton("Torch", 20, 20, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|20 low_light_distance|20 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + lightButton("Hooded Lantern", 30, 30, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|30 low_light_distance|30 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + "
" + lightButton("Bullseye Lantern " + pictos("!"), 60, 60, 90, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|60 low_light_distance|60 has_directional_bright_light|on directional_bright_light_total|90 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + "
" + + lightButton("Light", 20, 20, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|20 low_light_distance|20 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + lightButton("Daylight", 60, 60, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|60 low_light_distance|60 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + lightButton("Dancing Light", 10, 0, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|0 low_light_distance|10 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + lightButton("Faerie Fire", 10, 0, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|0 low_light_distance|10 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + lightButton("Flametongue", 40, 40, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|40 low_light_distance|40 has_directional_bright_light|off directional_bright_light_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + // lightButton("Gem of Brightness", 30, 30, 360, "!token-mod --set emits_bright_light|on emits_low_light|on bright_light_distance|30 low_light_distance|30 has_limit_field_of_vision|off limit_field_of_vision_total|360 dim_light_opacity|" + tokenData.get("dim_light_opacity")) + + ``; + + + + } else { + tokenInfo = `
No token is selected.
`; + } + + + //PAGE SECTON + pageInfo = + openSection + + openSubhead + 'Dynamic Lighting for Page' + + openPageHead + '"' + pageData.get("name") + '"' + + toggle("small", pageData.get("dynamic_lighting_enabled"), "dynamic_lighting_enabled") + ' Dynamic Lighting' + + '  ' + toggle("small", pageData.get("showdarkness"), "showdarkness") + ' Fog of War' + + + '
' + + ' GM Dark Opacity: ' + + setValue(pageData.get("fog_opacity"), "fog_opacity", "!dltool-mod --fog_opacity|?{Input value between 0 and 100?|35}") + "%
" + + + toggle("small", pageData.get("daylight_mode_enabled"), "daylight_mode_enabled") + ' Day Mode  ' + + setValue(pageData.get("daylightModeOpacity"), "daylightModeOpacity", "!dltool-mod --daylightModeOpacity|?{Input value between 0 and 100?|100}") + "%
" + + + toggle("small", pageData.get("lightrestrictmove"), "lightrestrictmove") + ' Barriers Restrict Movement' + manualWarning + '
' + + toggle("small", pageData.get("lightupdatedrop"), "lightupdatedrop") + ' Update on Drop' + ' ' + + toggle("small", pageData.get("explorer_mode"), "explorer_mode") + ' Explorer Mode' + '
' + + HR + `${label("Daylight Presets:", "When Daylight Mode is on, tokens with Vision do not need specific light sources in able to see. These presets simulate regular daylight, a moonlit night, and a starlit night. Can also be used for buildings or dungeons with dim interiors.")} ` + + `` + daylightButton("Day", 100, "!dltool --daylight_mode_enabled|true" + " !dltool --daylightModeOpacity|100") + `` + + `` + daylightButton("Moon", 50, "!dltool --daylight_mode_enabled|true" + " !dltool --daylightModeOpacity|50") + `` + + `` + daylightButton("Star", 20, "!dltool --daylight_mode_enabled|true" + " !dltool --daylightModeOpacity|20") + `` + + ``; + + + //PAGEPLUS SECTON + let diagonalType = pageData.get("diagonaltype"); + switch (pageData.get("diagonaltype")) { + case "foure": + diagonalType = "DnD 5e-4e"; + break; + case "pythagorean": + diagonalType = "Euclidean"; + break; + case "threefive": + diagonalType = "PF 1&2-Dnd3.5"; + break; + case "manhattan": + diagonalType = "Manhattan"; + break; + default: + diagonalType = pageData.get("diagonaltype"); + } + + + + pagePlusInfo = + openSection + + openSubhead + 'Additional Page Settings' + + + + + toggle("small", pageData.get("showgrid"), "showgrid") + ' Show Grid' + '
' + + 'Grid Opacity: ' + + setValue(pageData.get("grid_opacity"), "grid_opacity", "!dltool-mod --grid_opacity|?{Input value between 0 and 1?|1}") + + ' Color:' + setValue(pageData.get("gridcolor"), "gridcolor", `!dltool-mod --gridcolor|?{Input value in Hex format|}`) + ' ' + + colorButton("page", "gridcolor", pageData.get('gridcolor')) + '
' + + + 'Grid Type: ' + + setValue(pageData.get("grid_type"), "grid_type", "!dltool-mod --grid_type|?{Choose grid type|Square,square|Hex(V),hex|Hex(H),hexr|Dimetric,dimetric|Isometric,isometric}") + + (((pageData.get("grid_type") === "hex" || pageData.get("grid_type") === "hexr")) ? " " + toggle("small", pageData.get("gridlabels"), "gridlabels") + ' Show Labels' : "") + + (((pageData.get("grid_type") === "square")) ? "  Diag.: " + setValue(diagonalType, "diagonaltype", "!dltool-mod --diagonaltype|?{Choose diagonal measurement method type|Dnd5e-4e,foure |Pathfinder-DnD3.5,threefive|Euclidean,pythagorean|Manhattan,manhattan}") : "") + + '
' + + + 'Page scale: ' + + setValue(pageData.get("scale_number"), "scale_number", "!dltool-mod --scale_number|?{Input numerical measurement for one grid unit|5}") + ' ' + + setValue(pageData.get("scale_units"), "scale_units", "!dltool-mod --scale_units|?{Input type of unit, example: ft. for feet|ft.}") + ' ' + + dlButton("Get from map", "!dltool --report|setscale") + '
' + + + HR + + 'Background Color: ' + setValue(pageData.get("background_color"), "background_color", `!dltool-mod --background_color|?{Input value in Hex format|}`) + ' ' + + colorButton("page", "background_color", pageData.get("background_color")) + '
' + + + 'Change Name: ' + + setValue(pageData.get("name"), "name", "!dltool-mod --name|"?{Input new name for page|" + pageData.get("name") + "}"") + '
' + + + + HR + `${label("Cell Width Divisions:", "How many times is one cell divided. This is the same as setting the Cell Width in the Page Settings, but is perhaps more intuitive. 2 divisions is the same as setting the cell width to 0.5. 8 divisions corresonds to 0.125.")}
` + + `` + cellWidthButton("1", "1", "!dltool --snapping_increment|1") + `` + + `` + cellWidthButton("2", "0.5", "!dltool --snapping_increment|0.5") + `` + + `` + cellWidthButton("3", "0.33333", "!dltool --snapping_increment|0.33333") + `` + + `` + cellWidthButton("4", "0.25", "!dltool --snapping_increment|0.25") + `` + + `` + cellWidthButton("5", "0.2", "!dltool --snapping_increment|0.2") + `` + + `` + cellWidthButton("6", "0.16666", "!dltool --snapping_increment|0.16666") + `` + + `` + cellWidthButton("7", "0.142857", "!dltool --snapping_increment|0.142857") + `` + + `` + cellWidthButton("8", "0.125", "!dltool --snapping_increment|0.125") + `` + + '
Cell Width: ' + + setValue(pageData.get("snapping_increment"), "snapping_increment", "!dltool-mod --snapping_increment|?{Input positive number?|1}") + + (isProd ? + HR + + openRolll20Subhead + `Roll 20 CNV`+ + dlButton("Toggle Buddy", "!prod map buddy") + dlButton("Split Path", "!pathSplit") +'
' + + `${label("Grid Presets:", "Grid Presets.")}
` + + gridButton("standard","1", "#COCOCO", "0.5", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|C0C0C0" + " !dltool-mod --grid_opacity|0.5") + gridButton("weak","1", "#000000", "0.1", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|000000" + " !dltool-mod --grid_opacity|0.1") + gridButton("medium","1", "#000000", "0.1", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|000000" + " !dltool-mod --grid_opacity|0.3") + gridButton("Strong","1", "#000000", "0.5", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|000000" + " !dltool-mod --grid_opacity|0.5") + `
` + gridButton("Invisible","1", "#000000", "0", "!dltool-mod --snapping_increment|1" + " !dltool-mod --gridcolor|000000" + " !dltool-mod --grid_opacity|0") + gridButton("Template","0.125", "000000", "0.25", "!dltool --snapping_increment|0.125" + " !dltool --gridcolor|FF00FF" + " !dltool --grid_opacity|0.25") + : "")+ + ``; + + + //Set Map from scale + scaleInfo = + openSection + + openSubhead + 'Set Scale from Printed Measurement' + + 'Often a map will have a printed scale that does not correspond to a grid setting. This is typically true of city and overland maps. To set the page scale to correspond to the printed scale, first use the Measurement Tool to measure the printed scale. You may need to hold down the alt/opt key to avoid snapping and get a precise measurement. Remember this number, then press the button below and enter that number into the dialog box.
' + + dlButton("set scale", "!dltool-mod --scale_number|[[(round((" + pageData.get("scale_number") + "/?{Input value measured from printed scale})*?{Input value as displayed on printed scale}*100))/100]]") + " " + setValue(pageData.get("scale_units"), "scale_units", "!dltool-mod --scale_units|?{Input type of unit, example: mi for miles|mi}") + ' ' + + ``; + + configInfo = + openSection + + openSubhead + 'Configuration' + + 'Use the buttons below to grant specific permissions to the players in your campaign.
' + + toggleConfig(state.DLTool.playersCanSight, "playersCanSight") + "Players can set their token's Vision
" + + toggleConfig(state.DLTool.playersCanLight, "playersCanLight") + "Players can set their token's Light
" + + toggleConfig(state.DLTool.playersCanChecklist, "playersCanChecklist") + "Players can use active Checklist
" + + ``; + + + + //Blanks out info for players if not allowed. + tokenInfo = (!state.DLTool.playersCanSight && !playerIsGM(msg.playerid) ? '' : tokenInfo); + lightInfo = (!state.DLTool.playersCanLight && !playerIsGM(msg.playerid) ? '' : lightInfo); + pageInfo = (!playerIsGM(msg.playerid) ? '' : pageInfo); + pagePlusInfo = (!playerIsGM(msg.playerid) ? '' : pagePlusInfo); + if (playerIsGM(msg.playerid)) { + utilityInfo = gmUtilityInfo; + } else { + utilityInfo = openSection + + ((tokenData !== '') ? dlButton("Why can't this token see?", "!dltool --report|checklist") : dlButton("Why can't this token see?", "!dltool --report|checklist")) + '
' + + dlButton("DL Report ", "!dltool --report") + ` | ` + + (!state.DLTool.playersCanSight && !playerIsGM(msg.playerid) ? '' : dlButton("Vision", "!dltool --report|vision")) + + (!state.DLTool.playersCanLight && !playerIsGM(msg.playerid) ? '' : dlButton("Light", "!dltool --report|light")) + + `` + }; + + + //Determines which report to send + + if (undefined === theOption) { + lines = openHeader + 'Dynamic Lighting Tool' + `` + + tokenInfo + lightInfo + pageInfo + utilityInfo + + ''; + } else { + + switch (theOption) { + case "vision": + lines = openHeader + 'Dynamic Lighting Tool' + `` + + tokenInfo + utilityInfo + + ''; + break; + case "light": + lines = openHeader + 'Dynamic Lighting Tool' + `` + + lightInfo + utilityInfo + + ''; + break; + case "page": + lines = openHeader + 'Dynamic Lighting Tool' + `` + + pageInfo + utilityInfo + + ''; + break; + case "extra": + lines = openHeader + 'Dynamic Lighting Tool' + `` + + pageInfo + pagePlusInfo + utilityInfo + + ''; + break; + case "setscale": + lines = openHeader + 'Dynamic Lighting Tool' + `` + + scaleInfo + utilityInfo + + ''; + break; + case "config": + lines = openHeader + 'Dynamic Lighting Tool' + `` + + ((playerIsGM(msg.playerid) || msg.playerid === "API") ? configInfo + gmUtilityInfo : "You must be a GM in order to configure this script") + + ''; + break; + default: + lines = openHeader + 'Dynamic Lighting Tool' + `` + + checklistTokenInfo + utilityInfo + + ''; + } + } + + + let toWhom = (msg.playerid !=='API' ? '/w "' + getObj("player",msg.playerid).get("_displayname") + '" ' : '/w gm '); + + + /* + if (!playerIsGM(msg.playerid)) { + + lines = openHeader + 'Dynamic Lighting Tool' + `` + + checklistTokenInfo + + ''; + toWhom = '/w ' + getObj("player", msg.playerid).get("_displayname") + ' '; + + } + */ + + sendChat('DL Tool', toWhom + openReport + lines + closeReport, null, { + noarchive: true + }); + } + break; + + + //GENERIC MESSSAGE + case 'message': + if (undefined !== theMessage) { + theMessage = '' + theMessage + ''; + sendChat('DLTool', '/w gm ' + openSection + theMessage + closeReport, null, { + noarchive: true + }); + + } + break; + + + case 'default': + + theMessage = `${openHeader}Dynamic Lighting Tool${openSection}${openSubhead}Saving a Default Token${spacer}Users can become frustrated when they set up a token perfectly, but the next time they pull it from the Journal Tab, none of the settings seem to have saved.
Setting a default token is like taking a snapshot of a token exactly as it is, and saving it to the character journal. Any changes you make to a token on the VTT will not affect the default token at all.
Therefore, setting the journal's default token must always be done as the last step.` + + `${openSection}${openSubhead}Three Ways to Set a Default Token${spacer}1) From the Token Settings
Open the token's Token Settings panel. Click the "Update Default Token" button.
${HR}2) From the Journal
Open the journal for the character the token represents. Click the "Edit" button in the upper right corner. On the edit screen, there are three buttons.
${pictos('L')} Edit Token Properties: Calls up the Token Settings panel for making other changes you wish to become new defaults.

${pictos('L')} Use Selected Token: Sets the selected token as the new default token for that journal.
${pictos('L')} Apply Token Defaults: Overwrites all tokens in play that represent this character to the new defaults. Caution: if you have edited tokens on the board (say, by numbering them), this can overwrite those changes.${HR}3) ${dlButton("Save Token as Default", "!token-mod --set defaulttoken")}`; + + //theMessage = '' + theMessage + ''; + + sendChat('DLTool', '/w gm ' + openReport + theMessage + utilityInfo + closeReport, null, { + noarchive: true + }); + + + break; + + + + + //CHECKLIST REPORT + + + case 'checklist': { + let VS = `
 
`; //Vertical spacer + theMessage = `
Check that token is not blocked off by DL lines from seeing the immediate surroundings.${VS}If testing with the player present, make sure the player is looking at their token's immediate area. Shift-Click and hold on the token to pull the player's view to that area. Check the permission settings manually or with with the report to ensure they have control over the token.${VS}Check that the player has not been Split from the Party (Check the Help Center if this is unfamiliar)${VS}If Fog of War or Explorable Darkness (Dynamic Lighting feature that lets the token retain a memory of map areas it has seen) is being used, check that the area the token is in has been cleared. Both of these can be cleared using the darkness tool on the control palette to the left.${VS}Try toggling a light source preset on and off. Sometimes unset default values can cause a DL glitch.${VS}Can you see a rotating cube in this URL? If not, the browser needs to be WebGL compatible (99%+ are).

${HR}Golden Rule: If things don't seem to be working or responding properly,
1) Open and close the token settings manually, and/or 2) Reload the game.
`; + + theMessage = `${openSubhead}Other things to check for` + theMessage + ''; + + if (msg.selected) { + tokenData = getObj('graphic', msg.selected[0]._id); + } + + + sendChat('DLTool', '/w gm ' + openReport + openHeader + 'Dynamic Lighting Tool' + openSection + theMessage + closeReport + utilityInfo + closeReport, null, { + noarchive: true + }); + } + break; + + case 'playersCanSight': + if (true){ + if (state.DLTool.playersCanSight ? state.DLTool.playersCanSight=false : state.DLTool.playersCanSight=true); + } + sendChat('DLTool', '!dltool --report|config'); + break; + + case 'playersCanLight': + if (true){ + if (state.DLTool.playersCanLight ? state.DLTool.playersCanLight=false : state.DLTool.playersCanLight=true); + } + sendChat('DLTool', '!dltool --report|config'); + break; + + case 'playersCanChecklist': + if (true){ + if (state.DLTool.playersCanChecklist ? state.DLTool.playersCanChecklist=false : state.DLTool.playersCanChecklist=true); + } + sendChat('DLTool', '!dltool --report|config'); + break; + + + case 'fog_opacity': + if (theOption >= 1 && theOption <= 100) { + theOption = theOption / 100; + } else { + if (theOption === "0") { + theOption = 0; + } else { + theOption = 1.0; + } + } + break; + + case 'daylightModeOpacity': + if (theOption >= 1 && theOption <= 100) { + theOption = theOption / 100; + } else { + if (theOption === "0") { + theOption = 0; + } else { + theOption = 1.0; + } + } + pageData.set('force_lighting_refresh', true); + + break; + + case 'showdarkness': + if (theOption === "false" || theOption === "true") { + stringToBoolean(theOption); + } else { + sendChat('DLTool', '/w gm ' + openReport + theOption + ' is not a valid value for ' + theCommand + ' It has been set to false.' + closeReport, null, { + noarchive: true + }); + theOption = false; + } + if (pageData.get("dynamic_lighting_enabled") && theOption === "true") { + pageData.set('dynamic_lighting_enabled', false); + } + break; + + case 'dynamic_lighting_enabled': + if (theOption === "false" || theOption === "true") { + stringToBoolean(theOption); + } else { + sendChat('DLTool', '/w gm ' + openReport + theOption + ' is not a valid value for ' + theCommand + ' It has been set to false.' + closeReport, null, { + noarchive: true + }); + theOption = false; + } + if (pageData.get("showdarkness") && theOption === "true") { + pageData.set('showdarkness', false); + } + + + pageData.set('force_lighting_refresh', true); + break; + + case 'daylight_mode_enabled': + if (theOption === "false" || theOption === "true") { + theOption = ((theOption === 'true') ? true : false); + } else { + theOption = false; + sendChat('DLTool', '/w gm ' + openReport + theOption + ' is not a valid value for ' + theCommand + ' It has been set to false.' + closeReport, null, { + noarchive: true + }); + pageData.set('force_lighting_refresh', true); + } + break; + + case 'lightrestrictmove': + if (theOption === "false" || theOption === "true") { + theOption = ((theOption === 'true') ? true : false); + } else { + theOption = false; + sendChat('DLTool', '/w gm ' + openReport + theOption + ' is not a valid value for ' + theCommand + ' It has been set to false.' + closeReport, null, { + noarchive: true + }); + } + pageData.set('force_lighting_refresh', true); + + break; + + case 'lightupdatedrop': + if (theOption === "false" || theOption === "true") { + theOption = ((theOption === 'true') ? true : false); + } else { + theOption = false; + sendChat('DLTool', '/w gm ' + openReport + theOption + ' is not a valid value for ' + theCommand + ' It has been set to false.' + closeReport, null, { + noarchive: true + }); + } + break; + + case 'explorer_mode': + if (theOption === "off" || theOption === "basic") { + theOption = (theOption === 'basic') ? 'basic' : 'off'; + } else { + theOption = 'off'; + sendChat('DLTool', '/w gm ' + openReport + theOption + ' is not a valid value for ' + theCommand + ' It has been set to false.' + closeReport, null, { + noarchive: true + }); + } + break; + + case 'colorpicker': { + + let dataSet = theOption.split("%%")[0]; + let theProperty = theOption.split("%%")[1]; + let opacityButton = ""; + let colorList = ["#000000", "#434343", "#666666", "#C0C0C0", "#D9D9D9", "#FFFFFF", "#980000", "#FF0000", "#FF9900", "#FFFF00", "#00FF00", "#00FFFF", "#4A86E8", "#0000FF", "#9900FF", "#FF00FF", "#E6B8AF", "#F4CCCC", "#FCE5CD", "#FFF2CC", "#D9EAD3", "#D0E0E3", "#C9DAF8", "#CFE2F3", "#D9D2E9", "#EAD1DC", "#DD7E6B", "#EA9999", "#F9CB9C", "#FFE599", "#B6D7A8", "#A2C4C9", "#A4C2F4", "#9FC5E8", "#B4A7D6", "#D5A6BD", "#CC4125", "#E06666", "#F6B26B", "#FFD966", "#93C47D", "#76A5AF", "#6D9EEB", "#6FA8DC", "#8E7CC3", "#C27BA0", "#A61C00", "#CC0000", "#E69138", "#F1C232", "#6AA84F", "#45818E", "#3C78D8", "#3D85C6", "#674EA7", "#A64D79", "#5B0F00", "#660000", "#783F04", "#7F6000", "#274E13", "#0C343D", "#1C4587", "#073763", "#20124D", "#20124E"]; + let colorTable = openHeader + "Pick a color for this property:" + + openPageHead + theProperty + ``; + + colorList.forEach(c => { + + colorTable = colorTable + + ((dataSet === "page") ? ` `; + }); + + colorTable = colorTable + `
`; + + let TransparencyButton = `` : ` href ="!token-mod --set ${theProperty}|transparent">`) + ` Transparent `; + + switch (theProperty) { + + case 'gridcolor': + opacityButton = ' Grid Opacity: ' + + setValue(pageData.get("grid_opacity"), "grid_opacity", "!dltool-mod --grid_opacity|?{Input value between 0 and 1?|1}"); + + break; + + case 'night_vision_tint': + opacityButton = ""; + //TransparencyButton = `` : ` href ="!token-mod --set ${theProperty}\|none">`) + ` None ` + + break; + + case 'lightColor': + opacityButton = ''; + // opacityButton = 'Color:' + setValue(tokenData.get("lightColor"), "lightColor", "!token-mod --set lightColor|?{Use sparingly. Input in hex, rgb or hsv format.|transparent}") + " " + + //`
 
`; + break; + + + default: + // Nothing here. :) + } + + + + opacityButton = opacityButton.replace(" !dltool --report", " " + msg.content); + + colorTable = colorTable + TransparencyButton; + //TransparencyButton = `` : ` href ="!token-mod --set ${theProperty}\|transparent">`) + ` Transparent ` + + + colorTable = colorTable + opacityButton; + + sendChat('DLTool', '/w gm ' + openReport + colorTable + utilityInfo + closeReport, null, { + noarchive: true + }); + + //pageData.set('force_lighting_refresh', true); + } + break; + + default: + // Nothing here. :) + } + + + + + if (theOption === "false") { + pageData.set(theCommand, false); + pageData.set('force_lighting_refresh', true); + + } else { + if (theCommand.includes("name")) { + theOption = theOption.toString().replace(/"/g, ""); + } + pageData.set(theCommand, theOption); + pageData.set('force_lighting_refresh', true); + } + }); + } + }); +}); + +{ + try { + throw new Error(''); + } catch (e) { + API_Meta.dltool.lineCount = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - API_Meta.dltool.offset); + } +} From 197272de0a52cd70a5c0470382b7f41d06b39bc0 Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 10 Apr 2025 00:03:00 -0700 Subject: [PATCH 03/13] Update script.json --- Dynamic Lighting Tool/script.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dynamic Lighting Tool/script.json b/Dynamic Lighting Tool/script.json index f389f5c422..ad5e10669a 100644 --- a/Dynamic Lighting Tool/script.json +++ b/Dynamic Lighting Tool/script.json @@ -1,12 +1,12 @@ { "name": "Dynamic Lighting Tool", "script": "dltool.js", - "version": "1.0.8", + "version": "1.0.9", "description": "### Dynamic Lighting Tool\r**Dynamic Lighting Tool** is a script that performs a host of Dynamic Lighting tasks. It allows you to change most Dynamic Lighting settings on tokens and pages in real time, without needing to call up dialog boxes. It also analyzes many common Dynamic Lighting issues and suggests solutions.\r\r\r### Features:\rA full report of all current relevant Dynamic Lighting information on the current page and the selected token.\rA *Why can't this token see?* button that performs a detailed analysis of the selected token and tries to pinpoint what the problem might be.\rA list of things to check manually that cannot be handled by mod scripts.\rPreset buttons for common lighting solutions.\rIdentifies controllers and represented sheet (if any) of selected token.\rExtensive hover text over most labels and settings with explanations and tips.\rIf the checkLightLevel script is installed (soon in One Click, or get it here), it will inform you of whether the token has light shining on it and how much.\r\r### Dependencies:\rThis script requires the following scripts for best performance. They will be loaded as dependencies\r**Token Mod.** This is used for setting token values. There are many idiosyncrasies in the Mod system for tokens, and the Aaron has already done the hard work of accounting for them.\r**checkLightLevel.** This adds functionality, but the script will function without it.\r\r### Command:\r`!dltool` or `!dltool --report`\r\rFor full documentation see [this thread](https://app.roll20.net/forum/post/11316788/script-dltool-a-dynamic-lighting-control-panel-and-troubleshooter) in the Roll20 forums.", "authors": "Keith Curtis", "roll20userid": "162065", "dependencies": [ "TokenMod", "checkLightLevel" ], "modifies": {}, "conflicts": [], - "previousversions": ["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8"] + "previousversions": ["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.0.9"] } From a1792b9563144bc07997add099a3440024f1d758 Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 08:48:18 -0700 Subject: [PATCH 04/13] Create Condefintion.js Created js file --- Condefinition/Condefintion.js | 1348 +++++++++++++++++++++++++++++++++ 1 file changed, 1348 insertions(+) create mode 100644 Condefinition/Condefintion.js diff --git a/Condefinition/Condefintion.js b/Condefinition/Condefintion.js new file mode 100644 index 0000000000..a7e6976932 --- /dev/null +++ b/Condefinition/Condefintion.js @@ -0,0 +1,1348 @@ +var API_Meta = API_Meta || +{}; //eslint-disable-line no-var +API_Meta.Condefinition = { + offset: Number.MAX_SAFE_INTEGER, + lineCount: -1 +}; +{ + try + { + throw new Error(''); + } + catch (e) + { + API_Meta.Condefinition.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (7)); + } +} + +/* globals libTokenMarkers, TokenMod, SmartAoE */ + + + +on('ready', () => +{ + + // Make sure libTokenMarkers exists, has the functions that are expected, and has a constant for testing + if('undefined' === typeof libTokenMarkers || + (['getStatus', 'getStatuses', 'getOrderedList'].find(k => + !libTokenMarkers.hasOwnProperty(k) || 'function' !== typeof libTokenMarkers[k] + )) + ) + { + // notify of the missing library + sendChat('', `/w gm
Missing dependency: libTokenMarkers.
You can install this on your Mod Page with One-Click install.
`); + return; + + } + + // Checks for the existence of a given marker. Used for determining whether to create marketplace buttons + const markerExists = (marker) => + { + if(!marker || !marker.length) return false; + + const match = /(@\d+$|:)/.exec(marker); + const endIndex = match ? match.index : marker.length; + + const key = marker.slice(0, endIndex); + const status = libTokenMarkers.getStatus(key); + + return status.getName() === marker; + }; + + let definitions2014 = [ + ["concentrating", "Some Spells require you to maintain Concentration in order to keep their magic active. If you lose concentra⁠tion, such a spell ends.
If a spell must be maintained with Concentration, that fact appears in its Duration entry, and the spell specifies how long you can conce⁠ntrate on it. You can end Concentration at any time (no Action required).
Normal activity, such as moving and Attacking, doesn’t interfere with Concentration. The following factors can break concentration:
• Casting another spell that requires Concentration. You lose concentr⁠ation on a spell if you cast another spell that requires conc⁠entration. You can’t concentrate on two Spells at once.
• Taking Damage. Whenever you take damage while you are concentrating on a spell, you must make a Constitution saving throw to maintain your Concentration. The DC equals 10 or half the damage you take, whichever number is higher. If you take damage from multiple sources, such as an arrow and a dragon’s breath, you make a separate saving throw for each source of damage.
• Being Incapacitated or killed. You lose Concentration on a spell if you are incap⁠acitated or if you die.
• The DM might also decide that certain environmental phenomena, such as a wave Crashing over you while you’re on a storm-tossed ship, require you to succeed on a DC 10 Constitution saving throw to maintain Concentration on a spell."], + ["blinded", "• A blinded creature can’t see and automatically fails any ability check that requires sight.
• Attack rolls against the creature have advantage, and the creature’s attack rolls have disadvantage."], + ["charmed", "A charmed creature can’t attack the charmer or target the charmer with harmful bilities or magical Effects.
The charmer has advantage on any ability check to interact socially with the creature."], + ["deafened", "A deafened creature can’t hear and automatically fails any ability check that requires hearing."], + ["exhaustion", "Some special ablities and environmental hazards, such as starvation and the long-term effects of freezing or scorching temperatures, can lead to a spcial condition called exhaustion. Exhaustion is measured in six levels. An Effect can give a creature one or more levels of exhaustion, as specified in the effect’s description.

Lvl Effect
1Disadvantage on Ability Checks
2Speed halved
3Disadvantage on attack rolls and Saving Throws
4Hit point maximum halved
5Speed reduced to 0
6Death

If an already exhausted creature suffers another effect that causes exhaustion, its current level of exhaustion increases by the amount specified in the effect’s description.

A creature suffers the effect of its current level of exhaustion as well as all lower levels. For example, a creature suffering level 2 exhaustion has its speed halved and has disadvantage on Ability Checks.

An Effect that removes exhaustion reduces its level as specified in the effect’s description, with all exhaustion Effects Ending if a creature’s exhaustion level is reduced below 1.

Finishing a Long Rest reduces a creature’s exhaustion level by 1, provided that the creature has also ingested some food and drink. Also, being raised from the dead reduces a creature's exhaustion level by 1."], + ["frightened", "A frightened creature has disadvantage on Ability Checks and attack rolls while the source of its fear is within Line of Sight.
The creature can’t willingly move closer to the source of its fear."], + ["grappled", "A grappled creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.
The condition ends if the grappler is incapacitated.
The condition also ends if an Effect removes the grappled creature from the reach of the Grappler or Grappling Effect, such as when a creature is hurled away by the thunderwave spell."], + ["incapacitated", "An incapacitated creature can’t take actions or reactions."], + ["invisible", "An invisible creature is impossible to see without the aid of magic or a spcial sense. For the purpose of hiding, the creature is heavily obscured. The creature’s location can be detected by any noise it makes or any tracks it leaves.
Attack rolls against the creature have disadvantage, and the creature’s Attack rolls have advantage."], + ["paralyzed", "A paralyzed creature is incapacitated and can’t move or speak.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage.
Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature."], + ["petrified", "A petrified creature is transformed, along with any nonmagical object it is wearing or carrying, into a solid inanimate substance (usually stone). Its weight increases by a factor of ten, and it ceases aging.
The creature is incapacitated, can’t move or speak, and is unaware of its surroundings.
Attack rolls against the creature have advantage.
The creature automatically fails Strength and Dexterity Saving Throws.
The creature has Resistance to all damage.
The creature is immune to poison and disease, although a poison or disease already in its system is suspended, not neutralized."], + ["poisoned", "A poisoned creature has disadvantage on attack rolls and Ability Checks."], + ["prone", "A prone creature’s only Movement option is to crawl, unless it stands up and thereby ends the condition.
The creature has disadvantage on attack rolls.
An attack roll against the creature has advantage
if the attacker is within 5 feet of the creature.Otherwise, the attack roll has disadvantage."], + ["restrained", "A restrained creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.
Attack rolls against the creature have advantage, and the creature’s Attack rolls have disadvantage.
The creature has disadvantage on Dexterity Saving Throws."], + ["stunned", "A stunned creature is incapacitated, can’t move, and can speak only falteringly.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage."], + ["unconscious", "An unconscious creature is incapacitated, can’t move or speak, and is unaware of its surroundings
The creature drops whatever it’s holding and falls prone.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage.
Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature."], + ["dead", "A dead creature is an object.
Most GMs have a monster die the instant it drops to 0 Hit Points, rather than having it fall Unconscious and make death Saving Throws.
Mighty Villains and Special nonplayer Characters are Common exceptions; the GM might have them fall Unconscious and follow the same rules as player Characters."], + ["bardic-inspiration", "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails."], + ["bloodied", "Bloodied is not an official term, but usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is."], + ["confused", "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll a d10 at the start of each of its turns to determine its behavior for that turn.
d10 Behavior
1 The creature uses all its Movement to move in a random direction. To determine the direction, roll a d8 and assign a direction to each die face. The creature doesn't take an Action this turn.
2-6 The creature doesn't move or take ACTIONS this turn.
7-8 The creature uses its Action to make a melee Attack against a randomly determined creature within its reach. If there is no creature within its reach, the creature does nothing this turn.
9-10 The creature can act and move normally."], + ["full-cover", "A target with total cover can’t be targeted directly by an Attack or a spell, although some Spells can reach such a target by including it in an area of Effect. A target has total cover if it is completely concealed by an obstacle.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], + ["three-quarter-cover", "A target with three-quarters cover has a +5 bonus to AC and Dexterity Saving Throws. A target has three-quarters cover if about three-quarters of it is covered by an obstacle. The obstacle might be a portcullis, an arrow slit, or a thick tree trunk.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], + ["half-cover", "A target with half cover has a +2 bonus to AC and Dexterity Saving Throws. A target has half cover if an obstacle blocks at least half of its body. The obstacle might be a low wall, a large piece of furniture, a narrow tree trunk, or a creature, whether that creature is an enemy or a friend.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], + ["diseased", "See the entry on Diseases in the Compendium"], + ["ethereal", "Border Ethereal
From the Border Ethereal, a Traveler can see into whatever plane it overlaps, but that plane appears muted and indistinct, its colors blurring into each other and its edges turning fuzzy. Ethereal denizens watch the plane as though peering through distorted and frosted glass, and can’t see anything beyond 30 feet into the other plane. Conversely, the Ethereal Plane is usually Invisible to those on the overlapped planes, except with the aid of magic.
Normally, Creatures in the Border Ethereal can’t Attack Creatures on the overlapped plane, and vice versa. A Traveler on the Ethereal Plane is Invisible and utterly silent to someone on the overlapped plane, and solid Objects on the overlapped plane don’t hamper the Movement of a creature in the Border Ethereal. The exceptions are certain Magical Effects (including anything made of Magical force) and living beings. This makes the Ethereal Plane ideal for reconnaissance, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can move up and down as easily as walking."], + ["flying", "Flying Creatures enjoy many benefits of mobility, but they must also deal with the danger of Falling. If a flying creature is knocked prone, has its speed reduced to 0, or is otherwise deprived of the ability to move, the creature falls, unless it has the ability to hover or it is being held aloft by magic, such as by the fly spell."], + ["haste", "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it."], + ["hexed", "Until the spell ends, you deal an extra 1d6 necrotic damage to the target whenever you hit it with an Attack. Also, choose one ability when you cast the spell. The target has disadvantage on Ability Checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can use a bonus Action on a subsequent turn of yours to curse a new creature.
A Remove Curse cast on the target ends this spell early."], + ["hexblade-curse", "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest."], + ["hidden", "Combatants often try to Escape their foes’ notice by Hiding, casting the Invisibility spell, or lurking in darkne⁠ss.
When you Attack a target that you can’t see, you have disadvantage on the at⁠tack roll. This is true whether you’re guessing the target’s Location or you’re targeting a creature you can hear but not see. If the target isn’t in the Location you targeted, you automatically miss, but the DM typically just says that the att⁠ack missed, not whether you guessed the target’s Location correctl
When a creature can’t see you, you have advantage on Attack rolls against it. If you are hidden—both unseen and unheard—when you make an at⁠tack, you give away your Location when the att⁠ack hits or misses."], + ["TempHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."], + ["favored", "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level."], + ["marked", "You deal an extra 1d6 damage to the target whenever you hit it with a weapon Attack, and you have advantage on any Wisdom (Perception) or Wis⁠dom (Survival) check you make to find it. If the target drops to 0 Hit Points before this spell ends, you can use a bonus Action on a subsequent turn of yours to mark a new creature
At Higher Levels. When you cast this spell using a spell slot of 3rd or 4th Level, you can maintain your Concentration on the spell for up to 8 hours. When you use a spell slot of 5th Level or higher, you can maintain your concentr⁠ation on the spell for up to 24 hours."], + ["raging", "While raging, you gain the following benefits if you aren’t wearing heavy armor:
• You have advantage on Strength checks and Strength Saving Throws.
• When you make a melee weapon Attack using Strength, you gain a bonus to the damage roll that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian table.If you are able to cast Spells, you can’t cast them or concentrate on them while raging.
Your rage lasts for 1 minute. It ends early if you are knocked Unconscious or if Your Turn ends and you haven’t attacked a Hostile creature since your last turn or taken damage since then. You can also end your rage on Your Turn as a bonus Action.
Once you have raged the number of times shown for your Barbarian level in the Rages column of the Barbarian table, you must finish a Long Rest before you can rage again."], + ["slowed", "An affected target’s speed is halved, it takes a −2 penalty to AC and Dexterity Saving Throws, and it can’t use reactions. On its turn, it can use either an Action or a bonus Action, not both. Regardless of the creature’s Abilities or magic items, it can’t make more than one melee or ranged Attack during its turn.
If the creature attempts to Cast a Spell with a Casting Time of 1 Action, roll a d20. On an 11 or higher, the spell doesn’t take Effect until the creature’s next turn, and the creature must use its Action on that turn to complete the spell. If it can’t, the spell is wasted.
A creature affected by this spell makes another Wisdom saving throw at the end of each of its turns. On a successful save, the Effect ends for it."], + ["Torch", "A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee Attack with a burning torch and hit, it deals 1 fire damage."], + ["dying", "Falling Unconscious
If damage reduces you to 0 Hit Points and fails to kill you, you fall Unconscious (see Conditions ). This unconsciousness ends if you regain any Hit Points.
Death Saving Throws
Whenever you start Your Turn with 0 Hit Points, you must make a Special saving throw, called a death saving throw, to determine whether you creep closer to death or hang onto life. Unlike other Saving Throws, this one isn’t tied to any ability score. You are in the hands of fate now, aided only by Spells and Features that improve your chances of succeeding on a saving throw.
Roll a d20: If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no Effect by itself. On your third success, you become stable (see below). On your third failure, you die. The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become stable.
Rolling 1 or 20: When you make a death saving throw and roll a 1 on The D20, it counts as two failures. If you roll a 20 on The D20, you regain 1 hit point.
Damage at 0 Hit Points: If you take any damage while you have 0 Hit Points, you suffer a death saving throw failure. If the damage is from a critical hit, you suffer two failures instead. If the damage equals or exceeds your hit point maximum, you suffer Instant Death."], + ["burrowing", "A monster that has a burrowing speed can use that speed to move through sand, earth, mud, or ice. A monster can’t burrow through solid rock unless it has a Special trait that allows it to do so."], + ["dodging", "Until the start of your next turn, any Attack roll made against you has disadvantage if you can see the attacker, and you make Dexterity Saving Throws with advantage. You lose this benefit if you are Incapacitated or if your speed drops to 0."], + ["inspiration", "If you have Inspiration, you can expend it when you make an Attack roll, saving throw, or ability check. Spending your Inspiration gives you advantage on that roll.
Additionally, if you have Inspiration, you can reward another player for good Roleplaying, clever thinking, or simply doing something exciting in the game. When another player character does something that really contributes to the story in a fun and interesting way, you can give up your Inspiration to give that character Inspiration."], + ["TemporaryHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."] + ]; + + let definitions2024 = [ + ["concentrating", "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die."], + ["blinded", "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage."], + ["charmed", "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially."], + ["deafened", "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing."], + ["exhaustion", "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends."], + ["frightened", "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear."], + ["grappled", "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it."], + ["incapacitated", "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll."], + ["invisible", "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature."], + ["paralyzed", "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you."], + ["petrified", "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition."], + ["poisoned", "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks."], + ["prone", "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage."], + ["restrained", "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws."], + ["stunned", "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage."], + ["unconscious", "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings."], + ["dead", "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them."], + ["bardic-inspiration", "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails."], + ["bloodied", "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is."], + ["confused", "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success."], + ["full-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], + ["three-quarter-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], + ["half-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], + ["diseased", "See the entry on Diseases in the Compendium"], + ["ethereal", "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond."], + ["flying", "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover."], + ["haste", "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it."], + ["hexed", "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature."], + ["hexblade-curse", "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest."], + ["hidden", "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component."], + ["TempHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."], + ["favored", "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level."], + ["marked", "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours)."], + ["raging", "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage."], + ["slowed", "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success."], + ["Torch", "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage."], + ["dying", "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours."], + ["burrowing", "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed."], + ["dodging", "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0."], + ["inspiration", "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it."], + ["TemporaryHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."] + ]; + + + let defaultConditionsArray = [ + ["concentrating", + /concentration check|concentration=1/i, + "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die.", + `death-zone` + ], + ["blinded", + /(be|and|is|magically|become|becomes|is either|has the) blinded|blinded condition/i, + "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.", + `bleeding-eye` + ], + [ + "charmed", + /(be|and|is|magically|become|becomes) charmed|charmed condition/i, + "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially.", + `chained-heart` + ], + [ + "deafened", + /(be|and|is|magically|become|becomes) deafened|deafened condition/i, + "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing.", + `overdrive` + ], + [ + "exhaustion", + /(be|and|is|magically|become|becomes) exhausted|(of|magical) exhaustion|exhausted condition/i, + "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends.", + `half-haze` + ], + [ + "frightened", + /(be|and|is|magically|become|becomes) frightened|frightened condition/i, + "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear.", + `screaming` + ], + [ + "grappled", + /(be|and|is|magically|becomes|considered) grappled|grappled condition/i, + "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it.", + `grab` + ], + [ + "incapacitated", + /(be|and|is|magically|become|becomes) incapacitated|incapacitated condition/i, + "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll.", + `interdiction` + ], + [ + "invisible", + /(be|and|is|magically|become|becomes) invisible|invisible condition/i, + "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature.", + `ninja-mask` + ], + [ + "paralyzed", + /(be|and|is|magically|become|becomes) paralyzed|paralyzed condition/i, + "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.", + `aura` + ], + [ + "petrified", + /(be|and|is|magically|become|becomes|becoming) petrified|(turns to|turning to) stone|petrified condition/i, + "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition.", + `chemical-bolt` + ], + [ + "poisoned", + /(be|and|is|magically|become|becomes) poisoned|poisoned condition/i, + "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks.", + 'skull' + ], + [ + "prone", + /(be|and|is|magically|become|becomes|knocked|fall|falls) prone|prone condition/i, + "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage.", + `back-pain` + ], + [ + "restrained", + /(be|and|is|magically|become|becomes) restrained|restrained condition/i, + "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws.", + `cobweb` + ], + [ + "stunned", + /(be|and|is|magically|become|becomes) stunned|stunned condition/i, + "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.", + `broken-skull` + ], + [ + "unconscious", + /(be|and|is|magically|become|becomes) unconscious|unconscious condition/i, + "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings.", + `sleepy` + ], + [ + "dead", + /nonmatching string to prevent accidental triggering/i, + "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them.", + `dead` + ], + [ + "bardic-inspiration", + /You can inspire others through stirring words or music/i, + "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails.", + `black-flag` + ], + [ + "bloodied", + /nonmatching string to prevent accidental triggering/i, + "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is.", + `pummeled` + ], + [ + "confused", + /spawning delusions and provoking uncontrolled action/i, + "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success.", + `rolling-bomb` + ], + [ + "full-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `bolt-shield` + ], + [ + "three-quarter-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `broken-shield` + ], + [ + "half-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `broken-shield` + ], + [ + "diseased", + /nonmatching string to prevent accidental triggering/i, + "See the entry on Diseases in the Compendium", + `radioactive` + ], + [ + "ethereal", + /ethereal/i, + "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond.", + `angel-outfit` + ], + [ + "flying", + /nonmatching string to prevent accidental triggering/i, + "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover.", + `fluffy-wing` + ], + [ + "haste", + /as a wave of lethargy sweeps over it/i, + "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it.", + `stopwatch` + ], + [ + "hexed", + /You place a curse on a creature that you can see within range/i, + "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature.", + `lightning-helix` + ], + [ + "hexblade-curse", + /Starting at 1st Level, you gain the ability to place a baleful curse on someone/i, + "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest.", + `all-for-one` + ], + [ + "hidden", + /nonmatching string to prevent accidental triggering/i, + "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component.", + `ninja-mask` + ], + [ + "TempHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `broken-heart` + ], + [ + "favored", + /mystical bond with Nature to mark the target as your Favored enemy/i, + "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level.", + `archery-target` + ], + [ + "marked", + /(mystically mark it as your quarry|You magically mark one creature you can see within range as your quarry)/i, + "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours).", + `archery-target` + ], + [ + "raging", + /On your turn, you can enter a rage as a Bonus Action/i, + "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage.", + `strong` + ], + [ + "slowed", + /You alter time around up to six creatures of your choice/i, + "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success.", + `snail` + ], + [ + "Torch", + /nonmatching string to prevent accidental triggering/i, + "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage.", + `frozen-orb` + ], + [ + "dying", + /nonmatching string to prevent accidental triggering/i, + "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours.", + `death-zone` + ], + [ + "burrowing", + /nonmatching string to prevent accidental triggering/i, + "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed.", + `edge-crack` + ], + [ + "dodging", + /nonmatching string to prevent accidental triggering/i, + "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0.", + `tread` + ], + [ + "inspiration", + /nonmatching string to prevent accidental triggering/i, + "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it.", + `flying-flag` + ], + [ + "TemporaryHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `broken-heart` + ] + + + + ] + // END SET STATUS CONDITIONS OR TOKEN MARKERS + + + let defaultConditionsArray_EasyToRead = [ + ["concentrating", + /concentration check|concentration=1/i, + "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die.", + `Concentrating` + ], + ["blinded", + /(be|and|is|magically|become|becomes|is either|has the) blinded|blinded condition/i, + "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.", + `Blinded` + ], + [ + "charmed", + /(be|and|is|magically|become|becomes) charmed|charmed condition/i, + "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially.", + `Charmed` + ], + [ + "deafened", + /(be|and|is|magically|become|becomes) deafened|deafened condition/i, + "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing.", + `Deafened` + ], + [ + "exhaustion", + /(be|and|is|magically|become|becomes) exhausted|(of|magical) exhaustion|exhausted condition/i, + "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends.", + `Exhaustion1` + ], + [ + "frightened", + /(be|and|is|magically|become|becomes) frightened|frightened condition/i, + "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear.", + `Frightened` + ], + [ + "grappled", + /(be|and|is|magically|becomes|considered) grappled|grappled condition/i, + "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it.", + `Grappled` + ], + [ + "incapacitated", + /(be|and|is|magically|become|becomes) incapacitated|incapacitated condition/i, + "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll.", + `Incapacitated` + ], + [ + "invisible", + /(be|and|is|magically|become|becomes) invisible|invisible condition/i, + "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature.", + `Invisible` + ], + [ + "paralyzed", + /(be|and|is|magically|become|becomes) paralyzed|paralyzed condition/i, + "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.", + `Paralyzed` + ], + [ + "petrified", + /(be|and|is|magically|become|becomes|becoming) petrified|(turns to|turning to) stone|petrified condition/i, + "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition.", + `Petrified` + ], + [ + "poisoned", + /(be|and|is|magically|become|becomes) poisoned|poisoned condition/i, + "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks.", + 'Poisoned' + ], + [ + "prone", + /(be|and|is|magically|become|becomes|knocked|fall|falls) prone|prone condition/i, + "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage.", + `Prone` + ], + [ + "restrained", + /(be|and|is|magically|become|becomes) restrained|restrained condition/i, + "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws.", + `Restrained` + ], + [ + "stunned", + /(be|and|is|magically|become|becomes) stunned|stunned condition/i, + "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.", + `Stunned` + ], + [ + "unconscious", + /(be|and|is|magically|become|becomes) unconscious|unconscious condition/i, + "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings.", + `Unconscious9` + ], + [ + "dead", + /nonmatching string to prevent accidental triggering/i, + "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them.", + `dead` + ], + [ + "bardic-inspiration", + /You can inspire others through stirring words or music/i, + "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails.", + `Bardic` + ], + [ + "bloodied", + /nonmatching string to prevent accidental triggering/i, + "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is.", + `Bloodied` + ], + [ + "confused", + /spawning delusions and provoking uncontrolled action/i, + "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success.", + `Confused` + ], + [ + "full-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + // `death-zone` + `Cover` + ], + [ + "three-quarter-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `ThreeQuarterCover` + ], + [ + "half-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `HalfCover` + ], + [ + "diseased", + /nonmatching string to prevent accidental triggering/i, + "See the entry on Diseases in the Compendium", + `Dieseased` + ], + [ + "ethereal", + /ethereal/i, + "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond.", + `Ethereal` + ], + [ + "flying", + /nonmatching string to prevent accidental triggering/i, + "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover.", + `Flying` + ], + [ + "haste", + /as a wave of lethargy sweeps over it/i, + "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it.", + `Haste` + ], + [ + "hexed", + /You place a curse on a creature that you can see within range/i, + "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature.", + `Hexed` + ], + [ + "hexblade-curse", + /Starting at 1st Level, you gain the ability to place a baleful curse on someone/i, + "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest.", + `Hexed2` + ], + [ + "hidden", + /nonmatching string to prevent accidental triggering/i, + "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component.", + `Hidden` + ], + [ + "TempHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `TempHP` + ], + [ + "favored", + /mystical bond with Nature to mark the target as your Favored enemy/i, + "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level.", + `Marked` + ], + [ + "marked", + /(mystically mark it as your quarry|You magically mark one creature you can see within range as your quarry)/i, + "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours).", + `Marked2` + ], + [ + "raging", + /On your turn, you can enter a rage as a Bonus Action/i, + "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage.", + `Raging` + ], + [ + "slowed", + /You alter time around up to six creatures of your choice/i, + "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success.", + `Slow` + ], + [ + "Torch", + /nonmatching string to prevent accidental triggering/i, + "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage.", + `Torch` + ], + [ + "dying", + /nonmatching string to prevent accidental triggering/i, + "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours.", + `Dying` + ], + [ + "burrowing", + /nonmatching string to prevent accidental triggering/i, + "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed.", + `Burrowing` + ], + [ + "dodging", + /nonmatching string to prevent accidental triggering/i, + "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0.", + `Dodging` + ], + [ + "inspiration", + /nonmatching string to prevent accidental triggering/i, + "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it.", + `Inspiration` + ], + [ + "TemporaryHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `TempHP2` + ] + + + + ] + // END SET STATUS CONDITIONS OR TOKEN MARKERS + + //Creates Handouts + function createHandoutIfMissing(name, html, gmnotes, avatar) + { + if(!name) return; + if(!html && !gmnotes && !avatar) return; // nothing to set + + const existing = findObjs( + { + _type: "handout", + name + })[0]; + if(existing) return; + + const handout = createObj("handout", + { + name, + inplayerjournals: "all", + archived: false + }); + + const props = {}; + if(html) props.notes = html; + if(gmnotes) props.gmnotes = gmnotes; + if(avatar) props.avatar = avatar; + + handout.set(props); + } + + + + const buttonstyle = `"background-color:#702c91; border-style:none;border-radius:0px 0px 0px 0px; margin:3px 2px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; + const publicButtonStyle = `"background-color:#702c91; border-style:none;border-radius:10px 0px 0px 10px; margin:3px 2px 3px 3px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 3px"`; + const markerButtonStyle = `"background-color:#702c91; border-style:none;border-radius:0px 10px 10px 0px; margin:3px 3px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 3px"`; + const saveButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:13px; margin:3px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; + const groupSaveButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:13px 0px 0px 13px; margin:3px 1px 3px 3px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; + const applyDamageButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:0px 13px 13px 0px; margin:3px 3px 3px 1px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; + const simpleButtonstyle = `"background-color:#702c91; border-style:none;border-radius:2px; margin:3px 2px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; + + const conditionnamestyle = `"background-color:#702c91; border-style:none;border-radius:6px 6px 0px 0px; margin:-8px -8px 3px -8px; font-weight:bold;text-transform:capitalize;text-decoration:none;display:block;text-align:center;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; + + const reportstyle = `"display: block; background-color:#aaa; border-radius:6px; text-decoration:none;color:#111; font-family:Arial; font-size:13px; padding: 8px;"`; + const preportstyle = `"display: block; background-color:#aaa; border-radius:6px; text-decoration:none;color:#111; font-family:Arial; font-size:13px; padding: 8px;"`; + const regexForTitles = /incapacitated<\/a>/; + const buttonbox = `
`; + const buttonboxUnshifted = `
`; + const buttonMenuStyle = `"display:block; border:1px solid #555; padding:3px; border-radius:4px; background-color:#bbb;"`; + const printChar = 'w'; + + + + + const helpHTML = `

Condefinition

What it does

Condefinition reads incoming roll templates and looks for imposed conditions and saving throws. It display a button(s) in chat that allow you to quickly apply a corresponding token marker, define the condition, track concentration, roll saving throws and/or apply damage from spells or effects that are triggered by saving throws.

  • If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to have it roll the appropriate save. If you have GroupCheck installed, it will run a groupcheck save. If you have Apply Damage installed, it will run through the steps to do a save and apply damage.
  • If the roll template contains an imposed condition, it will create a button to define the condition. If there is a cross reference in the definition of the condition, it  will create an inline link. You can also hover over the button for the text. You can use this button to whisper the text to yourself, or broadcast to the players.
  • You can also toggle that condition on any selected tokens. Assigning token markers requires installing TokenMod, and for greater facility, LibTokenMarkers. It comes with the default Status Markers assigned, but the script creates a configuration handout that can be edited to use custom token markers. Instructions are included later in this handout.
  • If you installed this Mod using Roll20 One-Click, it should automatically install GroupCheckTokenMod, and LibTokenMarkers if they are not already present. Apply Damage needs to be installed manually if you want its functionality.
  • Besides the official conditions, this also tracks mentions in chat for many common features that benefit from markers, such as raging, using Hunter's Mark, Hexblade's Curse and more. Each of these has buttons to toggle or define the effect.
  • The marker for the Concentrating condition also tracks concentration, and prompts for a Constitution Saving Throw when the token takes damage. See below for details. 
  • This script has been written to work on Classic or Jumpgate, and with the 2014 and/or 2024 sheets for 5e D&D. A dedicated user could probably adapt this for other sheets, but you would need to install the code manually. Contact me for guidance if you need it, but you will need a decent understanding of JavaScript.

What it can't do

Currently, there are some limitations:

  • This is built for GMs to facilitate running NPCs. Although most of the functions will work with PCs as well, and buttons should display for any player whose actions generate them, not every bit of it is player-accessible
  • The conditions are matched to tokens and their markers, not character sheets. This is the intended behavior as each instance of a goblin (for example) can have its own imposed conditions.
  • I have tried to catch every variation of condition wording, but I have probably missed a few incidences, particularly in products which do not adhere well to the WotC style.
  • In this iteration, all buttons and definitions are whispered to the controller of the NPC, typically the GM. If there is interest, I may change this to obey the whisper settings of the NPC, but I did not want to spam the chat. 

Helper Scripts

  • Required: Token-mod, libTokenMarkers
  • Improved by: GroupCheckApply Damage

Operation

Buttons

Every time a condition is implied by something in a chat roll template, or if the report function is used on a selected token, the script produces a button. Each button has three parts.

The middle, largest part of the button will send a message tot he GM in chat, that defines the condition. Sometimes, this will have links to other conditions that the condition imposes. Such as an Unconscious character is also Incapacitated.

The left side of the button has a word balloon graphic. This also send the definition to chat, but in this case, it is visible to all players.

The right hand side of the button shows the marker associated with that condition. It will toggle the marker for any and all selected tokens.


List All Common Condition Definitions

Condefinition can produce a reference palette of all official condition buttons. Type !condef-all  to display the report. Note that the script tracks more markers than this, such as \"Raging\", or \"Marked\". These are just the official conditions defined by the rules.


Concentration

Condefintion will monitor if the token taking damage has a defined concentration marker on it. If you reduce the hit point bar of a concentrating token, the script will prompt you to make the appropriate Constitution save.

Example. \"Morrigan\" just took 30 hp of damage while concentrating on a spell. The Script notes that the concentration marker was active, calculates the saving throw and produces a button that will cause the selected token to roll a saving throw. Note: In order to make this script work with both the 2014 and 2024 sheets, the Group Check mod is required and configured for your sheet(s). If you installed Condefinition via Roll20 One Click, it should have installed all helper scripts automatically. See the first section of this handout for more details. 


Report

Condefintion also allows you to select any number of tokens and run !condef-report. The script produces a set of report buttons for each selected token that has a defined condition marker on it. In this case, the sub-buttons that toggle token markers will only affect the respective token, and that token does not need to be selected.


Automation of Abilities that Force Saving Throws

This feature requires both Group Check, and the manually installed script Apply Damage in order to function. It also requires that the spell or feature of a creature is sent to chat with the Description turned on. In some cases this requires rolling damage or clicking the roll template button that shows the spell description. There are too many sheet variables to account for here, but in short, the keywords needed in order to trigger the script must have been sent to chat. 

The button produced is very similar to the concentration check button. In this case, the left half will roll a saving throw for all selected tokens. If you have Apply Damage installed, it will also walk you through the steps necessary to resolve the roll and apply damage accordingly. Note that this function will work on a combination of selected 2014 and 2024 tokens.


Configuration

Out of the box, this script will support conditions defined by both the 2014 and 2024 rule sets. It also can switch between the default token markers or my own Easy to Read token markers. This latter is entirely for my own convenience, and they are not required in any way for the script to function.

The Condefinitions Handout

Type !condef help or !condef config in chat to call up the configuration controls. 

Condefinition uses a lot of Regular Expressions (search code) to find and apply token markers and definitions. It reads these from a handout called Condefinitions. You can edit this handout manually. It has all of the code needed to define the conditions wrapped in a code block. You can edit the names, the definitions, the search code and the name of the corresponding token marker. The edited text must be clean plain text wrapped in code tags using the Code style button in the editor. Most users will only need to change the name of the token marker to match their chosen set.

If you don't feel comfortable editing the other code, or do so and make a mistake which breaks the handout, you can reset to the default using the buttons in the configuration panel. The script contains defaults for the 2014 and 2024 rule sets, using the default token markers provided by Roll20. I original wrote this script using my own Marketplace set, so if you have installed my \"Easy to Read Token Markers\" set, then there are also buttons that set defaults for those. This Marketplace set is honestly for my own convenience, and the script does not require this set in any way.

Each Condefintion definition is four lines long, and separated by an empty line.

  • Line 1 is the name of the condition
  • Line 2 is the Regular Expression (REGEX) used to trigger the operation of the script. It's a list of search terms that match condition and effect names. If you are not familiar with REGEX, just leave that line alone and you should be fine.
  • Line 3 is the definition of the condition or effect.. This must all be on one line, and can accept simple html styling.
  • Line 4 is the name of the associated token marker.

After editing and saving the configuration document, you must press the \"Update Conditions\" button in the chat configuration controls. This will apply the conditions immediately.

It is strongly advised that if you do make home brew changes, you duplicate the Condefinitions Handout to use as a backup. the controls can \"reset to factory specs\", but they cannot undo breaking changes.

If you create a configuration that uses a marketplace set of Token Markers that you prefer, feel free to share with others. It can be copied and pasted between games, so long as you are careful to paste clean text only (hold down the shift key while pasting, or copy from a plain text editor), and wrap the whole thing in the \"Code\" style.

`; + //createHandoutIfMissing("Help: Condefinition", helpHTML); + createHandoutIfMissing("Help: Condefinition", helpHTML, "", "https://s3.amazonaws.com/files.d20.io/images/442783616/hDkduTWDpcVEKomHnbb6AQ/med.png"); + + //Only include these buttons if the user has the Easy To Read markers from the Marketplace + let marketButtons = ((markerExists("Hexed3")) ? + `Easy to Read Markers (Marketplace)` + `
` + + makeGenericButton("2014", "!condef-easy2014") + ` ` + + makeGenericButton("2024", "!condef-easy2024") + `
` : + "" + ) + + let configMessage = `
` + + `Condefinition uses a lot of Regular Expressions (search code) to find and apply token markers and definitions. It reads these from a handout called Condefinitions. This handout has all of the code needed to define the conditions in a code block. You can edit the names, the definitions, the search code and the name of the corresponding token marker. The edited text must be clean plain text wrapped in code tags using the Code style button in the editor. Most users will only need to change the name of the token marker to match their chosen set.

If you don't feel comfortable editing the other code, or do so and make a mistake which breaks the handout, you can reset to the default using the buttons in the configuration panel. The script contains defaults for the 2014 and 2024 rule sets, using the default token markers provided by Roll20. I original wrote this script using my own Marketplace set, so if you have installed my "Easy to Read Token Markers" set, then there are also buttons that set defaults for those. This Marketplace set is honestly for my own convenience, and the script does not require this set in any way.` + `

` + + `
` + + `Generic Token Markers` + `
` + + makeGenericButton("2014", "!condef-generic2014") + ` ` + + makeGenericButton("2024", "!condef-generic2024") + `
` + + + marketButtons + + + `Edit Manually from Handout` + `
` + + makeGenericButton("Open Handout", getHandoutURL("Condefinitions")) + + makeGenericButton("Update Conditions", "!condef-loadconditions") + `

` + + + makeGenericButton("Open Help Handout", getHandoutURL("Help: Condefinition")) + `
`; + + + + + let conditionsArray = []; + loadConditionsFromHandout(); + + let ConcentrationMarker = (conditionsArray.find(([k]) => k.toLowerCase() === "concentrating") || [, , , "death-zone"])[3]; + let condefConcentrationMarker = "status_" + ConcentrationMarker; + + + + let applyDamageIsInstalled = false; + //check for dependencies + if(typeof ApplyDamage !== "undefined") + { + applyDamageIsInstalled = true; + } + + let groupCheckIsInstalled = false; + if(typeof GroupCheck !== "undefined") + { + groupCheckIsInstalled = true; + } + + + const version = '0.0.0b12'; + log('Condefinitions v' + version + ' is ready! --offset ' + API_Meta.Condefinition.offset + ' for the D&D 5th Edition by Roll20 Sheet.'); + loadConditionsFromHandout(); + + function getHandoutURL(handoutName) + { + const handout = findObjs( + { + _type: "handout", + name: handoutName + })[0]; + if(!handout) + { + sendMessage("No Condefintions Handout could be found. Press one of the default settings buttons to create a new handout.") + return `"No Handout was found"`; + } + else + { + const id = handout.get("_id"); + return `https://journal.roll20.net/handout/${id}`; + } + } + + + function getConditionIcon(conditionName) + { + const iconMap = { + blinded: "bleeding-eye", + charmed: "chained-heart", + // Extend as needed + }; + return iconMap[conditionName] || "question-mark"; + } + + + + + function decodeHTMLEntities(str) + { + return str + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/&/g, "&"); + } + + + function deserializeConditionsMultiline(text) + { + return text + .replace(/^
|<\/pre>$/g, "") // Strip 
 tags if present
+            .split(/\r?\n\r?\n/) // Split on double line breaks
+            .map(block =>
+            {
+                const [key, regexStr, description, label] = block.trim()
+                    .split(/\r?\n/);
+                const regexMatch = regexStr?.match(/^\/(.+)\/([gimuy]*)$/);
+                const regex = regexMatch ? new RegExp(regexMatch[1], regexMatch[2]) : /.^/;
+
+                return [key, regex, description, label];
+            })
+            .filter(entry => entry.length === 4); // Prevents malformed rows
+    }
+
+
+
+    function loadConditionsFromHandout()
+    {
+        const handout = findObjs(
+        {
+            _type: "handout",
+            name: "Condefinitions"
+        })[0];
+        if(!handout)
+        {
+            log("⚠️ Handout 'Condefinitions' not found. Creating new Config handout.");
+            writeConditionsToHandoutMultilinePlainText(defaultConditionsArray);
+            loadConditionsFromHandout();
+            createHandoutIfMissing("Condefinitions", helpHTML);
+            sendMessage(configMessage, "Condefinition Configuration");
+            return;
+        }
+
+        handout.get("notes", function(notes)
+        {
+            const parsed = deserializeConditionsMultiline(notes);
+            if(parsed.length)
+            {
+                conditionsArray = parsed;
+            }
+            else
+            {
+                log("⚠️ No valid conditions found in 'Condefinitions' handout.");
+            }
+        });
+    }
+
+
+
+
+    function serializeConditionsArrayMultiline(array)
+    {
+        return array.map(([key, regex, description, label]) =>
+                `${key}\n${regex.toString()}\n${description}\n${label}`
+            )
+            .join("\n\n");
+    }
+
+
+
+    function writeConditionsToHandoutMultilinePlainText(conditionsArray)
+    {
+        const content = conditionsArray.map(([key, regex, description, label]) =>
+            {
+                const regexString = regex.toString(); // /.../flags
+                // const icon = getConditionIcon(key);   // optional helper for icon name
+                return `${key}\n${regex.toString()}\n${description}\n${label}`;
+            })
+            .join("\n\n");
+
+        const escaped = content
+            .replace(/&/g, "&")
+            .replace(//g, ">");
+
+        const wrapped = `
${escaped}
`; + + let handout = findObjs( + { + _type: "handout", + name: "Condefinitions" + })[0]; + + if(!handout) + { + handout = createObj("handout", + { + name: "Condefinitions", + inplayerjournals: "all", + archived: false + }); + } + + handout.set( + { + notes: wrapped + }); + } + + + + function readAndParseConditions() + { + const handout = findObjs( + { + _type: "handout", + name: "Condefinitions" + })[0]; + if(!handout) + { + log("⚠️ Handout not found."); + return; + } + + handout.get("notes", function(notes) + { + + const stripped = notes.replace(/^
/i, "")
+                .replace(/<\/pre>$/i, "");
+            const decoded = stripped
+                .replace(/</g, "<")
+                .replace(/>/g, ">")
+                .replace(/&/g, "&");
+
+
+            const parsed = deserializeConditionsMultiline(notes);
+            return parsed
+        });
+    }
+
+
+    function mergeDescriptionsWithClassicDefinitions(originalArray, newConditions)
+    {
+        return originalArray.map(entry =>
+        {
+            const [key, regex, , marker] = entry;
+            const match = newConditions.find(def => def[0] === key);
+            const newDescription = match ? match[1] : entry[2]; // fallback to original description if no match
+            return [key, regex, newDescription, marker];
+        });
+    }
+
+
+
+
+    function sendMessage(message, title)
+    {
+        let theTitle = (title ? `
${title}
` : ""); + let theMessage = (message ? `
${theTitle}${message}
` : ""); + + sendChat("Condefinition", `/w gm ${theMessage}`, null, + { + noarchive: true + }); + } + + + + + // writeConditionsToHandoutMultilinePlainText(conditionsArray); + + + const input = `
blinded
+/(be|and|is|magically|become|becomes|is either) blinded|blinded condition/i
+Example description here
+bleeding-eye
+Blinded
`; + + const result = deserializeConditionsMultiline(input); + + + + let buttons = ""; + let reportText = ""; + + function makeButton(conditionName, descriptionText, tokenMarker, tokenID) + { + let tmLabel = `L`; + //let markerName = tokenMarker; + + let markerName = ((tokenMarker.includes(";;")) ? tokenMarker.split(";;")[0] : tokenMarker); + if('undefined' !== typeof libTokenMarkers && undefined !== libTokenMarkers.getStatus(markerName) + .url) + { + let tmImage = libTokenMarkers.getStatus(markerName) + .url; + + if(undefined !== tmImage && tmImage.length > 0) + { + tmLabel = ``; + } + } + buttons = buttons + ``; + } + + + function makeGenericButton(name, link) + { + return ``; + + } + + + //Concentration Observer + function concentrationCheck(obj, prev) + { + if(obj.get("statusmarkers") + .includes(condefConcentrationMarker) || obj.get("statusmarkers") + .includes(ConcentrationMarker) || obj.get(condefConcentrationMarker)) + { + // if (obj.get(condefConcentrationMarker)) { + if(prev["bar1_value"] > obj.get("bar1_value")) + { + let final_conc_DC = 10; + let calc_conc_DC = (prev["bar1_value"] - obj.get("bar1_value")) / 2; + if(calc_conc_DC > final_conc_DC) + { + final_conc_DC = Math.floor(calc_conc_DC); + } + // let tokenName = obj.get("name"); + let theMessage = `! &{template:spell} {{name=Concentration}}{{savedc=${final_conc_DC}}} {{description=Make a DC ${final_conc_DC} Constitution saving throw}}{{Concentration=1}}`; + // let theMessage = `this should print`; + sendChat("gm", theMessage); + } + } + + } + + //Event Handlers + on("change:graphic:bar1_value", concentrationCheck); + if(typeof(TokenMod) === 'object') TokenMod.ObserveTokenChange(concentrationCheck); + if('undefined' !== typeof SmartAoE && SmartAoE.ObserveTokenChange) + { + SmartAoE.ObserveTokenChange(function(obj, prev) + { + concentrationCheck(obj, prev); + }); + } + + + //Condition report creator. Use !condef for GM only, pcondef for player report. Follow by condition names separated by spaces. !condef-all returns buttons for all conditions, for reference + on('chat:message', function(msg) + { + + + if(msg.type === "api" && msg.content === "!condef-generic2014") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray, definitions2014)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to Default token markers using the 2014 condition definitions"); + return; + } + + if(msg.type === "api" && msg.content === "!condef-generic2024") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray, definitions2024)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to Default token markers using the 2024 condition definitions"); + return; + } + + if(msg.type === "api" && msg.content === "!condef-easy2014") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray_EasyToRead, definitions2014)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to the Easy to Read token markers using the 2014 condition definitions"); + return; + } + + if(msg.type === "api" && msg.content === "!condef-easy2024") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray_EasyToRead, definitions2024)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to the Easy to Read token markers using the 2024 condition definitions"); + return; + } + + + if(msg.type === "api" && msg.content === "!condef-loadconditions") + { + loadConditionsFromHandout(); + ConcentrationMarker = (conditionsArray.find(([k]) => k.toLowerCase() === "concentrating") || [, , , "death-zone"])[3]; + condefConcentrationMarker = "status_" + ConcentrationMarker; + + sendMessage("Condition definitions reloaded from handout."); + return; + } + + if(msg.type === "api" && (msg.content === "!condef-config" || msg.content === "!condef-help")) + { + createHandoutIfMissing("Help: Condefinition", helpHTML, "", "https://s3.amazonaws.com/files.d20.io/images/442783616/hDkduTWDpcVEKomHnbb6AQ/med.png"); + + sendMessage(configMessage, "Condefinition Configuration"); + return; + } + + + + + if('api' === msg.type && msg.content.match(/^!(condef|pcondef|condef-all|condef-report|condef-toggle)/)) + { + let args = msg.content.split(" "); + let sender = msg.who; + if(msg.content === '!condef-all') + { + let message = `! &{template:noecho} {{description= blinded condition charmed condition deafened condition exhausted condition frightened condition grappled condition incapacitated condition invisible condition paralyzed condition petrified condition poisoned condition prone condition restrained condition stunned condition unconscious condition concentration check}}`; + sendChat("gm", message, null, + { + noarchive: true + }); + message = ""; + return; + } + + + let messagePrefix = ((msg.content.includes('pcondef')) ? '' : '/w ' + sender + ' '); + let theCommand = ((msg.content.includes("pcondef")) ? "!pcondef" : "!condef"); + + + //selected vs target handler + if(msg.content.includes('condef-toggle ') && msg.content.length > 15) + { + let tokenMarker = msg.content.split('condef-toggle ')[1]; + let message = ''; + if(msg.selected) + { + //message = `!token-mod --set statusmarkers|!${tokenMarker}`; + let ids = msg.selected.reduce((m, o) => [...m, o._id], []); + message = `!token-mod --api-as ${msg.playerid} --set statusmarkers|!${tokenMarker} --ids ${ids.join(' ')}`; + //message = `!token-mod --api-as ${msg.playerid} --set statusmarkers|!${tokenMarker}`; + + } + else + { + + message = messagePrefix + buttonboxUnshifted + 'No token is selected.
Click here to pick a target.
'; + } + sendChat("", message, null, + { + noarchive: true + }); + return; + } + + if(msg.content === '!condef-report') + { + buttons = ""; + + let selected = (msg.selected); + + if(selected) + { + _.each(selected, function(token) + { + let tok = getObj("graphic", token._id); + let tokName = tok.get("name") || "unnamed token"; + let tokID = tok.get("_id"); + let markers = tok.get("statusmarkers") + .replace(/::/g, ";;"); + + if(markers) + { + for(let i = 0; i < conditionsArray.length; i++) + { + let name = conditionsArray[i][0]; + let descriptionText = conditionsArray[i][2]; + let tokenMarker = conditionsArray[i][3]; + + if(markers.includes(tokenMarker)) + { + makeButton(name, descriptionText, tokenMarker, tokID); + } + } + let message = buttonbox + "" + tokName + "" + buttons + "
"; + sendChat("", messagePrefix + message, null, + { + noarchive: true + }); + + buttons = ""; + + } + }); + } + else + { + sendMessage("Select one or more tokens with conditions on them"); + + } + return; + } + + + + + for(let i = 0; i < conditionsArray.length; i++) + { + let reportName = conditionsArray[i][0]; + let reportDescription = conditionsArray[i][2]; + if(undefined !== args[1] && args[1] === reportName) + { + reportDescription = reportDescription.replace("!condef", theCommand); + reportText = `
${reportName}
${reportDescription.replace(/</g, "<").replace(/>/g, ">")}
`; + } + } + + if(undefined !== reportText && reportText.length > 0) + { + sendChat("", messagePrefix + reportText, null, + { + noarchive: true + }); + + } + + } + + + + //Roll Template Interception + if((undefined !== msg.rolltemplate && msg.rolltemplate.match(/npcfullatk|npcdmg|npcaction|traits|atkdmg|spell|condefinitions|spelloutput|noecho/g)) || (msg.content.match(/dnd-2024/g))) + { + //log (msg.content); + let sender = msg.who; + let messagePrefix = '/w ' + sender + ' '; + let saveAbility = ""; + let saveMatches = ""; + let theAbility = ""; + let saveDC = ""; + let conCheck = ""; + let concentrationButton = ""; + saveMatches = msg.content.match(/DC\s(\d\d)\s(Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma)\ssaving throw/i); + if(msg.rolltemplate !== "spell" && msg.rolltemplate !== "atkdmg" && null !== saveMatches && saveMatches.length === 3) + { + saveDC = saveMatches[1]; + saveAbility = saveMatches[2]; + } + //msg echo to console is disabled + if(msg.rolltemplate === "spell" || msg.rolltemplate === "atkdmg" || msg.rolltemplate === "spelloutput" || (msg.content.match(/dnd-2024 dnd-2024--/g))) + { + /*log(msg.content);*/ + saveAbility = msg.content.match(/(Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma)\ssav(e|ing throw)/i) || ""; + if(saveAbility.length > 0) + { + saveAbility = saveAbility[1] || ""; + } + + saveDC = ((msg.rolltemplate === "spell" || msg.rolltemplate === "spelloutput") ? msg.content.match(/{{savedc=(\d+)}}/) : msg.content.match(/{{mod=DC(\d+)}}/)) || msg.content.match(/DC\s(\d+)/) || ""; + conCheck = ((msg.rolltemplate === "spell" && msg.content.match(/{{name=Concentration/)) ? "Concentration Check" : ""); + // if (conCheck!==""){ + // makeButton("Concentrating", "makes a con check", "concentrating"); + // } + // concentrationButton = ((conCheck==="") ? "" : "
" + buttons); + + + //log("concentrationButton = " + concentrationButton); + if(saveDC.length > 0) + { + saveDC = saveDC[1] || ""; + } + + } + + if(undefined !== saveAbility && null !== saveAbility) + { + + theAbility = saveAbility.replace(/Strength/i, "str") + .replace(/Dexterity/i, "dex") + .replace(/Constitution/i, "con") + .replace(/Intelligence/i, "int") + .replace(/Wisdom/i, "wis") + .replace(/Charisma/i, "cha"); + } + let saveButton = ""; + + if(theAbility.match(/(str|dex|con|int|wis|cha)/)) + { + //for regular saves + saveButton = `DC${saveDC} ${theAbility} ${conCheck}${concentrationButton}`; + //for groupcheck + if(groupCheckIsInstalled) + { + saveAbility = saveAbility.charAt(0) + .toUpperCase() + saveAbility.slice(1); + saveButton = `DC${saveDC} ${theAbility} ${conCheck}${concentrationButton}`; + if(applyDamageIsInstalled && conCheck !== "Concentration Check") + { + saveButton = saveButton + `Dmg`; + } + } + } + + for(let i = 0; i < conditionsArray.length; i++) + { + let name = conditionsArray[i][0]; + let descriptionText = conditionsArray[i][2]; + let tokenMarker = conditionsArray[i][3]; + + if(undefined !== name) + { + if(msg.content.match(conditionsArray[i][1])) + { + makeButton(name, descriptionText, tokenMarker); + } + + } + } + let GMSaveButton = saveButton; + if(!playerIsGM(msg.playerid) && msg.playerid !== "API") + { + saveButton = ""; + } + if(buttons.length > 0 || saveButton.length > 0) + { + + let message = buttonbox + saveButton + buttons + ""; + sendChat("", messagePrefix + message, null, + { + noarchive: true + }); + + if(!messagePrefix.includes(' (GM)') && msg.rolltemplate !== "noecho") + { + message = buttonbox + GMSaveButton + buttons + ""; + if(conCheck !== "Concentration Check") + { + sendChat("", '/w gm ' + message, null, + { + noarchive: true + }); + } + } + + + buttons = ""; + + } + } + }); + +}); + +{ + try + { + throw new Error(''); + } + catch (e) + { + API_Meta.Condefinition.lineCount = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - API_Meta.Condefinition.offset); + } +} From ccaeef74fdc672ff9c8ed9e6df6ce2d8ac236fd5 Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 08:49:12 -0700 Subject: [PATCH 05/13] Create Condefinition.js Created Version File --- Condefinition/1.0/Condefinition.js | 1348 ++++++++++++++++++++++++++++ 1 file changed, 1348 insertions(+) create mode 100644 Condefinition/1.0/Condefinition.js diff --git a/Condefinition/1.0/Condefinition.js b/Condefinition/1.0/Condefinition.js new file mode 100644 index 0000000000..a7e6976932 --- /dev/null +++ b/Condefinition/1.0/Condefinition.js @@ -0,0 +1,1348 @@ +var API_Meta = API_Meta || +{}; //eslint-disable-line no-var +API_Meta.Condefinition = { + offset: Number.MAX_SAFE_INTEGER, + lineCount: -1 +}; +{ + try + { + throw new Error(''); + } + catch (e) + { + API_Meta.Condefinition.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (7)); + } +} + +/* globals libTokenMarkers, TokenMod, SmartAoE */ + + + +on('ready', () => +{ + + // Make sure libTokenMarkers exists, has the functions that are expected, and has a constant for testing + if('undefined' === typeof libTokenMarkers || + (['getStatus', 'getStatuses', 'getOrderedList'].find(k => + !libTokenMarkers.hasOwnProperty(k) || 'function' !== typeof libTokenMarkers[k] + )) + ) + { + // notify of the missing library + sendChat('', `/w gm
Missing dependency: libTokenMarkers.
You can install this on your Mod Page with One-Click install.
`); + return; + + } + + // Checks for the existence of a given marker. Used for determining whether to create marketplace buttons + const markerExists = (marker) => + { + if(!marker || !marker.length) return false; + + const match = /(@\d+$|:)/.exec(marker); + const endIndex = match ? match.index : marker.length; + + const key = marker.slice(0, endIndex); + const status = libTokenMarkers.getStatus(key); + + return status.getName() === marker; + }; + + let definitions2014 = [ + ["concentrating", "Some Spells require you to maintain Concentration in order to keep their magic active. If you lose concentra⁠tion, such a spell ends.
If a spell must be maintained with Concentration, that fact appears in its Duration entry, and the spell specifies how long you can conce⁠ntrate on it. You can end Concentration at any time (no Action required).
Normal activity, such as moving and Attacking, doesn’t interfere with Concentration. The following factors can break concentration:
• Casting another spell that requires Concentration. You lose concentr⁠ation on a spell if you cast another spell that requires conc⁠entration. You can’t concentrate on two Spells at once.
• Taking Damage. Whenever you take damage while you are concentrating on a spell, you must make a Constitution saving throw to maintain your Concentration. The DC equals 10 or half the damage you take, whichever number is higher. If you take damage from multiple sources, such as an arrow and a dragon’s breath, you make a separate saving throw for each source of damage.
• Being Incapacitated or killed. You lose Concentration on a spell if you are incap⁠acitated or if you die.
• The DM might also decide that certain environmental phenomena, such as a wave Crashing over you while you’re on a storm-tossed ship, require you to succeed on a DC 10 Constitution saving throw to maintain Concentration on a spell."], + ["blinded", "• A blinded creature can’t see and automatically fails any ability check that requires sight.
• Attack rolls against the creature have advantage, and the creature’s attack rolls have disadvantage."], + ["charmed", "A charmed creature can’t attack the charmer or target the charmer with harmful bilities or magical Effects.
The charmer has advantage on any ability check to interact socially with the creature."], + ["deafened", "A deafened creature can’t hear and automatically fails any ability check that requires hearing."], + ["exhaustion", "Some special ablities and environmental hazards, such as starvation and the long-term effects of freezing or scorching temperatures, can lead to a spcial condition called exhaustion. Exhaustion is measured in six levels. An Effect can give a creature one or more levels of exhaustion, as specified in the effect’s description.

Lvl Effect
1Disadvantage on Ability Checks
2Speed halved
3Disadvantage on attack rolls and Saving Throws
4Hit point maximum halved
5Speed reduced to 0
6Death

If an already exhausted creature suffers another effect that causes exhaustion, its current level of exhaustion increases by the amount specified in the effect’s description.

A creature suffers the effect of its current level of exhaustion as well as all lower levels. For example, a creature suffering level 2 exhaustion has its speed halved and has disadvantage on Ability Checks.

An Effect that removes exhaustion reduces its level as specified in the effect’s description, with all exhaustion Effects Ending if a creature’s exhaustion level is reduced below 1.

Finishing a Long Rest reduces a creature’s exhaustion level by 1, provided that the creature has also ingested some food and drink. Also, being raised from the dead reduces a creature's exhaustion level by 1."], + ["frightened", "A frightened creature has disadvantage on Ability Checks and attack rolls while the source of its fear is within Line of Sight.
The creature can’t willingly move closer to the source of its fear."], + ["grappled", "A grappled creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.
The condition ends if the grappler is incapacitated.
The condition also ends if an Effect removes the grappled creature from the reach of the Grappler or Grappling Effect, such as when a creature is hurled away by the thunderwave spell."], + ["incapacitated", "An incapacitated creature can’t take actions or reactions."], + ["invisible", "An invisible creature is impossible to see without the aid of magic or a spcial sense. For the purpose of hiding, the creature is heavily obscured. The creature’s location can be detected by any noise it makes or any tracks it leaves.
Attack rolls against the creature have disadvantage, and the creature’s Attack rolls have advantage."], + ["paralyzed", "A paralyzed creature is incapacitated and can’t move or speak.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage.
Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature."], + ["petrified", "A petrified creature is transformed, along with any nonmagical object it is wearing or carrying, into a solid inanimate substance (usually stone). Its weight increases by a factor of ten, and it ceases aging.
The creature is incapacitated, can’t move or speak, and is unaware of its surroundings.
Attack rolls against the creature have advantage.
The creature automatically fails Strength and Dexterity Saving Throws.
The creature has Resistance to all damage.
The creature is immune to poison and disease, although a poison or disease already in its system is suspended, not neutralized."], + ["poisoned", "A poisoned creature has disadvantage on attack rolls and Ability Checks."], + ["prone", "A prone creature’s only Movement option is to crawl, unless it stands up and thereby ends the condition.
The creature has disadvantage on attack rolls.
An attack roll against the creature has advantage
if the attacker is within 5 feet of the creature.Otherwise, the attack roll has disadvantage."], + ["restrained", "A restrained creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.
Attack rolls against the creature have advantage, and the creature’s Attack rolls have disadvantage.
The creature has disadvantage on Dexterity Saving Throws."], + ["stunned", "A stunned creature is incapacitated, can’t move, and can speak only falteringly.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage."], + ["unconscious", "An unconscious creature is incapacitated, can’t move or speak, and is unaware of its surroundings
The creature drops whatever it’s holding and falls prone.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage.
Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature."], + ["dead", "A dead creature is an object.
Most GMs have a monster die the instant it drops to 0 Hit Points, rather than having it fall Unconscious and make death Saving Throws.
Mighty Villains and Special nonplayer Characters are Common exceptions; the GM might have them fall Unconscious and follow the same rules as player Characters."], + ["bardic-inspiration", "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails."], + ["bloodied", "Bloodied is not an official term, but usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is."], + ["confused", "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll a d10 at the start of each of its turns to determine its behavior for that turn.
d10 Behavior
1 The creature uses all its Movement to move in a random direction. To determine the direction, roll a d8 and assign a direction to each die face. The creature doesn't take an Action this turn.
2-6 The creature doesn't move or take ACTIONS this turn.
7-8 The creature uses its Action to make a melee Attack against a randomly determined creature within its reach. If there is no creature within its reach, the creature does nothing this turn.
9-10 The creature can act and move normally."], + ["full-cover", "A target with total cover can’t be targeted directly by an Attack or a spell, although some Spells can reach such a target by including it in an area of Effect. A target has total cover if it is completely concealed by an obstacle.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], + ["three-quarter-cover", "A target with three-quarters cover has a +5 bonus to AC and Dexterity Saving Throws. A target has three-quarters cover if about three-quarters of it is covered by an obstacle. The obstacle might be a portcullis, an arrow slit, or a thick tree trunk.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], + ["half-cover", "A target with half cover has a +2 bonus to AC and Dexterity Saving Throws. A target has half cover if an obstacle blocks at least half of its body. The obstacle might be a low wall, a large piece of furniture, a narrow tree trunk, or a creature, whether that creature is an enemy or a friend.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], + ["diseased", "See the entry on Diseases in the Compendium"], + ["ethereal", "Border Ethereal
From the Border Ethereal, a Traveler can see into whatever plane it overlaps, but that plane appears muted and indistinct, its colors blurring into each other and its edges turning fuzzy. Ethereal denizens watch the plane as though peering through distorted and frosted glass, and can’t see anything beyond 30 feet into the other plane. Conversely, the Ethereal Plane is usually Invisible to those on the overlapped planes, except with the aid of magic.
Normally, Creatures in the Border Ethereal can’t Attack Creatures on the overlapped plane, and vice versa. A Traveler on the Ethereal Plane is Invisible and utterly silent to someone on the overlapped plane, and solid Objects on the overlapped plane don’t hamper the Movement of a creature in the Border Ethereal. The exceptions are certain Magical Effects (including anything made of Magical force) and living beings. This makes the Ethereal Plane ideal for reconnaissance, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can move up and down as easily as walking."], + ["flying", "Flying Creatures enjoy many benefits of mobility, but they must also deal with the danger of Falling. If a flying creature is knocked prone, has its speed reduced to 0, or is otherwise deprived of the ability to move, the creature falls, unless it has the ability to hover or it is being held aloft by magic, such as by the fly spell."], + ["haste", "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it."], + ["hexed", "Until the spell ends, you deal an extra 1d6 necrotic damage to the target whenever you hit it with an Attack. Also, choose one ability when you cast the spell. The target has disadvantage on Ability Checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can use a bonus Action on a subsequent turn of yours to curse a new creature.
A Remove Curse cast on the target ends this spell early."], + ["hexblade-curse", "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest."], + ["hidden", "Combatants often try to Escape their foes’ notice by Hiding, casting the Invisibility spell, or lurking in darkne⁠ss.
When you Attack a target that you can’t see, you have disadvantage on the at⁠tack roll. This is true whether you’re guessing the target’s Location or you’re targeting a creature you can hear but not see. If the target isn’t in the Location you targeted, you automatically miss, but the DM typically just says that the att⁠ack missed, not whether you guessed the target’s Location correctl
When a creature can’t see you, you have advantage on Attack rolls against it. If you are hidden—both unseen and unheard—when you make an at⁠tack, you give away your Location when the att⁠ack hits or misses."], + ["TempHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."], + ["favored", "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level."], + ["marked", "You deal an extra 1d6 damage to the target whenever you hit it with a weapon Attack, and you have advantage on any Wisdom (Perception) or Wis⁠dom (Survival) check you make to find it. If the target drops to 0 Hit Points before this spell ends, you can use a bonus Action on a subsequent turn of yours to mark a new creature
At Higher Levels. When you cast this spell using a spell slot of 3rd or 4th Level, you can maintain your Concentration on the spell for up to 8 hours. When you use a spell slot of 5th Level or higher, you can maintain your concentr⁠ation on the spell for up to 24 hours."], + ["raging", "While raging, you gain the following benefits if you aren’t wearing heavy armor:
• You have advantage on Strength checks and Strength Saving Throws.
• When you make a melee weapon Attack using Strength, you gain a bonus to the damage roll that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian table.If you are able to cast Spells, you can’t cast them or concentrate on them while raging.
Your rage lasts for 1 minute. It ends early if you are knocked Unconscious or if Your Turn ends and you haven’t attacked a Hostile creature since your last turn or taken damage since then. You can also end your rage on Your Turn as a bonus Action.
Once you have raged the number of times shown for your Barbarian level in the Rages column of the Barbarian table, you must finish a Long Rest before you can rage again."], + ["slowed", "An affected target’s speed is halved, it takes a −2 penalty to AC and Dexterity Saving Throws, and it can’t use reactions. On its turn, it can use either an Action or a bonus Action, not both. Regardless of the creature’s Abilities or magic items, it can’t make more than one melee or ranged Attack during its turn.
If the creature attempts to Cast a Spell with a Casting Time of 1 Action, roll a d20. On an 11 or higher, the spell doesn’t take Effect until the creature’s next turn, and the creature must use its Action on that turn to complete the spell. If it can’t, the spell is wasted.
A creature affected by this spell makes another Wisdom saving throw at the end of each of its turns. On a successful save, the Effect ends for it."], + ["Torch", "A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee Attack with a burning torch and hit, it deals 1 fire damage."], + ["dying", "Falling Unconscious
If damage reduces you to 0 Hit Points and fails to kill you, you fall Unconscious (see Conditions ). This unconsciousness ends if you regain any Hit Points.
Death Saving Throws
Whenever you start Your Turn with 0 Hit Points, you must make a Special saving throw, called a death saving throw, to determine whether you creep closer to death or hang onto life. Unlike other Saving Throws, this one isn’t tied to any ability score. You are in the hands of fate now, aided only by Spells and Features that improve your chances of succeeding on a saving throw.
Roll a d20: If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no Effect by itself. On your third success, you become stable (see below). On your third failure, you die. The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become stable.
Rolling 1 or 20: When you make a death saving throw and roll a 1 on The D20, it counts as two failures. If you roll a 20 on The D20, you regain 1 hit point.
Damage at 0 Hit Points: If you take any damage while you have 0 Hit Points, you suffer a death saving throw failure. If the damage is from a critical hit, you suffer two failures instead. If the damage equals or exceeds your hit point maximum, you suffer Instant Death."], + ["burrowing", "A monster that has a burrowing speed can use that speed to move through sand, earth, mud, or ice. A monster can’t burrow through solid rock unless it has a Special trait that allows it to do so."], + ["dodging", "Until the start of your next turn, any Attack roll made against you has disadvantage if you can see the attacker, and you make Dexterity Saving Throws with advantage. You lose this benefit if you are Incapacitated or if your speed drops to 0."], + ["inspiration", "If you have Inspiration, you can expend it when you make an Attack roll, saving throw, or ability check. Spending your Inspiration gives you advantage on that roll.
Additionally, if you have Inspiration, you can reward another player for good Roleplaying, clever thinking, or simply doing something exciting in the game. When another player character does something that really contributes to the story in a fun and interesting way, you can give up your Inspiration to give that character Inspiration."], + ["TemporaryHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."] + ]; + + let definitions2024 = [ + ["concentrating", "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die."], + ["blinded", "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage."], + ["charmed", "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially."], + ["deafened", "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing."], + ["exhaustion", "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends."], + ["frightened", "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear."], + ["grappled", "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it."], + ["incapacitated", "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll."], + ["invisible", "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature."], + ["paralyzed", "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you."], + ["petrified", "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition."], + ["poisoned", "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks."], + ["prone", "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage."], + ["restrained", "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws."], + ["stunned", "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage."], + ["unconscious", "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings."], + ["dead", "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them."], + ["bardic-inspiration", "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails."], + ["bloodied", "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is."], + ["confused", "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success."], + ["full-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], + ["three-quarter-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], + ["half-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], + ["diseased", "See the entry on Diseases in the Compendium"], + ["ethereal", "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond."], + ["flying", "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover."], + ["haste", "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it."], + ["hexed", "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature."], + ["hexblade-curse", "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest."], + ["hidden", "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component."], + ["TempHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."], + ["favored", "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level."], + ["marked", "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours)."], + ["raging", "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage."], + ["slowed", "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success."], + ["Torch", "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage."], + ["dying", "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours."], + ["burrowing", "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed."], + ["dodging", "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0."], + ["inspiration", "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it."], + ["TemporaryHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."] + ]; + + + let defaultConditionsArray = [ + ["concentrating", + /concentration check|concentration=1/i, + "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die.", + `death-zone` + ], + ["blinded", + /(be|and|is|magically|become|becomes|is either|has the) blinded|blinded condition/i, + "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.", + `bleeding-eye` + ], + [ + "charmed", + /(be|and|is|magically|become|becomes) charmed|charmed condition/i, + "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially.", + `chained-heart` + ], + [ + "deafened", + /(be|and|is|magically|become|becomes) deafened|deafened condition/i, + "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing.", + `overdrive` + ], + [ + "exhaustion", + /(be|and|is|magically|become|becomes) exhausted|(of|magical) exhaustion|exhausted condition/i, + "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends.", + `half-haze` + ], + [ + "frightened", + /(be|and|is|magically|become|becomes) frightened|frightened condition/i, + "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear.", + `screaming` + ], + [ + "grappled", + /(be|and|is|magically|becomes|considered) grappled|grappled condition/i, + "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it.", + `grab` + ], + [ + "incapacitated", + /(be|and|is|magically|become|becomes) incapacitated|incapacitated condition/i, + "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll.", + `interdiction` + ], + [ + "invisible", + /(be|and|is|magically|become|becomes) invisible|invisible condition/i, + "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature.", + `ninja-mask` + ], + [ + "paralyzed", + /(be|and|is|magically|become|becomes) paralyzed|paralyzed condition/i, + "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.", + `aura` + ], + [ + "petrified", + /(be|and|is|magically|become|becomes|becoming) petrified|(turns to|turning to) stone|petrified condition/i, + "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition.", + `chemical-bolt` + ], + [ + "poisoned", + /(be|and|is|magically|become|becomes) poisoned|poisoned condition/i, + "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks.", + 'skull' + ], + [ + "prone", + /(be|and|is|magically|become|becomes|knocked|fall|falls) prone|prone condition/i, + "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage.", + `back-pain` + ], + [ + "restrained", + /(be|and|is|magically|become|becomes) restrained|restrained condition/i, + "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws.", + `cobweb` + ], + [ + "stunned", + /(be|and|is|magically|become|becomes) stunned|stunned condition/i, + "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.", + `broken-skull` + ], + [ + "unconscious", + /(be|and|is|magically|become|becomes) unconscious|unconscious condition/i, + "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings.", + `sleepy` + ], + [ + "dead", + /nonmatching string to prevent accidental triggering/i, + "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them.", + `dead` + ], + [ + "bardic-inspiration", + /You can inspire others through stirring words or music/i, + "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails.", + `black-flag` + ], + [ + "bloodied", + /nonmatching string to prevent accidental triggering/i, + "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is.", + `pummeled` + ], + [ + "confused", + /spawning delusions and provoking uncontrolled action/i, + "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success.", + `rolling-bomb` + ], + [ + "full-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `bolt-shield` + ], + [ + "three-quarter-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `broken-shield` + ], + [ + "half-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `broken-shield` + ], + [ + "diseased", + /nonmatching string to prevent accidental triggering/i, + "See the entry on Diseases in the Compendium", + `radioactive` + ], + [ + "ethereal", + /ethereal/i, + "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond.", + `angel-outfit` + ], + [ + "flying", + /nonmatching string to prevent accidental triggering/i, + "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover.", + `fluffy-wing` + ], + [ + "haste", + /as a wave of lethargy sweeps over it/i, + "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it.", + `stopwatch` + ], + [ + "hexed", + /You place a curse on a creature that you can see within range/i, + "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature.", + `lightning-helix` + ], + [ + "hexblade-curse", + /Starting at 1st Level, you gain the ability to place a baleful curse on someone/i, + "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest.", + `all-for-one` + ], + [ + "hidden", + /nonmatching string to prevent accidental triggering/i, + "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component.", + `ninja-mask` + ], + [ + "TempHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `broken-heart` + ], + [ + "favored", + /mystical bond with Nature to mark the target as your Favored enemy/i, + "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level.", + `archery-target` + ], + [ + "marked", + /(mystically mark it as your quarry|You magically mark one creature you can see within range as your quarry)/i, + "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours).", + `archery-target` + ], + [ + "raging", + /On your turn, you can enter a rage as a Bonus Action/i, + "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage.", + `strong` + ], + [ + "slowed", + /You alter time around up to six creatures of your choice/i, + "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success.", + `snail` + ], + [ + "Torch", + /nonmatching string to prevent accidental triggering/i, + "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage.", + `frozen-orb` + ], + [ + "dying", + /nonmatching string to prevent accidental triggering/i, + "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours.", + `death-zone` + ], + [ + "burrowing", + /nonmatching string to prevent accidental triggering/i, + "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed.", + `edge-crack` + ], + [ + "dodging", + /nonmatching string to prevent accidental triggering/i, + "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0.", + `tread` + ], + [ + "inspiration", + /nonmatching string to prevent accidental triggering/i, + "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it.", + `flying-flag` + ], + [ + "TemporaryHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `broken-heart` + ] + + + + ] + // END SET STATUS CONDITIONS OR TOKEN MARKERS + + + let defaultConditionsArray_EasyToRead = [ + ["concentrating", + /concentration check|concentration=1/i, + "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die.", + `Concentrating` + ], + ["blinded", + /(be|and|is|magically|become|becomes|is either|has the) blinded|blinded condition/i, + "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.", + `Blinded` + ], + [ + "charmed", + /(be|and|is|magically|become|becomes) charmed|charmed condition/i, + "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially.", + `Charmed` + ], + [ + "deafened", + /(be|and|is|magically|become|becomes) deafened|deafened condition/i, + "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing.", + `Deafened` + ], + [ + "exhaustion", + /(be|and|is|magically|become|becomes) exhausted|(of|magical) exhaustion|exhausted condition/i, + "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends.", + `Exhaustion1` + ], + [ + "frightened", + /(be|and|is|magically|become|becomes) frightened|frightened condition/i, + "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear.", + `Frightened` + ], + [ + "grappled", + /(be|and|is|magically|becomes|considered) grappled|grappled condition/i, + "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it.", + `Grappled` + ], + [ + "incapacitated", + /(be|and|is|magically|become|becomes) incapacitated|incapacitated condition/i, + "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll.", + `Incapacitated` + ], + [ + "invisible", + /(be|and|is|magically|become|becomes) invisible|invisible condition/i, + "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature.", + `Invisible` + ], + [ + "paralyzed", + /(be|and|is|magically|become|becomes) paralyzed|paralyzed condition/i, + "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.", + `Paralyzed` + ], + [ + "petrified", + /(be|and|is|magically|become|becomes|becoming) petrified|(turns to|turning to) stone|petrified condition/i, + "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition.", + `Petrified` + ], + [ + "poisoned", + /(be|and|is|magically|become|becomes) poisoned|poisoned condition/i, + "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks.", + 'Poisoned' + ], + [ + "prone", + /(be|and|is|magically|become|becomes|knocked|fall|falls) prone|prone condition/i, + "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage.", + `Prone` + ], + [ + "restrained", + /(be|and|is|magically|become|becomes) restrained|restrained condition/i, + "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws.", + `Restrained` + ], + [ + "stunned", + /(be|and|is|magically|become|becomes) stunned|stunned condition/i, + "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.", + `Stunned` + ], + [ + "unconscious", + /(be|and|is|magically|become|becomes) unconscious|unconscious condition/i, + "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings.", + `Unconscious9` + ], + [ + "dead", + /nonmatching string to prevent accidental triggering/i, + "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them.", + `dead` + ], + [ + "bardic-inspiration", + /You can inspire others through stirring words or music/i, + "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails.", + `Bardic` + ], + [ + "bloodied", + /nonmatching string to prevent accidental triggering/i, + "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is.", + `Bloodied` + ], + [ + "confused", + /spawning delusions and provoking uncontrolled action/i, + "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success.", + `Confused` + ], + [ + "full-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + // `death-zone` + `Cover` + ], + [ + "three-quarter-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `ThreeQuarterCover` + ], + [ + "half-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `HalfCover` + ], + [ + "diseased", + /nonmatching string to prevent accidental triggering/i, + "See the entry on Diseases in the Compendium", + `Dieseased` + ], + [ + "ethereal", + /ethereal/i, + "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond.", + `Ethereal` + ], + [ + "flying", + /nonmatching string to prevent accidental triggering/i, + "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover.", + `Flying` + ], + [ + "haste", + /as a wave of lethargy sweeps over it/i, + "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it.", + `Haste` + ], + [ + "hexed", + /You place a curse on a creature that you can see within range/i, + "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature.", + `Hexed` + ], + [ + "hexblade-curse", + /Starting at 1st Level, you gain the ability to place a baleful curse on someone/i, + "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest.", + `Hexed2` + ], + [ + "hidden", + /nonmatching string to prevent accidental triggering/i, + "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component.", + `Hidden` + ], + [ + "TempHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `TempHP` + ], + [ + "favored", + /mystical bond with Nature to mark the target as your Favored enemy/i, + "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level.", + `Marked` + ], + [ + "marked", + /(mystically mark it as your quarry|You magically mark one creature you can see within range as your quarry)/i, + "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours).", + `Marked2` + ], + [ + "raging", + /On your turn, you can enter a rage as a Bonus Action/i, + "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage.", + `Raging` + ], + [ + "slowed", + /You alter time around up to six creatures of your choice/i, + "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success.", + `Slow` + ], + [ + "Torch", + /nonmatching string to prevent accidental triggering/i, + "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage.", + `Torch` + ], + [ + "dying", + /nonmatching string to prevent accidental triggering/i, + "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours.", + `Dying` + ], + [ + "burrowing", + /nonmatching string to prevent accidental triggering/i, + "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed.", + `Burrowing` + ], + [ + "dodging", + /nonmatching string to prevent accidental triggering/i, + "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0.", + `Dodging` + ], + [ + "inspiration", + /nonmatching string to prevent accidental triggering/i, + "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it.", + `Inspiration` + ], + [ + "TemporaryHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `TempHP2` + ] + + + + ] + // END SET STATUS CONDITIONS OR TOKEN MARKERS + + //Creates Handouts + function createHandoutIfMissing(name, html, gmnotes, avatar) + { + if(!name) return; + if(!html && !gmnotes && !avatar) return; // nothing to set + + const existing = findObjs( + { + _type: "handout", + name + })[0]; + if(existing) return; + + const handout = createObj("handout", + { + name, + inplayerjournals: "all", + archived: false + }); + + const props = {}; + if(html) props.notes = html; + if(gmnotes) props.gmnotes = gmnotes; + if(avatar) props.avatar = avatar; + + handout.set(props); + } + + + + const buttonstyle = `"background-color:#702c91; border-style:none;border-radius:0px 0px 0px 0px; margin:3px 2px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; + const publicButtonStyle = `"background-color:#702c91; border-style:none;border-radius:10px 0px 0px 10px; margin:3px 2px 3px 3px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 3px"`; + const markerButtonStyle = `"background-color:#702c91; border-style:none;border-radius:0px 10px 10px 0px; margin:3px 3px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 3px"`; + const saveButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:13px; margin:3px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; + const groupSaveButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:13px 0px 0px 13px; margin:3px 1px 3px 3px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; + const applyDamageButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:0px 13px 13px 0px; margin:3px 3px 3px 1px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; + const simpleButtonstyle = `"background-color:#702c91; border-style:none;border-radius:2px; margin:3px 2px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; + + const conditionnamestyle = `"background-color:#702c91; border-style:none;border-radius:6px 6px 0px 0px; margin:-8px -8px 3px -8px; font-weight:bold;text-transform:capitalize;text-decoration:none;display:block;text-align:center;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; + + const reportstyle = `"display: block; background-color:#aaa; border-radius:6px; text-decoration:none;color:#111; font-family:Arial; font-size:13px; padding: 8px;"`; + const preportstyle = `"display: block; background-color:#aaa; border-radius:6px; text-decoration:none;color:#111; font-family:Arial; font-size:13px; padding: 8px;"`; + const regexForTitles = /incapacitated<\/a>/; + const buttonbox = `
`; + const buttonboxUnshifted = `
`; + const buttonMenuStyle = `"display:block; border:1px solid #555; padding:3px; border-radius:4px; background-color:#bbb;"`; + const printChar = 'w'; + + + + + const helpHTML = `

Condefinition

What it does

Condefinition reads incoming roll templates and looks for imposed conditions and saving throws. It display a button(s) in chat that allow you to quickly apply a corresponding token marker, define the condition, track concentration, roll saving throws and/or apply damage from spells or effects that are triggered by saving throws.

  • If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to have it roll the appropriate save. If you have GroupCheck installed, it will run a groupcheck save. If you have Apply Damage installed, it will run through the steps to do a save and apply damage.
  • If the roll template contains an imposed condition, it will create a button to define the condition. If there is a cross reference in the definition of the condition, it  will create an inline link. You can also hover over the button for the text. You can use this button to whisper the text to yourself, or broadcast to the players.
  • You can also toggle that condition on any selected tokens. Assigning token markers requires installing TokenMod, and for greater facility, LibTokenMarkers. It comes with the default Status Markers assigned, but the script creates a configuration handout that can be edited to use custom token markers. Instructions are included later in this handout.
  • If you installed this Mod using Roll20 One-Click, it should automatically install GroupCheckTokenMod, and LibTokenMarkers if they are not already present. Apply Damage needs to be installed manually if you want its functionality.
  • Besides the official conditions, this also tracks mentions in chat for many common features that benefit from markers, such as raging, using Hunter's Mark, Hexblade's Curse and more. Each of these has buttons to toggle or define the effect.
  • The marker for the Concentrating condition also tracks concentration, and prompts for a Constitution Saving Throw when the token takes damage. See below for details. 
  • This script has been written to work on Classic or Jumpgate, and with the 2014 and/or 2024 sheets for 5e D&D. A dedicated user could probably adapt this for other sheets, but you would need to install the code manually. Contact me for guidance if you need it, but you will need a decent understanding of JavaScript.

What it can't do

Currently, there are some limitations:

  • This is built for GMs to facilitate running NPCs. Although most of the functions will work with PCs as well, and buttons should display for any player whose actions generate them, not every bit of it is player-accessible
  • The conditions are matched to tokens and their markers, not character sheets. This is the intended behavior as each instance of a goblin (for example) can have its own imposed conditions.
  • I have tried to catch every variation of condition wording, but I have probably missed a few incidences, particularly in products which do not adhere well to the WotC style.
  • In this iteration, all buttons and definitions are whispered to the controller of the NPC, typically the GM. If there is interest, I may change this to obey the whisper settings of the NPC, but I did not want to spam the chat. 

Helper Scripts

  • Required: Token-mod, libTokenMarkers
  • Improved by: GroupCheckApply Damage

Operation

Buttons

Every time a condition is implied by something in a chat roll template, or if the report function is used on a selected token, the script produces a button. Each button has three parts.

The middle, largest part of the button will send a message tot he GM in chat, that defines the condition. Sometimes, this will have links to other conditions that the condition imposes. Such as an Unconscious character is also Incapacitated.

The left side of the button has a word balloon graphic. This also send the definition to chat, but in this case, it is visible to all players.

The right hand side of the button shows the marker associated with that condition. It will toggle the marker for any and all selected tokens.


List All Common Condition Definitions

Condefinition can produce a reference palette of all official condition buttons. Type !condef-all  to display the report. Note that the script tracks more markers than this, such as \"Raging\", or \"Marked\". These are just the official conditions defined by the rules.


Concentration

Condefintion will monitor if the token taking damage has a defined concentration marker on it. If you reduce the hit point bar of a concentrating token, the script will prompt you to make the appropriate Constitution save.

Example. \"Morrigan\" just took 30 hp of damage while concentrating on a spell. The Script notes that the concentration marker was active, calculates the saving throw and produces a button that will cause the selected token to roll a saving throw. Note: In order to make this script work with both the 2014 and 2024 sheets, the Group Check mod is required and configured for your sheet(s). If you installed Condefinition via Roll20 One Click, it should have installed all helper scripts automatically. See the first section of this handout for more details. 


Report

Condefintion also allows you to select any number of tokens and run !condef-report. The script produces a set of report buttons for each selected token that has a defined condition marker on it. In this case, the sub-buttons that toggle token markers will only affect the respective token, and that token does not need to be selected.


Automation of Abilities that Force Saving Throws

This feature requires both Group Check, and the manually installed script Apply Damage in order to function. It also requires that the spell or feature of a creature is sent to chat with the Description turned on. In some cases this requires rolling damage or clicking the roll template button that shows the spell description. There are too many sheet variables to account for here, but in short, the keywords needed in order to trigger the script must have been sent to chat. 

The button produced is very similar to the concentration check button. In this case, the left half will roll a saving throw for all selected tokens. If you have Apply Damage installed, it will also walk you through the steps necessary to resolve the roll and apply damage accordingly. Note that this function will work on a combination of selected 2014 and 2024 tokens.


Configuration

Out of the box, this script will support conditions defined by both the 2014 and 2024 rule sets. It also can switch between the default token markers or my own Easy to Read token markers. This latter is entirely for my own convenience, and they are not required in any way for the script to function.

The Condefinitions Handout

Type !condef help or !condef config in chat to call up the configuration controls. 

Condefinition uses a lot of Regular Expressions (search code) to find and apply token markers and definitions. It reads these from a handout called Condefinitions. You can edit this handout manually. It has all of the code needed to define the conditions wrapped in a code block. You can edit the names, the definitions, the search code and the name of the corresponding token marker. The edited text must be clean plain text wrapped in code tags using the Code style button in the editor. Most users will only need to change the name of the token marker to match their chosen set.

If you don't feel comfortable editing the other code, or do so and make a mistake which breaks the handout, you can reset to the default using the buttons in the configuration panel. The script contains defaults for the 2014 and 2024 rule sets, using the default token markers provided by Roll20. I original wrote this script using my own Marketplace set, so if you have installed my \"Easy to Read Token Markers\" set, then there are also buttons that set defaults for those. This Marketplace set is honestly for my own convenience, and the script does not require this set in any way.

Each Condefintion definition is four lines long, and separated by an empty line.

  • Line 1 is the name of the condition
  • Line 2 is the Regular Expression (REGEX) used to trigger the operation of the script. It's a list of search terms that match condition and effect names. If you are not familiar with REGEX, just leave that line alone and you should be fine.
  • Line 3 is the definition of the condition or effect.. This must all be on one line, and can accept simple html styling.
  • Line 4 is the name of the associated token marker.

After editing and saving the configuration document, you must press the \"Update Conditions\" button in the chat configuration controls. This will apply the conditions immediately.

It is strongly advised that if you do make home brew changes, you duplicate the Condefinitions Handout to use as a backup. the controls can \"reset to factory specs\", but they cannot undo breaking changes.

If you create a configuration that uses a marketplace set of Token Markers that you prefer, feel free to share with others. It can be copied and pasted between games, so long as you are careful to paste clean text only (hold down the shift key while pasting, or copy from a plain text editor), and wrap the whole thing in the \"Code\" style.

`; + //createHandoutIfMissing("Help: Condefinition", helpHTML); + createHandoutIfMissing("Help: Condefinition", helpHTML, "", "https://s3.amazonaws.com/files.d20.io/images/442783616/hDkduTWDpcVEKomHnbb6AQ/med.png"); + + //Only include these buttons if the user has the Easy To Read markers from the Marketplace + let marketButtons = ((markerExists("Hexed3")) ? + `Easy to Read Markers (Marketplace)` + `
` + + makeGenericButton("2014", "!condef-easy2014") + ` ` + + makeGenericButton("2024", "!condef-easy2024") + `
` : + "" + ) + + let configMessage = `
` + + `Condefinition uses a lot of Regular Expressions (search code) to find and apply token markers and definitions. It reads these from a handout called Condefinitions. This handout has all of the code needed to define the conditions in a code block. You can edit the names, the definitions, the search code and the name of the corresponding token marker. The edited text must be clean plain text wrapped in code tags using the Code style button in the editor. Most users will only need to change the name of the token marker to match their chosen set.

If you don't feel comfortable editing the other code, or do so and make a mistake which breaks the handout, you can reset to the default using the buttons in the configuration panel. The script contains defaults for the 2014 and 2024 rule sets, using the default token markers provided by Roll20. I original wrote this script using my own Marketplace set, so if you have installed my "Easy to Read Token Markers" set, then there are also buttons that set defaults for those. This Marketplace set is honestly for my own convenience, and the script does not require this set in any way.` + `

` + + `
` + + `Generic Token Markers` + `
` + + makeGenericButton("2014", "!condef-generic2014") + ` ` + + makeGenericButton("2024", "!condef-generic2024") + `
` + + + marketButtons + + + `Edit Manually from Handout` + `
` + + makeGenericButton("Open Handout", getHandoutURL("Condefinitions")) + + makeGenericButton("Update Conditions", "!condef-loadconditions") + `

` + + + makeGenericButton("Open Help Handout", getHandoutURL("Help: Condefinition")) + `
`; + + + + + let conditionsArray = []; + loadConditionsFromHandout(); + + let ConcentrationMarker = (conditionsArray.find(([k]) => k.toLowerCase() === "concentrating") || [, , , "death-zone"])[3]; + let condefConcentrationMarker = "status_" + ConcentrationMarker; + + + + let applyDamageIsInstalled = false; + //check for dependencies + if(typeof ApplyDamage !== "undefined") + { + applyDamageIsInstalled = true; + } + + let groupCheckIsInstalled = false; + if(typeof GroupCheck !== "undefined") + { + groupCheckIsInstalled = true; + } + + + const version = '0.0.0b12'; + log('Condefinitions v' + version + ' is ready! --offset ' + API_Meta.Condefinition.offset + ' for the D&D 5th Edition by Roll20 Sheet.'); + loadConditionsFromHandout(); + + function getHandoutURL(handoutName) + { + const handout = findObjs( + { + _type: "handout", + name: handoutName + })[0]; + if(!handout) + { + sendMessage("No Condefintions Handout could be found. Press one of the default settings buttons to create a new handout.") + return `"No Handout was found"`; + } + else + { + const id = handout.get("_id"); + return `https://journal.roll20.net/handout/${id}`; + } + } + + + function getConditionIcon(conditionName) + { + const iconMap = { + blinded: "bleeding-eye", + charmed: "chained-heart", + // Extend as needed + }; + return iconMap[conditionName] || "question-mark"; + } + + + + + function decodeHTMLEntities(str) + { + return str + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/&/g, "&"); + } + + + function deserializeConditionsMultiline(text) + { + return text + .replace(/^
|<\/pre>$/g, "") // Strip 
 tags if present
+            .split(/\r?\n\r?\n/) // Split on double line breaks
+            .map(block =>
+            {
+                const [key, regexStr, description, label] = block.trim()
+                    .split(/\r?\n/);
+                const regexMatch = regexStr?.match(/^\/(.+)\/([gimuy]*)$/);
+                const regex = regexMatch ? new RegExp(regexMatch[1], regexMatch[2]) : /.^/;
+
+                return [key, regex, description, label];
+            })
+            .filter(entry => entry.length === 4); // Prevents malformed rows
+    }
+
+
+
+    function loadConditionsFromHandout()
+    {
+        const handout = findObjs(
+        {
+            _type: "handout",
+            name: "Condefinitions"
+        })[0];
+        if(!handout)
+        {
+            log("⚠️ Handout 'Condefinitions' not found. Creating new Config handout.");
+            writeConditionsToHandoutMultilinePlainText(defaultConditionsArray);
+            loadConditionsFromHandout();
+            createHandoutIfMissing("Condefinitions", helpHTML);
+            sendMessage(configMessage, "Condefinition Configuration");
+            return;
+        }
+
+        handout.get("notes", function(notes)
+        {
+            const parsed = deserializeConditionsMultiline(notes);
+            if(parsed.length)
+            {
+                conditionsArray = parsed;
+            }
+            else
+            {
+                log("⚠️ No valid conditions found in 'Condefinitions' handout.");
+            }
+        });
+    }
+
+
+
+
+    function serializeConditionsArrayMultiline(array)
+    {
+        return array.map(([key, regex, description, label]) =>
+                `${key}\n${regex.toString()}\n${description}\n${label}`
+            )
+            .join("\n\n");
+    }
+
+
+
+    function writeConditionsToHandoutMultilinePlainText(conditionsArray)
+    {
+        const content = conditionsArray.map(([key, regex, description, label]) =>
+            {
+                const regexString = regex.toString(); // /.../flags
+                // const icon = getConditionIcon(key);   // optional helper for icon name
+                return `${key}\n${regex.toString()}\n${description}\n${label}`;
+            })
+            .join("\n\n");
+
+        const escaped = content
+            .replace(/&/g, "&")
+            .replace(//g, ">");
+
+        const wrapped = `
${escaped}
`; + + let handout = findObjs( + { + _type: "handout", + name: "Condefinitions" + })[0]; + + if(!handout) + { + handout = createObj("handout", + { + name: "Condefinitions", + inplayerjournals: "all", + archived: false + }); + } + + handout.set( + { + notes: wrapped + }); + } + + + + function readAndParseConditions() + { + const handout = findObjs( + { + _type: "handout", + name: "Condefinitions" + })[0]; + if(!handout) + { + log("⚠️ Handout not found."); + return; + } + + handout.get("notes", function(notes) + { + + const stripped = notes.replace(/^
/i, "")
+                .replace(/<\/pre>$/i, "");
+            const decoded = stripped
+                .replace(/</g, "<")
+                .replace(/>/g, ">")
+                .replace(/&/g, "&");
+
+
+            const parsed = deserializeConditionsMultiline(notes);
+            return parsed
+        });
+    }
+
+
+    function mergeDescriptionsWithClassicDefinitions(originalArray, newConditions)
+    {
+        return originalArray.map(entry =>
+        {
+            const [key, regex, , marker] = entry;
+            const match = newConditions.find(def => def[0] === key);
+            const newDescription = match ? match[1] : entry[2]; // fallback to original description if no match
+            return [key, regex, newDescription, marker];
+        });
+    }
+
+
+
+
+    function sendMessage(message, title)
+    {
+        let theTitle = (title ? `
${title}
` : ""); + let theMessage = (message ? `
${theTitle}${message}
` : ""); + + sendChat("Condefinition", `/w gm ${theMessage}`, null, + { + noarchive: true + }); + } + + + + + // writeConditionsToHandoutMultilinePlainText(conditionsArray); + + + const input = `
blinded
+/(be|and|is|magically|become|becomes|is either) blinded|blinded condition/i
+Example description here
+bleeding-eye
+Blinded
`; + + const result = deserializeConditionsMultiline(input); + + + + let buttons = ""; + let reportText = ""; + + function makeButton(conditionName, descriptionText, tokenMarker, tokenID) + { + let tmLabel = `L`; + //let markerName = tokenMarker; + + let markerName = ((tokenMarker.includes(";;")) ? tokenMarker.split(";;")[0] : tokenMarker); + if('undefined' !== typeof libTokenMarkers && undefined !== libTokenMarkers.getStatus(markerName) + .url) + { + let tmImage = libTokenMarkers.getStatus(markerName) + .url; + + if(undefined !== tmImage && tmImage.length > 0) + { + tmLabel = ``; + } + } + buttons = buttons + ``; + } + + + function makeGenericButton(name, link) + { + return ``; + + } + + + //Concentration Observer + function concentrationCheck(obj, prev) + { + if(obj.get("statusmarkers") + .includes(condefConcentrationMarker) || obj.get("statusmarkers") + .includes(ConcentrationMarker) || obj.get(condefConcentrationMarker)) + { + // if (obj.get(condefConcentrationMarker)) { + if(prev["bar1_value"] > obj.get("bar1_value")) + { + let final_conc_DC = 10; + let calc_conc_DC = (prev["bar1_value"] - obj.get("bar1_value")) / 2; + if(calc_conc_DC > final_conc_DC) + { + final_conc_DC = Math.floor(calc_conc_DC); + } + // let tokenName = obj.get("name"); + let theMessage = `! &{template:spell} {{name=Concentration}}{{savedc=${final_conc_DC}}} {{description=Make a DC ${final_conc_DC} Constitution saving throw}}{{Concentration=1}}`; + // let theMessage = `this should print`; + sendChat("gm", theMessage); + } + } + + } + + //Event Handlers + on("change:graphic:bar1_value", concentrationCheck); + if(typeof(TokenMod) === 'object') TokenMod.ObserveTokenChange(concentrationCheck); + if('undefined' !== typeof SmartAoE && SmartAoE.ObserveTokenChange) + { + SmartAoE.ObserveTokenChange(function(obj, prev) + { + concentrationCheck(obj, prev); + }); + } + + + //Condition report creator. Use !condef for GM only, pcondef for player report. Follow by condition names separated by spaces. !condef-all returns buttons for all conditions, for reference + on('chat:message', function(msg) + { + + + if(msg.type === "api" && msg.content === "!condef-generic2014") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray, definitions2014)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to Default token markers using the 2014 condition definitions"); + return; + } + + if(msg.type === "api" && msg.content === "!condef-generic2024") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray, definitions2024)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to Default token markers using the 2024 condition definitions"); + return; + } + + if(msg.type === "api" && msg.content === "!condef-easy2014") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray_EasyToRead, definitions2014)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to the Easy to Read token markers using the 2014 condition definitions"); + return; + } + + if(msg.type === "api" && msg.content === "!condef-easy2024") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray_EasyToRead, definitions2024)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to the Easy to Read token markers using the 2024 condition definitions"); + return; + } + + + if(msg.type === "api" && msg.content === "!condef-loadconditions") + { + loadConditionsFromHandout(); + ConcentrationMarker = (conditionsArray.find(([k]) => k.toLowerCase() === "concentrating") || [, , , "death-zone"])[3]; + condefConcentrationMarker = "status_" + ConcentrationMarker; + + sendMessage("Condition definitions reloaded from handout."); + return; + } + + if(msg.type === "api" && (msg.content === "!condef-config" || msg.content === "!condef-help")) + { + createHandoutIfMissing("Help: Condefinition", helpHTML, "", "https://s3.amazonaws.com/files.d20.io/images/442783616/hDkduTWDpcVEKomHnbb6AQ/med.png"); + + sendMessage(configMessage, "Condefinition Configuration"); + return; + } + + + + + if('api' === msg.type && msg.content.match(/^!(condef|pcondef|condef-all|condef-report|condef-toggle)/)) + { + let args = msg.content.split(" "); + let sender = msg.who; + if(msg.content === '!condef-all') + { + let message = `! &{template:noecho} {{description= blinded condition charmed condition deafened condition exhausted condition frightened condition grappled condition incapacitated condition invisible condition paralyzed condition petrified condition poisoned condition prone condition restrained condition stunned condition unconscious condition concentration check}}`; + sendChat("gm", message, null, + { + noarchive: true + }); + message = ""; + return; + } + + + let messagePrefix = ((msg.content.includes('pcondef')) ? '' : '/w ' + sender + ' '); + let theCommand = ((msg.content.includes("pcondef")) ? "!pcondef" : "!condef"); + + + //selected vs target handler + if(msg.content.includes('condef-toggle ') && msg.content.length > 15) + { + let tokenMarker = msg.content.split('condef-toggle ')[1]; + let message = ''; + if(msg.selected) + { + //message = `!token-mod --set statusmarkers|!${tokenMarker}`; + let ids = msg.selected.reduce((m, o) => [...m, o._id], []); + message = `!token-mod --api-as ${msg.playerid} --set statusmarkers|!${tokenMarker} --ids ${ids.join(' ')}`; + //message = `!token-mod --api-as ${msg.playerid} --set statusmarkers|!${tokenMarker}`; + + } + else + { + + message = messagePrefix + buttonboxUnshifted + 'No token is selected.
Click here to pick a target.
'; + } + sendChat("", message, null, + { + noarchive: true + }); + return; + } + + if(msg.content === '!condef-report') + { + buttons = ""; + + let selected = (msg.selected); + + if(selected) + { + _.each(selected, function(token) + { + let tok = getObj("graphic", token._id); + let tokName = tok.get("name") || "unnamed token"; + let tokID = tok.get("_id"); + let markers = tok.get("statusmarkers") + .replace(/::/g, ";;"); + + if(markers) + { + for(let i = 0; i < conditionsArray.length; i++) + { + let name = conditionsArray[i][0]; + let descriptionText = conditionsArray[i][2]; + let tokenMarker = conditionsArray[i][3]; + + if(markers.includes(tokenMarker)) + { + makeButton(name, descriptionText, tokenMarker, tokID); + } + } + let message = buttonbox + "" + tokName + "" + buttons + "
"; + sendChat("", messagePrefix + message, null, + { + noarchive: true + }); + + buttons = ""; + + } + }); + } + else + { + sendMessage("Select one or more tokens with conditions on them"); + + } + return; + } + + + + + for(let i = 0; i < conditionsArray.length; i++) + { + let reportName = conditionsArray[i][0]; + let reportDescription = conditionsArray[i][2]; + if(undefined !== args[1] && args[1] === reportName) + { + reportDescription = reportDescription.replace("!condef", theCommand); + reportText = `
${reportName}
${reportDescription.replace(/</g, "<").replace(/>/g, ">")}
`; + } + } + + if(undefined !== reportText && reportText.length > 0) + { + sendChat("", messagePrefix + reportText, null, + { + noarchive: true + }); + + } + + } + + + + //Roll Template Interception + if((undefined !== msg.rolltemplate && msg.rolltemplate.match(/npcfullatk|npcdmg|npcaction|traits|atkdmg|spell|condefinitions|spelloutput|noecho/g)) || (msg.content.match(/dnd-2024/g))) + { + //log (msg.content); + let sender = msg.who; + let messagePrefix = '/w ' + sender + ' '; + let saveAbility = ""; + let saveMatches = ""; + let theAbility = ""; + let saveDC = ""; + let conCheck = ""; + let concentrationButton = ""; + saveMatches = msg.content.match(/DC\s(\d\d)\s(Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma)\ssaving throw/i); + if(msg.rolltemplate !== "spell" && msg.rolltemplate !== "atkdmg" && null !== saveMatches && saveMatches.length === 3) + { + saveDC = saveMatches[1]; + saveAbility = saveMatches[2]; + } + //msg echo to console is disabled + if(msg.rolltemplate === "spell" || msg.rolltemplate === "atkdmg" || msg.rolltemplate === "spelloutput" || (msg.content.match(/dnd-2024 dnd-2024--/g))) + { + /*log(msg.content);*/ + saveAbility = msg.content.match(/(Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma)\ssav(e|ing throw)/i) || ""; + if(saveAbility.length > 0) + { + saveAbility = saveAbility[1] || ""; + } + + saveDC = ((msg.rolltemplate === "spell" || msg.rolltemplate === "spelloutput") ? msg.content.match(/{{savedc=(\d+)}}/) : msg.content.match(/{{mod=DC(\d+)}}/)) || msg.content.match(/DC\s(\d+)/) || ""; + conCheck = ((msg.rolltemplate === "spell" && msg.content.match(/{{name=Concentration/)) ? "Concentration Check" : ""); + // if (conCheck!==""){ + // makeButton("Concentrating", "makes a con check", "concentrating"); + // } + // concentrationButton = ((conCheck==="") ? "" : "
" + buttons); + + + //log("concentrationButton = " + concentrationButton); + if(saveDC.length > 0) + { + saveDC = saveDC[1] || ""; + } + + } + + if(undefined !== saveAbility && null !== saveAbility) + { + + theAbility = saveAbility.replace(/Strength/i, "str") + .replace(/Dexterity/i, "dex") + .replace(/Constitution/i, "con") + .replace(/Intelligence/i, "int") + .replace(/Wisdom/i, "wis") + .replace(/Charisma/i, "cha"); + } + let saveButton = ""; + + if(theAbility.match(/(str|dex|con|int|wis|cha)/)) + { + //for regular saves + saveButton = `DC${saveDC} ${theAbility} ${conCheck}${concentrationButton}`; + //for groupcheck + if(groupCheckIsInstalled) + { + saveAbility = saveAbility.charAt(0) + .toUpperCase() + saveAbility.slice(1); + saveButton = `DC${saveDC} ${theAbility} ${conCheck}${concentrationButton}`; + if(applyDamageIsInstalled && conCheck !== "Concentration Check") + { + saveButton = saveButton + `Dmg`; + } + } + } + + for(let i = 0; i < conditionsArray.length; i++) + { + let name = conditionsArray[i][0]; + let descriptionText = conditionsArray[i][2]; + let tokenMarker = conditionsArray[i][3]; + + if(undefined !== name) + { + if(msg.content.match(conditionsArray[i][1])) + { + makeButton(name, descriptionText, tokenMarker); + } + + } + } + let GMSaveButton = saveButton; + if(!playerIsGM(msg.playerid) && msg.playerid !== "API") + { + saveButton = ""; + } + if(buttons.length > 0 || saveButton.length > 0) + { + + let message = buttonbox + saveButton + buttons + ""; + sendChat("", messagePrefix + message, null, + { + noarchive: true + }); + + if(!messagePrefix.includes(' (GM)') && msg.rolltemplate !== "noecho") + { + message = buttonbox + GMSaveButton + buttons + ""; + if(conCheck !== "Concentration Check") + { + sendChat("", '/w gm ' + message, null, + { + noarchive: true + }); + } + } + + + buttons = ""; + + } + } + }); + +}); + +{ + try + { + throw new Error(''); + } + catch (e) + { + API_Meta.Condefinition.lineCount = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - API_Meta.Condefinition.offset); + } +} From cef252414425b4563eb0fad7b41b444439a688c7 Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 08:59:38 -0700 Subject: [PATCH 06/13] Create script.json --- Condefinition/script.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Condefinition/script.json diff --git a/Condefinition/script.json b/Condefinition/script.json new file mode 100644 index 0000000000..6bef4250b9 --- /dev/null +++ b/Condefinition/script.json @@ -0,0 +1,12 @@ +{ + "name": "Condefinition", + "script": "Condefinition.js", + "version": "1.0.0", + "description": "## Condefinition\r### What it does\r\rCondefinition reads incoming roll templates and looks for imposed conditions and saving throws. It displays button(s) in chat that allow you to:\r- Quickly apply a corresponding token marker\r- Define the condition\r- Track concentration\r- Roll saving throws\r- Apply damage from spells or effects triggered by saving throws\r- If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to roll the appropriate save. With **GroupCheck** installed, it runs a groupcheck save. If you have [**Apply Damage**](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153) installed, it also applies damage.\r- If the roll template contains an imposed condition, it creates a button to define the condition. If there's a cross-reference in the definition, it creates an inline link. You can hover or whisper/broadcast the text to players.\r- You can toggle that condition on selected tokens. Assigning token markers requires **TokenMod**, and for improved function, **LibTokenMarkers**. Default status markers are included, and the configuration handout allows you to customize these.\r- If installed via One-Click, this Mod will also auto-install **GroupCheck**, **TokenMod**, and **LibTokenMarkers** if they’re missing. **[Apply Damage](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)** must be installed manually.\r- In addition to official conditions, it tracks many common features that benefit from markers (e.g., Raging, Hunter's Mark, Hexblade's Curse).\r- The Concentration condition marker also tracks concentration and prompts for a Constitution Save when damaged.\r- Compatible with Classic and Jumpgate VTT, and the 2014 or 2024 D&D sheets. Advanced configuration requires JavaScript knowledge.\r### What it can't do\r\rThere are some limitations:\r- Primarily designed for GMs and NPCs. Players may see buttons, but full use is GM-facing.\r- Conditions are matched to tokens, not character sheets (intentional, for individual instances like multiple goblins).\r- Some condition wordings may be missed, especially in non-WotC content.\r- Currently, all buttons and definitions are whispered to the controller of the NPC. If needed, this could change based on whisper settings.\r### Helper Scripts\r- **Required:** `TokenMod`, `libTokenMarkers`\r- **Optional/Recommended:** `GroupCheck`, [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)\r---\r## Operation\r### **Buttons**\r\rWhenever a condition is implied in chat, or the report function is used on a token, a button is created. Each button has three parts:\r- **Middle:** Sends the condition definition to the GM. Some include cross-links to related conditions (e.g., *Unconscious* also includes *Incapacitated*).\r- **Left side:** Word balloon icon that sends the condition to all players.\r- **Right side:** Toggles the token marker for selected tokens.\r![Condition Button Example](https://files.d20.io/images/442935594/yOS7eoRAux8WyT5rvSFaLg/original.png?1748567284)\r---\r### **List All Common Condition Definitions**\r\rType `!condef-all` in chat to display all official condition buttons. This does not include extras like *Raging* or *Marked*, just the official conditions.\r![All Conditions Screenshot](https://files.d20.io/images/442933995/z7UHtU9JRZgfR0p0vx_H4g/original.png?1748566537)\r---\r### **Concentration**\r\rWhen a token takes damage and has a concentration marker, Condefinition calculates and prompts a Constitution Save.\r\rExample: "Morrigan" takes 30 damage while concentrating. The script detects the marker and produces a save button.\r\rNote: This requires **GroupCheck** configured for both 2014 and 2024 sheets.\r![Concentration Save Screenshot](https://files.d20.io/images/442936255/oTJKREx0B8Dwp5TQ6VGxyg/original.png?1748567553)\r---\r### **Report**\r\rSelect tokens and run `!condef-report`. The script creates condition buttons for each token with active markers. These buttons only affect the associated token.\r![Report Screenshot](https://files.d20.io/images/442937172/myYkaSLzPA8hqYG9xKlu_g/original.png?1748568068)\r---\r### **Automation of Abilities that Force Saving Throws**\r\rRequires both **GroupCheck** and manually installed [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153). The spell or ability must be sent to chat with its Description turned on to trigger automation.\r![Apply Damage Automation](https://files.d20.io/images/442940114/kWl_PCGDYV8f_9cs_jw_Yw/original.png?1748569736)\r\rThe button works like the concentration check: left half rolls saves for all selected tokens, and optionally applies damage.\r![Save and Apply Damage Button](https://files.d20.io/images/442941123/VzdgD5qvSLHRqwKBX2rXNw/original.png?1748570402)\r---\r## Configuration\r\rSupports conditions from both 2014 and 2024 rule sets. Can switch between default token markers or the author's "Easy to Read" marketplace markers.\r### The Condefinitions Handout\r\rUse `!condef help` or `!condef config` to access settings.\r\rCondition definitions are stored in a handout named **Condefinitions** and consist of 4-line entries separated by an empty line:\r\r1. **Line 1:** Condition name \r2. **Line 2:** Regex to match keywords (e.g., "poisoned|toxic") \r3. **Line 3:** One-line definition (can include simple HTML) \r4. **Line 4:** Name of the token marker\r\rTo update, save the handout and click **Update Conditions** in chat. Use the **Code** style when pasting definitions.\r**Tip:** Duplicate the handout before editing, in case you need to roll back.\r\rIf you use a custom marketplace set for token markers, feel free to share your config — just ensure clean, plain text and wrap in the `Code` style.\r![Configuration Screenshot](https://files.d20.io/images/442943259/dwGOgHA6nb3a8fRJIat8Dw/original.png?1748571846)", + "authors": "Keith Curtis", + "roll20userid": "162065", + "dependencies": [ "TokenMod", "GroupCheck", "libTokenMarkers" ], + "modifies": {}, + "conflicts": [], + "previousversions": ["1.0.0"] +} From 5d59eec9b4ee66b8fa3b8c88283f7683ebb9c221 Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 09:09:17 -0700 Subject: [PATCH 07/13] Create readme.md --- Condefinition/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Condefinition/readme.md diff --git a/Condefinition/readme.md b/Condefinition/readme.md new file mode 100644 index 0000000000..69ab5d6567 --- /dev/null +++ b/Condefinition/readme.md @@ -0,0 +1 @@ +## Condefinition\r### What it does\r\rCondefinition reads incoming roll templates and looks for imposed conditions and saving throws. It displays button(s) in chat that allow you to:\r- Quickly apply a corresponding token marker\r- Define the condition\r- Track concentration\r- Roll saving throws\r- Apply damage from spells or effects triggered by saving throws\r- If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to roll the appropriate save. With **GroupCheck** installed, it runs a groupcheck save. If you have [**Apply Damage**](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153) installed, it also applies damage.\r- If the roll template contains an imposed condition, it creates a button to define the condition. If there's a cross-reference in the definition, it creates an inline link. You can hover or whisper/broadcast the text to players.\r- You can toggle that condition on selected tokens. Assigning token markers requires **TokenMod**, and for improved function, **LibTokenMarkers**. Default status markers are included, and the configuration handout allows you to customize these.\r- If installed via One-Click, this Mod will also auto-install **GroupCheck**, **TokenMod**, and **LibTokenMarkers** if they’re missing. **[Apply Damage](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)** must be installed manually.\r- In addition to official conditions, it tracks many common features that benefit from markers (e.g., Raging, Hunter's Mark, Hexblade's Curse).\r- The Concentration condition marker also tracks concentration and prompts for a Constitution Save when damaged.\r- Compatible with Classic and Jumpgate VTT, and the 2014 or 2024 D&D sheets. Advanced configuration requires JavaScript knowledge.\r### What it can't do\r\rThere are some limitations:\r- Primarily designed for GMs and NPCs. Players may see buttons, but full use is GM-facing.\r- Conditions are matched to tokens, not character sheets (intentional, for individual instances like multiple goblins).\r- Some condition wordings may be missed, especially in non-WotC content.\r- Currently, all buttons and definitions are whispered to the controller of the NPC. If needed, this could change based on whisper settings.\r### Helper Scripts\r- **Required:** `TokenMod`, `libTokenMarkers`\r- **Optional/Recommended:** `GroupCheck`, [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)\r---\r## Operation\r### **Buttons**\r\rWhenever a condition is implied in chat, or the report function is used on a token, a button is created. Each button has three parts:\r- **Middle:** Sends the condition definition to the GM. Some include cross-links to related conditions (e.g., *Unconscious* also includes *Incapacitated*).\r- **Left side:** Word balloon icon that sends the condition to all players.\r- **Right side:** Toggles the token marker for selected tokens.\r![Condition Button Example](https://files.d20.io/images/442935594/yOS7eoRAux8WyT5rvSFaLg/original.png?1748567284)\r---\r### **List All Common Condition Definitions**\r\rType `!condef-all` in chat to display all official condition buttons. This does not include extras like *Raging* or *Marked*, just the official conditions.\r![All Conditions Screenshot](https://files.d20.io/images/442933995/z7UHtU9JRZgfR0p0vx_H4g/original.png?1748566537)\r---\r### **Concentration**\r\rWhen a token takes damage and has a concentration marker, Condefinition calculates and prompts a Constitution Save.\r\rExample: "Morrigan" takes 30 damage while concentrating. The script detects the marker and produces a save button.\r\rNote: This requires **GroupCheck** configured for both 2014 and 2024 sheets.\r![Concentration Save Screenshot](https://files.d20.io/images/442936255/oTJKREx0B8Dwp5TQ6VGxyg/original.png?1748567553)\r---\r### **Report**\r\rSelect tokens and run `!condef-report`. The script creates condition buttons for each token with active markers. These buttons only affect the associated token.\r![Report Screenshot](https://files.d20.io/images/442937172/myYkaSLzPA8hqYG9xKlu_g/original.png?1748568068)\r---\r### **Automation of Abilities that Force Saving Throws**\r\rRequires both **GroupCheck** and manually installed [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153). The spell or ability must be sent to chat with its Description turned on to trigger automation.\r![Apply Damage Automation](https://files.d20.io/images/442940114/kWl_PCGDYV8f_9cs_jw_Yw/original.png?1748569736)\r\rThe button works like the concentration check: left half rolls saves for all selected tokens, and optionally applies damage.\r![Save and Apply Damage Button](https://files.d20.io/images/442941123/VzdgD5qvSLHRqwKBX2rXNw/original.png?1748570402)\r---\r## Configuration\r\rSupports conditions from both 2014 and 2024 rule sets. Can switch between default token markers or the author's "Easy to Read" marketplace markers.\r### The Condefinitions Handout\r\rUse `!condef help` or `!condef config` to access settings.\r\rCondition definitions are stored in a handout named **Condefinitions** and consist of 4-line entries separated by an empty line:\r\r1. **Line 1:** Condition name \r2. **Line 2:** Regex to match keywords (e.g., "poisoned|toxic") \r3. **Line 3:** One-line definition (can include simple HTML) \r4. **Line 4:** Name of the token marker\r\rTo update, save the handout and click **Update Conditions** in chat. Use the **Code** style when pasting definitions.\r**Tip:** Duplicate the handout before editing, in case you need to roll back.\r\rIf you use a custom marketplace set for token markers, feel free to share your config — just ensure clean, plain text and wrap in the `Code` style.\r![Configuration Screenshot](https://files.d20.io/images/442943259/dwGOgHA6nb3a8fRJIat8Dw/original.png?1748571846) From 2547e957f8569ced7c32ad7729e732ccbdbdd0ee Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 09:10:00 -0700 Subject: [PATCH 08/13] Update readme.md --- Condefinition/readme.md | 119 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/Condefinition/readme.md b/Condefinition/readme.md index 69ab5d6567..54c50e5eb2 100644 --- a/Condefinition/readme.md +++ b/Condefinition/readme.md @@ -1 +1,118 @@ -## Condefinition\r### What it does\r\rCondefinition reads incoming roll templates and looks for imposed conditions and saving throws. It displays button(s) in chat that allow you to:\r- Quickly apply a corresponding token marker\r- Define the condition\r- Track concentration\r- Roll saving throws\r- Apply damage from spells or effects triggered by saving throws\r- If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to roll the appropriate save. With **GroupCheck** installed, it runs a groupcheck save. If you have [**Apply Damage**](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153) installed, it also applies damage.\r- If the roll template contains an imposed condition, it creates a button to define the condition. If there's a cross-reference in the definition, it creates an inline link. You can hover or whisper/broadcast the text to players.\r- You can toggle that condition on selected tokens. Assigning token markers requires **TokenMod**, and for improved function, **LibTokenMarkers**. Default status markers are included, and the configuration handout allows you to customize these.\r- If installed via One-Click, this Mod will also auto-install **GroupCheck**, **TokenMod**, and **LibTokenMarkers** if they’re missing. **[Apply Damage](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)** must be installed manually.\r- In addition to official conditions, it tracks many common features that benefit from markers (e.g., Raging, Hunter's Mark, Hexblade's Curse).\r- The Concentration condition marker also tracks concentration and prompts for a Constitution Save when damaged.\r- Compatible with Classic and Jumpgate VTT, and the 2014 or 2024 D&D sheets. Advanced configuration requires JavaScript knowledge.\r### What it can't do\r\rThere are some limitations:\r- Primarily designed for GMs and NPCs. Players may see buttons, but full use is GM-facing.\r- Conditions are matched to tokens, not character sheets (intentional, for individual instances like multiple goblins).\r- Some condition wordings may be missed, especially in non-WotC content.\r- Currently, all buttons and definitions are whispered to the controller of the NPC. If needed, this could change based on whisper settings.\r### Helper Scripts\r- **Required:** `TokenMod`, `libTokenMarkers`\r- **Optional/Recommended:** `GroupCheck`, [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)\r---\r## Operation\r### **Buttons**\r\rWhenever a condition is implied in chat, or the report function is used on a token, a button is created. Each button has three parts:\r- **Middle:** Sends the condition definition to the GM. Some include cross-links to related conditions (e.g., *Unconscious* also includes *Incapacitated*).\r- **Left side:** Word balloon icon that sends the condition to all players.\r- **Right side:** Toggles the token marker for selected tokens.\r![Condition Button Example](https://files.d20.io/images/442935594/yOS7eoRAux8WyT5rvSFaLg/original.png?1748567284)\r---\r### **List All Common Condition Definitions**\r\rType `!condef-all` in chat to display all official condition buttons. This does not include extras like *Raging* or *Marked*, just the official conditions.\r![All Conditions Screenshot](https://files.d20.io/images/442933995/z7UHtU9JRZgfR0p0vx_H4g/original.png?1748566537)\r---\r### **Concentration**\r\rWhen a token takes damage and has a concentration marker, Condefinition calculates and prompts a Constitution Save.\r\rExample: "Morrigan" takes 30 damage while concentrating. The script detects the marker and produces a save button.\r\rNote: This requires **GroupCheck** configured for both 2014 and 2024 sheets.\r![Concentration Save Screenshot](https://files.d20.io/images/442936255/oTJKREx0B8Dwp5TQ6VGxyg/original.png?1748567553)\r---\r### **Report**\r\rSelect tokens and run `!condef-report`. The script creates condition buttons for each token with active markers. These buttons only affect the associated token.\r![Report Screenshot](https://files.d20.io/images/442937172/myYkaSLzPA8hqYG9xKlu_g/original.png?1748568068)\r---\r### **Automation of Abilities that Force Saving Throws**\r\rRequires both **GroupCheck** and manually installed [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153). The spell or ability must be sent to chat with its Description turned on to trigger automation.\r![Apply Damage Automation](https://files.d20.io/images/442940114/kWl_PCGDYV8f_9cs_jw_Yw/original.png?1748569736)\r\rThe button works like the concentration check: left half rolls saves for all selected tokens, and optionally applies damage.\r![Save and Apply Damage Button](https://files.d20.io/images/442941123/VzdgD5qvSLHRqwKBX2rXNw/original.png?1748570402)\r---\r## Configuration\r\rSupports conditions from both 2014 and 2024 rule sets. Can switch between default token markers or the author's "Easy to Read" marketplace markers.\r### The Condefinitions Handout\r\rUse `!condef help` or `!condef config` to access settings.\r\rCondition definitions are stored in a handout named **Condefinitions** and consist of 4-line entries separated by an empty line:\r\r1. **Line 1:** Condition name \r2. **Line 2:** Regex to match keywords (e.g., "poisoned|toxic") \r3. **Line 3:** One-line definition (can include simple HTML) \r4. **Line 4:** Name of the token marker\r\rTo update, save the handout and click **Update Conditions** in chat. Use the **Code** style when pasting definitions.\r**Tip:** Duplicate the handout before editing, in case you need to roll back.\r\rIf you use a custom marketplace set for token markers, feel free to share your config — just ensure clean, plain text and wrap in the `Code` style.\r![Configuration Screenshot](https://files.d20.io/images/442943259/dwGOgHA6nb3a8fRJIat8Dw/original.png?1748571846) +## Condefinition + +### What it does + +Condefinition reads incoming roll templates and looks for imposed conditions and saving throws. It displays button(s) in chat that allow you to: + +- Quickly apply a corresponding token marker +- Define the condition +- Track concentration +- Roll saving throws +- Apply damage from spells or effects triggered by saving throws + +- If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to roll the appropriate save. With **GroupCheck** installed, it runs a groupcheck save. If you have [**Apply Damage**](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153) installed, it also applies damage. + +- If the roll template contains an imposed condition, it creates a button to define the condition. If there's a cross-reference in the definition, it creates an inline link. You can hover or whisper/broadcast the text to players. + +- You can toggle that condition on selected tokens. Assigning token markers requires **TokenMod**, and for improved function, **LibTokenMarkers**. Default status markers are included, and the configuration handout allows you to customize these. + +- If installed via One-Click, this Mod will also auto-install **GroupCheck**, **TokenMod**, and **LibTokenMarkers** if they’re missing. **[Apply Damage](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)** must be installed manually. + +- In addition to official conditions, it tracks many common features that benefit from markers (e.g., Raging, Hunter's Mark, Hexblade's Curse). + +- The Concentration condition marker also tracks concentration and prompts for a Constitution Save when damaged. + +- Compatible with Classic and Jumpgate VTT, and the 2014 or 2024 D&D sheets. Advanced configuration requires JavaScript knowledge. + +### What it can't do + +There are some limitations: + +- Primarily designed for GMs and NPCs. Players may see buttons, but full use is GM-facing. +- Conditions are matched to tokens, not character sheets (intentional, for individual instances like multiple goblins). +- Some condition wordings may be missed, especially in non-WotC content. +- Currently, all buttons and definitions are whispered to the controller of the NPC. If needed, this could change based on whisper settings. + +### Helper Scripts + +- **Required:** `TokenMod`, `libTokenMarkers` +- **Optional/Recommended:** `GroupCheck`, [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153) + +--- + +## Operation + +### **Buttons** + +Whenever a condition is implied in chat, or the report function is used on a token, a button is created. Each button has three parts: + +- **Middle:** Sends the condition definition to the GM. Some include cross-links to related conditions (e.g., *Unconscious* also includes *Incapacitated*). +- **Left side:** Word balloon icon that sends the condition to all players. +- **Right side:** Toggles the token marker for selected tokens. + +![Condition Button Example](https://files.d20.io/images/442935594/yOS7eoRAux8WyT5rvSFaLg/original.png?1748567284) + +--- + +### **List All Common Condition Definitions** + +Type `!condef-all` in chat to display all official condition buttons. This does not include extras like *Raging* or *Marked*, just the official conditions. + +![All Conditions Screenshot](https://files.d20.io/images/442933995/z7UHtU9JRZgfR0p0vx_H4g/original.png?1748566537) + +--- + +### **Concentration** + +When a token takes damage and has a concentration marker, Condefinition calculates and prompts a Constitution Save. + +Example: "Morrigan" takes 30 damage while concentrating. The script detects the marker and produces a save button. + +Note: This requires **GroupCheck** configured for both 2014 and 2024 sheets. + +![Concentration Save Screenshot](https://files.d20.io/images/442936255/oTJKREx0B8Dwp5TQ6VGxyg/original.png?1748567553) + +--- + +### **Report** + +Select tokens and run `!condef-report`. The script creates condition buttons for each token with active markers. These buttons only affect the associated token. + +![Report Screenshot](https://files.d20.io/images/442937172/myYkaSLzPA8hqYG9xKlu_g/original.png?1748568068) + +--- + +### **Automation of Abilities that Force Saving Throws** + +Requires both **GroupCheck** and manually installed [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153). The spell or ability must be sent to chat with its Description turned on to trigger automation. + +![Apply Damage Automation](https://files.d20.io/images/442940114/kWl_PCGDYV8f_9cs_jw_Yw/original.png?1748569736) + +The button works like the concentration check: left half rolls saves for all selected tokens, and optionally applies damage. + +![Save and Apply Damage Button](https://files.d20.io/images/442941123/VzdgD5qvSLHRqwKBX2rXNw/original.png?1748570402) + +--- + +## Configuration + +Supports conditions from both 2014 and 2024 rule sets. Can switch between default token markers or the author's "Easy to Read" marketplace markers. + +### The Condefinitions Handout + +Use `!condef help` or `!condef config` to access settings. + +Condition definitions are stored in a handout named **Condefinitions** and consist of 4-line entries separated by an empty line: + +1. **Line 1:** Condition name +2. **Line 2:** Regex to match keywords (e.g., "poisoned|toxic") +3. **Line 3:** One-line definition (can include simple HTML) +4. **Line 4:** Name of the token marker + +To update, save the handout and click **Update Conditions** in chat. Use the **Code** style when pasting definitions. + +**Tip:** Duplicate the handout before editing, in case you need to roll back. + +If you use a custom marketplace set for token markers, feel free to share your config — just ensure clean, plain text and wrap in the `Code` style. + +![Configuration Screenshot](https://files.d20.io/images/442943259/dwGOgHA6nb3a8fRJIat8Dw/original.png?1748571846) From c4ab7216205f3404aac9610c7f65497a23cf8e6e Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 09:14:31 -0700 Subject: [PATCH 09/13] Update script.json --- Condefinition/script.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Condefinition/script.json b/Condefinition/script.json index 6bef4250b9..1737345dfb 100644 --- a/Condefinition/script.json +++ b/Condefinition/script.json @@ -2,7 +2,7 @@ "name": "Condefinition", "script": "Condefinition.js", "version": "1.0.0", - "description": "## Condefinition\r### What it does\r\rCondefinition reads incoming roll templates and looks for imposed conditions and saving throws. It displays button(s) in chat that allow you to:\r- Quickly apply a corresponding token marker\r- Define the condition\r- Track concentration\r- Roll saving throws\r- Apply damage from spells or effects triggered by saving throws\r- If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to roll the appropriate save. With **GroupCheck** installed, it runs a groupcheck save. If you have [**Apply Damage**](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153) installed, it also applies damage.\r- If the roll template contains an imposed condition, it creates a button to define the condition. If there's a cross-reference in the definition, it creates an inline link. You can hover or whisper/broadcast the text to players.\r- You can toggle that condition on selected tokens. Assigning token markers requires **TokenMod**, and for improved function, **LibTokenMarkers**. Default status markers are included, and the configuration handout allows you to customize these.\r- If installed via One-Click, this Mod will also auto-install **GroupCheck**, **TokenMod**, and **LibTokenMarkers** if they’re missing. **[Apply Damage](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)** must be installed manually.\r- In addition to official conditions, it tracks many common features that benefit from markers (e.g., Raging, Hunter's Mark, Hexblade's Curse).\r- The Concentration condition marker also tracks concentration and prompts for a Constitution Save when damaged.\r- Compatible with Classic and Jumpgate VTT, and the 2014 or 2024 D&D sheets. Advanced configuration requires JavaScript knowledge.\r### What it can't do\r\rThere are some limitations:\r- Primarily designed for GMs and NPCs. Players may see buttons, but full use is GM-facing.\r- Conditions are matched to tokens, not character sheets (intentional, for individual instances like multiple goblins).\r- Some condition wordings may be missed, especially in non-WotC content.\r- Currently, all buttons and definitions are whispered to the controller of the NPC. If needed, this could change based on whisper settings.\r### Helper Scripts\r- **Required:** `TokenMod`, `libTokenMarkers`\r- **Optional/Recommended:** `GroupCheck`, [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)\r---\r## Operation\r### **Buttons**\r\rWhenever a condition is implied in chat, or the report function is used on a token, a button is created. Each button has three parts:\r- **Middle:** Sends the condition definition to the GM. Some include cross-links to related conditions (e.g., *Unconscious* also includes *Incapacitated*).\r- **Left side:** Word balloon icon that sends the condition to all players.\r- **Right side:** Toggles the token marker for selected tokens.\r![Condition Button Example](https://files.d20.io/images/442935594/yOS7eoRAux8WyT5rvSFaLg/original.png?1748567284)\r---\r### **List All Common Condition Definitions**\r\rType `!condef-all` in chat to display all official condition buttons. This does not include extras like *Raging* or *Marked*, just the official conditions.\r![All Conditions Screenshot](https://files.d20.io/images/442933995/z7UHtU9JRZgfR0p0vx_H4g/original.png?1748566537)\r---\r### **Concentration**\r\rWhen a token takes damage and has a concentration marker, Condefinition calculates and prompts a Constitution Save.\r\rExample: "Morrigan" takes 30 damage while concentrating. The script detects the marker and produces a save button.\r\rNote: This requires **GroupCheck** configured for both 2014 and 2024 sheets.\r![Concentration Save Screenshot](https://files.d20.io/images/442936255/oTJKREx0B8Dwp5TQ6VGxyg/original.png?1748567553)\r---\r### **Report**\r\rSelect tokens and run `!condef-report`. The script creates condition buttons for each token with active markers. These buttons only affect the associated token.\r![Report Screenshot](https://files.d20.io/images/442937172/myYkaSLzPA8hqYG9xKlu_g/original.png?1748568068)\r---\r### **Automation of Abilities that Force Saving Throws**\r\rRequires both **GroupCheck** and manually installed [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153). The spell or ability must be sent to chat with its Description turned on to trigger automation.\r![Apply Damage Automation](https://files.d20.io/images/442940114/kWl_PCGDYV8f_9cs_jw_Yw/original.png?1748569736)\r\rThe button works like the concentration check: left half rolls saves for all selected tokens, and optionally applies damage.\r![Save and Apply Damage Button](https://files.d20.io/images/442941123/VzdgD5qvSLHRqwKBX2rXNw/original.png?1748570402)\r---\r## Configuration\r\rSupports conditions from both 2014 and 2024 rule sets. Can switch between default token markers or the author's "Easy to Read" marketplace markers.\r### The Condefinitions Handout\r\rUse `!condef help` or `!condef config` to access settings.\r\rCondition definitions are stored in a handout named **Condefinitions** and consist of 4-line entries separated by an empty line:\r\r1. **Line 1:** Condition name \r2. **Line 2:** Regex to match keywords (e.g., "poisoned|toxic") \r3. **Line 3:** One-line definition (can include simple HTML) \r4. **Line 4:** Name of the token marker\r\rTo update, save the handout and click **Update Conditions** in chat. Use the **Code** style when pasting definitions.\r**Tip:** Duplicate the handout before editing, in case you need to roll back.\r\rIf you use a custom marketplace set for token markers, feel free to share your config — just ensure clean, plain text and wrap in the `Code` style.\r![Configuration Screenshot](https://files.d20.io/images/442943259/dwGOgHA6nb3a8fRJIat8Dw/original.png?1748571846)", + "description": "## Condefinition\r### What it does\r\rCondefinition reads incoming roll templates and looks for imposed conditions and saving throws. It displays button(s) in chat that allow you to:\r- Quickly apply a corresponding token marker\r- Define the condition\r- Track concentration\r- Roll saving throws\r- Apply damage from spells or effects triggered by saving throws\r- If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to roll the appropriate save. With **GroupCheck** installed, it runs a groupcheck save. If you have [**Apply Damage**](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153) installed, it also applies damage.\r- If the roll template contains an imposed condition, it creates a button to define the condition. If there's a cross-reference in the definition, it creates an inline link. You can hover or whisper/broadcast the text to players.\r- You can toggle that condition on selected tokens. Assigning token markers requires **TokenMod**, and for improved function, **LibTokenMarkers**. Default status markers are included, and the configuration handout allows you to customize these.\r- If installed via One-Click, this Mod will also auto-install **GroupCheck**, **TokenMod**, and **LibTokenMarkers** if they’re missing. **[Apply Damage](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)** must be installed manually.\r- In addition to official conditions, it tracks many common features that benefit from markers (e.g., Raging, Hunter's Mark, Hexblade's Curse).\r- The Concentration condition marker also tracks concentration and prompts for a Constitution Save when damaged.\r- Compatible with Classic and Jumpgate VTT, and the 2014 or 2024 D&D sheets. Advanced configuration requires JavaScript knowledge.\r### What it can't do\r\rThere are some limitations:\r- Primarily designed for GMs and NPCs. Players may see buttons, but full use is GM-facing.\r- Conditions are matched to tokens, not character sheets (intentional, for individual instances like multiple goblins).\r- Some condition wordings may be missed, especially in non-WotC content.\r- Currently, all buttons and definitions are whispered to the controller of the NPC. If needed, this could change based on whisper settings.\r### Helper Scripts\r- **Required:** `TokenMod`, `libTokenMarkers`\r- **Optional/Recommended:** `GroupCheck`, [`Apply Damage`](https://app.roll20.net/forum/post/3631602/script-groupcheck-roll-checks-saves-et-cetera-for-many-tokens-at-once/?pageforid=4359153#post-4359153)\r---\r## Operation\rFor full documentation and configuration options, enter `!config-help` or `!condef-config` in chat. The script produces a full documentation handout.", "authors": "Keith Curtis", "roll20userid": "162065", "dependencies": [ "TokenMod", "GroupCheck", "libTokenMarkers" ], From 4d9febc44fc967e67aa4440c2c36f2787268ae8f Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 09:14:53 -0700 Subject: [PATCH 10/13] Update script.json --- Condefinition/script.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Condefinition/script.json b/Condefinition/script.json index 1737345dfb..c90ae25da8 100644 --- a/Condefinition/script.json +++ b/Condefinition/script.json @@ -6,7 +6,7 @@ "authors": "Keith Curtis", "roll20userid": "162065", "dependencies": [ "TokenMod", "GroupCheck", "libTokenMarkers" ], - "modifies": {}, + "modifies": {}, "conflicts": [], "previousversions": ["1.0.0"] } From ed8348c1a8f87fd443c9b4e8d08586a45c1446a5 Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 09:16:20 -0700 Subject: [PATCH 11/13] Update Condefintion.js --- Condefinition/Condefintion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Condefinition/Condefintion.js b/Condefinition/Condefintion.js index a7e6976932..8572848b8b 100644 --- a/Condefinition/Condefintion.js +++ b/Condefinition/Condefintion.js @@ -745,7 +745,7 @@ on('ready', () => } - const version = '0.0.0b12'; + const version = '1.0.0'; log('Condefinitions v' + version + ' is ready! --offset ' + API_Meta.Condefinition.offset + ' for the D&D 5th Edition by Roll20 Sheet.'); loadConditionsFromHandout(); From 40183417c2ed848006cd40eb3b54f435d2efaf37 Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 09:16:59 -0700 Subject: [PATCH 12/13] Create Condefinition.js --- Condefinition/1.0.0/Condefinition.js | 1348 ++++++++++++++++++++++++++ 1 file changed, 1348 insertions(+) create mode 100644 Condefinition/1.0.0/Condefinition.js diff --git a/Condefinition/1.0.0/Condefinition.js b/Condefinition/1.0.0/Condefinition.js new file mode 100644 index 0000000000..8572848b8b --- /dev/null +++ b/Condefinition/1.0.0/Condefinition.js @@ -0,0 +1,1348 @@ +var API_Meta = API_Meta || +{}; //eslint-disable-line no-var +API_Meta.Condefinition = { + offset: Number.MAX_SAFE_INTEGER, + lineCount: -1 +}; +{ + try + { + throw new Error(''); + } + catch (e) + { + API_Meta.Condefinition.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (7)); + } +} + +/* globals libTokenMarkers, TokenMod, SmartAoE */ + + + +on('ready', () => +{ + + // Make sure libTokenMarkers exists, has the functions that are expected, and has a constant for testing + if('undefined' === typeof libTokenMarkers || + (['getStatus', 'getStatuses', 'getOrderedList'].find(k => + !libTokenMarkers.hasOwnProperty(k) || 'function' !== typeof libTokenMarkers[k] + )) + ) + { + // notify of the missing library + sendChat('', `/w gm
Missing dependency: libTokenMarkers.
You can install this on your Mod Page with One-Click install.
`); + return; + + } + + // Checks for the existence of a given marker. Used for determining whether to create marketplace buttons + const markerExists = (marker) => + { + if(!marker || !marker.length) return false; + + const match = /(@\d+$|:)/.exec(marker); + const endIndex = match ? match.index : marker.length; + + const key = marker.slice(0, endIndex); + const status = libTokenMarkers.getStatus(key); + + return status.getName() === marker; + }; + + let definitions2014 = [ + ["concentrating", "Some Spells require you to maintain Concentration in order to keep their magic active. If you lose concentra⁠tion, such a spell ends.
If a spell must be maintained with Concentration, that fact appears in its Duration entry, and the spell specifies how long you can conce⁠ntrate on it. You can end Concentration at any time (no Action required).
Normal activity, such as moving and Attacking, doesn’t interfere with Concentration. The following factors can break concentration:
• Casting another spell that requires Concentration. You lose concentr⁠ation on a spell if you cast another spell that requires conc⁠entration. You can’t concentrate on two Spells at once.
• Taking Damage. Whenever you take damage while you are concentrating on a spell, you must make a Constitution saving throw to maintain your Concentration. The DC equals 10 or half the damage you take, whichever number is higher. If you take damage from multiple sources, such as an arrow and a dragon’s breath, you make a separate saving throw for each source of damage.
• Being Incapacitated or killed. You lose Concentration on a spell if you are incap⁠acitated or if you die.
• The DM might also decide that certain environmental phenomena, such as a wave Crashing over you while you’re on a storm-tossed ship, require you to succeed on a DC 10 Constitution saving throw to maintain Concentration on a spell."], + ["blinded", "• A blinded creature can’t see and automatically fails any ability check that requires sight.
• Attack rolls against the creature have advantage, and the creature’s attack rolls have disadvantage."], + ["charmed", "A charmed creature can’t attack the charmer or target the charmer with harmful bilities or magical Effects.
The charmer has advantage on any ability check to interact socially with the creature."], + ["deafened", "A deafened creature can’t hear and automatically fails any ability check that requires hearing."], + ["exhaustion", "Some special ablities and environmental hazards, such as starvation and the long-term effects of freezing or scorching temperatures, can lead to a spcial condition called exhaustion. Exhaustion is measured in six levels. An Effect can give a creature one or more levels of exhaustion, as specified in the effect’s description.

Lvl Effect
1Disadvantage on Ability Checks
2Speed halved
3Disadvantage on attack rolls and Saving Throws
4Hit point maximum halved
5Speed reduced to 0
6Death

If an already exhausted creature suffers another effect that causes exhaustion, its current level of exhaustion increases by the amount specified in the effect’s description.

A creature suffers the effect of its current level of exhaustion as well as all lower levels. For example, a creature suffering level 2 exhaustion has its speed halved and has disadvantage on Ability Checks.

An Effect that removes exhaustion reduces its level as specified in the effect’s description, with all exhaustion Effects Ending if a creature’s exhaustion level is reduced below 1.

Finishing a Long Rest reduces a creature’s exhaustion level by 1, provided that the creature has also ingested some food and drink. Also, being raised from the dead reduces a creature's exhaustion level by 1."], + ["frightened", "A frightened creature has disadvantage on Ability Checks and attack rolls while the source of its fear is within Line of Sight.
The creature can’t willingly move closer to the source of its fear."], + ["grappled", "A grappled creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.
The condition ends if the grappler is incapacitated.
The condition also ends if an Effect removes the grappled creature from the reach of the Grappler or Grappling Effect, such as when a creature is hurled away by the thunderwave spell."], + ["incapacitated", "An incapacitated creature can’t take actions or reactions."], + ["invisible", "An invisible creature is impossible to see without the aid of magic or a spcial sense. For the purpose of hiding, the creature is heavily obscured. The creature’s location can be detected by any noise it makes or any tracks it leaves.
Attack rolls against the creature have disadvantage, and the creature’s Attack rolls have advantage."], + ["paralyzed", "A paralyzed creature is incapacitated and can’t move or speak.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage.
Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature."], + ["petrified", "A petrified creature is transformed, along with any nonmagical object it is wearing or carrying, into a solid inanimate substance (usually stone). Its weight increases by a factor of ten, and it ceases aging.
The creature is incapacitated, can’t move or speak, and is unaware of its surroundings.
Attack rolls against the creature have advantage.
The creature automatically fails Strength and Dexterity Saving Throws.
The creature has Resistance to all damage.
The creature is immune to poison and disease, although a poison or disease already in its system is suspended, not neutralized."], + ["poisoned", "A poisoned creature has disadvantage on attack rolls and Ability Checks."], + ["prone", "A prone creature’s only Movement option is to crawl, unless it stands up and thereby ends the condition.
The creature has disadvantage on attack rolls.
An attack roll against the creature has advantage
if the attacker is within 5 feet of the creature.Otherwise, the attack roll has disadvantage."], + ["restrained", "A restrained creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.
Attack rolls against the creature have advantage, and the creature’s Attack rolls have disadvantage.
The creature has disadvantage on Dexterity Saving Throws."], + ["stunned", "A stunned creature is incapacitated, can’t move, and can speak only falteringly.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage."], + ["unconscious", "An unconscious creature is incapacitated, can’t move or speak, and is unaware of its surroundings
The creature drops whatever it’s holding and falls prone.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage.
Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature."], + ["dead", "A dead creature is an object.
Most GMs have a monster die the instant it drops to 0 Hit Points, rather than having it fall Unconscious and make death Saving Throws.
Mighty Villains and Special nonplayer Characters are Common exceptions; the GM might have them fall Unconscious and follow the same rules as player Characters."], + ["bardic-inspiration", "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails."], + ["bloodied", "Bloodied is not an official term, but usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is."], + ["confused", "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll a d10 at the start of each of its turns to determine its behavior for that turn.
d10 Behavior
1 The creature uses all its Movement to move in a random direction. To determine the direction, roll a d8 and assign a direction to each die face. The creature doesn't take an Action this turn.
2-6 The creature doesn't move or take ACTIONS this turn.
7-8 The creature uses its Action to make a melee Attack against a randomly determined creature within its reach. If there is no creature within its reach, the creature does nothing this turn.
9-10 The creature can act and move normally."], + ["full-cover", "A target with total cover can’t be targeted directly by an Attack or a spell, although some Spells can reach such a target by including it in an area of Effect. A target has total cover if it is completely concealed by an obstacle.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], + ["three-quarter-cover", "A target with three-quarters cover has a +5 bonus to AC and Dexterity Saving Throws. A target has three-quarters cover if about three-quarters of it is covered by an obstacle. The obstacle might be a portcullis, an arrow slit, or a thick tree trunk.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], + ["half-cover", "A target with half cover has a +2 bonus to AC and Dexterity Saving Throws. A target has half cover if an obstacle blocks at least half of its body. The obstacle might be a low wall, a large piece of furniture, a narrow tree trunk, or a creature, whether that creature is an enemy or a friend.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], + ["diseased", "See the entry on Diseases in the Compendium"], + ["ethereal", "Border Ethereal
From the Border Ethereal, a Traveler can see into whatever plane it overlaps, but that plane appears muted and indistinct, its colors blurring into each other and its edges turning fuzzy. Ethereal denizens watch the plane as though peering through distorted and frosted glass, and can’t see anything beyond 30 feet into the other plane. Conversely, the Ethereal Plane is usually Invisible to those on the overlapped planes, except with the aid of magic.
Normally, Creatures in the Border Ethereal can’t Attack Creatures on the overlapped plane, and vice versa. A Traveler on the Ethereal Plane is Invisible and utterly silent to someone on the overlapped plane, and solid Objects on the overlapped plane don’t hamper the Movement of a creature in the Border Ethereal. The exceptions are certain Magical Effects (including anything made of Magical force) and living beings. This makes the Ethereal Plane ideal for reconnaissance, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can move up and down as easily as walking."], + ["flying", "Flying Creatures enjoy many benefits of mobility, but they must also deal with the danger of Falling. If a flying creature is knocked prone, has its speed reduced to 0, or is otherwise deprived of the ability to move, the creature falls, unless it has the ability to hover or it is being held aloft by magic, such as by the fly spell."], + ["haste", "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it."], + ["hexed", "Until the spell ends, you deal an extra 1d6 necrotic damage to the target whenever you hit it with an Attack. Also, choose one ability when you cast the spell. The target has disadvantage on Ability Checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can use a bonus Action on a subsequent turn of yours to curse a new creature.
A Remove Curse cast on the target ends this spell early."], + ["hexblade-curse", "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest."], + ["hidden", "Combatants often try to Escape their foes’ notice by Hiding, casting the Invisibility spell, or lurking in darkne⁠ss.
When you Attack a target that you can’t see, you have disadvantage on the at⁠tack roll. This is true whether you’re guessing the target’s Location or you’re targeting a creature you can hear but not see. If the target isn’t in the Location you targeted, you automatically miss, but the DM typically just says that the att⁠ack missed, not whether you guessed the target’s Location correctl
When a creature can’t see you, you have advantage on Attack rolls against it. If you are hidden—both unseen and unheard—when you make an at⁠tack, you give away your Location when the att⁠ack hits or misses."], + ["TempHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."], + ["favored", "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level."], + ["marked", "You deal an extra 1d6 damage to the target whenever you hit it with a weapon Attack, and you have advantage on any Wisdom (Perception) or Wis⁠dom (Survival) check you make to find it. If the target drops to 0 Hit Points before this spell ends, you can use a bonus Action on a subsequent turn of yours to mark a new creature
At Higher Levels. When you cast this spell using a spell slot of 3rd or 4th Level, you can maintain your Concentration on the spell for up to 8 hours. When you use a spell slot of 5th Level or higher, you can maintain your concentr⁠ation on the spell for up to 24 hours."], + ["raging", "While raging, you gain the following benefits if you aren’t wearing heavy armor:
• You have advantage on Strength checks and Strength Saving Throws.
• When you make a melee weapon Attack using Strength, you gain a bonus to the damage roll that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian table.If you are able to cast Spells, you can’t cast them or concentrate on them while raging.
Your rage lasts for 1 minute. It ends early if you are knocked Unconscious or if Your Turn ends and you haven’t attacked a Hostile creature since your last turn or taken damage since then. You can also end your rage on Your Turn as a bonus Action.
Once you have raged the number of times shown for your Barbarian level in the Rages column of the Barbarian table, you must finish a Long Rest before you can rage again."], + ["slowed", "An affected target’s speed is halved, it takes a −2 penalty to AC and Dexterity Saving Throws, and it can’t use reactions. On its turn, it can use either an Action or a bonus Action, not both. Regardless of the creature’s Abilities or magic items, it can’t make more than one melee or ranged Attack during its turn.
If the creature attempts to Cast a Spell with a Casting Time of 1 Action, roll a d20. On an 11 or higher, the spell doesn’t take Effect until the creature’s next turn, and the creature must use its Action on that turn to complete the spell. If it can’t, the spell is wasted.
A creature affected by this spell makes another Wisdom saving throw at the end of each of its turns. On a successful save, the Effect ends for it."], + ["Torch", "A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee Attack with a burning torch and hit, it deals 1 fire damage."], + ["dying", "Falling Unconscious
If damage reduces you to 0 Hit Points and fails to kill you, you fall Unconscious (see Conditions ). This unconsciousness ends if you regain any Hit Points.
Death Saving Throws
Whenever you start Your Turn with 0 Hit Points, you must make a Special saving throw, called a death saving throw, to determine whether you creep closer to death or hang onto life. Unlike other Saving Throws, this one isn’t tied to any ability score. You are in the hands of fate now, aided only by Spells and Features that improve your chances of succeeding on a saving throw.
Roll a d20: If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no Effect by itself. On your third success, you become stable (see below). On your third failure, you die. The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become stable.
Rolling 1 or 20: When you make a death saving throw and roll a 1 on The D20, it counts as two failures. If you roll a 20 on The D20, you regain 1 hit point.
Damage at 0 Hit Points: If you take any damage while you have 0 Hit Points, you suffer a death saving throw failure. If the damage is from a critical hit, you suffer two failures instead. If the damage equals or exceeds your hit point maximum, you suffer Instant Death."], + ["burrowing", "A monster that has a burrowing speed can use that speed to move through sand, earth, mud, or ice. A monster can’t burrow through solid rock unless it has a Special trait that allows it to do so."], + ["dodging", "Until the start of your next turn, any Attack roll made against you has disadvantage if you can see the attacker, and you make Dexterity Saving Throws with advantage. You lose this benefit if you are Incapacitated or if your speed drops to 0."], + ["inspiration", "If you have Inspiration, you can expend it when you make an Attack roll, saving throw, or ability check. Spending your Inspiration gives you advantage on that roll.
Additionally, if you have Inspiration, you can reward another player for good Roleplaying, clever thinking, or simply doing something exciting in the game. When another player character does something that really contributes to the story in a fun and interesting way, you can give up your Inspiration to give that character Inspiration."], + ["TemporaryHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."] + ]; + + let definitions2024 = [ + ["concentrating", "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die."], + ["blinded", "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage."], + ["charmed", "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially."], + ["deafened", "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing."], + ["exhaustion", "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends."], + ["frightened", "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear."], + ["grappled", "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it."], + ["incapacitated", "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll."], + ["invisible", "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature."], + ["paralyzed", "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you."], + ["petrified", "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition."], + ["poisoned", "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks."], + ["prone", "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage."], + ["restrained", "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws."], + ["stunned", "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage."], + ["unconscious", "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings."], + ["dead", "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them."], + ["bardic-inspiration", "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails."], + ["bloodied", "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is."], + ["confused", "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success."], + ["full-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], + ["three-quarter-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], + ["half-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], + ["diseased", "See the entry on Diseases in the Compendium"], + ["ethereal", "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond."], + ["flying", "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover."], + ["haste", "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it."], + ["hexed", "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature."], + ["hexblade-curse", "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest."], + ["hidden", "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component."], + ["TempHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."], + ["favored", "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level."], + ["marked", "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours)."], + ["raging", "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage."], + ["slowed", "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success."], + ["Torch", "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage."], + ["dying", "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours."], + ["burrowing", "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed."], + ["dodging", "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0."], + ["inspiration", "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it."], + ["TemporaryHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."] + ]; + + + let defaultConditionsArray = [ + ["concentrating", + /concentration check|concentration=1/i, + "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die.", + `death-zone` + ], + ["blinded", + /(be|and|is|magically|become|becomes|is either|has the) blinded|blinded condition/i, + "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.", + `bleeding-eye` + ], + [ + "charmed", + /(be|and|is|magically|become|becomes) charmed|charmed condition/i, + "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially.", + `chained-heart` + ], + [ + "deafened", + /(be|and|is|magically|become|becomes) deafened|deafened condition/i, + "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing.", + `overdrive` + ], + [ + "exhaustion", + /(be|and|is|magically|become|becomes) exhausted|(of|magical) exhaustion|exhausted condition/i, + "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends.", + `half-haze` + ], + [ + "frightened", + /(be|and|is|magically|become|becomes) frightened|frightened condition/i, + "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear.", + `screaming` + ], + [ + "grappled", + /(be|and|is|magically|becomes|considered) grappled|grappled condition/i, + "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it.", + `grab` + ], + [ + "incapacitated", + /(be|and|is|magically|become|becomes) incapacitated|incapacitated condition/i, + "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll.", + `interdiction` + ], + [ + "invisible", + /(be|and|is|magically|become|becomes) invisible|invisible condition/i, + "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature.", + `ninja-mask` + ], + [ + "paralyzed", + /(be|and|is|magically|become|becomes) paralyzed|paralyzed condition/i, + "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.", + `aura` + ], + [ + "petrified", + /(be|and|is|magically|become|becomes|becoming) petrified|(turns to|turning to) stone|petrified condition/i, + "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition.", + `chemical-bolt` + ], + [ + "poisoned", + /(be|and|is|magically|become|becomes) poisoned|poisoned condition/i, + "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks.", + 'skull' + ], + [ + "prone", + /(be|and|is|magically|become|becomes|knocked|fall|falls) prone|prone condition/i, + "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage.", + `back-pain` + ], + [ + "restrained", + /(be|and|is|magically|become|becomes) restrained|restrained condition/i, + "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws.", + `cobweb` + ], + [ + "stunned", + /(be|and|is|magically|become|becomes) stunned|stunned condition/i, + "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.", + `broken-skull` + ], + [ + "unconscious", + /(be|and|is|magically|become|becomes) unconscious|unconscious condition/i, + "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings.", + `sleepy` + ], + [ + "dead", + /nonmatching string to prevent accidental triggering/i, + "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them.", + `dead` + ], + [ + "bardic-inspiration", + /You can inspire others through stirring words or music/i, + "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails.", + `black-flag` + ], + [ + "bloodied", + /nonmatching string to prevent accidental triggering/i, + "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is.", + `pummeled` + ], + [ + "confused", + /spawning delusions and provoking uncontrolled action/i, + "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success.", + `rolling-bomb` + ], + [ + "full-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `bolt-shield` + ], + [ + "three-quarter-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `broken-shield` + ], + [ + "half-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `broken-shield` + ], + [ + "diseased", + /nonmatching string to prevent accidental triggering/i, + "See the entry on Diseases in the Compendium", + `radioactive` + ], + [ + "ethereal", + /ethereal/i, + "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond.", + `angel-outfit` + ], + [ + "flying", + /nonmatching string to prevent accidental triggering/i, + "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover.", + `fluffy-wing` + ], + [ + "haste", + /as a wave of lethargy sweeps over it/i, + "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it.", + `stopwatch` + ], + [ + "hexed", + /You place a curse on a creature that you can see within range/i, + "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature.", + `lightning-helix` + ], + [ + "hexblade-curse", + /Starting at 1st Level, you gain the ability to place a baleful curse on someone/i, + "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest.", + `all-for-one` + ], + [ + "hidden", + /nonmatching string to prevent accidental triggering/i, + "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component.", + `ninja-mask` + ], + [ + "TempHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `broken-heart` + ], + [ + "favored", + /mystical bond with Nature to mark the target as your Favored enemy/i, + "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level.", + `archery-target` + ], + [ + "marked", + /(mystically mark it as your quarry|You magically mark one creature you can see within range as your quarry)/i, + "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours).", + `archery-target` + ], + [ + "raging", + /On your turn, you can enter a rage as a Bonus Action/i, + "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage.", + `strong` + ], + [ + "slowed", + /You alter time around up to six creatures of your choice/i, + "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success.", + `snail` + ], + [ + "Torch", + /nonmatching string to prevent accidental triggering/i, + "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage.", + `frozen-orb` + ], + [ + "dying", + /nonmatching string to prevent accidental triggering/i, + "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours.", + `death-zone` + ], + [ + "burrowing", + /nonmatching string to prevent accidental triggering/i, + "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed.", + `edge-crack` + ], + [ + "dodging", + /nonmatching string to prevent accidental triggering/i, + "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0.", + `tread` + ], + [ + "inspiration", + /nonmatching string to prevent accidental triggering/i, + "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it.", + `flying-flag` + ], + [ + "TemporaryHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `broken-heart` + ] + + + + ] + // END SET STATUS CONDITIONS OR TOKEN MARKERS + + + let defaultConditionsArray_EasyToRead = [ + ["concentrating", + /concentration check|concentration=1/i, + "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die.", + `Concentrating` + ], + ["blinded", + /(be|and|is|magically|become|becomes|is either|has the) blinded|blinded condition/i, + "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.", + `Blinded` + ], + [ + "charmed", + /(be|and|is|magically|become|becomes) charmed|charmed condition/i, + "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially.", + `Charmed` + ], + [ + "deafened", + /(be|and|is|magically|become|becomes) deafened|deafened condition/i, + "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing.", + `Deafened` + ], + [ + "exhaustion", + /(be|and|is|magically|become|becomes) exhausted|(of|magical) exhaustion|exhausted condition/i, + "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends.", + `Exhaustion1` + ], + [ + "frightened", + /(be|and|is|magically|become|becomes) frightened|frightened condition/i, + "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear.", + `Frightened` + ], + [ + "grappled", + /(be|and|is|magically|becomes|considered) grappled|grappled condition/i, + "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it.", + `Grappled` + ], + [ + "incapacitated", + /(be|and|is|magically|become|becomes) incapacitated|incapacitated condition/i, + "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll.", + `Incapacitated` + ], + [ + "invisible", + /(be|and|is|magically|become|becomes) invisible|invisible condition/i, + "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature.", + `Invisible` + ], + [ + "paralyzed", + /(be|and|is|magically|become|becomes) paralyzed|paralyzed condition/i, + "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.", + `Paralyzed` + ], + [ + "petrified", + /(be|and|is|magically|become|becomes|becoming) petrified|(turns to|turning to) stone|petrified condition/i, + "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition.", + `Petrified` + ], + [ + "poisoned", + /(be|and|is|magically|become|becomes) poisoned|poisoned condition/i, + "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks.", + 'Poisoned' + ], + [ + "prone", + /(be|and|is|magically|become|becomes|knocked|fall|falls) prone|prone condition/i, + "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage.", + `Prone` + ], + [ + "restrained", + /(be|and|is|magically|become|becomes) restrained|restrained condition/i, + "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws.", + `Restrained` + ], + [ + "stunned", + /(be|and|is|magically|become|becomes) stunned|stunned condition/i, + "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.", + `Stunned` + ], + [ + "unconscious", + /(be|and|is|magically|become|becomes) unconscious|unconscious condition/i, + "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings.", + `Unconscious9` + ], + [ + "dead", + /nonmatching string to prevent accidental triggering/i, + "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them.", + `dead` + ], + [ + "bardic-inspiration", + /You can inspire others through stirring words or music/i, + "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails.", + `Bardic` + ], + [ + "bloodied", + /nonmatching string to prevent accidental triggering/i, + "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is.", + `Bloodied` + ], + [ + "confused", + /spawning delusions and provoking uncontrolled action/i, + "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success.", + `Confused` + ], + [ + "full-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + // `death-zone` + `Cover` + ], + [ + "three-quarter-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `ThreeQuarterCover` + ], + [ + "half-cover", + /nonmatching string to prevent accidental triggering/i, + "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", + `HalfCover` + ], + [ + "diseased", + /nonmatching string to prevent accidental triggering/i, + "See the entry on Diseases in the Compendium", + `Dieseased` + ], + [ + "ethereal", + /ethereal/i, + "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond.", + `Ethereal` + ], + [ + "flying", + /nonmatching string to prevent accidental triggering/i, + "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover.", + `Flying` + ], + [ + "haste", + /as a wave of lethargy sweeps over it/i, + "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it.", + `Haste` + ], + [ + "hexed", + /You place a curse on a creature that you can see within range/i, + "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature.", + `Hexed` + ], + [ + "hexblade-curse", + /Starting at 1st Level, you gain the ability to place a baleful curse on someone/i, + "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest.", + `Hexed2` + ], + [ + "hidden", + /nonmatching string to prevent accidental triggering/i, + "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component.", + `Hidden` + ], + [ + "TempHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `TempHP` + ], + [ + "favored", + /mystical bond with Nature to mark the target as your Favored enemy/i, + "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level.", + `Marked` + ], + [ + "marked", + /(mystically mark it as your quarry|You magically mark one creature you can see within range as your quarry)/i, + "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours).", + `Marked2` + ], + [ + "raging", + /On your turn, you can enter a rage as a Bonus Action/i, + "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage.", + `Raging` + ], + [ + "slowed", + /You alter time around up to six creatures of your choice/i, + "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success.", + `Slow` + ], + [ + "Torch", + /nonmatching string to prevent accidental triggering/i, + "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage.", + `Torch` + ], + [ + "dying", + /nonmatching string to prevent accidental triggering/i, + "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours.", + `Dying` + ], + [ + "burrowing", + /nonmatching string to prevent accidental triggering/i, + "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed.", + `Burrowing` + ], + [ + "dodging", + /nonmatching string to prevent accidental triggering/i, + "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0.", + `Dodging` + ], + [ + "inspiration", + /nonmatching string to prevent accidental triggering/i, + "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it.", + `Inspiration` + ], + [ + "TemporaryHP", + /nonmatching string to prevent accidental triggering/i, + "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", + `TempHP2` + ] + + + + ] + // END SET STATUS CONDITIONS OR TOKEN MARKERS + + //Creates Handouts + function createHandoutIfMissing(name, html, gmnotes, avatar) + { + if(!name) return; + if(!html && !gmnotes && !avatar) return; // nothing to set + + const existing = findObjs( + { + _type: "handout", + name + })[0]; + if(existing) return; + + const handout = createObj("handout", + { + name, + inplayerjournals: "all", + archived: false + }); + + const props = {}; + if(html) props.notes = html; + if(gmnotes) props.gmnotes = gmnotes; + if(avatar) props.avatar = avatar; + + handout.set(props); + } + + + + const buttonstyle = `"background-color:#702c91; border-style:none;border-radius:0px 0px 0px 0px; margin:3px 2px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; + const publicButtonStyle = `"background-color:#702c91; border-style:none;border-radius:10px 0px 0px 10px; margin:3px 2px 3px 3px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 3px"`; + const markerButtonStyle = `"background-color:#702c91; border-style:none;border-radius:0px 10px 10px 0px; margin:3px 3px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 3px"`; + const saveButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:13px; margin:3px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; + const groupSaveButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:13px 0px 0px 13px; margin:3px 1px 3px 3px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; + const applyDamageButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:0px 13px 13px 0px; margin:3px 3px 3px 1px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; + const simpleButtonstyle = `"background-color:#702c91; border-style:none;border-radius:2px; margin:3px 2px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; + + const conditionnamestyle = `"background-color:#702c91; border-style:none;border-radius:6px 6px 0px 0px; margin:-8px -8px 3px -8px; font-weight:bold;text-transform:capitalize;text-decoration:none;display:block;text-align:center;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; + + const reportstyle = `"display: block; background-color:#aaa; border-radius:6px; text-decoration:none;color:#111; font-family:Arial; font-size:13px; padding: 8px;"`; + const preportstyle = `"display: block; background-color:#aaa; border-radius:6px; text-decoration:none;color:#111; font-family:Arial; font-size:13px; padding: 8px;"`; + const regexForTitles = /incapacitated<\/a>/; + const buttonbox = `
`; + const buttonboxUnshifted = `
`; + const buttonMenuStyle = `"display:block; border:1px solid #555; padding:3px; border-radius:4px; background-color:#bbb;"`; + const printChar = 'w'; + + + + + const helpHTML = `

Condefinition

What it does

Condefinition reads incoming roll templates and looks for imposed conditions and saving throws. It display a button(s) in chat that allow you to quickly apply a corresponding token marker, define the condition, track concentration, roll saving throws and/or apply damage from spells or effects that are triggered by saving throws.

  • If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to have it roll the appropriate save. If you have GroupCheck installed, it will run a groupcheck save. If you have Apply Damage installed, it will run through the steps to do a save and apply damage.
  • If the roll template contains an imposed condition, it will create a button to define the condition. If there is a cross reference in the definition of the condition, it  will create an inline link. You can also hover over the button for the text. You can use this button to whisper the text to yourself, or broadcast to the players.
  • You can also toggle that condition on any selected tokens. Assigning token markers requires installing TokenMod, and for greater facility, LibTokenMarkers. It comes with the default Status Markers assigned, but the script creates a configuration handout that can be edited to use custom token markers. Instructions are included later in this handout.
  • If you installed this Mod using Roll20 One-Click, it should automatically install GroupCheckTokenMod, and LibTokenMarkers if they are not already present. Apply Damage needs to be installed manually if you want its functionality.
  • Besides the official conditions, this also tracks mentions in chat for many common features that benefit from markers, such as raging, using Hunter's Mark, Hexblade's Curse and more. Each of these has buttons to toggle or define the effect.
  • The marker for the Concentrating condition also tracks concentration, and prompts for a Constitution Saving Throw when the token takes damage. See below for details. 
  • This script has been written to work on Classic or Jumpgate, and with the 2014 and/or 2024 sheets for 5e D&D. A dedicated user could probably adapt this for other sheets, but you would need to install the code manually. Contact me for guidance if you need it, but you will need a decent understanding of JavaScript.

What it can't do

Currently, there are some limitations:

  • This is built for GMs to facilitate running NPCs. Although most of the functions will work with PCs as well, and buttons should display for any player whose actions generate them, not every bit of it is player-accessible
  • The conditions are matched to tokens and their markers, not character sheets. This is the intended behavior as each instance of a goblin (for example) can have its own imposed conditions.
  • I have tried to catch every variation of condition wording, but I have probably missed a few incidences, particularly in products which do not adhere well to the WotC style.
  • In this iteration, all buttons and definitions are whispered to the controller of the NPC, typically the GM. If there is interest, I may change this to obey the whisper settings of the NPC, but I did not want to spam the chat. 

Helper Scripts

  • Required: Token-mod, libTokenMarkers
  • Improved by: GroupCheckApply Damage

Operation

Buttons

Every time a condition is implied by something in a chat roll template, or if the report function is used on a selected token, the script produces a button. Each button has three parts.

The middle, largest part of the button will send a message tot he GM in chat, that defines the condition. Sometimes, this will have links to other conditions that the condition imposes. Such as an Unconscious character is also Incapacitated.

The left side of the button has a word balloon graphic. This also send the definition to chat, but in this case, it is visible to all players.

The right hand side of the button shows the marker associated with that condition. It will toggle the marker for any and all selected tokens.


List All Common Condition Definitions

Condefinition can produce a reference palette of all official condition buttons. Type !condef-all  to display the report. Note that the script tracks more markers than this, such as \"Raging\", or \"Marked\". These are just the official conditions defined by the rules.


Concentration

Condefintion will monitor if the token taking damage has a defined concentration marker on it. If you reduce the hit point bar of a concentrating token, the script will prompt you to make the appropriate Constitution save.

Example. \"Morrigan\" just took 30 hp of damage while concentrating on a spell. The Script notes that the concentration marker was active, calculates the saving throw and produces a button that will cause the selected token to roll a saving throw. Note: In order to make this script work with both the 2014 and 2024 sheets, the Group Check mod is required and configured for your sheet(s). If you installed Condefinition via Roll20 One Click, it should have installed all helper scripts automatically. See the first section of this handout for more details. 


Report

Condefintion also allows you to select any number of tokens and run !condef-report. The script produces a set of report buttons for each selected token that has a defined condition marker on it. In this case, the sub-buttons that toggle token markers will only affect the respective token, and that token does not need to be selected.


Automation of Abilities that Force Saving Throws

This feature requires both Group Check, and the manually installed script Apply Damage in order to function. It also requires that the spell or feature of a creature is sent to chat with the Description turned on. In some cases this requires rolling damage or clicking the roll template button that shows the spell description. There are too many sheet variables to account for here, but in short, the keywords needed in order to trigger the script must have been sent to chat. 

The button produced is very similar to the concentration check button. In this case, the left half will roll a saving throw for all selected tokens. If you have Apply Damage installed, it will also walk you through the steps necessary to resolve the roll and apply damage accordingly. Note that this function will work on a combination of selected 2014 and 2024 tokens.


Configuration

Out of the box, this script will support conditions defined by both the 2014 and 2024 rule sets. It also can switch between the default token markers or my own Easy to Read token markers. This latter is entirely for my own convenience, and they are not required in any way for the script to function.

The Condefinitions Handout

Type !condef help or !condef config in chat to call up the configuration controls. 

Condefinition uses a lot of Regular Expressions (search code) to find and apply token markers and definitions. It reads these from a handout called Condefinitions. You can edit this handout manually. It has all of the code needed to define the conditions wrapped in a code block. You can edit the names, the definitions, the search code and the name of the corresponding token marker. The edited text must be clean plain text wrapped in code tags using the Code style button in the editor. Most users will only need to change the name of the token marker to match their chosen set.

If you don't feel comfortable editing the other code, or do so and make a mistake which breaks the handout, you can reset to the default using the buttons in the configuration panel. The script contains defaults for the 2014 and 2024 rule sets, using the default token markers provided by Roll20. I original wrote this script using my own Marketplace set, so if you have installed my \"Easy to Read Token Markers\" set, then there are also buttons that set defaults for those. This Marketplace set is honestly for my own convenience, and the script does not require this set in any way.

Each Condefintion definition is four lines long, and separated by an empty line.

  • Line 1 is the name of the condition
  • Line 2 is the Regular Expression (REGEX) used to trigger the operation of the script. It's a list of search terms that match condition and effect names. If you are not familiar with REGEX, just leave that line alone and you should be fine.
  • Line 3 is the definition of the condition or effect.. This must all be on one line, and can accept simple html styling.
  • Line 4 is the name of the associated token marker.

After editing and saving the configuration document, you must press the \"Update Conditions\" button in the chat configuration controls. This will apply the conditions immediately.

It is strongly advised that if you do make home brew changes, you duplicate the Condefinitions Handout to use as a backup. the controls can \"reset to factory specs\", but they cannot undo breaking changes.

If you create a configuration that uses a marketplace set of Token Markers that you prefer, feel free to share with others. It can be copied and pasted between games, so long as you are careful to paste clean text only (hold down the shift key while pasting, or copy from a plain text editor), and wrap the whole thing in the \"Code\" style.

`; + //createHandoutIfMissing("Help: Condefinition", helpHTML); + createHandoutIfMissing("Help: Condefinition", helpHTML, "", "https://s3.amazonaws.com/files.d20.io/images/442783616/hDkduTWDpcVEKomHnbb6AQ/med.png"); + + //Only include these buttons if the user has the Easy To Read markers from the Marketplace + let marketButtons = ((markerExists("Hexed3")) ? + `Easy to Read Markers (Marketplace)` + `
` + + makeGenericButton("2014", "!condef-easy2014") + ` ` + + makeGenericButton("2024", "!condef-easy2024") + `
` : + "" + ) + + let configMessage = `
` + + `Condefinition uses a lot of Regular Expressions (search code) to find and apply token markers and definitions. It reads these from a handout called Condefinitions. This handout has all of the code needed to define the conditions in a code block. You can edit the names, the definitions, the search code and the name of the corresponding token marker. The edited text must be clean plain text wrapped in code tags using the Code style button in the editor. Most users will only need to change the name of the token marker to match their chosen set.

If you don't feel comfortable editing the other code, or do so and make a mistake which breaks the handout, you can reset to the default using the buttons in the configuration panel. The script contains defaults for the 2014 and 2024 rule sets, using the default token markers provided by Roll20. I original wrote this script using my own Marketplace set, so if you have installed my "Easy to Read Token Markers" set, then there are also buttons that set defaults for those. This Marketplace set is honestly for my own convenience, and the script does not require this set in any way.` + `

` + + `
` + + `Generic Token Markers` + `
` + + makeGenericButton("2014", "!condef-generic2014") + ` ` + + makeGenericButton("2024", "!condef-generic2024") + `
` + + + marketButtons + + + `Edit Manually from Handout` + `
` + + makeGenericButton("Open Handout", getHandoutURL("Condefinitions")) + + makeGenericButton("Update Conditions", "!condef-loadconditions") + `

` + + + makeGenericButton("Open Help Handout", getHandoutURL("Help: Condefinition")) + `
`; + + + + + let conditionsArray = []; + loadConditionsFromHandout(); + + let ConcentrationMarker = (conditionsArray.find(([k]) => k.toLowerCase() === "concentrating") || [, , , "death-zone"])[3]; + let condefConcentrationMarker = "status_" + ConcentrationMarker; + + + + let applyDamageIsInstalled = false; + //check for dependencies + if(typeof ApplyDamage !== "undefined") + { + applyDamageIsInstalled = true; + } + + let groupCheckIsInstalled = false; + if(typeof GroupCheck !== "undefined") + { + groupCheckIsInstalled = true; + } + + + const version = '1.0.0'; + log('Condefinitions v' + version + ' is ready! --offset ' + API_Meta.Condefinition.offset + ' for the D&D 5th Edition by Roll20 Sheet.'); + loadConditionsFromHandout(); + + function getHandoutURL(handoutName) + { + const handout = findObjs( + { + _type: "handout", + name: handoutName + })[0]; + if(!handout) + { + sendMessage("No Condefintions Handout could be found. Press one of the default settings buttons to create a new handout.") + return `"No Handout was found"`; + } + else + { + const id = handout.get("_id"); + return `https://journal.roll20.net/handout/${id}`; + } + } + + + function getConditionIcon(conditionName) + { + const iconMap = { + blinded: "bleeding-eye", + charmed: "chained-heart", + // Extend as needed + }; + return iconMap[conditionName] || "question-mark"; + } + + + + + function decodeHTMLEntities(str) + { + return str + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/&/g, "&"); + } + + + function deserializeConditionsMultiline(text) + { + return text + .replace(/^
|<\/pre>$/g, "") // Strip 
 tags if present
+            .split(/\r?\n\r?\n/) // Split on double line breaks
+            .map(block =>
+            {
+                const [key, regexStr, description, label] = block.trim()
+                    .split(/\r?\n/);
+                const regexMatch = regexStr?.match(/^\/(.+)\/([gimuy]*)$/);
+                const regex = regexMatch ? new RegExp(regexMatch[1], regexMatch[2]) : /.^/;
+
+                return [key, regex, description, label];
+            })
+            .filter(entry => entry.length === 4); // Prevents malformed rows
+    }
+
+
+
+    function loadConditionsFromHandout()
+    {
+        const handout = findObjs(
+        {
+            _type: "handout",
+            name: "Condefinitions"
+        })[0];
+        if(!handout)
+        {
+            log("⚠️ Handout 'Condefinitions' not found. Creating new Config handout.");
+            writeConditionsToHandoutMultilinePlainText(defaultConditionsArray);
+            loadConditionsFromHandout();
+            createHandoutIfMissing("Condefinitions", helpHTML);
+            sendMessage(configMessage, "Condefinition Configuration");
+            return;
+        }
+
+        handout.get("notes", function(notes)
+        {
+            const parsed = deserializeConditionsMultiline(notes);
+            if(parsed.length)
+            {
+                conditionsArray = parsed;
+            }
+            else
+            {
+                log("⚠️ No valid conditions found in 'Condefinitions' handout.");
+            }
+        });
+    }
+
+
+
+
+    function serializeConditionsArrayMultiline(array)
+    {
+        return array.map(([key, regex, description, label]) =>
+                `${key}\n${regex.toString()}\n${description}\n${label}`
+            )
+            .join("\n\n");
+    }
+
+
+
+    function writeConditionsToHandoutMultilinePlainText(conditionsArray)
+    {
+        const content = conditionsArray.map(([key, regex, description, label]) =>
+            {
+                const regexString = regex.toString(); // /.../flags
+                // const icon = getConditionIcon(key);   // optional helper for icon name
+                return `${key}\n${regex.toString()}\n${description}\n${label}`;
+            })
+            .join("\n\n");
+
+        const escaped = content
+            .replace(/&/g, "&")
+            .replace(//g, ">");
+
+        const wrapped = `
${escaped}
`; + + let handout = findObjs( + { + _type: "handout", + name: "Condefinitions" + })[0]; + + if(!handout) + { + handout = createObj("handout", + { + name: "Condefinitions", + inplayerjournals: "all", + archived: false + }); + } + + handout.set( + { + notes: wrapped + }); + } + + + + function readAndParseConditions() + { + const handout = findObjs( + { + _type: "handout", + name: "Condefinitions" + })[0]; + if(!handout) + { + log("⚠️ Handout not found."); + return; + } + + handout.get("notes", function(notes) + { + + const stripped = notes.replace(/^
/i, "")
+                .replace(/<\/pre>$/i, "");
+            const decoded = stripped
+                .replace(/</g, "<")
+                .replace(/>/g, ">")
+                .replace(/&/g, "&");
+
+
+            const parsed = deserializeConditionsMultiline(notes);
+            return parsed
+        });
+    }
+
+
+    function mergeDescriptionsWithClassicDefinitions(originalArray, newConditions)
+    {
+        return originalArray.map(entry =>
+        {
+            const [key, regex, , marker] = entry;
+            const match = newConditions.find(def => def[0] === key);
+            const newDescription = match ? match[1] : entry[2]; // fallback to original description if no match
+            return [key, regex, newDescription, marker];
+        });
+    }
+
+
+
+
+    function sendMessage(message, title)
+    {
+        let theTitle = (title ? `
${title}
` : ""); + let theMessage = (message ? `
${theTitle}${message}
` : ""); + + sendChat("Condefinition", `/w gm ${theMessage}`, null, + { + noarchive: true + }); + } + + + + + // writeConditionsToHandoutMultilinePlainText(conditionsArray); + + + const input = `
blinded
+/(be|and|is|magically|become|becomes|is either) blinded|blinded condition/i
+Example description here
+bleeding-eye
+Blinded
`; + + const result = deserializeConditionsMultiline(input); + + + + let buttons = ""; + let reportText = ""; + + function makeButton(conditionName, descriptionText, tokenMarker, tokenID) + { + let tmLabel = `L`; + //let markerName = tokenMarker; + + let markerName = ((tokenMarker.includes(";;")) ? tokenMarker.split(";;")[0] : tokenMarker); + if('undefined' !== typeof libTokenMarkers && undefined !== libTokenMarkers.getStatus(markerName) + .url) + { + let tmImage = libTokenMarkers.getStatus(markerName) + .url; + + if(undefined !== tmImage && tmImage.length > 0) + { + tmLabel = ``; + } + } + buttons = buttons + ``; + } + + + function makeGenericButton(name, link) + { + return ``; + + } + + + //Concentration Observer + function concentrationCheck(obj, prev) + { + if(obj.get("statusmarkers") + .includes(condefConcentrationMarker) || obj.get("statusmarkers") + .includes(ConcentrationMarker) || obj.get(condefConcentrationMarker)) + { + // if (obj.get(condefConcentrationMarker)) { + if(prev["bar1_value"] > obj.get("bar1_value")) + { + let final_conc_DC = 10; + let calc_conc_DC = (prev["bar1_value"] - obj.get("bar1_value")) / 2; + if(calc_conc_DC > final_conc_DC) + { + final_conc_DC = Math.floor(calc_conc_DC); + } + // let tokenName = obj.get("name"); + let theMessage = `! &{template:spell} {{name=Concentration}}{{savedc=${final_conc_DC}}} {{description=Make a DC ${final_conc_DC} Constitution saving throw}}{{Concentration=1}}`; + // let theMessage = `this should print`; + sendChat("gm", theMessage); + } + } + + } + + //Event Handlers + on("change:graphic:bar1_value", concentrationCheck); + if(typeof(TokenMod) === 'object') TokenMod.ObserveTokenChange(concentrationCheck); + if('undefined' !== typeof SmartAoE && SmartAoE.ObserveTokenChange) + { + SmartAoE.ObserveTokenChange(function(obj, prev) + { + concentrationCheck(obj, prev); + }); + } + + + //Condition report creator. Use !condef for GM only, pcondef for player report. Follow by condition names separated by spaces. !condef-all returns buttons for all conditions, for reference + on('chat:message', function(msg) + { + + + if(msg.type === "api" && msg.content === "!condef-generic2014") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray, definitions2014)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to Default token markers using the 2014 condition definitions"); + return; + } + + if(msg.type === "api" && msg.content === "!condef-generic2024") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray, definitions2024)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to Default token markers using the 2024 condition definitions"); + return; + } + + if(msg.type === "api" && msg.content === "!condef-easy2014") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray_EasyToRead, definitions2014)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to the Easy to Read token markers using the 2014 condition definitions"); + return; + } + + if(msg.type === "api" && msg.content === "!condef-easy2024") + { + writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray_EasyToRead, definitions2024)); + loadConditionsFromHandout(); + sendMessage("Condefinitions handout has been reset to the Easy to Read token markers using the 2024 condition definitions"); + return; + } + + + if(msg.type === "api" && msg.content === "!condef-loadconditions") + { + loadConditionsFromHandout(); + ConcentrationMarker = (conditionsArray.find(([k]) => k.toLowerCase() === "concentrating") || [, , , "death-zone"])[3]; + condefConcentrationMarker = "status_" + ConcentrationMarker; + + sendMessage("Condition definitions reloaded from handout."); + return; + } + + if(msg.type === "api" && (msg.content === "!condef-config" || msg.content === "!condef-help")) + { + createHandoutIfMissing("Help: Condefinition", helpHTML, "", "https://s3.amazonaws.com/files.d20.io/images/442783616/hDkduTWDpcVEKomHnbb6AQ/med.png"); + + sendMessage(configMessage, "Condefinition Configuration"); + return; + } + + + + + if('api' === msg.type && msg.content.match(/^!(condef|pcondef|condef-all|condef-report|condef-toggle)/)) + { + let args = msg.content.split(" "); + let sender = msg.who; + if(msg.content === '!condef-all') + { + let message = `! &{template:noecho} {{description= blinded condition charmed condition deafened condition exhausted condition frightened condition grappled condition incapacitated condition invisible condition paralyzed condition petrified condition poisoned condition prone condition restrained condition stunned condition unconscious condition concentration check}}`; + sendChat("gm", message, null, + { + noarchive: true + }); + message = ""; + return; + } + + + let messagePrefix = ((msg.content.includes('pcondef')) ? '' : '/w ' + sender + ' '); + let theCommand = ((msg.content.includes("pcondef")) ? "!pcondef" : "!condef"); + + + //selected vs target handler + if(msg.content.includes('condef-toggle ') && msg.content.length > 15) + { + let tokenMarker = msg.content.split('condef-toggle ')[1]; + let message = ''; + if(msg.selected) + { + //message = `!token-mod --set statusmarkers|!${tokenMarker}`; + let ids = msg.selected.reduce((m, o) => [...m, o._id], []); + message = `!token-mod --api-as ${msg.playerid} --set statusmarkers|!${tokenMarker} --ids ${ids.join(' ')}`; + //message = `!token-mod --api-as ${msg.playerid} --set statusmarkers|!${tokenMarker}`; + + } + else + { + + message = messagePrefix + buttonboxUnshifted + 'No token is selected.
Click here to pick a target.
'; + } + sendChat("", message, null, + { + noarchive: true + }); + return; + } + + if(msg.content === '!condef-report') + { + buttons = ""; + + let selected = (msg.selected); + + if(selected) + { + _.each(selected, function(token) + { + let tok = getObj("graphic", token._id); + let tokName = tok.get("name") || "unnamed token"; + let tokID = tok.get("_id"); + let markers = tok.get("statusmarkers") + .replace(/::/g, ";;"); + + if(markers) + { + for(let i = 0; i < conditionsArray.length; i++) + { + let name = conditionsArray[i][0]; + let descriptionText = conditionsArray[i][2]; + let tokenMarker = conditionsArray[i][3]; + + if(markers.includes(tokenMarker)) + { + makeButton(name, descriptionText, tokenMarker, tokID); + } + } + let message = buttonbox + "" + tokName + "" + buttons + "
"; + sendChat("", messagePrefix + message, null, + { + noarchive: true + }); + + buttons = ""; + + } + }); + } + else + { + sendMessage("Select one or more tokens with conditions on them"); + + } + return; + } + + + + + for(let i = 0; i < conditionsArray.length; i++) + { + let reportName = conditionsArray[i][0]; + let reportDescription = conditionsArray[i][2]; + if(undefined !== args[1] && args[1] === reportName) + { + reportDescription = reportDescription.replace("!condef", theCommand); + reportText = `
${reportName}
${reportDescription.replace(/</g, "<").replace(/>/g, ">")}
`; + } + } + + if(undefined !== reportText && reportText.length > 0) + { + sendChat("", messagePrefix + reportText, null, + { + noarchive: true + }); + + } + + } + + + + //Roll Template Interception + if((undefined !== msg.rolltemplate && msg.rolltemplate.match(/npcfullatk|npcdmg|npcaction|traits|atkdmg|spell|condefinitions|spelloutput|noecho/g)) || (msg.content.match(/dnd-2024/g))) + { + //log (msg.content); + let sender = msg.who; + let messagePrefix = '/w ' + sender + ' '; + let saveAbility = ""; + let saveMatches = ""; + let theAbility = ""; + let saveDC = ""; + let conCheck = ""; + let concentrationButton = ""; + saveMatches = msg.content.match(/DC\s(\d\d)\s(Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma)\ssaving throw/i); + if(msg.rolltemplate !== "spell" && msg.rolltemplate !== "atkdmg" && null !== saveMatches && saveMatches.length === 3) + { + saveDC = saveMatches[1]; + saveAbility = saveMatches[2]; + } + //msg echo to console is disabled + if(msg.rolltemplate === "spell" || msg.rolltemplate === "atkdmg" || msg.rolltemplate === "spelloutput" || (msg.content.match(/dnd-2024 dnd-2024--/g))) + { + /*log(msg.content);*/ + saveAbility = msg.content.match(/(Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma)\ssav(e|ing throw)/i) || ""; + if(saveAbility.length > 0) + { + saveAbility = saveAbility[1] || ""; + } + + saveDC = ((msg.rolltemplate === "spell" || msg.rolltemplate === "spelloutput") ? msg.content.match(/{{savedc=(\d+)}}/) : msg.content.match(/{{mod=DC(\d+)}}/)) || msg.content.match(/DC\s(\d+)/) || ""; + conCheck = ((msg.rolltemplate === "spell" && msg.content.match(/{{name=Concentration/)) ? "Concentration Check" : ""); + // if (conCheck!==""){ + // makeButton("Concentrating", "makes a con check", "concentrating"); + // } + // concentrationButton = ((conCheck==="") ? "" : "
" + buttons); + + + //log("concentrationButton = " + concentrationButton); + if(saveDC.length > 0) + { + saveDC = saveDC[1] || ""; + } + + } + + if(undefined !== saveAbility && null !== saveAbility) + { + + theAbility = saveAbility.replace(/Strength/i, "str") + .replace(/Dexterity/i, "dex") + .replace(/Constitution/i, "con") + .replace(/Intelligence/i, "int") + .replace(/Wisdom/i, "wis") + .replace(/Charisma/i, "cha"); + } + let saveButton = ""; + + if(theAbility.match(/(str|dex|con|int|wis|cha)/)) + { + //for regular saves + saveButton = `DC${saveDC} ${theAbility} ${conCheck}${concentrationButton}`; + //for groupcheck + if(groupCheckIsInstalled) + { + saveAbility = saveAbility.charAt(0) + .toUpperCase() + saveAbility.slice(1); + saveButton = `DC${saveDC} ${theAbility} ${conCheck}${concentrationButton}`; + if(applyDamageIsInstalled && conCheck !== "Concentration Check") + { + saveButton = saveButton + `Dmg`; + } + } + } + + for(let i = 0; i < conditionsArray.length; i++) + { + let name = conditionsArray[i][0]; + let descriptionText = conditionsArray[i][2]; + let tokenMarker = conditionsArray[i][3]; + + if(undefined !== name) + { + if(msg.content.match(conditionsArray[i][1])) + { + makeButton(name, descriptionText, tokenMarker); + } + + } + } + let GMSaveButton = saveButton; + if(!playerIsGM(msg.playerid) && msg.playerid !== "API") + { + saveButton = ""; + } + if(buttons.length > 0 || saveButton.length > 0) + { + + let message = buttonbox + saveButton + buttons + ""; + sendChat("", messagePrefix + message, null, + { + noarchive: true + }); + + if(!messagePrefix.includes(' (GM)') && msg.rolltemplate !== "noecho") + { + message = buttonbox + GMSaveButton + buttons + ""; + if(conCheck !== "Concentration Check") + { + sendChat("", '/w gm ' + message, null, + { + noarchive: true + }); + } + } + + + buttons = ""; + + } + } + }); + +}); + +{ + try + { + throw new Error(''); + } + catch (e) + { + API_Meta.Condefinition.lineCount = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - API_Meta.Condefinition.offset); + } +} From 98fdae10d8000231833bbce3c6d9a9be1499cb06 Mon Sep 17 00:00:00 2001 From: keithcurtis1 Date: Thu, 5 Jun 2025 09:18:52 -0700 Subject: [PATCH 13/13] Delete Condefinition/1.0 directory --- Condefinition/1.0/Condefinition.js | 1348 ---------------------------- 1 file changed, 1348 deletions(-) delete mode 100644 Condefinition/1.0/Condefinition.js diff --git a/Condefinition/1.0/Condefinition.js b/Condefinition/1.0/Condefinition.js deleted file mode 100644 index a7e6976932..0000000000 --- a/Condefinition/1.0/Condefinition.js +++ /dev/null @@ -1,1348 +0,0 @@ -var API_Meta = API_Meta || -{}; //eslint-disable-line no-var -API_Meta.Condefinition = { - offset: Number.MAX_SAFE_INTEGER, - lineCount: -1 -}; -{ - try - { - throw new Error(''); - } - catch (e) - { - API_Meta.Condefinition.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (7)); - } -} - -/* globals libTokenMarkers, TokenMod, SmartAoE */ - - - -on('ready', () => -{ - - // Make sure libTokenMarkers exists, has the functions that are expected, and has a constant for testing - if('undefined' === typeof libTokenMarkers || - (['getStatus', 'getStatuses', 'getOrderedList'].find(k => - !libTokenMarkers.hasOwnProperty(k) || 'function' !== typeof libTokenMarkers[k] - )) - ) - { - // notify of the missing library - sendChat('', `/w gm
Missing dependency: libTokenMarkers.
You can install this on your Mod Page with One-Click install.
`); - return; - - } - - // Checks for the existence of a given marker. Used for determining whether to create marketplace buttons - const markerExists = (marker) => - { - if(!marker || !marker.length) return false; - - const match = /(@\d+$|:)/.exec(marker); - const endIndex = match ? match.index : marker.length; - - const key = marker.slice(0, endIndex); - const status = libTokenMarkers.getStatus(key); - - return status.getName() === marker; - }; - - let definitions2014 = [ - ["concentrating", "Some Spells require you to maintain Concentration in order to keep their magic active. If you lose concentra⁠tion, such a spell ends.
If a spell must be maintained with Concentration, that fact appears in its Duration entry, and the spell specifies how long you can conce⁠ntrate on it. You can end Concentration at any time (no Action required).
Normal activity, such as moving and Attacking, doesn’t interfere with Concentration. The following factors can break concentration:
• Casting another spell that requires Concentration. You lose concentr⁠ation on a spell if you cast another spell that requires conc⁠entration. You can’t concentrate on two Spells at once.
• Taking Damage. Whenever you take damage while you are concentrating on a spell, you must make a Constitution saving throw to maintain your Concentration. The DC equals 10 or half the damage you take, whichever number is higher. If you take damage from multiple sources, such as an arrow and a dragon’s breath, you make a separate saving throw for each source of damage.
• Being Incapacitated or killed. You lose Concentration on a spell if you are incap⁠acitated or if you die.
• The DM might also decide that certain environmental phenomena, such as a wave Crashing over you while you’re on a storm-tossed ship, require you to succeed on a DC 10 Constitution saving throw to maintain Concentration on a spell."], - ["blinded", "• A blinded creature can’t see and automatically fails any ability check that requires sight.
• Attack rolls against the creature have advantage, and the creature’s attack rolls have disadvantage."], - ["charmed", "A charmed creature can’t attack the charmer or target the charmer with harmful bilities or magical Effects.
The charmer has advantage on any ability check to interact socially with the creature."], - ["deafened", "A deafened creature can’t hear and automatically fails any ability check that requires hearing."], - ["exhaustion", "Some special ablities and environmental hazards, such as starvation and the long-term effects of freezing or scorching temperatures, can lead to a spcial condition called exhaustion. Exhaustion is measured in six levels. An Effect can give a creature one or more levels of exhaustion, as specified in the effect’s description.

Lvl Effect
1Disadvantage on Ability Checks
2Speed halved
3Disadvantage on attack rolls and Saving Throws
4Hit point maximum halved
5Speed reduced to 0
6Death

If an already exhausted creature suffers another effect that causes exhaustion, its current level of exhaustion increases by the amount specified in the effect’s description.

A creature suffers the effect of its current level of exhaustion as well as all lower levels. For example, a creature suffering level 2 exhaustion has its speed halved and has disadvantage on Ability Checks.

An Effect that removes exhaustion reduces its level as specified in the effect’s description, with all exhaustion Effects Ending if a creature’s exhaustion level is reduced below 1.

Finishing a Long Rest reduces a creature’s exhaustion level by 1, provided that the creature has also ingested some food and drink. Also, being raised from the dead reduces a creature's exhaustion level by 1."], - ["frightened", "A frightened creature has disadvantage on Ability Checks and attack rolls while the source of its fear is within Line of Sight.
The creature can’t willingly move closer to the source of its fear."], - ["grappled", "A grappled creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.
The condition ends if the grappler is incapacitated.
The condition also ends if an Effect removes the grappled creature from the reach of the Grappler or Grappling Effect, such as when a creature is hurled away by the thunderwave spell."], - ["incapacitated", "An incapacitated creature can’t take actions or reactions."], - ["invisible", "An invisible creature is impossible to see without the aid of magic or a spcial sense. For the purpose of hiding, the creature is heavily obscured. The creature’s location can be detected by any noise it makes or any tracks it leaves.
Attack rolls against the creature have disadvantage, and the creature’s Attack rolls have advantage."], - ["paralyzed", "A paralyzed creature is incapacitated and can’t move or speak.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage.
Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature."], - ["petrified", "A petrified creature is transformed, along with any nonmagical object it is wearing or carrying, into a solid inanimate substance (usually stone). Its weight increases by a factor of ten, and it ceases aging.
The creature is incapacitated, can’t move or speak, and is unaware of its surroundings.
Attack rolls against the creature have advantage.
The creature automatically fails Strength and Dexterity Saving Throws.
The creature has Resistance to all damage.
The creature is immune to poison and disease, although a poison or disease already in its system is suspended, not neutralized."], - ["poisoned", "A poisoned creature has disadvantage on attack rolls and Ability Checks."], - ["prone", "A prone creature’s only Movement option is to crawl, unless it stands up and thereby ends the condition.
The creature has disadvantage on attack rolls.
An attack roll against the creature has advantage
if the attacker is within 5 feet of the creature.Otherwise, the attack roll has disadvantage."], - ["restrained", "A restrained creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.
Attack rolls against the creature have advantage, and the creature’s Attack rolls have disadvantage.
The creature has disadvantage on Dexterity Saving Throws."], - ["stunned", "A stunned creature is incapacitated, can’t move, and can speak only falteringly.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage."], - ["unconscious", "An unconscious creature is incapacitated, can’t move or speak, and is unaware of its surroundings
The creature drops whatever it’s holding and falls prone.
The creature automatically fails Strength and Dexterity Saving Throws.
Attack rolls against the creature have advantage.
Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature."], - ["dead", "A dead creature is an object.
Most GMs have a monster die the instant it drops to 0 Hit Points, rather than having it fall Unconscious and make death Saving Throws.
Mighty Villains and Special nonplayer Characters are Common exceptions; the GM might have them fall Unconscious and follow the same rules as player Characters."], - ["bardic-inspiration", "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails."], - ["bloodied", "Bloodied is not an official term, but usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is."], - ["confused", "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll a d10 at the start of each of its turns to determine its behavior for that turn.
d10 Behavior
1 The creature uses all its Movement to move in a random direction. To determine the direction, roll a d8 and assign a direction to each die face. The creature doesn't take an Action this turn.
2-6 The creature doesn't move or take ACTIONS this turn.
7-8 The creature uses its Action to make a melee Attack against a randomly determined creature within its reach. If there is no creature within its reach, the creature does nothing this turn.
9-10 The creature can act and move normally."], - ["full-cover", "A target with total cover can’t be targeted directly by an Attack or a spell, although some Spells can reach such a target by including it in an area of Effect. A target has total cover if it is completely concealed by an obstacle.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], - ["three-quarter-cover", "A target with three-quarters cover has a +5 bonus to AC and Dexterity Saving Throws. A target has three-quarters cover if about three-quarters of it is covered by an obstacle. The obstacle might be a portcullis, an arrow slit, or a thick tree trunk.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], - ["half-cover", "A target with half cover has a +2 bonus to AC and Dexterity Saving Throws. A target has half cover if an obstacle blocks at least half of its body. The obstacle might be a low wall, a large piece of furniture, a narrow tree trunk, or a creature, whether that creature is an enemy or a friend.

Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.
There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover."], - ["diseased", "See the entry on Diseases in the Compendium"], - ["ethereal", "Border Ethereal
From the Border Ethereal, a Traveler can see into whatever plane it overlaps, but that plane appears muted and indistinct, its colors blurring into each other and its edges turning fuzzy. Ethereal denizens watch the plane as though peering through distorted and frosted glass, and can’t see anything beyond 30 feet into the other plane. Conversely, the Ethereal Plane is usually Invisible to those on the overlapped planes, except with the aid of magic.
Normally, Creatures in the Border Ethereal can’t Attack Creatures on the overlapped plane, and vice versa. A Traveler on the Ethereal Plane is Invisible and utterly silent to someone on the overlapped plane, and solid Objects on the overlapped plane don’t hamper the Movement of a creature in the Border Ethereal. The exceptions are certain Magical Effects (including anything made of Magical force) and living beings. This makes the Ethereal Plane ideal for reconnaissance, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can move up and down as easily as walking."], - ["flying", "Flying Creatures enjoy many benefits of mobility, but they must also deal with the danger of Falling. If a flying creature is knocked prone, has its speed reduced to 0, or is otherwise deprived of the ability to move, the creature falls, unless it has the ability to hover or it is being held aloft by magic, such as by the fly spell."], - ["haste", "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it."], - ["hexed", "Until the spell ends, you deal an extra 1d6 necrotic damage to the target whenever you hit it with an Attack. Also, choose one ability when you cast the spell. The target has disadvantage on Ability Checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can use a bonus Action on a subsequent turn of yours to curse a new creature.
A Remove Curse cast on the target ends this spell early."], - ["hexblade-curse", "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest."], - ["hidden", "Combatants often try to Escape their foes’ notice by Hiding, casting the Invisibility spell, or lurking in darkne⁠ss.
When you Attack a target that you can’t see, you have disadvantage on the at⁠tack roll. This is true whether you’re guessing the target’s Location or you’re targeting a creature you can hear but not see. If the target isn’t in the Location you targeted, you automatically miss, but the DM typically just says that the att⁠ack missed, not whether you guessed the target’s Location correctl
When a creature can’t see you, you have advantage on Attack rolls against it. If you are hidden—both unseen and unheard—when you make an at⁠tack, you give away your Location when the att⁠ack hits or misses."], - ["TempHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."], - ["favored", "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level."], - ["marked", "You deal an extra 1d6 damage to the target whenever you hit it with a weapon Attack, and you have advantage on any Wisdom (Perception) or Wis⁠dom (Survival) check you make to find it. If the target drops to 0 Hit Points before this spell ends, you can use a bonus Action on a subsequent turn of yours to mark a new creature
At Higher Levels. When you cast this spell using a spell slot of 3rd or 4th Level, you can maintain your Concentration on the spell for up to 8 hours. When you use a spell slot of 5th Level or higher, you can maintain your concentr⁠ation on the spell for up to 24 hours."], - ["raging", "While raging, you gain the following benefits if you aren’t wearing heavy armor:
• You have advantage on Strength checks and Strength Saving Throws.
• When you make a melee weapon Attack using Strength, you gain a bonus to the damage roll that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian table.If you are able to cast Spells, you can’t cast them or concentrate on them while raging.
Your rage lasts for 1 minute. It ends early if you are knocked Unconscious or if Your Turn ends and you haven’t attacked a Hostile creature since your last turn or taken damage since then. You can also end your rage on Your Turn as a bonus Action.
Once you have raged the number of times shown for your Barbarian level in the Rages column of the Barbarian table, you must finish a Long Rest before you can rage again."], - ["slowed", "An affected target’s speed is halved, it takes a −2 penalty to AC and Dexterity Saving Throws, and it can’t use reactions. On its turn, it can use either an Action or a bonus Action, not both. Regardless of the creature’s Abilities or magic items, it can’t make more than one melee or ranged Attack during its turn.
If the creature attempts to Cast a Spell with a Casting Time of 1 Action, roll a d20. On an 11 or higher, the spell doesn’t take Effect until the creature’s next turn, and the creature must use its Action on that turn to complete the spell. If it can’t, the spell is wasted.
A creature affected by this spell makes another Wisdom saving throw at the end of each of its turns. On a successful save, the Effect ends for it."], - ["Torch", "A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee Attack with a burning torch and hit, it deals 1 fire damage."], - ["dying", "Falling Unconscious
If damage reduces you to 0 Hit Points and fails to kill you, you fall Unconscious (see Conditions ). This unconsciousness ends if you regain any Hit Points.
Death Saving Throws
Whenever you start Your Turn with 0 Hit Points, you must make a Special saving throw, called a death saving throw, to determine whether you creep closer to death or hang onto life. Unlike other Saving Throws, this one isn’t tied to any ability score. You are in the hands of fate now, aided only by Spells and Features that improve your chances of succeeding on a saving throw.
Roll a d20: If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no Effect by itself. On your third success, you become stable (see below). On your third failure, you die. The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become stable.
Rolling 1 or 20: When you make a death saving throw and roll a 1 on The D20, it counts as two failures. If you roll a 20 on The D20, you regain 1 hit point.
Damage at 0 Hit Points: If you take any damage while you have 0 Hit Points, you suffer a death saving throw failure. If the damage is from a critical hit, you suffer two failures instead. If the damage equals or exceeds your hit point maximum, you suffer Instant Death."], - ["burrowing", "A monster that has a burrowing speed can use that speed to move through sand, earth, mud, or ice. A monster can’t burrow through solid rock unless it has a Special trait that allows it to do so."], - ["dodging", "Until the start of your next turn, any Attack roll made against you has disadvantage if you can see the attacker, and you make Dexterity Saving Throws with advantage. You lose this benefit if you are Incapacitated or if your speed drops to 0."], - ["inspiration", "If you have Inspiration, you can expend it when you make an Attack roll, saving throw, or ability check. Spending your Inspiration gives you advantage on that roll.
Additionally, if you have Inspiration, you can reward another player for good Roleplaying, clever thinking, or simply doing something exciting in the game. When another player character does something that really contributes to the story in a fun and interesting way, you can give up your Inspiration to give that character Inspiration."], - ["TemporaryHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."] - ]; - - let definitions2024 = [ - ["concentrating", "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die."], - ["blinded", "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage."], - ["charmed", "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially."], - ["deafened", "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing."], - ["exhaustion", "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends."], - ["frightened", "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear."], - ["grappled", "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it."], - ["incapacitated", "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll."], - ["invisible", "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature."], - ["paralyzed", "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you."], - ["petrified", "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition."], - ["poisoned", "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks."], - ["prone", "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage."], - ["restrained", "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws."], - ["stunned", "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage."], - ["unconscious", "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings."], - ["dead", "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them."], - ["bardic-inspiration", "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails."], - ["bloodied", "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is."], - ["confused", "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success."], - ["full-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], - ["three-quarter-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], - ["half-cover", "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree."], - ["diseased", "See the entry on Diseases in the Compendium"], - ["ethereal", "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond."], - ["flying", "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover."], - ["haste", "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it."], - ["hexed", "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature."], - ["hexblade-curse", "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest."], - ["hidden", "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component."], - ["TempHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."], - ["favored", "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level."], - ["marked", "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours)."], - ["raging", "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage."], - ["slowed", "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success."], - ["Torch", "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage."], - ["dying", "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours."], - ["burrowing", "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed."], - ["dodging", "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0."], - ["inspiration", "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it."], - ["TemporaryHP", "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest."] - ]; - - - let defaultConditionsArray = [ - ["concentrating", - /concentration check|concentration=1/i, - "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die.", - `death-zone` - ], - ["blinded", - /(be|and|is|magically|become|becomes|is either|has the) blinded|blinded condition/i, - "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.", - `bleeding-eye` - ], - [ - "charmed", - /(be|and|is|magically|become|becomes) charmed|charmed condition/i, - "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially.", - `chained-heart` - ], - [ - "deafened", - /(be|and|is|magically|become|becomes) deafened|deafened condition/i, - "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing.", - `overdrive` - ], - [ - "exhaustion", - /(be|and|is|magically|become|becomes) exhausted|(of|magical) exhaustion|exhausted condition/i, - "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends.", - `half-haze` - ], - [ - "frightened", - /(be|and|is|magically|become|becomes) frightened|frightened condition/i, - "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear.", - `screaming` - ], - [ - "grappled", - /(be|and|is|magically|becomes|considered) grappled|grappled condition/i, - "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it.", - `grab` - ], - [ - "incapacitated", - /(be|and|is|magically|become|becomes) incapacitated|incapacitated condition/i, - "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll.", - `interdiction` - ], - [ - "invisible", - /(be|and|is|magically|become|becomes) invisible|invisible condition/i, - "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature.", - `ninja-mask` - ], - [ - "paralyzed", - /(be|and|is|magically|become|becomes) paralyzed|paralyzed condition/i, - "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.", - `aura` - ], - [ - "petrified", - /(be|and|is|magically|become|becomes|becoming) petrified|(turns to|turning to) stone|petrified condition/i, - "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition.", - `chemical-bolt` - ], - [ - "poisoned", - /(be|and|is|magically|become|becomes) poisoned|poisoned condition/i, - "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks.", - 'skull' - ], - [ - "prone", - /(be|and|is|magically|become|becomes|knocked|fall|falls) prone|prone condition/i, - "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage.", - `back-pain` - ], - [ - "restrained", - /(be|and|is|magically|become|becomes) restrained|restrained condition/i, - "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws.", - `cobweb` - ], - [ - "stunned", - /(be|and|is|magically|become|becomes) stunned|stunned condition/i, - "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.", - `broken-skull` - ], - [ - "unconscious", - /(be|and|is|magically|become|becomes) unconscious|unconscious condition/i, - "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings.", - `sleepy` - ], - [ - "dead", - /nonmatching string to prevent accidental triggering/i, - "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them.", - `dead` - ], - [ - "bardic-inspiration", - /You can inspire others through stirring words or music/i, - "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails.", - `black-flag` - ], - [ - "bloodied", - /nonmatching string to prevent accidental triggering/i, - "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is.", - `pummeled` - ], - [ - "confused", - /spawning delusions and provoking uncontrolled action/i, - "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success.", - `rolling-bomb` - ], - [ - "full-cover", - /nonmatching string to prevent accidental triggering/i, - "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", - `bolt-shield` - ], - [ - "three-quarter-cover", - /nonmatching string to prevent accidental triggering/i, - "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", - `broken-shield` - ], - [ - "half-cover", - /nonmatching string to prevent accidental triggering/i, - "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", - `broken-shield` - ], - [ - "diseased", - /nonmatching string to prevent accidental triggering/i, - "See the entry on Diseases in the Compendium", - `radioactive` - ], - [ - "ethereal", - /ethereal/i, - "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond.", - `angel-outfit` - ], - [ - "flying", - /nonmatching string to prevent accidental triggering/i, - "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover.", - `fluffy-wing` - ], - [ - "haste", - /as a wave of lethargy sweeps over it/i, - "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it.", - `stopwatch` - ], - [ - "hexed", - /You place a curse on a creature that you can see within range/i, - "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature.", - `lightning-helix` - ], - [ - "hexblade-curse", - /Starting at 1st Level, you gain the ability to place a baleful curse on someone/i, - "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest.", - `all-for-one` - ], - [ - "hidden", - /nonmatching string to prevent accidental triggering/i, - "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component.", - `ninja-mask` - ], - [ - "TempHP", - /nonmatching string to prevent accidental triggering/i, - "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", - `broken-heart` - ], - [ - "favored", - /mystical bond with Nature to mark the target as your Favored enemy/i, - "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level.", - `archery-target` - ], - [ - "marked", - /(mystically mark it as your quarry|You magically mark one creature you can see within range as your quarry)/i, - "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours).", - `archery-target` - ], - [ - "raging", - /On your turn, you can enter a rage as a Bonus Action/i, - "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage.", - `strong` - ], - [ - "slowed", - /You alter time around up to six creatures of your choice/i, - "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success.", - `snail` - ], - [ - "Torch", - /nonmatching string to prevent accidental triggering/i, - "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage.", - `frozen-orb` - ], - [ - "dying", - /nonmatching string to prevent accidental triggering/i, - "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours.", - `death-zone` - ], - [ - "burrowing", - /nonmatching string to prevent accidental triggering/i, - "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed.", - `edge-crack` - ], - [ - "dodging", - /nonmatching string to prevent accidental triggering/i, - "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0.", - `tread` - ], - [ - "inspiration", - /nonmatching string to prevent accidental triggering/i, - "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it.", - `flying-flag` - ], - [ - "TemporaryHP", - /nonmatching string to prevent accidental triggering/i, - "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", - `broken-heart` - ] - - - - ] - // END SET STATUS CONDITIONS OR TOKEN MARKERS - - - let defaultConditionsArray_EasyToRead = [ - ["concentrating", - /concentration check|concentration=1/i, - "Some spells and other effects require Concentration to remain active, as specified in their descriptions. If the effect’s creator loses Concentration, the effect ends. If the effect has a maximum duration, the effect’s description specifies how long the creator can concentrate on it: up to 1 minute, 1 hour, or some other duration. The creator can end Concentration at any time (no action required). The following factors break Concentration.
Another Concentration Effect. You lose Concentration on an effect the moment you start casting a spell that requires Concentration or activate another effect that requires Concentration.
Damage. If you take damage, you must succeed on a Constitution saving throw to maintain Concentration. The DC equals 10 or half the damage taken (round down), whichever number is higher, up to a maximum DC of 30.
Incapacitated or Dead. Your Concentration ends if you have the Incapacitated condition or you die.", - `Concentrating` - ], - ["blinded", - /(be|and|is|magically|become|becomes|is either|has the) blinded|blinded condition/i, - "While you have the Blinded condition, you experience the following effects.
Can’t See. You can’t see and automatically fail any ability check that requires sight.
Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.", - `Blinded` - ], - [ - "charmed", - /(be|and|is|magically|become|becomes) charmed|charmed condition/i, - "While you have the Charmed condition, you experience the following effects.

Can’t Harm the Charmer. You can’t attack the charmer or target the charmer with damaging abilities or magical effects.

Social Advantage. The charmer has Advantage on any ability check to interact with you socially.", - `Charmed` - ], - [ - "deafened", - /(be|and|is|magically|become|becomes) deafened|deafened condition/i, - "While you have the Deafened condition, you experience the following effect.

Can’t Hear. You can’t hear and automatically fail any ability check that requires hearing.", - `Deafened` - ], - [ - "exhaustion", - /(be|and|is|magically|become|becomes) exhausted|(of|magical) exhaustion|exhausted condition/i, - "While you have the Exhaustion condition, you experience the following effects.

Exhaustion Levels. This condition is cumulative. Each time you receive it, you gain 1 Exhaustion level. You die if your Exhaustion level is 6.

D20 Tests Affected. When you make a D20 Test, the roll is reduced by 2 times your Exhaustion level.

Speed Reduced. Your Speed is reduced by a number of feet equal to 5 times your Exhaustion level.

Removing Exhaustion Levels. Finishing a Long Rest removes 1 of your Exhaustion levels. When your Exhaustion level reaches 0, the condition ends.", - `Exhaustion1` - ], - [ - "frightened", - /(be|and|is|magically|become|becomes) frightened|frightened condition/i, - "While you have the Frightened condition, you experience the following effects.

Ability Checks and Attacks Affected. You have Disadvantage on ability checks and attack rolls while the source of fear is within line of sight.

Can’t Approach. You can’t willingly move closer to the source of fear.", - `Frightened` - ], - [ - "grappled", - /(be|and|is|magically|becomes|considered) grappled|grappled condition/i, - "While you have the Grappled condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. You have Disadvantage on attack rolls against any target other than the grappler.

Movable. The grappler can drag or carry you when it moves, but every foot of movement costs it 1 extra foot unless you are Tiny or two or more sizes smaller than it.", - `Grappled` - ], - [ - "incapacitated", - /(be|and|is|magically|become|becomes) incapacitated|incapacitated condition/i, - "While you have the Incapacitated condition, you experience the following effects.

Inactive. You can’t take any action, Bonus Action, or Reaction.

No Concentration. Your Concentration is broken.

Speechless. You can’t speak.

Surprised. If you’re Incapacitated when you roll Initiative, you have Disadvantage on the roll.", - `Incapacitated` - ], - [ - "invisible", - /(be|and|is|magically|become|becomes) invisible|invisible condition/i, - "While you have the Invisible condition, you experience the following effects.

Surprise. If you’re Invisible when you roll Initiative, you have Advantage on the roll.

Concealed. You aren’t affected by any effect that requires its target to be seen unless the effect’s creator can somehow see you. Any equipment you are wearing or carrying is also concealed.

Attacks Affected. Attack rolls against you have Disadvantage, and your attack rolls have Advantage. If a creature can somehow see you, you don’t gain this benefit against that creature.", - `Invisible` - ], - [ - "paralyzed", - /(be|and|is|magically|become|becomes) paralyzed|paralyzed condition/i, - "While you have the Paralyzed condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.", - `Paralyzed` - ], - [ - "petrified", - /(be|and|is|magically|become|becomes|becoming) petrified|(turns to|turning to) stone|petrified condition/i, - "While you have the Petrified condition, you experience the following effects.

Turned to Inanimate Substance. You are transformed, along with any nonmagical objects you are wearing and carrying, into a solid inanimate substance (usually stone). Your weight increases by a factor of ten, and you cease aging.

Incapacitated. You have the Incapacitated condition.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Resist Damage. You have Resistance to all damage.

Poison Immunity. You have Immunity to the Poisoned condition.", - `Petrified` - ], - [ - "poisoned", - /(be|and|is|magically|become|becomes) poisoned|poisoned condition/i, - "While you have the Poisoned condition, you experience the following effect.

Ability Checks and Attacks Affected. You have Disadvantage on attack rolls and ability checks.", - 'Poisoned' - ], - [ - "prone", - /(be|and|is|magically|become|becomes|knocked|fall|falls) prone|prone condition/i, - "While you have the Prone condition, you experience the following effects.

Restricted Movement. Your only movement options are to crawl or to spend an amount of movement equal to half your Speed (round down) to right yourself and thereby end the condition. If your Speed is 0, you can’t right yourself.

Attacks Affected. You have Disadvantage on attack rolls. An attack roll against you has Advantage if the attacker is within 5 feet of you. Otherwise, that attack roll has Disadvantage.", - `Prone` - ], - [ - "restrained", - /(be|and|is|magically|become|becomes) restrained|restrained condition/i, - "While you have the Restrained condition, you experience the following effects.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage, and your attack rolls have Disadvantage.

Saving Throws Affected. You have Disadvantage on Dexterity saving throws.", - `Restrained` - ], - [ - "stunned", - /(be|and|is|magically|become|becomes) stunned|stunned condition/i, - "While you have the Stunned condition, you experience the following effects.

Incapacitated. You have the Incapacitated condition.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Attacks Affected. Attack rolls against you have Advantage.", - `Stunned` - ], - [ - "unconscious", - /(be|and|is|magically|become|becomes) unconscious|unconscious condition/i, - "While you have the Unconscious condition, you experience the following effects.

Inert. You have the Incapacitated and Prone conditions, and you drop whatever you’re holding. When this condition ends, you remain Prone.

Speed 0. Your Speed is 0 and can’t increase.

Attacks Affected. Attack rolls against you have Advantage.

Saving Throws Affected. You automatically fail Strength and Dexterity saving throws.

Automatic Critical Hits. Any attack roll that hits you is a Critical Hit if the attacker is within 5 feet of you.

Unaware. You’re unaware of your surroundings.", - `Unconscious9` - ], - [ - "dead", - /nonmatching string to prevent accidental triggering/i, - "A dead creature has no Hit Points and can’t regain them unless it is first revived by magic such as the Raise Dead or Revivify spell. When such a spell is cast, the spirit knows who is casting it and can refuse. The spirit of a dead creature has left the body and departed for the Outer Planes, and reviving the creature requires calling the spirit back.
If the creature returns to life, the revival effect determines the creature’s current Hit Points. Unless otherwise stated, the creature returns to life with any conditions, magical contagions, or curses that were affecting it at death if the durations of those effects are still ongoing. If the creature died with any Exhaustion levels, it returns with 1 fewer level. If the creature had Attunement to one or more magic items, it is no longer attuned to them.", - `dead` - ], - [ - "bardic-inspiration", - /You can inspire others through stirring words or music/i, - "Once within the next 10 minutes, the creature can roll the die and add the number rolled to one ability check, Attack roll, or saving throw it makes. The creature can wait until after it rolls The D20 before deciding to use the Bardic Inspiration die, but must decide before the DM says whether the roll succeeds or fails.", - `Bardic` - ], - [ - "bloodied", - /nonmatching string to prevent accidental triggering/i, - "A creature is Bloodied while it has half its Hit Points or fewer remaining. Usually determines the effectiveness of a Swarm. It is the point at which a creature reaches half their full hit points. The DM may reveal this to the players as an indicator of how strong the monster currently is.", - `Bloodied` - ], - [ - "confused", - /spawning delusions and provoking uncontrolled action/i, - "Not a true condition, but can represent the effect of the confusion spell.
An affected target can’t take reactions and must roll 1d10 at the start of each of its turns to determine its behavior for that turn, consulting the table below.
1d10 - Behavior for the Turn
1 - The target doesn't take an action, and it uses all its movement to move. Roll 1d4 for the direction: 1, north; 2, east; 3, south; or 4, west.
2-6 - The target doesn't move or take actions.
7-8 - The target doesn't move, and it takes the Attack action to make one melee attack against a random creature within reach. If none are within reach, the target takes no action.
9-10 - The target chooses its behavior. At the end of each of its turns, an affected target repeats the save, ending the spell on itself on a success.", - `Confused` - ], - [ - "full-cover", - /nonmatching string to prevent accidental triggering/i, - "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", - // `death-zone` - `Cover` - ], - [ - "three-quarter-cover", - /nonmatching string to prevent accidental triggering/i, - "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", - `ThreeQuarterCover` - ], - [ - "half-cover", - /nonmatching string to prevent accidental triggering/i, - "Cover provides a degree of protection to a target behind it. There are three degrees of cover, each of which provides a different benefit to a target: Half Cover (+2 bonus to AC and Dexterity saving throws), Three-Quarters Cover (+5 bonus to AC and Dexterity saving throws), and Total Cover (can’t be targeted directly). If behind more than one degree of cover, a target benefits only from the most protective degree.", - `HalfCover` - ], - [ - "diseased", - /nonmatching string to prevent accidental triggering/i, - "See the entry on Diseases in the Compendium", - `Dieseased` - ], - [ - "ethereal", - /ethereal/i, - "Border Ethereal
From the Border Ethereal, a traveler can see into whatever plane it overlaps, but that plane appears grayish and indistinct, its colors blurring into each other and its edges turning fuzzy, limiting visibility to 30 feet into the other plane. Conversely, the Ethereal Plane is usually imperceptible to those on the overlapped planes, except with the aid of magic.
Normally, creatures in the Border Ethereal can’t attack creatures on the overlapped plane, and vice versa. A traveler on the Ethereal Plane is imperceptible to someone on the overlapped plane, and solid objects on the overlapped plane don’t hamper the movement of a creature in the Border Ethereal. The exceptions are certain magical effects (including anything made of magical force) and living beings. This makes the Ethereal Plane ideal for scouting, spying on opponents, and moving around without being detected. The Ethereal Plane also disobeys the laws of gravity; a creature there can freely move in any direction.
Deep Ethereal
To reach the Deep Ethereal, one typically needs a Plane Shift spell, a Gate spell, or a magical portal. Visitors to the Deep Ethereal are engulfed by roiling mist. Scattered throughout the plane are curtains of vaporous color, and passing through a curtain leads a traveler to a region of the Border Ethereal connected to a specific Inner Plane, the Material Plane, the Feywild, or the Shadowfell. The color of the curtain indicates the plane whose Border Ethereal the curtain conceals; see the Ethereal Curtains table. The curtains are also distinguishable by texture and temperature, each one reflecting something of the nature of the plane beyond.", - `Ethereal` - ], - [ - "flying", - /nonmatching string to prevent accidental triggering/i, - "A variety of effects allow a creature to fly. While flying, you fall if you have the Incapacitated or Prone condition or your Fly Speed is reduced to 0. You can stay aloft in those circumstances if you can hover.", - `Flying` - ], - [ - "haste", - /as a wave of lethargy sweeps over it/i, - "The target’s speed is doubled, it gains a +2 bonus to AC, it has advantage on Dexterity Saving Throws, and it gains an additional Action on each of its turns. That Action can be used only to take the Attack (one weapon attac⁠k only), Dash, Disengage, Hide, or Use an Object Action.
When the spell ends, the target can’t move or take actions until after its next turn, as a wave of lethargy sweeps over it.", - `Haste` - ], - [ - "hexed", - /You place a curse on a creature that you can see within range/i, - "You place a curse on a creature that you can see within range. Until the spell ends, you deal an extra 1d6 Necrotic damage to the target whenever you hit it with an attack roll. Also, choose one ability when you cast the spell. The target has Disadvantage on ability checks made with the chosen ability.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action on a later turn to curse a new creature.", - `Hexed` - ], - [ - "hexblade-curse", - /Starting at 1st Level, you gain the ability to place a baleful curse on someone/i, - "As a Bonus Action, choose one creature you can see within 30 feet of you. The target is Cursed for 1 minute. The curse ends early if the target dies, you die, or you are Incapacitated. Until the curse ends, you gain the following benefits:
You gain a bonus to Damage Rolls against the Cursed target. The bonus equals your Proficiency Bonus.
Any Attack roll you make against the Cursed target is a critical hit on a roll of 19 or 20 on The D20.
If the Cursed target dies, you regain Hit Points equal to your Warlock level + your Charisma modifier (minimum of 1 hit point).
You can’t use this feature again until you finish a short or Long Rest.", - `Hexed2` - ], - [ - "hidden", - /nonmatching string to prevent accidental triggering/i, - "With the Hide action, you try to conceal yourself. To do so, you must succeed on a DC 15 Dexterity (Stealth) check while you’re Heavily Obscured or behind Three-Quarters Cover or Total Cover, and you must be out of any enemy’s line of sight; if you can see a creature, you can discern whether it can see you.
On a successful check, you have the Invisible condition. Make note of your check’s total, which is the DC for a creature to find you with a Wisdom (Perception) check.
The condition ends on you immediately after any of the following occurs: you make a sound louder than a whisper, an enemy finds you, you make an attack roll, or you cast a spell with a Verbal component.", - `Hidden` - ], - [ - "TempHP", - /nonmatching string to prevent accidental triggering/i, - "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", - `TempHP` - ], - [ - "favored", - /mystical bond with Nature to mark the target as your Favored enemy/i, - "Concentration.
The first time on each of your turns that you hit the Favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4.
You can use this feature to mark a Favored enemy a number of times equal to your Proficiency bonus, and you regain all expended uses when you finish a Long Rest.
This feature's extra damage increases when you reach certain levels in this class: to 1d6 at 6th Level and to 1d8 at 14th level.", - `Marked` - ], - [ - "marked", - /(mystically mark it as your quarry|You magically mark one creature you can see within range as your quarry)/i, - "You magically mark one creature you can see within range as your quarry. Until the spell ends, you deal an extra 1d6 Force damage to the target whenever you hit it with an attack roll. You also have Advantage on any Wisdom (Perception or Survival) check you make to find it.
If the target drops to 0 Hit Points before this spell ends, you can take a Bonus Action to move the mark to a new creature you can see within range.
Using a Higher-Level Spell Slot. Your Concentration can last longer with a spell slot of level 3–4 (up to 8 hours) or 5+ (up to 24 hours).", - `Marked2` - ], - [ - "raging", - /On your turn, you can enter a rage as a Bonus Action/i, - "While active, your Rage follows the rules below.
Damage Resistance. You have Resistance to Bludgeoning, Piercing, and Slashing damage.
Rage Damage. When you make an attack using Strength—with either a weapon or an Unarmed Strike—and deal damage to the target, you gain a bonus to the damage that increases as you gain levels as a Barbarian, as shown in the Rage Damage column of the Barbarian Features table.
Strength Advantage. You have Advantage on Strength checks and Strength saving throws.
No Concentration or Spells. You can’t maintain Concentration, and you can’t cast spells.
Duration. The Rage lasts until the end of your next turn, and it ends early if you don Heavy armor or have the Incapacitated condition. If your Rage is still active on your next turn, you can extend the Rage for another round by doing one of the following:
Make an attack roll against an enemy.
Force an enemy to make a saving throw.
Take a Bonus Action to extend your Rage.", - `Raging` - ], - [ - "slowed", - /You alter time around up to six creatures of your choice/i, - "Each target must succeed on a Wisdom saving throw or be affected by this spell for the duration.
An affected target’s Speed is halved, it takes a −2 penalty to AC and Dexterity saving throws, and it can’t take Reactions. On its turns, it can take either an action or a Bonus Action, not both, and it can make only one attack if it takes the Attack action. If it casts a spell with a Somatic component, there is a 25 percent chance the spell fails as a result of the target making the spell’s gestures too slowly.
An affected target repeats the save at the end of each of its turns, ending the spell on itself on a success.", - `Slow` - ], - [ - "Torch", - /nonmatching string to prevent accidental triggering/i, - "A Torch burns for 1 hour, casting Bright Light in a 20-foot radius and Dim Light for an additional 20 feet. When you take the Attack action, you can attack with the Torch, using it as a Simple Melee weapon. On a hit, the target takes 1 Fire damage.", - `Torch` - ], - [ - "dying", - /nonmatching string to prevent accidental triggering/i, - "When a creature drops to 0 Hit Points, it either dies outright or falls unconscious, as explained below.
Instant Death
Here are the main ways a creature can die instantly.
Monster Death.
A monster dies the instant it drops to 0 Hit Points, although a Dungeon Master can ignore this rule for an individual monster and treat it like a character.
Hit Point Maximum of 0.
A creature dies if its Hit Point maximum reaches 0. Certain effects drain life energy, reducing a creature’s Hit Point maximum.
Massive Damage.
When damage reduces a character to 0 Hit Points and damage remains, the character dies if the remainder equals or exceeds their Hit Point maximum. For example, if your character has a Hit Point maximum of 12, currently has 6 Hit Points, and takes 18 damage, the character drops to 0 Hit Points, but 12 damage remains. The character then dies, since 12 equals their Hit Point maximum.
Character Demise
If your character dies, others might find a magical way to revive your character, such as with the Raise Dead spell. Or talk with the DM about making a new character to join the group.
Falling
Unconscious
If you reach 0 Hit Points and don’t die instantly, you have the Unconscious condition until you regain any Hit Points, and you now face making Death Saving Throws (see below).
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
Death Saving Throws
Whenever you start your turn with 0 Hit Points, you must make a Death Saving Throw to determine whether you creep closer to death or hang on to life. Unlike other saving throws, this one isn’t tied to an ability score. You’re in the hands of fate now.
Three Successes/Failures.
Roll 1d20. If the roll is 10 or higher, you succeed. Otherwise, you fail. A success or failure has no effect by itself. On your third success, you become Stable. On your third failure, you die.
The successes and failures don’t need to be consecutive; keep track of both until you collect three of a kind. The number of both is reset to zero when you regain any Hit Points or become Stable.
Rolling a 1 or 20.
When you roll a 1 on the d20 for a Death Saving Throw, you suffer two failures. If you roll a 20 on the d20, you regain 1 Hit Point.
Damage at 0 Hit Points.
If you take any damage while you have 0 Hit Points, you suffer a Death Saving Throw failure. If the damage is from a Critical Hit, you suffer two failures instead. If the damage equals or exceeds your Hit Point maximum, you die.
Stabilizing a Character
You can take the Help action to try to stabilize a creature with 0 Hit Points, which requires a successful DC 10 Wisdom (Medicine) check.
A Stable creature doesn’t make Death Saving Throws even though it has 0 Hit Points, but it still has the Unconscious condition. If the creature takes damage, it stops being Stable and starts making Death Saving Throws again. A Stable creature that isn’t healed regains 1 Hit Point after 1d4 hours.", - `Dying` - ], - [ - "burrowing", - /nonmatching string to prevent accidental triggering/i, - "A creature that has a Burrow Speed can use that speed to move through sand, earth, mud, or ice. The creature can’t burrow through solid rock unless the creature has a trait that allows it to do so. See also “Speed.", - `Burrowing` - ], - [ - "dodging", - /nonmatching string to prevent accidental triggering/i, - "If you take the Dodge action, you gain the following benefits: until the start of your next turn, any attack roll made against you has Disadvantage if you can see the attacker, and you make Dexterity saving throws with Advantage.
You lose these benefits if you have the Incapacitated condition or if your Speed is 0.", - `Dodging` - ], - [ - "inspiration", - /nonmatching string to prevent accidental triggering/i, - "If you (a player character) have Heroic Inspiration, you can expend it to reroll any die immediately after rolling it, and you must use the new roll.
If you gain Heroic Inspiration but already have it, it’s lost unless you give it to a player character who lacks it.", - `Inspiration` - ], - [ - "TemporaryHP", - /nonmatching string to prevent accidental triggering/i, - "Temporary Hit Points aren’t actual hit points; they are a buffer against damage, a pool of Hit Points that protect you from injury.
When you have temporary Hit Points and take damage, the temporary Hit Points are lost first, and any leftover damage carries over to your normal Hit Points. For example, if you have 5 temporary Hit Points and take 7 damage, you lose the temporary Hit Points and then take 2 damage.
Because temporary Hit Points are separate from your actual Hit Points, they can exceed your hit point maximum. A character can, therefore, be at full Hit Points and receive temporary Hit Points.
Healing can’t restore temporary Hit Points, and they can’t be added together. If you have temporary Hit Points and receive more of them, you decide whether to keep the ones you have or to gain the new ones. For example, if a spell grants you 12 temporary Hit Points when you already have 10, you can have 12 or 10, not 22.
If you have 0 Hit Points, receiving temporary Hit Points doesn’t restore you to consciousness or stabilize you. They can still absorb damage directed at you while you’re in that state, but only true Healing can save you.
Unless a feature that grants you temporary Hit Points has a Duration, they last until they’re depleted or you finish a Long Rest.", - `TempHP2` - ] - - - - ] - // END SET STATUS CONDITIONS OR TOKEN MARKERS - - //Creates Handouts - function createHandoutIfMissing(name, html, gmnotes, avatar) - { - if(!name) return; - if(!html && !gmnotes && !avatar) return; // nothing to set - - const existing = findObjs( - { - _type: "handout", - name - })[0]; - if(existing) return; - - const handout = createObj("handout", - { - name, - inplayerjournals: "all", - archived: false - }); - - const props = {}; - if(html) props.notes = html; - if(gmnotes) props.gmnotes = gmnotes; - if(avatar) props.avatar = avatar; - - handout.set(props); - } - - - - const buttonstyle = `"background-color:#702c91; border-style:none;border-radius:0px 0px 0px 0px; margin:3px 2px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; - const publicButtonStyle = `"background-color:#702c91; border-style:none;border-radius:10px 0px 0px 10px; margin:3px 2px 3px 3px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 3px"`; - const markerButtonStyle = `"background-color:#702c91; border-style:none;border-radius:0px 10px 10px 0px; margin:3px 3px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 3px"`; - const saveButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:13px; margin:3px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; - const groupSaveButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:13px 0px 0px 13px; margin:3px 1px 3px 3px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; - const applyDamageButtonstyle = `"background-color:#ce0f69; border-width:0px;border-radius:0px 13px 13px 0px; margin:3px 3px 3px 1px; text-transform:capitalize;text-decoration:none;display:inline-block;color:#fff; font-family:Arial; font-size:13px; padding:0px 7px"`; - const simpleButtonstyle = `"background-color:#702c91; border-style:none;border-radius:2px; margin:3px 2px 3px 0px; text-decoration:none;display:inline-block;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; - - const conditionnamestyle = `"background-color:#702c91; border-style:none;border-radius:6px 6px 0px 0px; margin:-8px -8px 3px -8px; font-weight:bold;text-transform:capitalize;text-decoration:none;display:block;text-align:center;color:#e6e6e6; font-family:Arial; font-size:13px; padding:0px 7px"`; - - const reportstyle = `"display: block; background-color:#aaa; border-radius:6px; text-decoration:none;color:#111; font-family:Arial; font-size:13px; padding: 8px;"`; - const preportstyle = `"display: block; background-color:#aaa; border-radius:6px; text-decoration:none;color:#111; font-family:Arial; font-size:13px; padding: 8px;"`; - const regexForTitles = /incapacitated<\/a>/; - const buttonbox = `
`; - const buttonboxUnshifted = `
`; - const buttonMenuStyle = `"display:block; border:1px solid #555; padding:3px; border-radius:4px; background-color:#bbb;"`; - const printChar = 'w'; - - - - - const helpHTML = `

Condefinition

What it does

Condefinition reads incoming roll templates and looks for imposed conditions and saving throws. It display a button(s) in chat that allow you to quickly apply a corresponding token marker, define the condition, track concentration, roll saving throws and/or apply damage from spells or effects that are triggered by saving throws.

  • If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to have it roll the appropriate save. If you have GroupCheck installed, it will run a groupcheck save. If you have Apply Damage installed, it will run through the steps to do a save and apply damage.
  • If the roll template contains an imposed condition, it will create a button to define the condition. If there is a cross reference in the definition of the condition, it  will create an inline link. You can also hover over the button for the text. You can use this button to whisper the text to yourself, or broadcast to the players.
  • You can also toggle that condition on any selected tokens. Assigning token markers requires installing TokenMod, and for greater facility, LibTokenMarkers. It comes with the default Status Markers assigned, but the script creates a configuration handout that can be edited to use custom token markers. Instructions are included later in this handout.
  • If you installed this Mod using Roll20 One-Click, it should automatically install GroupCheckTokenMod, and LibTokenMarkers if they are not already present. Apply Damage needs to be installed manually if you want its functionality.
  • Besides the official conditions, this also tracks mentions in chat for many common features that benefit from markers, such as raging, using Hunter's Mark, Hexblade's Curse and more. Each of these has buttons to toggle or define the effect.
  • The marker for the Concentrating condition also tracks concentration, and prompts for a Constitution Saving Throw when the token takes damage. See below for details. 
  • This script has been written to work on Classic or Jumpgate, and with the 2014 and/or 2024 sheets for 5e D&D. A dedicated user could probably adapt this for other sheets, but you would need to install the code manually. Contact me for guidance if you need it, but you will need a decent understanding of JavaScript.

What it can't do

Currently, there are some limitations:

  • This is built for GMs to facilitate running NPCs. Although most of the functions will work with PCs as well, and buttons should display for any player whose actions generate them, not every bit of it is player-accessible
  • The conditions are matched to tokens and their markers, not character sheets. This is the intended behavior as each instance of a goblin (for example) can have its own imposed conditions.
  • I have tried to catch every variation of condition wording, but I have probably missed a few incidences, particularly in products which do not adhere well to the WotC style.
  • In this iteration, all buttons and definitions are whispered to the controller of the NPC, typically the GM. If there is interest, I may change this to obey the whisper settings of the NPC, but I did not want to spam the chat. 

Helper Scripts

  • Required: Token-mod, libTokenMarkers
  • Improved by: GroupCheckApply Damage

Operation

Buttons

Every time a condition is implied by something in a chat roll template, or if the report function is used on a selected token, the script produces a button. Each button has three parts.

The middle, largest part of the button will send a message tot he GM in chat, that defines the condition. Sometimes, this will have links to other conditions that the condition imposes. Such as an Unconscious character is also Incapacitated.

The left side of the button has a word balloon graphic. This also send the definition to chat, but in this case, it is visible to all players.

The right hand side of the button shows the marker associated with that condition. It will toggle the marker for any and all selected tokens.


List All Common Condition Definitions

Condefinition can produce a reference palette of all official condition buttons. Type !condef-all  to display the report. Note that the script tracks more markers than this, such as \"Raging\", or \"Marked\". These are just the official conditions defined by the rules.


Concentration

Condefintion will monitor if the token taking damage has a defined concentration marker on it. If you reduce the hit point bar of a concentrating token, the script will prompt you to make the appropriate Constitution save.

Example. \"Morrigan\" just took 30 hp of damage while concentrating on a spell. The Script notes that the concentration marker was active, calculates the saving throw and produces a button that will cause the selected token to roll a saving throw. Note: In order to make this script work with both the 2014 and 2024 sheets, the Group Check mod is required and configured for your sheet(s). If you installed Condefinition via Roll20 One Click, it should have installed all helper scripts automatically. See the first section of this handout for more details. 


Report

Condefintion also allows you to select any number of tokens and run !condef-report. The script produces a set of report buttons for each selected token that has a defined condition marker on it. In this case, the sub-buttons that toggle token markers will only affect the respective token, and that token does not need to be selected.


Automation of Abilities that Force Saving Throws

This feature requires both Group Check, and the manually installed script Apply Damage in order to function. It also requires that the spell or feature of a creature is sent to chat with the Description turned on. In some cases this requires rolling damage or clicking the roll template button that shows the spell description. There are too many sheet variables to account for here, but in short, the keywords needed in order to trigger the script must have been sent to chat. 

The button produced is very similar to the concentration check button. In this case, the left half will roll a saving throw for all selected tokens. If you have Apply Damage installed, it will also walk you through the steps necessary to resolve the roll and apply damage accordingly. Note that this function will work on a combination of selected 2014 and 2024 tokens.


Configuration

Out of the box, this script will support conditions defined by both the 2014 and 2024 rule sets. It also can switch between the default token markers or my own Easy to Read token markers. This latter is entirely for my own convenience, and they are not required in any way for the script to function.

The Condefinitions Handout

Type !condef help or !condef config in chat to call up the configuration controls. 

Condefinition uses a lot of Regular Expressions (search code) to find and apply token markers and definitions. It reads these from a handout called Condefinitions. You can edit this handout manually. It has all of the code needed to define the conditions wrapped in a code block. You can edit the names, the definitions, the search code and the name of the corresponding token marker. The edited text must be clean plain text wrapped in code tags using the Code style button in the editor. Most users will only need to change the name of the token marker to match their chosen set.

If you don't feel comfortable editing the other code, or do so and make a mistake which breaks the handout, you can reset to the default using the buttons in the configuration panel. The script contains defaults for the 2014 and 2024 rule sets, using the default token markers provided by Roll20. I original wrote this script using my own Marketplace set, so if you have installed my \"Easy to Read Token Markers\" set, then there are also buttons that set defaults for those. This Marketplace set is honestly for my own convenience, and the script does not require this set in any way.

Each Condefintion definition is four lines long, and separated by an empty line.

  • Line 1 is the name of the condition
  • Line 2 is the Regular Expression (REGEX) used to trigger the operation of the script. It's a list of search terms that match condition and effect names. If you are not familiar with REGEX, just leave that line alone and you should be fine.
  • Line 3 is the definition of the condition or effect.. This must all be on one line, and can accept simple html styling.
  • Line 4 is the name of the associated token marker.

After editing and saving the configuration document, you must press the \"Update Conditions\" button in the chat configuration controls. This will apply the conditions immediately.

It is strongly advised that if you do make home brew changes, you duplicate the Condefinitions Handout to use as a backup. the controls can \"reset to factory specs\", but they cannot undo breaking changes.

If you create a configuration that uses a marketplace set of Token Markers that you prefer, feel free to share with others. It can be copied and pasted between games, so long as you are careful to paste clean text only (hold down the shift key while pasting, or copy from a plain text editor), and wrap the whole thing in the \"Code\" style.

`; - //createHandoutIfMissing("Help: Condefinition", helpHTML); - createHandoutIfMissing("Help: Condefinition", helpHTML, "", "https://s3.amazonaws.com/files.d20.io/images/442783616/hDkduTWDpcVEKomHnbb6AQ/med.png"); - - //Only include these buttons if the user has the Easy To Read markers from the Marketplace - let marketButtons = ((markerExists("Hexed3")) ? - `Easy to Read Markers (Marketplace)` + `
` + - makeGenericButton("2014", "!condef-easy2014") + ` ` + - makeGenericButton("2024", "!condef-easy2024") + `
` : - "" - ) - - let configMessage = `
` + - `Condefinition uses a lot of Regular Expressions (search code) to find and apply token markers and definitions. It reads these from a handout called Condefinitions. This handout has all of the code needed to define the conditions in a code block. You can edit the names, the definitions, the search code and the name of the corresponding token marker. The edited text must be clean plain text wrapped in code tags using the Code style button in the editor. Most users will only need to change the name of the token marker to match their chosen set.

If you don't feel comfortable editing the other code, or do so and make a mistake which breaks the handout, you can reset to the default using the buttons in the configuration panel. The script contains defaults for the 2014 and 2024 rule sets, using the default token markers provided by Roll20. I original wrote this script using my own Marketplace set, so if you have installed my "Easy to Read Token Markers" set, then there are also buttons that set defaults for those. This Marketplace set is honestly for my own convenience, and the script does not require this set in any way.` + `

` + - `
` + - `Generic Token Markers` + `
` + - makeGenericButton("2014", "!condef-generic2014") + ` ` + - makeGenericButton("2024", "!condef-generic2024") + `
` + - - marketButtons + - - `Edit Manually from Handout` + `
` + - makeGenericButton("Open Handout", getHandoutURL("Condefinitions")) + - makeGenericButton("Update Conditions", "!condef-loadconditions") + `

` + - - makeGenericButton("Open Help Handout", getHandoutURL("Help: Condefinition")) + `
`; - - - - - let conditionsArray = []; - loadConditionsFromHandout(); - - let ConcentrationMarker = (conditionsArray.find(([k]) => k.toLowerCase() === "concentrating") || [, , , "death-zone"])[3]; - let condefConcentrationMarker = "status_" + ConcentrationMarker; - - - - let applyDamageIsInstalled = false; - //check for dependencies - if(typeof ApplyDamage !== "undefined") - { - applyDamageIsInstalled = true; - } - - let groupCheckIsInstalled = false; - if(typeof GroupCheck !== "undefined") - { - groupCheckIsInstalled = true; - } - - - const version = '0.0.0b12'; - log('Condefinitions v' + version + ' is ready! --offset ' + API_Meta.Condefinition.offset + ' for the D&D 5th Edition by Roll20 Sheet.'); - loadConditionsFromHandout(); - - function getHandoutURL(handoutName) - { - const handout = findObjs( - { - _type: "handout", - name: handoutName - })[0]; - if(!handout) - { - sendMessage("No Condefintions Handout could be found. Press one of the default settings buttons to create a new handout.") - return `"No Handout was found"`; - } - else - { - const id = handout.get("_id"); - return `https://journal.roll20.net/handout/${id}`; - } - } - - - function getConditionIcon(conditionName) - { - const iconMap = { - blinded: "bleeding-eye", - charmed: "chained-heart", - // Extend as needed - }; - return iconMap[conditionName] || "question-mark"; - } - - - - - function decodeHTMLEntities(str) - { - return str - .replace(/</g, "<") - .replace(/>/g, ">") - .replace(/&/g, "&"); - } - - - function deserializeConditionsMultiline(text) - { - return text - .replace(/^
|<\/pre>$/g, "") // Strip 
 tags if present
-            .split(/\r?\n\r?\n/) // Split on double line breaks
-            .map(block =>
-            {
-                const [key, regexStr, description, label] = block.trim()
-                    .split(/\r?\n/);
-                const regexMatch = regexStr?.match(/^\/(.+)\/([gimuy]*)$/);
-                const regex = regexMatch ? new RegExp(regexMatch[1], regexMatch[2]) : /.^/;
-
-                return [key, regex, description, label];
-            })
-            .filter(entry => entry.length === 4); // Prevents malformed rows
-    }
-
-
-
-    function loadConditionsFromHandout()
-    {
-        const handout = findObjs(
-        {
-            _type: "handout",
-            name: "Condefinitions"
-        })[0];
-        if(!handout)
-        {
-            log("⚠️ Handout 'Condefinitions' not found. Creating new Config handout.");
-            writeConditionsToHandoutMultilinePlainText(defaultConditionsArray);
-            loadConditionsFromHandout();
-            createHandoutIfMissing("Condefinitions", helpHTML);
-            sendMessage(configMessage, "Condefinition Configuration");
-            return;
-        }
-
-        handout.get("notes", function(notes)
-        {
-            const parsed = deserializeConditionsMultiline(notes);
-            if(parsed.length)
-            {
-                conditionsArray = parsed;
-            }
-            else
-            {
-                log("⚠️ No valid conditions found in 'Condefinitions' handout.");
-            }
-        });
-    }
-
-
-
-
-    function serializeConditionsArrayMultiline(array)
-    {
-        return array.map(([key, regex, description, label]) =>
-                `${key}\n${regex.toString()}\n${description}\n${label}`
-            )
-            .join("\n\n");
-    }
-
-
-
-    function writeConditionsToHandoutMultilinePlainText(conditionsArray)
-    {
-        const content = conditionsArray.map(([key, regex, description, label]) =>
-            {
-                const regexString = regex.toString(); // /.../flags
-                // const icon = getConditionIcon(key);   // optional helper for icon name
-                return `${key}\n${regex.toString()}\n${description}\n${label}`;
-            })
-            .join("\n\n");
-
-        const escaped = content
-            .replace(/&/g, "&")
-            .replace(//g, ">");
-
-        const wrapped = `
${escaped}
`; - - let handout = findObjs( - { - _type: "handout", - name: "Condefinitions" - })[0]; - - if(!handout) - { - handout = createObj("handout", - { - name: "Condefinitions", - inplayerjournals: "all", - archived: false - }); - } - - handout.set( - { - notes: wrapped - }); - } - - - - function readAndParseConditions() - { - const handout = findObjs( - { - _type: "handout", - name: "Condefinitions" - })[0]; - if(!handout) - { - log("⚠️ Handout not found."); - return; - } - - handout.get("notes", function(notes) - { - - const stripped = notes.replace(/^
/i, "")
-                .replace(/<\/pre>$/i, "");
-            const decoded = stripped
-                .replace(/</g, "<")
-                .replace(/>/g, ">")
-                .replace(/&/g, "&");
-
-
-            const parsed = deserializeConditionsMultiline(notes);
-            return parsed
-        });
-    }
-
-
-    function mergeDescriptionsWithClassicDefinitions(originalArray, newConditions)
-    {
-        return originalArray.map(entry =>
-        {
-            const [key, regex, , marker] = entry;
-            const match = newConditions.find(def => def[0] === key);
-            const newDescription = match ? match[1] : entry[2]; // fallback to original description if no match
-            return [key, regex, newDescription, marker];
-        });
-    }
-
-
-
-
-    function sendMessage(message, title)
-    {
-        let theTitle = (title ? `
${title}
` : ""); - let theMessage = (message ? `
${theTitle}${message}
` : ""); - - sendChat("Condefinition", `/w gm ${theMessage}`, null, - { - noarchive: true - }); - } - - - - - // writeConditionsToHandoutMultilinePlainText(conditionsArray); - - - const input = `
blinded
-/(be|and|is|magically|become|becomes|is either) blinded|blinded condition/i
-Example description here
-bleeding-eye
-Blinded
`; - - const result = deserializeConditionsMultiline(input); - - - - let buttons = ""; - let reportText = ""; - - function makeButton(conditionName, descriptionText, tokenMarker, tokenID) - { - let tmLabel = `L`; - //let markerName = tokenMarker; - - let markerName = ((tokenMarker.includes(";;")) ? tokenMarker.split(";;")[0] : tokenMarker); - if('undefined' !== typeof libTokenMarkers && undefined !== libTokenMarkers.getStatus(markerName) - .url) - { - let tmImage = libTokenMarkers.getStatus(markerName) - .url; - - if(undefined !== tmImage && tmImage.length > 0) - { - tmLabel = ``; - } - } - buttons = buttons + ``; - } - - - function makeGenericButton(name, link) - { - return ``; - - } - - - //Concentration Observer - function concentrationCheck(obj, prev) - { - if(obj.get("statusmarkers") - .includes(condefConcentrationMarker) || obj.get("statusmarkers") - .includes(ConcentrationMarker) || obj.get(condefConcentrationMarker)) - { - // if (obj.get(condefConcentrationMarker)) { - if(prev["bar1_value"] > obj.get("bar1_value")) - { - let final_conc_DC = 10; - let calc_conc_DC = (prev["bar1_value"] - obj.get("bar1_value")) / 2; - if(calc_conc_DC > final_conc_DC) - { - final_conc_DC = Math.floor(calc_conc_DC); - } - // let tokenName = obj.get("name"); - let theMessage = `! &{template:spell} {{name=Concentration}}{{savedc=${final_conc_DC}}} {{description=Make a DC ${final_conc_DC} Constitution saving throw}}{{Concentration=1}}`; - // let theMessage = `this should print`; - sendChat("gm", theMessage); - } - } - - } - - //Event Handlers - on("change:graphic:bar1_value", concentrationCheck); - if(typeof(TokenMod) === 'object') TokenMod.ObserveTokenChange(concentrationCheck); - if('undefined' !== typeof SmartAoE && SmartAoE.ObserveTokenChange) - { - SmartAoE.ObserveTokenChange(function(obj, prev) - { - concentrationCheck(obj, prev); - }); - } - - - //Condition report creator. Use !condef for GM only, pcondef for player report. Follow by condition names separated by spaces. !condef-all returns buttons for all conditions, for reference - on('chat:message', function(msg) - { - - - if(msg.type === "api" && msg.content === "!condef-generic2014") - { - writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray, definitions2014)); - loadConditionsFromHandout(); - sendMessage("Condefinitions handout has been reset to Default token markers using the 2014 condition definitions"); - return; - } - - if(msg.type === "api" && msg.content === "!condef-generic2024") - { - writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray, definitions2024)); - loadConditionsFromHandout(); - sendMessage("Condefinitions handout has been reset to Default token markers using the 2024 condition definitions"); - return; - } - - if(msg.type === "api" && msg.content === "!condef-easy2014") - { - writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray_EasyToRead, definitions2014)); - loadConditionsFromHandout(); - sendMessage("Condefinitions handout has been reset to the Easy to Read token markers using the 2014 condition definitions"); - return; - } - - if(msg.type === "api" && msg.content === "!condef-easy2024") - { - writeConditionsToHandoutMultilinePlainText(mergeDescriptionsWithClassicDefinitions(defaultConditionsArray_EasyToRead, definitions2024)); - loadConditionsFromHandout(); - sendMessage("Condefinitions handout has been reset to the Easy to Read token markers using the 2024 condition definitions"); - return; - } - - - if(msg.type === "api" && msg.content === "!condef-loadconditions") - { - loadConditionsFromHandout(); - ConcentrationMarker = (conditionsArray.find(([k]) => k.toLowerCase() === "concentrating") || [, , , "death-zone"])[3]; - condefConcentrationMarker = "status_" + ConcentrationMarker; - - sendMessage("Condition definitions reloaded from handout."); - return; - } - - if(msg.type === "api" && (msg.content === "!condef-config" || msg.content === "!condef-help")) - { - createHandoutIfMissing("Help: Condefinition", helpHTML, "", "https://s3.amazonaws.com/files.d20.io/images/442783616/hDkduTWDpcVEKomHnbb6AQ/med.png"); - - sendMessage(configMessage, "Condefinition Configuration"); - return; - } - - - - - if('api' === msg.type && msg.content.match(/^!(condef|pcondef|condef-all|condef-report|condef-toggle)/)) - { - let args = msg.content.split(" "); - let sender = msg.who; - if(msg.content === '!condef-all') - { - let message = `! &{template:noecho} {{description= blinded condition charmed condition deafened condition exhausted condition frightened condition grappled condition incapacitated condition invisible condition paralyzed condition petrified condition poisoned condition prone condition restrained condition stunned condition unconscious condition concentration check}}`; - sendChat("gm", message, null, - { - noarchive: true - }); - message = ""; - return; - } - - - let messagePrefix = ((msg.content.includes('pcondef')) ? '' : '/w ' + sender + ' '); - let theCommand = ((msg.content.includes("pcondef")) ? "!pcondef" : "!condef"); - - - //selected vs target handler - if(msg.content.includes('condef-toggle ') && msg.content.length > 15) - { - let tokenMarker = msg.content.split('condef-toggle ')[1]; - let message = ''; - if(msg.selected) - { - //message = `!token-mod --set statusmarkers|!${tokenMarker}`; - let ids = msg.selected.reduce((m, o) => [...m, o._id], []); - message = `!token-mod --api-as ${msg.playerid} --set statusmarkers|!${tokenMarker} --ids ${ids.join(' ')}`; - //message = `!token-mod --api-as ${msg.playerid} --set statusmarkers|!${tokenMarker}`; - - } - else - { - - message = messagePrefix + buttonboxUnshifted + 'No token is selected.
Click here to pick a target.
'; - } - sendChat("", message, null, - { - noarchive: true - }); - return; - } - - if(msg.content === '!condef-report') - { - buttons = ""; - - let selected = (msg.selected); - - if(selected) - { - _.each(selected, function(token) - { - let tok = getObj("graphic", token._id); - let tokName = tok.get("name") || "unnamed token"; - let tokID = tok.get("_id"); - let markers = tok.get("statusmarkers") - .replace(/::/g, ";;"); - - if(markers) - { - for(let i = 0; i < conditionsArray.length; i++) - { - let name = conditionsArray[i][0]; - let descriptionText = conditionsArray[i][2]; - let tokenMarker = conditionsArray[i][3]; - - if(markers.includes(tokenMarker)) - { - makeButton(name, descriptionText, tokenMarker, tokID); - } - } - let message = buttonbox + "" + tokName + "" + buttons + "
"; - sendChat("", messagePrefix + message, null, - { - noarchive: true - }); - - buttons = ""; - - } - }); - } - else - { - sendMessage("Select one or more tokens with conditions on them"); - - } - return; - } - - - - - for(let i = 0; i < conditionsArray.length; i++) - { - let reportName = conditionsArray[i][0]; - let reportDescription = conditionsArray[i][2]; - if(undefined !== args[1] && args[1] === reportName) - { - reportDescription = reportDescription.replace("!condef", theCommand); - reportText = `
${reportName}
${reportDescription.replace(/</g, "<").replace(/>/g, ">")}
`; - } - } - - if(undefined !== reportText && reportText.length > 0) - { - sendChat("", messagePrefix + reportText, null, - { - noarchive: true - }); - - } - - } - - - - //Roll Template Interception - if((undefined !== msg.rolltemplate && msg.rolltemplate.match(/npcfullatk|npcdmg|npcaction|traits|atkdmg|spell|condefinitions|spelloutput|noecho/g)) || (msg.content.match(/dnd-2024/g))) - { - //log (msg.content); - let sender = msg.who; - let messagePrefix = '/w ' + sender + ' '; - let saveAbility = ""; - let saveMatches = ""; - let theAbility = ""; - let saveDC = ""; - let conCheck = ""; - let concentrationButton = ""; - saveMatches = msg.content.match(/DC\s(\d\d)\s(Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma)\ssaving throw/i); - if(msg.rolltemplate !== "spell" && msg.rolltemplate !== "atkdmg" && null !== saveMatches && saveMatches.length === 3) - { - saveDC = saveMatches[1]; - saveAbility = saveMatches[2]; - } - //msg echo to console is disabled - if(msg.rolltemplate === "spell" || msg.rolltemplate === "atkdmg" || msg.rolltemplate === "spelloutput" || (msg.content.match(/dnd-2024 dnd-2024--/g))) - { - /*log(msg.content);*/ - saveAbility = msg.content.match(/(Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma)\ssav(e|ing throw)/i) || ""; - if(saveAbility.length > 0) - { - saveAbility = saveAbility[1] || ""; - } - - saveDC = ((msg.rolltemplate === "spell" || msg.rolltemplate === "spelloutput") ? msg.content.match(/{{savedc=(\d+)}}/) : msg.content.match(/{{mod=DC(\d+)}}/)) || msg.content.match(/DC\s(\d+)/) || ""; - conCheck = ((msg.rolltemplate === "spell" && msg.content.match(/{{name=Concentration/)) ? "Concentration Check" : ""); - // if (conCheck!==""){ - // makeButton("Concentrating", "makes a con check", "concentrating"); - // } - // concentrationButton = ((conCheck==="") ? "" : "
" + buttons); - - - //log("concentrationButton = " + concentrationButton); - if(saveDC.length > 0) - { - saveDC = saveDC[1] || ""; - } - - } - - if(undefined !== saveAbility && null !== saveAbility) - { - - theAbility = saveAbility.replace(/Strength/i, "str") - .replace(/Dexterity/i, "dex") - .replace(/Constitution/i, "con") - .replace(/Intelligence/i, "int") - .replace(/Wisdom/i, "wis") - .replace(/Charisma/i, "cha"); - } - let saveButton = ""; - - if(theAbility.match(/(str|dex|con|int|wis|cha)/)) - { - //for regular saves - saveButton = `DC${saveDC} ${theAbility} ${conCheck}${concentrationButton}`; - //for groupcheck - if(groupCheckIsInstalled) - { - saveAbility = saveAbility.charAt(0) - .toUpperCase() + saveAbility.slice(1); - saveButton = `DC${saveDC} ${theAbility} ${conCheck}${concentrationButton}`; - if(applyDamageIsInstalled && conCheck !== "Concentration Check") - { - saveButton = saveButton + `Dmg`; - } - } - } - - for(let i = 0; i < conditionsArray.length; i++) - { - let name = conditionsArray[i][0]; - let descriptionText = conditionsArray[i][2]; - let tokenMarker = conditionsArray[i][3]; - - if(undefined !== name) - { - if(msg.content.match(conditionsArray[i][1])) - { - makeButton(name, descriptionText, tokenMarker); - } - - } - } - let GMSaveButton = saveButton; - if(!playerIsGM(msg.playerid) && msg.playerid !== "API") - { - saveButton = ""; - } - if(buttons.length > 0 || saveButton.length > 0) - { - - let message = buttonbox + saveButton + buttons + ""; - sendChat("", messagePrefix + message, null, - { - noarchive: true - }); - - if(!messagePrefix.includes(' (GM)') && msg.rolltemplate !== "noecho") - { - message = buttonbox + GMSaveButton + buttons + ""; - if(conCheck !== "Concentration Check") - { - sendChat("", '/w gm ' + message, null, - { - noarchive: true - }); - } - } - - - buttons = ""; - - } - } - }); - -}); - -{ - try - { - throw new Error(''); - } - catch (e) - { - API_Meta.Condefinition.lineCount = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - API_Meta.Condefinition.offset); - } -}