Skip to content

Commit

Permalink
Added psionic notes to spells if there is a note and the psionics han…
Browse files Browse the repository at this point in the history
…dbook is active
  • Loading branch information
DBFBlackbull committed Dec 22, 2023
1 parent b0a3080 commit 9f2f195
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 6 deletions.
31 changes: 28 additions & 3 deletions ADnD_2E_Revised/2ESheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -32238,6 +32238,7 @@ <h2>Monster Sheet specific</h2>
</table>
{{/c1-1}}
{{#effects2}}<br>{{effects2}}{{/effects2}}
{{#psionics}}<br>&emsp;**Psionics:** {{psionics}}{{/psionics}}
{{#blindness}}<br>&emsp;**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.<br>&emsp;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.<br>&emsp;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}}<br>&emsp;**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}}<br>&emsp;**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}}
Expand Down Expand Up @@ -33735,6 +33736,7 @@ <h2>Monster Sheet specific</h2>
</table>
{{/c1-1}}
{{#effects2}}<br>{{effects2}}{{/effects2}}
{{#psionics}}<br>&emsp;**Psionics:** {{psionics}}{{/psionics}}
{{#blindness}}<br>&emsp;**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.<br>&emsp;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.<br>&emsp;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}}<br>&emsp;**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}}<br>&emsp;**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}}
Expand Down Expand Up @@ -45439,10 +45441,11 @@ <h2>Monster Sheet specific</h2>
'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&emsp;*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&emsp;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.'
};

Expand Down Expand Up @@ -55605,10 +55608,11 @@ <h2>Monster Sheet specific</h2>
'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&emsp;*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&emsp;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.'
};

Expand Down Expand Up @@ -69495,6 +69499,8 @@ <h2>Monster Sheet specific</h2>
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',
Expand Down Expand Up @@ -69760,6 +69766,16 @@ <h2>Monster Sheet specific</h2>
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))
Expand Down Expand Up @@ -70684,6 +70700,12 @@ <h2>Monster Sheet specific</h2>
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),
Expand All @@ -70703,7 +70725,7 @@ <h2>Monster Sheet specific</h2>
[`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) {
Expand Down Expand Up @@ -72247,6 +72269,9 @@ <h2>Monster Sheet specific</h2>
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}]]')
Expand Down
1 change: 1 addition & 0 deletions ADnD_2E_Revised/html/components/rolltemplate-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@
</table>
{{/c1-1}}
{{#effects2}}<br>{{effects2}}{{/effects2}}
{{#psionics}}<br>&emsp;**Psionics:** {{psionics}}{{/psionics}}
{{#blindness}}<br>&emsp;**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.<br>&emsp;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.<br>&emsp;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}}<br>&emsp;**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}}<br>&emsp;**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}}
Expand Down
3 changes: 2 additions & 1 deletion ADnD_2E_Revised/javascript/priestSpells.js
Original file line number Diff line number Diff line change
Expand Up @@ -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&emsp;*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&emsp;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.'
};

Expand Down
23 changes: 22 additions & 1 deletion ADnD_2E_Revised/javascript/sheetWorkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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),
Expand All @@ -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) {
Expand Down Expand Up @@ -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}]]')
Expand Down
3 changes: 2 additions & 1 deletion ADnD_2E_Revised/javascript/wizardSpells.js
Original file line number Diff line number Diff line change
Expand Up @@ -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&emsp;*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&emsp;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.'
};

Expand Down

0 comments on commit 9f2f195

Please sign in to comment.