[DSA4.1] Sheet Worker Scripts for Stats & Derived Stats, Gifts and Meta-Talents (#5016)

* * Convert stats, derived stats, gifts and meta-talents to sheet worker scripts

* * Add apehead to the authors

* * Remove unused duplicate attributes of stats

* * Fix calculation of wound threshold

* * Use sheet worker scripts for wound threshold everywhere
* Use sheet worker scripts for showing stats everywhere

* * Add trailing newline to end of file

* * Use more systematic attribute names for meta-talents
	* Name_Metatalent: internal name
	* Name_Metatalent_Anzeige: display name (derived from internal name or user-supplied)
	* Name_Metatalent_Eigen: user-supplied name for self-made meta-talents
* Remove superfluous special experience column for meta-talents
* Improve alignment of pseudo-columns of the repeating group for meta-talents
* Ignore user-supplied meta-talent names for official meta-talents (instead of deleting them)

* * Sort metatalents alphabetically
* Use 2D array to store stats used for metatalents and display names

* * Set default values for all variables of a custom meta-talent, so that rolling will always work

* * Bump version number

* * Restructure calculation of stats and derived stats
	* Allow speed (GS) to be calculated without mathematical tricks
	* Remove other mathematical tricks as well
* Fix: Do no longer take temporary stat modifiers into account when calculating magic resistance, initiative, attack/parry/long range base values
	* Remove or adapt corresponding sections in formulas.md

* * Convert gifts to sheet worker scripts (analogously to meta-talents)
	* Custom gifts not yet fully supported

* * Keep gift stats when selecting "nothing" to prevent data loss

* * Add new version field for the character sheet to be used in update/migration scripts

* * Migration of gifts data from data version 20171014 to current

* * Use a new name for the gifts repeating section
* Use previous name for old data
* Update scripts accordingly
* Move old repeating section to new tab "Infos"
	* Inform users about the change(s)
	* Keep old repeating section so users do not lose any data and can manually fix errors introduced during automatic migration

* * Prepare gifts section for custom gifts

* * Fix: Propagate stats updates to gifts' stats

* * Add old meta-talents repeating section to Infos tab to allow users to recover old data
* Rename meta-talent repeating section to prevent name clash with old repeating section

* * Make HTML a bit more valid

* * Remove misleading and troubling attribute 'INI_max'
* Restructure calculation of 'INIBasis2' to be independent of 'INI_max'

* * Add migration for meta-talents

* * Fix: Handle gift/meta-talent "TaW" not set

Since this is the last commit regarding gifts/meta-talents:
* Fixes kreuvf/roll20-character-sheets#1
* Fixes kreuvf/roll20-character-sheets#22
* Relates to kreuvf/roll20-character-sheets#28

* * Bump version number

* * Give correct column for two-hand swords/sabres
This commit is contained in:
Kreuvf
2019-04-29 17:25:56 -05:00
committed by Cassie Levett
parent 2c8966b62a
commit 1cb01d004d
4 changed files with 1043 additions and 387 deletions
@@ -66,6 +66,10 @@ Confirmed Critical Failure: #b39797 (a red)
display: none;
}
.charsheet .sheet-section-info * {
text-align: left;
}
/* Headings */
.charsheet h1,
.charsheet h2,
@@ -150,6 +154,45 @@ input[type=number]::-webkit-outer-spin-button {
font-weight: bold;
}
.charsheet input[type="text"]:read-only,
.charsheet input[type="number"]:read-only {
background-color: #bf9e60;
border-style: solid;
border-color: #806940;
border-width: 0.1em;
font-weight: bold;
}
.charsheet input[type="number"]:-moz-read-only {
background-color: #bf9e60;
border-style: solid;
border-color: #806940;
border-width: 0.1em;
font-weight: bold;
}
.charsheet input[type="text"]:-moz-read-only {
background-color: #bf9e60;
border-style: solid;
border-color: #806940;
border-width: 0.1em;
font-weight: bold;
}
/* Selectable text has to go into <input> */
.charsheet input[type="text"].sheet-selectable-text {
background-color: inherit;
border: none;
color: inherit;
font-family: inherit;
font-size: inherit;
font-weight: inherit;
padding-left: 0;
padding-right: 0;
padding-top: inherit;
padding-bottom: inherit;
}
.charsheet .sheet-activation-items input[type="checkbox"] {
margin: 0.1em 0.3em 0.1em 0em;
}
@@ -227,6 +270,28 @@ The solution: convert the <input>s to type="text" and make them look like normal
vertical-align: bottom;
}
.charsheet input[type="text"]:read-only.sheet-stat-immutable {
background-color: #e6be74;
border-style: hidden;
box-shadow: none;
cursor: auto;
font-family: serif;
padding: 0;
width: 2.5em;
vertical-align: bottom;
}
.charsheet input[type="text"]:-moz-read-only.sheet-stat-immutable {
background-color: #e6be74;
border-style: hidden;
box-shadow: none;
cursor: auto;
font-family: serif;
padding: 0;
width: 2.5em;
vertical-align: bottom;
}
.charsheet input[type="text"]:disabled.sheet-stat-immutable-version {
width: 7em;
}
@@ -236,9 +301,25 @@ The solution: convert the <input>s to type="text" and make them look like normal
text-align: left;
}
.charsheet th > input[type="text"]:read-only.sheet-stat-immutable {
text-align: left;
}
.charsheet th > input[type="text"]:-moz-read-only.sheet-stat-immutable {
text-align: left;
}
/* Align text right to match other table cells */
.charsheet td > input[type="text"]:disabled.sheet-stat-immutable {
text-align: right;
text-align: center;
}
.charsheet td > input[type="text"]:read-only.sheet-stat-immutable {
text-align: center;
}
.charsheet td > input[type="text"]:-moz-read-only.sheet-stat-immutable {
text-align: center;
}
/* Style draggable UI buttons */
@@ -460,7 +541,8 @@ The solution: convert the <input>s to type="text" and make them look like normal
.charsheet input.sheet-tab83:checked ~ div.sheet-section-Orte,
.charsheet input.sheet-tab10:checked ~ div.sheet-section-config,
.charsheet input.sheet-tab101:checked ~ div.sheet-section-config1,
.charsheet input.sheet-tab102:checked ~ div.sheet-section-config2 {
.charsheet input.sheet-tab102:checked ~ div.sheet-section-config2,
.charsheet input.sheet-tab11:checked ~ div.sheet-section-info {
border-color: #806940;
border-style: solid;
border-width: 0.2em 0 0.2em 0;
@@ -529,7 +611,8 @@ The solution: convert the <input>s to type="text" and make them look like normal
.charsheet input.sheet-tab99:checked + span.sheet-tab99,
.charsheet input.sheet-tab10:checked + span.sheet-tab10,
.charsheet input.sheet-tab101:checked + span.sheet-tab101,
.charsheet input.sheet-tab102:checked + span.sheet-tab102 {
.charsheet input.sheet-tab102:checked + span.sheet-tab102,
.charsheet input.sheet-tab11:checked + span.sheet-tab11 {
background-color: #bf9e60;
border-color: #806940;
color: #000000;
@@ -1485,4 +1568,3 @@ The solution: convert the <input>s to type="text" and make them look like normal
font-weight: inherit;
color: #000000;
}
File diff suppressed because it is too large Load Diff
+2 -25
View File
@@ -20,37 +20,14 @@ The stat value (`@{MU}`) is increased (easy) or decreased (difficult) by the mod
Therefore, the first part is grouped with the roll `@{MU} + 0d1` and the highest value of both is dropped. In the above example, 14 would be higher than 12 and dropped, so that the result would be 12. When the check result is less than the stat value, the second part would be higher and dropped. The same is true for negative results (failures). Automatic successes (1) and failures (20) are handled by the roll template. Since stat values of 20 and higher are possible (and negative modifiers as well), the roll template currently does not show the resulting points in the case of automatic failures. The reasoning behind this is that the result would be non-negative, suggest success to the player and might confuse newbies. It should be noted that automatic success/failures in stat checks are an optional rule according to WdS, p. 7.
## Speed (Geschwindigkeit/GS)
`(@{GS_Basis} + @{GS_Mod} + (floor((@{GE_Basis} + @{GE_Mod} + 100)/111)-1) + (ceil((@{GE_Basis} + @{GE_Mod} + 100)/115)-1) - @{wound_Bauch} - (@{wound_RB}/2 - @{wound_LB}/2))`
The GS stat is 8 by default and modified by certain advantages/disadvantages (which are not currently respected) and certain wounds. Additionally, the agility stat (GE) influences the speed: GE less than 11 reduces the GS by one, GE greater than 15 increases the GS by one. The above formula contains some magic values to accomplish the correct behaviour.
`floor((@{GE_Basis} + @{GE_Mod} + 100)/111)-1`
`@{GE_Basis}` and `@{GE_Mod}` represent the current agility without wound effects. The trick to get this term to be -1 for GE less than 11 lies within floor(). floor() always rounds down. So, 0.999 gets rounded to 0. GE less than 11 also means GE less than or equal to 10 and with GE = 10, the fraction `110/111` will be rounded down to 0. The `-1` after the `floor(...)` makes the whole term become -1.
`ceil((@{GE_Basis} + @{GE_Mod} + 100)/115)-1`
Same situation as before, but this time using ceil() to always round up. Until GE = 15, the `ceil(...)` is 1 and the `-1` afterwards reduces it to zero cancelling out any effect. Starting with GE = 16, the `ceil(...)` is 2 and the whole term +1.
## Life Energy (Lebensenergie/LE), Stamina (Ausdauer/AU) and Astral Energy (Astralenergie/AE)
LE: `round(@{KO_Basis} + (@{KK_Basis}/2) + 0.05)`
AU: `round((@{MU_Basis} + @{KO_Basis} + @{GE_Basis})/2 + 0.05)`
AE: `round((@{MU_Basis} + @{IN_Basis} + @{CH_Basis})/2 + 0.05)`
These formulas are quite straightforward implementations of the official rules with one small change: Prior to rounding, 0.05 is added as a safeguard to ensure that .5 is correctly rounded up by making it 0.55. Not sure, if this is really necessary.
It is important to note that the base values of the stats are used here (`_Basis`). This prevents these base values to change upon temporary effects such as wounds, spells or disease. A side effect of this is that the "Mod" column on the "Grundwerte" tab must not be mistaken for the "Mod" column on the official PDF character sheet which takes boni/mali from the character generation. In its current form, this character sheet assumes that the value entered under `Basis` is the value of the current stat with all permanent modifications already factored in.
## Magic Resistance (Magieresistenz/MR)
`round((@{MU_Basis} + @{MU_Mod} + @{KL_Basis} + @{KL_Mod} + @{KO_Basis} + @{KO_Mod})/5)`
Since stats are positive integers and are divided by 5, the first decimal place always is an even number (.0, .2, .4, .6 or .8). Therefore, no safeguard is needed. Temporary modifiers without wounds are applied. No source is yet known for this behaviour and therefore, this will likely change in a future release.
No temporary stat modifiers or wounds are applied.
## Initiative/Attack/Parry/Long Range Base Values (INI/AT/PA/FK-Basiswert)
Analog to Magic Resistance, but wound effects are honoured for Attack/Parry/Long Range base values. No source is yet known for the application of temporary modifiers and therefore, this will likely change in a future release.
Wound effects are honoured for Attack/Parry/Long Range base values. No temporary stat modifiers are applied.
## 3d20 Checks
Four cases have to be distinguished in order to determine the result of a roll:
+1 -1
View File
@@ -1,7 +1,7 @@
{
"html": "dsa4_1_character_sheet_roll20.html",
"css": "dsa4_1_character_sheet_roll20.css",
"authors": "Gereon Heinemann, Patrick Gebhardt (gebhardthbs@web.de), Kai, Steven 'Kreuvf' Koenig (webmaster@kreuvf.de)",
"authors": "Gereon Heinemann, Patrick Gebhardt (gebhardthbs@web.de), Kai, Steven 'Kreuvf' Koenig (webmaster@kreuvf.de), apehead",
"roll20userid": "584207,592673,879287,1411023 ",
"preview": "dsa4_1_character_sheet_roll20.png",
"instructions": "Charakterbogen für das &quot;Das Schwarze Auge&quot;-Regelwerk 4.1"