diff --git a/ADnD_2E_Revised/2ESheet.html b/ADnD_2E_Revised/2ESheet.html index e2a4e5f498c..9532fd49ed9 100644 --- a/ADnD_2E_Revised/2ESheet.html +++ b/ADnD_2E_Revised/2ESheet.html @@ -32238,6 +32238,7 @@

Monster Sheet specific

{{/c1-1}} {{#effects2}}
{{effects2}}{{/effects2}} + {{#psionics}}
 **Psionics:** {{psionics}}{{/psionics}} {{#blindness}}
 **Blindness:** causes -4 penalty to attack rolls, saving throws, and surprise rolls. Armor Class is 4 worse (to a limit of 10). Sight-related damage bonuses (backstabbing, etc.) are negated. Safe movement rate is slowed by ⅓ of normal and faster movement requires a Dexterity check.
 Spellcasters can only cast spells with range "0" (affecting themselves) or "Touch" with a -4 penalty to hit the with the touch. All spells with a range greater than "0" requires the caster to see the point of impact or be able to touch it.
 Blindness protects the creature from spells such as *explosive runes* that must be read or *symbol* or *illusory script* that only works when seen.{{/blindness}} {{#deafness}}
 **Deafness:** causes -1 penalty to surprise rolls unless its other senses are unusually keen. Spellcasters have a 20% chance to miscast any spell with verbal component.{{/deafness}} {{#invisibility}}
 **Invisibility:** Attacks against an invisible creature suffers -4 penalty to attack rolls. Surprise caused by an invisible creature suffer -2 penalty to surprise rolls. Invisible creatures attempting detailed actions (for example, picking a lock or threading a needle) suffers -3 (or -15%) penalty to their chance of success. This does not apply to spellcasting. Invisible creatures cannot be detected with infravision.{{/invisibility}} @@ -33735,6 +33736,7 @@

Monster Sheet specific

{{/c1-1}} {{#effects2}}
{{effects2}}{{/effects2}} + {{#psionics}}
 **Psionics:** {{psionics}}{{/psionics}} {{#blindness}}
 **Blindness:** causes -4 penalty to attack rolls, saving throws, and surprise rolls. Armor Class is 4 worse (to a limit of 10). Sight-related damage bonuses (backstabbing, etc.) are negated. Safe movement rate is slowed by ⅓ of normal and faster movement requires a Dexterity check.
 Spellcasters can only cast spells with range "0" (affecting themselves) or "Touch" with a -4 penalty to hit the with the touch. All spells with a range greater than "0" requires the caster to see the point of impact or be able to touch it.
 Blindness protects the creature from spells such as *explosive runes* that must be read or *symbol* or *illusory script* that only works when seen.{{/blindness}} {{#deafness}}
 **Deafness:** causes -1 penalty to surprise rolls unless its other senses are unusually keen. Spellcasters have a 20% chance to miscast any spell with verbal component.{{/deafness}} {{#invisibility}}
 **Invisibility:** Attacks against an invisible creature suffers -4 penalty to attack rolls. Surprise caused by an invisible creature suffer -2 penalty to surprise rolls. Invisible creatures attempting detailed actions (for example, picking a lock or threading a needle) suffers -3 (or -15%) penalty to their chance of success. This does not apply to spellcasting. Invisible creatures cannot be detected with infravision.{{/invisibility}} @@ -45439,10 +45441,11 @@

Monster Sheet specific

'reference': 'p. 172', 'book': 'PHB', 'book-compendium': 'Wizard’s Spell Compendium Volume One p. 237', - 'errata': 'Dungeon Master Guide p. 161\nSage Advice #213 p. 85\nSage Advice #214 p. 78-79\nSage Advice #243 p. 22\nSage Advice #245 p. 17-18\nSage Advice #254 p. 24', + 'errata': 'Dungeon Master Guide p. 161\nThe Complete Psionics Handbook p. 110\nSage Advice #213 p. 85\nSage Advice #214 p. 78-79\nSage Advice #243 p. 22\nSage Advice #245 p. 17-18\nSage Advice #254 p. 24', 'damage': '', 'damage-type': '', 'healing': '', + 'psionics': '*Detect magic* never detects psionic activity.', 'effect': 'When the *detect magic* spell is cast, the wizard detects magical radiations in a path 10 feet wide and up to 60 feet long, in the direction he is facing. The intensity of the magic can be determined (dim, faint, moderate, strong, overwhelming), and the wizard has a 10% chance per level ([[{10*[[@{level-wizard}]],100}kl1]]%) to recognize if a certain type of magic (alteration, conjuration, etc.) is present. The caster can turn, scanning a 60-degree arc per round. A stone wall of 1 foot or more thickness, solid metal of 1 inch thickness, a yard or more of solid wood, or a *wall of force* blocks the spell. Magical areas, multiple types of magic, or strong local magical emanations may confuse or conceal weaker radiations. Note that this spell does not reveal the presence of good or evil, or reveal alignment. Otherplanar creatures are not necessarily magical.\n *Detect magic* can detect an invisible creature’s magical aura, but not pinpoint the invisible creature’s exact location. See *DUNGEON MASTER Guide* p. 161.\n Casting *detect magic* on a cursed item generally indicates the school of magic the cursed item is imitating, i.e. *dust of sneezing and choking* that imitates *dust of disappearance* would radiate illusion/phantasm magic. If the *dust* imitates *dust of appearance* it would radiate divination or abjuration magic.' }; @@ -55605,10 +55608,11 @@

Monster Sheet specific

'reference': 'p. 253', 'book': 'PHB', 'book-compendium': 'Priest’ Spell Compendium Volume One p. 201', - 'errata': 'Dungeon Master Guide p. 161\nSage Advice #213 p. 85\nSage Advice #214 p. 78-79\nSage Advice #243 p. 22\nSage Advice #245 p. 17-18\nSage Advice #254 p. 24', + 'errata': 'Dungeon Master Guide p. 161\nThe Complete Psionics Handbook p. 110\nSage Advice #213 p. 85\nSage Advice #214 p. 78-79\nSage Advice #243 p. 22\nSage Advice #245 p. 17-18\nSage Advice #254 p. 24', 'damage': '', 'damage-type': '', 'healing': '', + 'psionics': '*Detect magic* never detects psionic activity.', 'effect': 'When the *detect magic* spell is cast, the priest detects magical radiations in a path 10 feet wide and up to 30 yards long, in the direction he is facing. The intensity of the magic can be detected (dim, faint, moderate, strong, or overwhelming). The caster has a 10% chance per level ([[{10*[[@{level-priest}]],100}kl1]]%) to determine the sphere of the magic, but unlike the wizard version of the spell, the type of magic (alteration, conjuration, etc.) cannot be divined. The caster can turn, scanning a 60° arc per round. The spell is blocked by solid stone at least 1 foot thick, solid metal at least 1 inch thick, solid wood at least 1 yard thick, or a *wall of force*.\n *Detect magic* can detect an invisible creature’s magical aura, but not pinpoint the invisible creature’s exact location. See *DUNGEON MASTER Guide* p. 161.\n Casting *detect magic* on a cursed item generally indicates the sphere of magic the cursed item is imitating, i.e. *cloak of poisonousness* that imitates *cloak of protection* would radiate the protection sphere.' }; @@ -69495,6 +69499,8 @@

Monster Sheet specific

const WARNING = 3; const ERROR = 4; +const PSIONICS_HANDBOOK = 'The Complete Psionics Handbook'; + const BOOK_FIELDS = [ 'book-phb','book-tcfhb','book-tcthb','book-tcprhb','book-tcwhb','book-psionics', 'book-tom','book-aaeg', @@ -69760,6 +69766,16 @@

Monster Sheet specific

return new Set(settings); } +const isBookActive = function (books, obj) { + let activeBooks = getActiveSettings(BOOK_FIELDS, books); + console.log(activeBooks); + if (typeof obj === 'string') { + return activeBooks.has(obj); + } + + return false +} + const isBookInactive = function (books, obj) { let activeBooks = getActiveSettings(BOOK_FIELDS, books); if (Array.isArray(obj)) @@ -70684,6 +70700,12 @@

Monster Sheet specific

if (bookInactiveShowToast(books, spell)) return; + let effect = spell['effect']; + if (spell['psionics'] && isBookActive(books, PSIONICS_HANDBOOK)) { + console.log('adding psionics stuff'); + effect += `}}{{psionics=${spell['psionics']}`; + } + let spellInfo = { [`repeating_spells-${section}_spell-cast-time`] : spell['cast-time'], [`repeating_spells-${section}_spell-level`] : displaySpellLevel(spell['level'], className), @@ -70703,7 +70725,7 @@

Monster Sheet specific

[`repeating_spells-${section}_spell-knockdown`] : spell['knockdown'] || '', [`repeating_spells-${section}_spell-knockdown`] : spell['knockdown'] || '', [`repeating_spells-${section}_spell-crit-size`] : spell['crit-size'] || '', - [`repeating_spells-${section}_spell-effect`] : spell['effect'] + [`repeating_spells-${section}_spell-effect`] : effect }; if (isPriest) { @@ -72247,6 +72269,9 @@

Monster Sheet specific

rollBuilder.push('checktarget=[[@{scroll-failure}]]%'); rollBuilder.push('fail=DM roll for Magical Spell Failure'); rollBuilder.push(`effects=${spell['effect']}`); + if (spell['psionics'] && isBookActive(books, PSIONICS_HANDBOOK)) { + rollBuilder.push(`psionics=${spell['psionics']}`); + } let scrollMacro = rollBuilder.string(); scrollMacro = scrollMacro.replaceAll('[[@{level-wizard}]]','[[@{scroll-level}]]') diff --git a/ADnD_2E_Revised/html/components/rolltemplate-effects.html b/ADnD_2E_Revised/html/components/rolltemplate-effects.html index 079037299d9..bb47d7681e5 100644 --- a/ADnD_2E_Revised/html/components/rolltemplate-effects.html +++ b/ADnD_2E_Revised/html/components/rolltemplate-effects.html @@ -517,6 +517,7 @@ {{/c1-1}} {{#effects2}}
{{effects2}}{{/effects2}} + {{#psionics}}
 **Psionics:** {{psionics}}{{/psionics}} {{#blindness}}
 **Blindness:** causes -4 penalty to attack rolls, saving throws, and surprise rolls. Armor Class is 4 worse (to a limit of 10). Sight-related damage bonuses (backstabbing, etc.) are negated. Safe movement rate is slowed by ⅓ of normal and faster movement requires a Dexterity check.
 Spellcasters can only cast spells with range "0" (affecting themselves) or "Touch" with a -4 penalty to hit the with the touch. All spells with a range greater than "0" requires the caster to see the point of impact or be able to touch it.
 Blindness protects the creature from spells such as *explosive runes* that must be read or *symbol* or *illusory script* that only works when seen.{{/blindness}} {{#deafness}}
 **Deafness:** causes -1 penalty to surprise rolls unless its other senses are unusually keen. Spellcasters have a 20% chance to miscast any spell with verbal component.{{/deafness}} {{#invisibility}}
 **Invisibility:** Attacks against an invisible creature suffers -4 penalty to attack rolls. Surprise caused by an invisible creature suffer -2 penalty to surprise rolls. Invisible creatures attempting detailed actions (for example, picking a lock or threading a needle) suffers -3 (or -15%) penalty to their chance of success. This does not apply to spellcasting. Invisible creatures cannot be detected with infravision.{{/invisibility}} diff --git a/ADnD_2E_Revised/javascript/priestSpells.js b/ADnD_2E_Revised/javascript/priestSpells.js index 65dcd82cb22..f07e3f62218 100644 --- a/ADnD_2E_Revised/javascript/priestSpells.js +++ b/ADnD_2E_Revised/javascript/priestSpells.js @@ -152,10 +152,11 @@ pri1['Detect Magic'] = { 'reference': 'p. 253', 'book': 'PHB', 'book-compendium': 'Priest’ Spell Compendium Volume One p. 201', - 'errata': 'Dungeon Master Guide p. 161\nSage Advice #213 p. 85\nSage Advice #214 p. 78-79\nSage Advice #243 p. 22\nSage Advice #245 p. 17-18\nSage Advice #254 p. 24', + 'errata': 'Dungeon Master Guide p. 161\nThe Complete Psionics Handbook p. 110\nSage Advice #213 p. 85\nSage Advice #214 p. 78-79\nSage Advice #243 p. 22\nSage Advice #245 p. 17-18\nSage Advice #254 p. 24', 'damage': '', 'damage-type': '', 'healing': '', + 'psionics': '*Detect magic* never detects psionic activity.', 'effect': 'When the *detect magic* spell is cast, the priest detects magical radiations in a path 10 feet wide and up to 30 yards long, in the direction he is facing. The intensity of the magic can be detected (dim, faint, moderate, strong, or overwhelming). The caster has a 10% chance per level ([[{10*[[@{level-priest}]],100}kl1]]%) to determine the sphere of the magic, but unlike the wizard version of the spell, the type of magic (alteration, conjuration, etc.) cannot be divined. The caster can turn, scanning a 60° arc per round. The spell is blocked by solid stone at least 1 foot thick, solid metal at least 1 inch thick, solid wood at least 1 yard thick, or a *wall of force*.\n *Detect magic* can detect an invisible creature’s magical aura, but not pinpoint the invisible creature’s exact location. See *DUNGEON MASTER Guide* p. 161.\n Casting *detect magic* on a cursed item generally indicates the sphere of magic the cursed item is imitating, i.e. *cloak of poisonousness* that imitates *cloak of protection* would radiate the protection sphere.' }; diff --git a/ADnD_2E_Revised/javascript/sheetWorkers.js b/ADnD_2E_Revised/javascript/sheetWorkers.js index bb4ae01fed3..ddb3189ebf7 100644 --- a/ADnD_2E_Revised/javascript/sheetWorkers.js +++ b/ADnD_2E_Revised/javascript/sheetWorkers.js @@ -7,6 +7,8 @@ const INFO = 2; const WARNING = 3; const ERROR = 4; +const PSIONICS_HANDBOOK = 'The Complete Psionics Handbook'; + const BOOK_FIELDS = [ 'book-phb','book-tcfhb','book-tcthb','book-tcprhb','book-tcwhb','book-psionics', 'book-tom','book-aaeg', @@ -272,6 +274,16 @@ const getActiveSettings = function (settingFields, values) { return new Set(settings); } +const isBookActive = function (books, obj) { + let activeBooks = getActiveSettings(BOOK_FIELDS, books); + console.log(activeBooks); + if (typeof obj === 'string') { + return activeBooks.has(obj); + } + + return false +} + const isBookInactive = function (books, obj) { let activeBooks = getActiveSettings(BOOK_FIELDS, books); if (Array.isArray(obj)) @@ -1196,6 +1208,12 @@ function setupAutoFillSpellInfo(section, spellsTable, optionalRulesFields) { if (bookInactiveShowToast(books, spell)) return; + let effect = spell['effect']; + if (spell['psionics'] && isBookActive(books, PSIONICS_HANDBOOK)) { + console.log('adding psionics stuff'); + effect += `}}{{psionics=${spell['psionics']}`; + } + let spellInfo = { [`repeating_spells-${section}_spell-cast-time`] : spell['cast-time'], [`repeating_spells-${section}_spell-level`] : displaySpellLevel(spell['level'], className), @@ -1215,7 +1233,7 @@ function setupAutoFillSpellInfo(section, spellsTable, optionalRulesFields) { [`repeating_spells-${section}_spell-knockdown`] : spell['knockdown'] || '', [`repeating_spells-${section}_spell-knockdown`] : spell['knockdown'] || '', [`repeating_spells-${section}_spell-crit-size`] : spell['crit-size'] || '', - [`repeating_spells-${section}_spell-effect`] : spell['effect'] + [`repeating_spells-${section}_spell-effect`] : effect }; if (isPriest) { @@ -2759,6 +2777,9 @@ on('change:repeating_scrolls:scroll', async function (eventInfo) { rollBuilder.push('checktarget=[[@{scroll-failure}]]%'); rollBuilder.push('fail=DM roll for Magical Spell Failure'); rollBuilder.push(`effects=${spell['effect']}`); + if (spell['psionics'] && isBookActive(books, PSIONICS_HANDBOOK)) { + rollBuilder.push(`psionics=${spell['psionics']}`); + } let scrollMacro = rollBuilder.string(); scrollMacro = scrollMacro.replaceAll('[[@{level-wizard}]]','[[@{scroll-level}]]') diff --git a/ADnD_2E_Revised/javascript/wizardSpells.js b/ADnD_2E_Revised/javascript/wizardSpells.js index 92a3a2896e7..ad9957c7bea 100644 --- a/ADnD_2E_Revised/javascript/wizardSpells.js +++ b/ADnD_2E_Revised/javascript/wizardSpells.js @@ -257,10 +257,11 @@ wiz1['Detect Magic'] = { 'reference': 'p. 172', 'book': 'PHB', 'book-compendium': 'Wizard’s Spell Compendium Volume One p. 237', - 'errata': 'Dungeon Master Guide p. 161\nSage Advice #213 p. 85\nSage Advice #214 p. 78-79\nSage Advice #243 p. 22\nSage Advice #245 p. 17-18\nSage Advice #254 p. 24', + 'errata': 'Dungeon Master Guide p. 161\nThe Complete Psionics Handbook p. 110\nSage Advice #213 p. 85\nSage Advice #214 p. 78-79\nSage Advice #243 p. 22\nSage Advice #245 p. 17-18\nSage Advice #254 p. 24', 'damage': '', 'damage-type': '', 'healing': '', + 'psionics': '*Detect magic* never detects psionic activity.', 'effect': 'When the *detect magic* spell is cast, the wizard detects magical radiations in a path 10 feet wide and up to 60 feet long, in the direction he is facing. The intensity of the magic can be determined (dim, faint, moderate, strong, overwhelming), and the wizard has a 10% chance per level ([[{10*[[@{level-wizard}]],100}kl1]]%) to recognize if a certain type of magic (alteration, conjuration, etc.) is present. The caster can turn, scanning a 60-degree arc per round. A stone wall of 1 foot or more thickness, solid metal of 1 inch thickness, a yard or more of solid wood, or a *wall of force* blocks the spell. Magical areas, multiple types of magic, or strong local magical emanations may confuse or conceal weaker radiations. Note that this spell does not reveal the presence of good or evil, or reveal alignment. Otherplanar creatures are not necessarily magical.\n *Detect magic* can detect an invisible creature’s magical aura, but not pinpoint the invisible creature’s exact location. See *DUNGEON MASTER Guide* p. 161.\n Casting *detect magic* on a cursed item generally indicates the school of magic the cursed item is imitating, i.e. *dust of sneezing and choking* that imitates *dust of disappearance* would radiate illusion/phantasm magic. If the *dust* imitates *dust of appearance* it would radiate divination or abjuration magic.' };