diff --git a/NHKS/Historie.txt b/NHKS/Historie.txt index 56d6f88ead..627407ffa4 100644 --- a/NHKS/Historie.txt +++ b/NHKS/Historie.txt @@ -1,3 +1,10 @@ +2022-11-25 V1.1 + Release bei Roll20 + +2022-07-17 V1.1 + Take-2-Punkte + Waffenliste + 2022-07-16 V1.1 Kleinere Bugfixes im Layout Übersetzungsdatei bereinigt diff --git a/NHKS/NHKS.css b/NHKS/NHKS.css index 8654073600..e882549cad 100644 --- a/NHKS/NHKS.css +++ b/NHKS/NHKS.css @@ -1,7 +1,7 @@ /* EDITED by Gorthian Version 1.1 - Letzte Änderung 2022-07-17 + Letzte Änderung 2022-07-19 GitHub https://github.com/Gorthian/Roll20_NHKS_CharacterSheet Wiki https://github.com/Gorthian/Roll20_NHKS_CharacterSheet/wiki @@ -17,11 +17,28 @@ div.sheet-wrapper { --sheet-border : 1px solid black; } +/* TABS */ +div.sheet-NHKS .sheet-main-tab, div.sheet-NHKS .sheet-weapon-tab { + display: none; +} + +div.sheet-NHKS .sheet-tabstoggle[value="main"] ~ div.sheet-main-tab, +div.sheet-NHKS .sheet-tabstoggle[value="weapons"] ~ div.sheet-weapon-tab { + display: block; +} + /* GRIDS */ div.sheet-NHKS { background-color : var(--sheet-bg); color : var(--sheet-text-color); + min-width : 800px; +} + +div.sheet-tab-buttons { + display : grid; + grid-template-columns : repeat(4, 25%); + grid-auto-flow : columns; } div.sheet-general { @@ -65,22 +82,26 @@ div.sheet-skills { grid-auto-flow : colums dense; } -div.sheet-misc { - display : grid; - grid-template-columns : repeat(2, 50%); - grid-template-areas : "role-misc role-image" -} - -div.sheet-nhks-image { - grid-area : role-image; - text-align : center; -} - div.sheet-radio-set { display : flex; gap : 5px; } +div.sheet-weapon-entry { + border : var(--sheet-border); + display : grid; + grid-template-columns : 70% 30%; + grid-auto-flow : colums dense; +} + +div.sheet-weapon-entry .sheet-input-line .sheet-label { + width : 120px; +} + +div.sheet-weapon-entry textarea { + width : 80%; +} + /* Movie Awards */ div.sheet-movies div.sheet-radio-set input.sheet-radiobox { @@ -348,10 +369,10 @@ button[type="action"] { /* Hintergrundbilder */ -div.sheet-actor-general { - background-image : url("https://github.com/Gorthian/Roll20_NHKS_CharacterSheet/blob/main/images/standard/Schauspielerbogen_1_25_freigestellt.png?raw=true"); - background-position : top left; - background-size : contain; +div.sheet-main-tab { + background-image : url("https://github.com/Gorthian/Roll20_NHKS_CharacterSheet/blob/main/images/standard/Schauspielerbogen_1_50_freigestellt.png?raw=true"); + background-position : bottom right; + background-size : 25%; background-repeat : no-repeat; } @@ -362,7 +383,7 @@ div.sheet-general { background-repeat : no-repeat; } -div.sheet-content { +div.sheet-skills { background-image : url("https://github.com/Gorthian/Roll20_NHKS_CharacterSheet/blob/main/images/standard/Schauspielerbogen_3_25_freigestellt.png?raw=true"); background-position : bottom; background-size : contain; diff --git a/NHKS/NHKS.html b/NHKS/NHKS.html index a7d87824f0..f5fdd8f1b1 100644 --- a/NHKS/NHKS.html +++ b/NHKS/NHKS.html @@ -1,1374 +1,1524 @@ + +CREATED by Gorthian +Version v2.0 +Letzte Änderung 2022-11-25 +GitHub https://github.com/Gorthian/Roll20_NHKS_CharacterSheet +Wiki https://github.com/Gorthian/Roll20_NHKS_CharacterSheet/wiki +Bugs & Issues https://github.com/Gorthian/Roll20_NHKS_CharacterSheet/issues - - -
-
-
-

- - - - - - -

-

-
-
-

- - - - - - - - -
-
-

-
-
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
-
-
-
-
- /
-
- / -
-
-
-
- /
-
- / -
-
-
-
-
-
-
- -
-
- -
- -
-
-
-
- -
-
-
- -
-
-
- -
-
-
-
- -
-
-
- -
-
-
-
-
-
-

-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-

-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
-   -
-
- -
-
- -
-
- -
-
-
-
- -
-
-   -
-
- -
-
- -
-
- -
-
-
-
- -
-
-   -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- -
-
-   -
-
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
+--> + + + +
+ +
+
+ +
+
+ +
+
+ + + +
+
+
+

+ + + + + + +

+ +

+

+ +

+
+
+

+ + + + + +
+
+

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+


+ / +

+ / + +
+


+ / +

+ / + +
+
+
+ +
+

+

+

+ +
+


+


+


+ +
+


+


+ +
+
+
+
+
+ + + +
+

+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+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
+
+
+
+

+
+
+ +
+ + + + + + +
+ +
+
+
+
+

+
+
+ +
+ + + + + + +
+
+
+
+
+

+ +
+
+
+
+ + + + +
+

+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+

+
+
+
+ +
+ + +--> + + -
-
{{name}}
-
{{role-name}}
-
-
{{skill}}
-
{{skillValue}}
-
-
-
{{attribute}}
-
{{attributeValue}}
-
-
-
-
{{target}}
-
-
-
-
{{roll1}}
-
-
{{computed::roll1}}
+
+
{{name}}
+
{{role-name}}
+
+
{{skill}}
+
{{skillValue}}
+
+
{{attribute}}
+
{{attributeValue}}
+
+
+
{{modifier}}
+
{{modifierValue}}
+
+
+
+
{{computed::target}}
+
+
+
+
{{roll1}}
+
+
{{computed::roll1}}
+
- -
-
{{name}}
-
-
{{attribute}}
-
{{attributeValue}}
-
-
-
-
{{target}}
-
-
-
-
{{roll1}}
-
-
{{computed::roll1}}
+
+
{{name}}
+
+
{{attribute}}
+
{{attributeValue}}
+
+
{{modifier}}
+
{{modifierValue}}
+
+
+
+
{{computed::target}}
+
+
+
+
{{roll1}}
+
+
{{computed::roll1}}
+
- -
-
{{name}}
-
-
{{initiative}}
-
{{roll1}}
-
-
- -
+
+
{{name}}
+
+
{{initiative}}
+
{{roll1}}
+
+
+ + + \ No newline at end of file +/* Änderungen an Skills */ +aActorSkills.forEach(sSkill => { + on(`change:skill-${sSkill}`, function() { + console.log("[CHANGE] " + sSkill); + changedSkill(sSkill); + }); + + on(`change:skill-${sSkill}-is-role-skill`, function() { + console.log("[CHANGE] " + sSkill + "is-role-skill"); + changedSkill(sSkill); + }); +}); + +/* Änderungen an Kampf-Skills */ +aActorWeaponSkills.forEach(sSkill => { + on(`change:skill-${sSkill}`, function() { + console.log("[CHANGE] " + sSkill); + changedSkill(sSkill); + }); + + on(`change:skill-${sSkill}-is-role-skill`, function() { + console.log("[CHANGE] " + sSkill + "is-role-skill"); + changedSkill(sSkill); + }); +}); + +/* Event-Listener -- Ende */ + +/* Funktionen -- Start */ +function recalcValues() { + console.log("[recalcValues]"); + aActorAttributes.forEach(sAttribute => { + changedAttribute(sAttribute); + }); + aActorSkills.forEach(sSkill => { + changedSkill(sSkill); + }); + aActorWeaponSkills.forEach(sSkill => { + changedSkill(sSkill); + }); +} + +function changedAttribute(sAttribute) { + console.log("[changedAttribute] " + sAttribute); + + getAttrs([sAttribute], function (values){ + let iAttribute = parseInt(values[sAttribute]||iMinAttributeValue); + let aAttributes = {}; + + // Auf Min/Max prüfen + if (iAttribute < iMinAttributeValue ) { + iAttribute = iMinAttributeValue; + } else if (iAttribute > iMaxAttributeValue ) { + iAttribute = iMaxAttributeValue; + } + aAttributes[sAttribute] = iAttribute; + setAttrs(aAttributes); + + switch (sAttribute) { + case "strength": + recalcMeleeAttack(); + recalcMeleeDamage(); + recalcMeleeDefense(); + break; + case "stamina": + recalcHitpoints(); + break; + case "dexterity": + recalcMeleeDefense(); + recalcRangedAttack(); + recalcRangedDamage(); + break; + case "knowledge": + //nothing + break; + case "coolness": + recalcInitiative(); + break; + case "chi": + recalcMeleeAttack(); + recalcChipoints(); + recalcMeleeDefense(); + recalcRangedAttack(); + break; + default: + } + }); +} + +function changedSkill(sSkill) { + console.log("[changedSkill] " + sSkill); + + getAttrs(["skill-" + sSkill,"skill-" + sSkill + "-is-role-skill"], function (values){ + let iSkill = parseInt(values["skill-" + sSkill]||iMinSkillValue); + let iSkillRole = 0; + let iIsRoleSkill = parseInt(values["skill-" + sSkill + "-is-role-skill"]||0); + let aAttributes = {}; + console.log("[changedSkill] isRoleSkill" + iIsRoleSkill); + + // Auf Min/Max prüfen + if (iSkill < iMinSkillValue ) { + iSkill = iMinSkillValue; + } else if (iSkill > iMaxSkillValue ) { + iSkill = iMaxSkillValue; + } + + //Rollenskill berechnen + if (iIsRoleSkill == 1) { + switch (iSkill) { + case 0: case 1: case 2: + iSkillRole = 4; + break; + case 3: case 4: + iSkillRole = 5; + break; + case 5: case 6: case 7: case 8: case 9: + iSkillRole = iSkill+1; + break; + case 10: + iSkillRole = 10; + break; + default: + iSkillRole = 0; + } + } else { + iSkillRole = 0; + } + + aAttributes["skill-" + sSkill] = iSkill; + aAttributes["skill-" + sSkill + "-role"] = iSkillRole; + setAttrs(aAttributes); + }); +} + +function recalcInitiative() { + console.log("[recalcInitiative]"); + getAttrs(["coolness"], function (values){ + let iCoolness = parseInt(values["coolness"]||0); + let iInitiative = iCoolness; + let aAttributes = {}; + + aAttributes["initiative"] = iInitiative; + + setAttrs(aAttributes); + }); +} + +function recalcRolepoints(iPoints,sType) { + let iRolePoints = 0; + + if (sType == "main") { + iRolePoints = iPoints + 20; + } else { + iRolePoints = iPoints + 10; + } + + return iRolePoints; +} + +function recalcHitpoints() { + console.log("[recalcHitpoints]"); + getAttrs(["stamina","role-type"], function (values){ + let iStamina = parseInt(values["stamina"]||0); + let sRoleType = values["role-type"]||"main"; + let iHitpoints = (iStamina + 4) * 10; + let iRoleHitpoints = recalcRolepoints(iHitpoints,sRoleType); + let aAttributes = {}; + + aAttributes["hitpoints_max"] = iHitpoints; + aAttributes["role_hitpoints_max"] = iRoleHitpoints; + + setAttrs(aAttributes); + }); +} + +function recalcChipoints() { + console.log("[recalcChipoints]"); + getAttrs(["chi","role-type"], function (values){ + let iChi = parseInt(values["chi"]||0); + let sRoleType = values["role-type"]||"main"; + let iChipoints = iChi * 10; + let iRoleChipoints = recalcRolepoints(iChipoints,sRoleType); + let aAttributes = {}; + + aAttributes["chipoints_max"] = iChipoints; + aAttributes["role_chipoints_max"] = iRoleChipoints; + + setAttrs(aAttributes); + }); +} + +function recalcMeleeAttack() { + console.log("[recalcMeleeAttack]"); + getAttrs(["chi","strength"], function (values){ + let iChi = parseInt(values["chi"]||0); + let iStrength = parseInt(values["strength"]||0); + let iMeleeAttack = Math.round((iStrength * 2 + iChi) / 3); + let aAttributes = {}; + + aAttributes["melee-attack"] = iMeleeAttack; + + setAttrs(aAttributes); + }); +} + +function recalcMeleeDamage() { + console.log("[recalcMeleeDamage]"); + getAttrs(["strength"], function (values){ + let iStrength = parseInt(values["strength"]||5); + let iMeleeDamage = 0; + let aAttributes = {}; + + if (iStrength > 5) { + iMeleeDamage = iStrength - 4; + } + + aAttributes["melee-damage"] = iMeleeDamage; + + setAttrs(aAttributes); + }); +} + +function recalcRangedDamage() { + console.log("[recalcRangedDamage]"); + getAttrs(["dexterity"], function (values){ + let iDexterity = parseInt(values["dexterity"]||5); + let iRangedDamage = 0; + let aAttributes = {}; + + if (iDexterity > 5) { + iRangedDamage = iDexterity - 4; + } + + aAttributes["ranged-damage"] = iRangedDamage; + + setAttrs(aAttributes); + }); +} + +function recalcMeleeDefense() { + console.log("[recalcMeleeDefense]"); + getAttrs(["chi","strength","dexterity"], function (values){ + let iChi = parseInt(values["chi"]||0); + let iStrength = parseInt(values["strength"]||0); + let iDexterity = parseInt(values["dexterity"]||0); + let iMeleeDefense = Math.round((iStrength + iDexterity + iChi) / 3); + let aAttributes = {}; + + aAttributes["melee-defense"] = iMeleeDefense; + + setAttrs(aAttributes); + }); +} + +function recalcRangedAttack() { + console.log("[recalcRangedAttack]"); + getAttrs(["chi","dexterity"], function (values){ + let iChi = parseInt(values["chi"]||0); + let iDexterity = parseInt(values["dexterity"]||0); + let iRangedAttack = Math.round((iDexterity * 2 + iChi) / 3); + let aAttributes = {}; + + aAttributes["ranged-attack"] = iRangedAttack; + + setAttrs(aAttributes); + }); +} +/* Funktionen -- Ende */ + +/* Tabs -- Start */ + const buttonlist = ["main","weapons"]; + buttonlist.forEach(button => { + on(`clicked:${button}`, function() { + setAttrs({ + sheetTab: button + }); + }); + }); +/* Tabs -- Ende */ + + \ No newline at end of file diff --git a/NHKS/NHKS.png b/NHKS/NHKS.png index b01a81742a..a86fd634fa 100644 Binary files a/NHKS/NHKS.png and b/NHKS/NHKS.png differ diff --git a/NHKS/translation.json b/NHKS/translation.json index fbac1532be..05f3ae2f7b 100644 --- a/NHKS/translation.json +++ b/NHKS/translation.json @@ -10,7 +10,6 @@ "attributes" : "Attribute", "awards" : "AWARDS", "awardpoints" : "AWARD-PUNKTE", - "awardpoints-desc" : "", "boats" : "Boote lenken", "chi" : "Chi", "chi-short" : "CHI", @@ -33,7 +32,6 @@ "extremesport" : "Extremsport", "failure" : "Fehlschlag", "famepoints" : "STARRUHM-PUNKTE", - "famepoints-desc" : "", "firstaid" : "Erste Hile", "gender" : "Geschlecht", "general" : "Allgemein", @@ -49,6 +47,7 @@ "knowledge" : "Wissen", "knowledge-short" : "WIS", "languages" : "Sprachen", + "main" : "Allgemein", "main-role" : "Hauptrolle", "martialarts" : "MARTIAL ARTS", "mechanic" : "Mechanik", @@ -139,6 +138,7 @@ "strength" : "Stärke", "success" : "Erfolg", "supporting-role" : "Nebenrolle", + "take2points" : "Take-2-Punkte", "target-value" : "Zielwert", "unarmed" : "Waffenloser Kampf", "vehicles" : "Gewöhnliche Fahrzeuge",