diff --git a/RolemasterUnified_Official/rolemasterunified.css b/RolemasterUnified_Official/rolemasterunified.css index c65e44e065..054827b7a3 100644 --- a/RolemasterUnified_Official/rolemasterunified.css +++ b/RolemasterUnified_Official/rolemasterunified.css @@ -295,6 +295,15 @@ input:not(:checked).toggle + .toggler { display: none; } background: #dee; } +/* A text entry meant to blend in as text */ +.cminputinline { + border: none; + display: inline; + font-family: inherit; + font-size: inherit; + padding: 0px; + width: 20em; +} .skill_specialization { font-style: italic; diff --git a/RolemasterUnified_Official/rolemasterunified.html b/RolemasterUnified_Official/rolemasterunified.html index c47a96cef5..4a5a3a5088 100644 --- a/RolemasterUnified_Official/rolemasterunified.html +++ b/RolemasterUnified_Official/rolemasterunified.html @@ -1101,11 +1101,11 @@ in the game in "Superior".

?
-
+
-
+
@@ -1117,11 +1117,11 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1133,27 +1133,27 @@ in the game in "Superior".

?
-
+
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1165,23 +1165,23 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
@@ -1193,15 +1193,15 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1213,27 +1213,27 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1245,7 +1245,7 @@ in the game in "Superior".

?
-
+
?
@@ -1281,7 +1281,7 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
?
@@ -1305,12 +1305,12 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
? (Current ranks -, bonus -)
-
+
?
@@ -1362,15 +1362,15 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1382,31 +1382,31 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1418,11 +1418,11 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1434,15 +1434,15 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
-
+
@@ -1509,15 +1509,15 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1529,7 +1529,7 @@ in the game in "Superior".

?
-
+
@@ -1548,15 +1548,15 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
-
+
-
+
@@ -1583,19 +1583,19 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
-
+
-
+
-
+
(Current ranks -, bonus -)
@@ -1607,15 +1607,15 @@ in the game in "Superior".

?
-
+
-
+
-
+
(Current ranks -, bonus -)
@@ -1627,15 +1627,15 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1647,15 +1647,15 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1667,19 +1667,19 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1691,15 +1691,15 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
-
+
(Current ranks -, bonus -)
@@ -1711,11 +1711,11 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
@@ -1730,11 +1730,11 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1746,19 +1746,19 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1770,7 +1770,7 @@ in the game in "Superior".

?
-
+
@@ -1785,15 +1785,15 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1805,7 +1805,7 @@ in the game in "Superior".

?
-
+
?
@@ -1849,7 +1849,7 @@ in the game in "Superior".

?
-
+
@@ -1872,15 +1872,15 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1892,11 +1892,11 @@ in the game in "Superior".

?
-
+
(Current ranks -, bonus -)
-
+
@@ -1907,7 +1907,7 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
(Current ranks -, bonus -)
@@ -1919,7 +1919,7 @@ in the game in "Superior".

?
-
+
@@ -1946,7 +1946,7 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
@@ -1993,7 +1993,7 @@ in the game in "Superior".

(Current ranks -, bonus -)
-
+
@@ -2120,8 +2120,7 @@ in the game in "Superior".

- Current ranks - - bonus - +
@@ -3154,29 +3153,29 @@ Name
y0 - channelingin0 + channelingin
-
y
+
y
y0 - essenceem0 + essenceem
-
y
+
y
y0 - mentalismpr0 + mentalismpr
-
y
+
y
y0 - physicalco0 + physicalco
-
y
+
y
y0 - fearsd0 + fearsd
-
y
+
y
@@ -3191,15 +3190,17 @@ Name
- +
- -
+
+
@@ -3239,14 +3240,14 @@ Name
-
+
y
-
+
y @@ -3254,14 +3255,14 @@ Name
-
+
y
-
+
@@ -3275,15 +3276,15 @@ Name Perception •sd
-
-
+
+
y
Tracking •sd
-
-
+
+
y
@@ -3297,50 +3298,50 @@ Name
-
+
y
-
+
Maneuvering in Armor •
-
-
+
+
y
Mounted Combat •
-
-
+
+
y
Protect •
-
-
+
+
y
Restricted Quarters •
-
-
+
+
y
Subduing •
-
-
+
+
y
@@ -3353,43 +3354,43 @@ Name Adrenal Defense •ag
-
-
+
+
y
Adrenal Focus •sd
-
-
+
+
y
Adrenal Speed •qu
-
-
+
+
y
Adrenal Strength •st
-
-
+
+
y
y Discipline Styles •
-
+
y
-
+
@@ -3403,22 +3404,22 @@ Name Body Development •co
-
-
+
+
y
Fortitude •sd
-
-
+
+
y
Weight-training •st
-
-
+
+
y
@@ -3431,51 +3432,51 @@ Name Blind Fighting •
-
-
+
+
y
y Combat Styles •
-
+
y
-
+
Disarm •
-
-
+
+
y
Footwork •
-
-
+
+
y
Multiple Attacks •
-
-
+
+
y
Reverse Strike •
-
-
+
+
y
@@ -3487,188 +3488,188 @@ Name
y Melee Weapons •st
-
+
y
Blade -
+
y
Chain -
+
y
Hafted -
+
y
Greater Blade -
+
y
Greater Chain -
+
y
Greater Hafted -
+
y
Pole Arm -
+
y
Exotic -
+
y
y Ranged Weapons •ag
-
+
y
Bow -
+
y
Crossbow -
+
y
Sling -
+
y
Thrown -
+
y
Exotic -
+
y
Shield •st
-
-
+
+
y
y Unarmed •
-
+
y
Strikesst -
+
y
Sweeps & Throwsag -
+
y
Wrestlingag -
+
y
Beakst -
+
y
Bitest -
+
y
Clawst -
+
y
Hornst -
+
y
Ramst -
+
y
Stingerag -
+
y
Tramplest -
+
y
@@ -3681,22 +3682,22 @@ Name Illusion Crafting •pr
-
-
+
+
y
Musical Composition •pr
-
-
+
+
y
Writing •re
-
-
+
+
y
@@ -3709,50 +3710,50 @@ Name Culinary •sd
-
-
+
+
y
Drawing/Painting •in
-
-
+
+
y
Fabric Craft •sd
-
-
+
+
y
Leathercraft •sd
-
-
+
+
y
Metalcraft •st
-
-
+
+
y
Stonecraft •st
-
-
+
+
y
Woodcraft •sd
-
-
+
+
y
@@ -3765,15 +3766,15 @@ Name Attunement •pr
-
-
+
+
y
Runes •pr
-
-
+
+
y
@@ -3786,127 +3787,127 @@ Name Navigation •re
-
-
+
+
y
y Piloting •ag
-
+
y
-
+
y Survival •re
-
+
y
Alpine (A) -
+
y
Oceans (O) -
+
y
Underground (U) -
+
y
Ice Caps (I) -
+
y
Tundra (T) -
+
y
Boreal Forest (B) -
+
y
Desert Shrublands (X) -
+
y
Prairies & Steppes (P) -
+
y
Temperate Forests (F) -
+
y
Hot Deserts (D) -
+
y
Savannas (S) -
+
y
Tropical Forest (J) -
+
y
Urban -
+
y
Xeno -
+
y
@@ -3919,22 +3920,22 @@ Name Acrobatics •st
-
- +
+
y
Contortions •sd
-
-
+
+
y
Jumping •st
-
-
+
+
y
@@ -3946,50 +3947,50 @@ Name
y Creature Lore •re
-
+
y
Demon -
+
y
Dragon -
+
y
Faerie -
+
y
Undead -
+
y
y Historic Lore •re
-
+
y
-
+
y @@ -3997,77 +3998,77 @@ Name
-
+
y
-
+
y Materials Lore •re
-
+
y
Bone/Horn -
+
y
Fabrics -
+
y
Leather -
+
y
Metal -
+
y
Stone -
+
y
Wood -
+
y
y Racial Lore •re
-
+
y
-
+
y @@ -4075,14 +4076,14 @@ Name
-
+
y
-
+
y @@ -4090,22 +4091,22 @@ Name
-
+
y
-
+
Spell Lore •in
-
-
+
+
y
@@ -4119,14 +4120,14 @@ Name
- +
y
-
+
y @@ -4134,22 +4135,22 @@ Name
-
+
y
-
+
Transcendence •
-
-
+
+
y
@@ -4162,22 +4163,22 @@ Name Herbalism •re
-
- +
+
y
Medicine •re
-
-
+
+
y
Poison Mastery •re
-
-
+
+
y
@@ -4190,22 +4191,22 @@ Name Control Lycanthropy •sd
-
- +
+
y
Meditation •sd
-
-
+
+
y
Mental Focus •sd
-
-
+
+
y
@@ -4218,29 +4219,29 @@ Name Climbing •co
-
- +
+
y
Flying •co
-
-
+
+
y
Running •co
-
-
+
+
y
Swimming •co
-
-
+
+
y
@@ -4253,30 +4254,30 @@ Name Acting •me
-
- +
+
y
y Music •me
-
+
y
-
+
Stage Magic •ag
-
-
+
+
y
@@ -4289,49 +4290,49 @@ Name Channeling •sd
-
- +
+
y
y Directed Spell •ag
-
+
y
Elemental Bolts -
+
y
Illusionary Attacks -
+
y
Hurling -
+
y
Power Development •co
-
-
+
+
y
Power Projection •sd
-
-
+
+
y
@@ -4344,29 +4345,29 @@ Name Architecture •re
-
- +
+
y
Astronomy •re
-
-
+
+
y
Engineering •re
-
-
+
+
y
Mathematics •re
-
-
+
+
y
@@ -4378,50 +4379,50 @@ Name
y Influence •pr
-
+
y
Charm -
+
y
Duping -
+
y
Intimidation -
+
y
Leadership •pr
-
-
+
+
y
Social Awareness •em
-
-
+
+
y
Trading •pr
-
-
+
+
y
@@ -4433,64 +4434,64 @@ Name
y Magical Ritual •me
-
+
y
Alteration -
+
y
Creation -
+
y
Defensive -
+
y
Destruction -
+
y
Elemental -
+
y
Healing -
+
y
Informational -
+
y
Summoning & Transportation -
+
y
@@ -4502,64 +4503,64 @@ Name
y Ambush •in
-
+
y
Directed Spells -
+
y
Melee -
+
y
Ranged -
+
y
Shield -
+
y
Unarmed -
+
y
Concealment •in
-
-
+
+
y
Stalking •in
-
-
+
+
y
Trickery •in
-
-
+
+
y
@@ -4572,35 +4573,35 @@ Name Locks •ag
-
- +
+
y
y Mechanics •me
-
+
y
Operation -
+
y
Repair & Construction -
+
y
Traps •ag
-
-
+
+
y
@@ -4612,258 +4613,258 @@ Name
y Administration •re
-
+
y
Bookkeeper -
+
y
Librarian -
+
y
Officer -
+
y
Manager -
+
y
Quartermaster -
+
y
Seneschal -
+
y
y Service •pr
-
+
y
Bodyguard -
+
y
Bonesetter -
+
y
Casino Dealer/Croupier -
+
y
Guardsman -
+
y
Guide -
+
y
Innkeeper -
+
y
Purser -
+
y
Researcher -
+
y
Shaman -
+
y
Teacher -
+
y
Valet -
+
y
y Trade •re
-
+
y
Blacksmith -
+
y
Carpenter -
+
y
Farmer -
+
y
Fence -
+
y
Gambler -
+
y
Herdsman -
+
y
Hunter -
+
y
Merchant -
+
y
Miner -
+
y
Pirate -
+
y
Sailor -
+
y
Scribe -
+
y
Soldier -
+
y
Thief -
+
y
Tinker -
+
y
Trapper -
+
y
Weaver -
+
y
@@ -5645,7 +5646,7 @@ Sheet Version:
-Revision b29e6a3f1b8c2c2f18a89550163ac8a31028b97d +Revision 07d35031ffbeec6d473383fdf4a251188de88db7
@@ -7186,7 +7187,18 @@ let RMUSkills = {}; } RMUSkills.getCatByDisplayName = getCatByDisplayName; - + let getCatByDisplayNameCacheNoTrans_ = false; + function getCatByDisplayNameNoTrans(skillname) { + if (!getCatByDisplayNameCacheNoTrans_) { + let cache = {}; + for (const c of categories) { + cache[c.display] = c + } + getCatByDisplayNameCacheNoTrans_ = cache; + } + return getCatByDisplayNameCacheNoTrans_[skillname] + } + RMUSkills.getCatByDisplayNameNoTrans = getCatByDisplayNameNoTrans; const rankbonustable = [ /* 0 */ -25, @@ -9070,6 +9082,7 @@ onCheck("clicked:specialization_add", (ev) => { const catname = ev.htmlAttributes["data-cat"]; const specname = ev.htmlAttributes["data-specname"]; const data = getCharmancerData(); + console.log(data, data?.profession, data?.profession?.values, data?.profession?.values?.profession); const profession = cleanCompendiumName(data.profession.values.profession); const costs = getCostsFromData(profession); const costarray = generateCostArray(costs[catname]); @@ -9222,6 +9235,43 @@ onCheck("clicked:repeating_statgain", removeExtraStatGain); onCheck("page:levelup", levelUpStart); +/** + * For all specialised skills, get the name and ranks of the skills. + * + * Stored in results; each specialised skill is a list of the skill name and ranks + * + * results = { "riding": [prefix:'sss', category:animal, aname: 'riding', name:"Horse",ranks:7,bonus:44] .. }; + */ +function getSpecialisedSkillRanks(results) { + categories.forEach((cat) => { + cat.skills.forEach((skill) => { + if (!skill.dynamicspecializations) return; + let prefix = `repeating_specialization${skill.aname}` + getSectionIDsPending(prefix, (ids) => { + if (ids.length == 0) return; + let specskill = []; + results[skill.aname] = specskill; + ids.forEach(id => { + let toget = []; + toget.push(prefix + '_' + id + "_name"); + toget.push(prefix + '_' + id + "_ranks"); + toget.push(prefix + '_' + id + "_bonus"); + getAttrsPending(toget, data => { + specskill.push({ + category: cat.aname, + id:id, + prefix:prefix + '_' + id, + aname:skill.aname, + name:data[prefix + '_' + id + "_name"], + bonus:data[prefix + '_' + id + "_bonus"], + ranks:data[prefix + '_' + id+ "_ranks"]}); + }); + }); + }); + }); + }); +} + function levelUpStart(_) { console.log("********** Level up start **********"); pendingInfo(); @@ -9277,15 +9327,13 @@ function levelUpStart(_) { }); // Global scope; as the other is a pending funtion. + let savedskills = []; let savedspelllists = []; let savedtalents = []; let savedstatgains = []; addPendingFunction("Level Up Start body", () => { // So we need to get the profession & Costs - - - dpspent = 0; let catupdates = {} @@ -9309,13 +9357,17 @@ function levelUpStart(_) { } cmPopulateListOptions('cmskill' + skill.aname + 'ranks', costarray); }); + }); + const specialisedranks = {} + addPendingFunction('Levelup: Get specialised skill ranks', () => { + getSpecialisedSkillRanks(specialisedranks); + }); + addPendingFunction("Levelup: Get previous purchases", () => { // On load I should check the list of repeating sections and add // them if (data?.levelup?.repeating) { - const profession = data.profession.values.profession; - const costs = getCostsFromData(profession); for (const index in data.levelup.repeating) { // Need to extract the skillname so I can call addRepeating again const prefix = data.levelup.repeating[index]; @@ -9332,28 +9384,73 @@ function levelUpStart(_) { savedstatgains.push(prefix); continue; } + if (prefix.endsWith("_specializations")) { + savedskills.push(prefix); + continue; + } const match = prefix.match(/cmskill_(.*)_specializations/) - if (!match || match.length < 2) { - rmuerror("Coulnd't match regex against ", prefix, index); - continue; - } + if (!match || match.length < 2) { + rmuerror("Coulnd't match regex against ", prefix, index); + continue; + } + // what match regex const origname = match[0]; + // the capture - the id const skillname = match[1]; + console.log(match, 'wholething', match[0], 'cmskill', match[1]); + + // See if these match the name of any of the skills on the sheet + // (match by user visible name) + const sname = `${sectionname}_specname`; + + // Get the appropriate specialisation (if any) + const thisspecskills = specialisedranks[skillname]; + for (skill in thisspecskills) { + + } +/* const skill = RMUSkills.getSkillByName(skillname) const costarray = generateCostArray(costs[skill.category]); addRepeatingSection(`cmskill${skillname}`, 'specialization', origname, (sectionname) => { console.log("recreate section", sectionname); - const sname = `${sectionname}_specname`; const rname = `${sectionname}_cmskillranks`; cmPopulateListOptions(rname, costarray, data.levelup.values[rname]) setAttrsPending({[sname]: data.levelup.values[sname]}); } - ); + );*/ } } }); + + addPendingFunction('Levelup: Create specialisations from ranks', () => { + console.log('specranks', specialisedranks); + for (const skillname in specialisedranks) { + const specials = specialisedranks[skillname]; + console.log(skillname, specials); + specials.forEach(skill => { + console.log('add repeatin', `cmskill${skill.aname}`, 'specialization', skill.aname); + addRepeatingSection(`cmskill${skill.aname}`, 'specialization', `cmskill_${skill.aname}_specializations`, + (sectionname) => { + const costarray = generateCostArray(costs[skill.category]); + console.log( skill.category, costs[skill.category]); + console.log("recreate section", sectionname); + const longname = `${sectionname}_skillrankscombo`; + const sname = `${sectionname}_specname`; + const rname = `${sectionname}_cmskillranks`; + const bonus = `${sectionname}_cmskillbonus`; + + cmPopulateListOptions(rname, costarray, 0) + setAttrsPending({[sname]: skill.name, + [longname]: `Current ranks ${skill.ranks} Bonus: ${skill.bonus}` + }); + }); + }); + } + }); + + addPendingFunction('Talents add', () => { const data = getCharmancerData(); console.log("data.level.values.current_level"); @@ -9368,6 +9465,7 @@ function levelUpStart(_) { } }); + // FIXME: THis is duplicated below. I hsould make it function const listRanks = {}; { @@ -9523,6 +9621,9 @@ onCheck("mancerfinish:levelup", (ev) => { if (purchase.includes("_talent_")) { continue; } + if (purchase.endsWith("_skillrankscombo")) { + continue; + } if (purchase.includes("spelllist")) { // Spell list, skip it - get cmranks & listname at once. @@ -10412,11 +10513,11 @@ onCheck("clicked:rollstats", function(ev) { const powerlevel = data.powerlevel.values.powerlevel; let reroll = 11; switch (powerlevel) { - case 'Average': reroll = 0; break; - case 'Superior': reroll = 11; break; - case 'Heroic': reroll = 21; break; - case 'Legendary': reroll = 31; break; - case 'Epic': reroll = 41; break; + case 'Average': reroll = 0; break; + case 'Superior': reroll = 11; break; + case 'Heroic': reroll = 21; break; + case 'Legendary': reroll = 31; break; + case 'Epic': reroll = 41; break; } systemRollStats(reroll, powerlevel); }); @@ -10810,7 +10911,8 @@ function saveCostData(pdata, kdata) { { const scosts = pdata['data-skillCost']; for (const [group, cost] of Object.entries(scosts)) { - updates[RMUSkills.getCatByDisplayName(group)?.aname + "_cost"] = cost; + // Costs from compendium are not localised. + updates[RMUSkills.getCatByDisplayNameNoTrans(group)?.aname + "_cost"] = cost; } } { diff --git a/RolemasterUnified_Official/sheet.json b/RolemasterUnified_Official/sheet.json index 2dc97b6a17..f53a18f875 100644 --- a/RolemasterUnified_Official/sheet.json +++ b/RolemasterUnified_Official/sheet.json @@ -8,5 +8,5 @@ "legacy": false, "printable": true, "compendium": "RMU", - "version": "1729631096" + "version": "1730180043" } diff --git a/RolemasterUnified_Official/updates.md b/RolemasterUnified_Official/updates.md index 20f1f4370e..806dc1c451 100644 --- a/RolemasterUnified_Official/updates.md +++ b/RolemasterUnified_Official/updates.md @@ -1,4 +1,17 @@ -# Next +# 2024-10-29 + +- Finally update skills to show specilisations, +- Fix translation issue identified by Jon_joe. + - Seems French has 2 strings translated. And one exposed a bug + - Add tests for case + - improve code flow. My JS has improved. +- Add injury string to direcly rolled cripts +- New combat has moved; now in creatures too +- Improve favourite skills buttons and layout +- Remove some spurious nil class descriptions +- RRs can now click on number or die + +# 2024-10-22 - Spells: Fix a nbs[ instead of a space - Less message spew during creation.