Turn off debug values for schools and spheres

This commit is contained in:
Peter Bjerg Lidegaard
2025-01-31 19:08:31 +01:00
parent 5c5a2764ac
commit 98113b25bc
4 changed files with 46 additions and 34 deletions
+23 -17
View File
@@ -22523,7 +22523,11 @@ PLAYERS OPTION: Spells & Magic p. 120-121}}
</select>
<br>
<br>
<h4>Miscellaneous modifier popup on rolls</h4>
<h3>Show spell errata sources</h3>
<label>Adds all the resources used for updating Wizard spells level 1-3 <input type="checkbox" name="attr_errata" title="@{errata}" value="errata"/><span></span></label>
<br>
<br>
<h3>Miscellaneous modifier popup on rolls</h3>
<p>By default all rolls creates a popup asking for a 'Miscellaneous modifier' to capture when the DM says: 'Make an X-roll with +2'.
If your DM rarely asks for this, if you find the popup annoying, or if you would rather add any bonuses after the roll is made, this popup can be turned off.
</p>
@@ -58091,7 +58095,7 @@ pri3['Continual Light'] = {
'damage': '',
'damage-type': '',
'healing': '',
'special-conditions': ['blindness'],
'special-conditions': [BLINDNESS],
'effect': 'This spell is similar to a *light* spell, except that it is as bright as full daylight and lasts until negated by magical darkness or by a *dispel magic* spell. Creatures with penalties in bright light suffer them in this spells area of effect. As with the *light* spell, this can be cast into the air, onto an object, or at a creature. In the third case, the *continual light* affects the space about 1 foot behind a creature that successfully rolls its saving throw vs. spell (a failed saving throw means the *continual light* is centered on the creature and moves as it moves). Note that this spell also blinds a creature if it is successfully cast upon the creatures visual organs. If the spell is cast on a small object that is then placed in a light-proof covering, the spell effects are blocked until the covering is removed.\n&emsp;*Continual light* brought into an area of magical darkness (or vice versa) cancels the darkness so that the otherwise prevailing light conditions exist in the overlapping areas of effect. If multiple *continual lights* are brought into an area of magical darkness, only one *continual light* will go out per magical darkness effect and the remaining will work as normal. A direct casting of a *continual light* spell against a similar or weaker magical darkness cancels both.\n&emsp;This spell eventually consumes the material it is cast upon, but the process takes far longer than the time in a typical campaign. Extremely hard and expensive materials might last hundreds or even thousands of years. Perishable materials, such as most foodstuffs, will rot normally long before a *continual light* spell can affect them. Likewise, most creatures will be dust before the spell will hurt them. If an object is consumed by this spell, the spell ceases to function.\n&emsp;The reverse spell, *continual darkness*, causes complete absence of light (pitch blackness), similar to the *darkness* spell but of greater duration and area.'
};
@@ -58434,7 +58438,7 @@ pri3['Pyrotechnics'] = {
'damage': '',
'damage-type': '',
'healing': '',
'special-conditions': ['blindness'],
'special-conditions': [BLINDNESS],
'effect': 'A *pyrotechnics* spell draws on an existing fire source to produce either of two effects, at the option of the caster.\n&emsp;First, it can produce a flashing and fiery burst of glowing, colored aerial *fireworks* that lasts one round. Creatures in, under, or within 120 feet of the area that have an unobstructed line of sight to the effect are blinded for 1d4+1 rounds unless they roll successful saving throws vs. spell. The fireworks fill a volume 10 times greater than the original fire source.\n&emsp;Second, it can cause a thick, writhing stream of *smoke* to arise from the source and form a choking cloud that lasts for one round per experience level of the caster. Currently [[@{level-priest}]] rounds. This covers a roughly hemispherical volume from the ground or floor up (or conforming to the shape of a confined area) that totally obscures vision beyond 2 feet. The smoke fills a volume 100 times that of the fire source.\n&emsp;The spell uses one fire source within a 20-foot cube, which is immediately extinguished. If an extremely large fire is used as the source, it is only partially extinguished by the casting. Magical fires are not extinguished, although a fire-based creature (such as a fire elemental) used as a source suffers 1d4 points of damage, plus 1 point of damage per caster level. Currently [[1d4+[[@{level-priest}]] ]] points of damage. This spell does not function under water.'
};
@@ -71138,6 +71142,7 @@ const INFO = 2;
const WARNING = 3;
const ERROR = 4;
const ERRATA_FIELD = 'errata';
const PSIONICS_HANDBOOK = 'The Complete Psionics Handbook';
const BOOK_FIELDS = [
@@ -72296,21 +72301,21 @@ function parseSpheres(spheresStrings, regex) {
const getSpellSchools = function (spell, books) {
let schoolRules = getActiveSettings(SCHOOL_FIELDS, books);
return spell['school'] + `%NEWLINE%S&M: (${spell[SCHOOL_SPELLS_AND_MAGIC]})`;
// return schoolRules.has(SCHOOL_SPELLS_AND_MAGIC)
// ? spell[SCHOOL_SPELLS_AND_MAGIC] || spell['school']
// : spell['school'];
//return spell['school'] + `%NEWLINE%S&M: (${spell[SCHOOL_SPELLS_AND_MAGIC]})`;
return schoolRules.has(SCHOOL_SPELLS_AND_MAGIC)
? spell[SCHOOL_SPELLS_AND_MAGIC] || spell['school']
: spell['school'];
}
const getSpellSpheres = function (spell, sphereRules) {
return spell['sphere'] + `%NEWLINE%Druid: ${spell['sphere-druids']}%NEWLINE%Necro: ${spell['sphere-necromancers']}%NEWLINE%S&M: ${spell[SPHERE_SPELLS_AND_MAGIC]}`
// return spell['sphere'] + `%NEWLINE%Druid: ${spell['sphere-druids']}%NEWLINE%Necro: ${spell['sphere-necromancers']}%NEWLINE%S&M: ${spell[SPHERE_SPELLS_AND_MAGIC]}`
// if (sphereRules.has(SPHERE_SPELLS_AND_MAGIC))
// return spell[SPHERE_SPELLS_AND_MAGIC] || spell['sphere'];
if (sphereRules.has(SPHERE_SPELLS_AND_MAGIC))
return spell[SPHERE_SPELLS_AND_MAGIC] || spell['sphere'];
// let sphere = spell['sphere'];
// sphereRules.forEach(rule => sphere += spell[rule] || '');
// return sphere;
let sphere = spell['sphere'];
sphereRules.forEach(rule => sphere += spell[rule] || '');
return sphere;
}
function isSpellAvailable(spellName, spell, availableSpheres, elementalSpheres, activeBooks, optionalSpheres) {
@@ -72534,7 +72539,7 @@ function setupAutoFillSpellInfo(section, spellsTable, optionalRulesFields) {
let levelField = isPriest ? 'level-priest' : 'level-wizard';
let className = isPriest ? 'Priest' : 'Wizard';
getAttrs([...BOOK_FIELDS, ...optionalRulesFields, levelField], function(books) {
getAttrs([...BOOK_FIELDS, ...optionalRulesFields, levelField, ERRATA_FIELD], function(books) {
if (bookInactiveShowToast(books, spell))
return;
@@ -72562,7 +72567,7 @@ function setupAutoFillSpellInfo(section, spellsTable, optionalRulesFields) {
[`repeating_spells-${section}_spell-saving-throw`] : spell['saving-throw'],
[`repeating_spells-${section}_spell-healing`] : spell['healing'],
[`repeating_spells-${section}_spell-materials`] : spell['materials'],
[`repeating_spells-${section}_spell-reference`] : displayReference(spell),
[`repeating_spells-${section}_spell-reference`] : displayReference(spell, books),
[`repeating_spells-${section}_spell-subtlety`] : spell['subtlety'] || '',
[`repeating_spells-${section}_spell-sensory`] : spell['sensory'] || '',
[`repeating_spells-${section}_spell-knockdown`] : spell['knockdown'] || '',
@@ -72620,12 +72625,13 @@ const displaySpellLevel = function(level, className) {
: `Level ${level} ${className}`;
}
const displayReference = function(spell) {
const displayReference = function(spell, books) {
let reference = `${spell['book']} ${spell['reference']}`
if (spell['book-compendium'])
reference += `\n${spell['book-compendium']}`;
if (spell['errata'])
let activeSettings = getActiveSettings([ERRATA_FIELD], books);
if (activeSettings.has(ERRATA_FIELD) && spell['errata'])
reference += `\n${spell['errata']}`;
return reference;
@@ -190,7 +190,11 @@
</select>
<br>
<br>
<h4>Miscellaneous modifier popup on rolls</h4>
<h3>Show spell errata sources</h3>
<label>Adds all the resources used for updating Wizard spells level 1-3 <input type="checkbox" name="attr_errata" title="@{errata}" value="errata"/><span></span></label>
<br>
<br>
<h3>Miscellaneous modifier popup on rolls</h3>
<p>By default all rolls creates a popup asking for a 'Miscellaneous modifier' to capture when the DM says: 'Make an X-roll with +2'.
If your DM rarely asks for this, if you find the popup annoying, or if you would rather add any bonuses after the roll is made, this popup can be turned off.
</p>
+2 -2
View File
@@ -1097,7 +1097,7 @@ pri3['Continual Light'] = {
'damage': '',
'damage-type': '',
'healing': '',
'special-conditions': ['blindness'],
'special-conditions': [BLINDNESS],
'effect': 'This spell is similar to a *light* spell, except that it is as bright as full daylight and lasts until negated by magical darkness or by a *dispel magic* spell. Creatures with penalties in bright light suffer them in this spells area of effect. As with the *light* spell, this can be cast into the air, onto an object, or at a creature. In the third case, the *continual light* affects the space about 1 foot behind a creature that successfully rolls its saving throw vs. spell (a failed saving throw means the *continual light* is centered on the creature and moves as it moves). Note that this spell also blinds a creature if it is successfully cast upon the creatures visual organs. If the spell is cast on a small object that is then placed in a light-proof covering, the spell effects are blocked until the covering is removed.\n&emsp;*Continual light* brought into an area of magical darkness (or vice versa) cancels the darkness so that the otherwise prevailing light conditions exist in the overlapping areas of effect. If multiple *continual lights* are brought into an area of magical darkness, only one *continual light* will go out per magical darkness effect and the remaining will work as normal. A direct casting of a *continual light* spell against a similar or weaker magical darkness cancels both.\n&emsp;This spell eventually consumes the material it is cast upon, but the process takes far longer than the time in a typical campaign. Extremely hard and expensive materials might last hundreds or even thousands of years. Perishable materials, such as most foodstuffs, will rot normally long before a *continual light* spell can affect them. Likewise, most creatures will be dust before the spell will hurt them. If an object is consumed by this spell, the spell ceases to function.\n&emsp;The reverse spell, *continual darkness*, causes complete absence of light (pitch blackness), similar to the *darkness* spell but of greater duration and area.'
};
@@ -1440,7 +1440,7 @@ pri3['Pyrotechnics'] = {
'damage': '',
'damage-type': '',
'healing': '',
'special-conditions': ['blindness'],
'special-conditions': [BLINDNESS],
'effect': 'A *pyrotechnics* spell draws on an existing fire source to produce either of two effects, at the option of the caster.\n&emsp;First, it can produce a flashing and fiery burst of glowing, colored aerial *fireworks* that lasts one round. Creatures in, under, or within 120 feet of the area that have an unobstructed line of sight to the effect are blinded for 1d4+1 rounds unless they roll successful saving throws vs. spell. The fireworks fill a volume 10 times greater than the original fire source.\n&emsp;Second, it can cause a thick, writhing stream of *smoke* to arise from the source and form a choking cloud that lasts for one round per experience level of the caster. Currently [[@{level-priest}]] rounds. This covers a roughly hemispherical volume from the ground or floor up (or conforming to the shape of a confined area) that totally obscures vision beyond 2 feet. The smoke fills a volume 100 times that of the fire source.\n&emsp;The spell uses one fire source within a 20-foot cube, which is immediately extinguished. If an extremely large fire is used as the source, it is only partially extinguished by the casting. Magical fires are not extinguished, although a fire-based creature (such as a fire elemental) used as a source suffers 1d4 points of damage, plus 1 point of damage per caster level. Currently [[1d4+[[@{level-priest}]] ]] points of damage. This spell does not function under water.'
};
+16 -14
View File
@@ -7,6 +7,7 @@ const INFO = 2;
const WARNING = 3;
const ERROR = 4;
const ERRATA_FIELD = 'errata';
const PSIONICS_HANDBOOK = 'The Complete Psionics Handbook';
const BOOK_FIELDS = [
@@ -1165,21 +1166,21 @@ function parseSpheres(spheresStrings, regex) {
const getSpellSchools = function (spell, books) {
let schoolRules = getActiveSettings(SCHOOL_FIELDS, books);
return spell['school'] + `%NEWLINE%S&M: (${spell[SCHOOL_SPELLS_AND_MAGIC]})`;
// return schoolRules.has(SCHOOL_SPELLS_AND_MAGIC)
// ? spell[SCHOOL_SPELLS_AND_MAGIC] || spell['school']
// : spell['school'];
//return spell['school'] + `%NEWLINE%S&M: (${spell[SCHOOL_SPELLS_AND_MAGIC]})`;
return schoolRules.has(SCHOOL_SPELLS_AND_MAGIC)
? spell[SCHOOL_SPELLS_AND_MAGIC] || spell['school']
: spell['school'];
}
const getSpellSpheres = function (spell, sphereRules) {
return spell['sphere'] + `%NEWLINE%Druid: ${spell['sphere-druids']}%NEWLINE%Necro: ${spell['sphere-necromancers']}%NEWLINE%S&M: ${spell[SPHERE_SPELLS_AND_MAGIC]}`
// return spell['sphere'] + `%NEWLINE%Druid: ${spell['sphere-druids']}%NEWLINE%Necro: ${spell['sphere-necromancers']}%NEWLINE%S&M: ${spell[SPHERE_SPELLS_AND_MAGIC]}`
// if (sphereRules.has(SPHERE_SPELLS_AND_MAGIC))
// return spell[SPHERE_SPELLS_AND_MAGIC] || spell['sphere'];
if (sphereRules.has(SPHERE_SPELLS_AND_MAGIC))
return spell[SPHERE_SPELLS_AND_MAGIC] || spell['sphere'];
// let sphere = spell['sphere'];
// sphereRules.forEach(rule => sphere += spell[rule] || '');
// return sphere;
let sphere = spell['sphere'];
sphereRules.forEach(rule => sphere += spell[rule] || '');
return sphere;
}
function isSpellAvailable(spellName, spell, availableSpheres, elementalSpheres, activeBooks, optionalSpheres) {
@@ -1403,7 +1404,7 @@ function setupAutoFillSpellInfo(section, spellsTable, optionalRulesFields) {
let levelField = isPriest ? 'level-priest' : 'level-wizard';
let className = isPriest ? 'Priest' : 'Wizard';
getAttrs([...BOOK_FIELDS, ...optionalRulesFields, levelField], function(books) {
getAttrs([...BOOK_FIELDS, ...optionalRulesFields, levelField, ERRATA_FIELD], function(books) {
if (bookInactiveShowToast(books, spell))
return;
@@ -1431,7 +1432,7 @@ function setupAutoFillSpellInfo(section, spellsTable, optionalRulesFields) {
[`repeating_spells-${section}_spell-saving-throw`] : spell['saving-throw'],
[`repeating_spells-${section}_spell-healing`] : spell['healing'],
[`repeating_spells-${section}_spell-materials`] : spell['materials'],
[`repeating_spells-${section}_spell-reference`] : displayReference(spell),
[`repeating_spells-${section}_spell-reference`] : displayReference(spell, books),
[`repeating_spells-${section}_spell-subtlety`] : spell['subtlety'] || '',
[`repeating_spells-${section}_spell-sensory`] : spell['sensory'] || '',
[`repeating_spells-${section}_spell-knockdown`] : spell['knockdown'] || '',
@@ -1489,12 +1490,13 @@ const displaySpellLevel = function(level, className) {
: `Level ${level} ${className}`;
}
const displayReference = function(spell) {
const displayReference = function(spell, books) {
let reference = `${spell['book']} ${spell['reference']}`
if (spell['book-compendium'])
reference += `\n${spell['book-compendium']}`;
if (spell['errata'])
let activeSettings = getActiveSettings([ERRATA_FIELD], books);
if (activeSettings.has(ERRATA_FIELD) && spell['errata'])
reference += `\n${spell['errata']}`;
return reference;