diff --git a/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.css b/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.css index 453c0c0b47..b3fd02bc7f 100644 --- a/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.css +++ b/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.css @@ -33,6 +33,7 @@ p { background-color: #ededed; font-family: "Rationale", sans-serif; font-size: 1.2em !important; + min-width: 825px; } /* Tabs */ diff --git a/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.html b/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.html index 20f08688a0..536a5f45ac 100644 --- a/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.html +++ b/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.html @@ -7968,7 +7968,8 @@ Hits
Speed
- + + m @@ -10631,8 +10632,8 @@
@@ -10641,7 +10642,7 @@

Pilot Skill

- DEX Mod + Characteristic Mod Ship DM Temp DM Roll @@ -11188,22 +11189,34 @@
-
- Hardpoint - Type - TL - Power - Range - Ammo - Damage - Traits - DM - # - - -
+ + + + + + + + + + + + + +
+ Hardpoint + Type + TL + Power + Range + Ammo + Damage + Traits + DM + # + + @@ -13008,7 +13021,7 @@
-

Character Sheet Version 1.1.13

+

Character Sheet Version 1.1.14


Assigning Attributes To Tokens

To represent the core character attributes on a token so they can be @@ -19520,7 +19533,7 @@ attrs.animal_name = compendiumData["data-Name"]; attrs.character_name = compendiumData["data-Name"]; attrs.animal_hits = compendiumData["Hits"]; - attrs.animal_speed = compendiumData["Speed"]; + attrs.animal_speed = compendiumData["Speed"].replace('m', ''); console.log("- Processing animal skills: " + compendiumData["Skills"]); @@ -19528,16 +19541,18 @@ removeRepeatingRows("repeating_animalskills"); // Bit hacky but sometimes we have 'Athletics (endurance)+2' so want to space out the mod for parsing let skills = compendiumData["Skills"].replace(")+", ") +").replace(")-", ") -").split(","); - console.log("- Skills- " + skills); + console.log("- Skills: " + skills); skills.forEach((skill, index) => { - console.log("- Skill: " + skill); - let skillRec = skill.trim().split(" "); - let mod = skillRec.pop().replace("+", ""); - let skillName = skillRec.join(" "); + if(skill.trim() !== "None" && skill.trim() !== "") { + console.log("- Skill: " + skill); + let skillRec = skill.trim().split(" "); + let mod = skillRec.pop().replace("+", ""); + let skillName = skillRec.join(" "); - let slotId = generateRowID(); - attrs["repeating_animalskills_" + slotId + "_name"] = skillName; - attrs["repeating_animalskills_" + slotId + "_mod"] = mod; + let slotId = generateRowID(); + attrs["repeating_animalskills_" + slotId + "_name"] = skillName; + attrs["repeating_animalskills_" + slotId + "_mod"] = mod; + } }); // Process attacks (repeating) @@ -19547,14 +19562,39 @@ let attacks = compendiumData["Attacks"].split(","); console.log("- Attacks: " + attacks); attacks.forEach((attack, index) => { - console.log("- Attack: " + attack); - let attackRec = attack.trim().split(" "); - let damage = attackRec.pop().replace(")", "").replace("(", ""); - let attackName = attackRec.join(" "); + if(attack.trim() !== "None" && attack.trim() !== "") { + console.log("- Attack: " + attack); - let slotId = generateRowID(); - attrs["repeating_animalattacks_" + slotId + "_name"] = attackName; - attrs["repeating_animalattacks_" + slotId + "_damage"] = damage.replace("D", "D6"); + // Check if we have damage and parse out + let attackName = attack; + let damage; + + // On very rare occasions we may get damage as e.g. 1Dx1D or 1D6x1D6, process this first + let match = /(\d+D6x\d+D6|\d+Dx\d+D)/.exec(attack); + + if(match) { + damage = match[1].replace("D6", "D").replace("x", "*"); + attackName = attackName.replace(match[0], "").replace(" ", " ").replace("()", "").replace("( ", "(").trim(); + } + else { + // Normal damage + match = /(\d+D6|\d+D3|\d+D)/.exec(attack); + + damage = match ? match[1] : undefined; + if(!damage) { + damage = ""; + } + else { + // Sometimes we have e.g. 2D, sometimes 2D6, we replace below so remove now + damage = damage.replace("D6", "D"); + attackName = attackName.replace(match[0], "").replace(" ", " ").replace("()", "").replace("( ", "(").trim(); + } + } + + let slotId = generateRowID(); + attrs["repeating_animalattacks_" + slotId + "_name"] = attackName.trim(); + attrs["repeating_animalattacks_" + slotId + "_damage"] = damage.replace(/D$/, "D6").trim(); + } }); } @@ -19563,18 +19603,20 @@ let traits = compendiumData["Traits"].split(","); traits.forEach((trait, index) => { - let traitRec = trait.trim(); - let mod = ""; - let traitArr = traitRec.split(" "); - if(traitRec.endsWith(")")) { - // Has a modifier - mod = traitArr.pop().replace(")", "").replace("(", ""); - } - let traitName = traitArr.join(" "); + if(trait !== "None") { + let traitRec = trait.trim(); + let mod = ""; + let traitArr = traitRec.split(" "); + if(traitRec.endsWith(")") || /\d/.test(traitRec)) { + // Has a modifier + mod = traitArr.pop().replace(")", "").replace("(", ""); + } + let traitName = traitArr.join(" "); - let slotId = generateRowID(); - attrs["repeating_animaltraits_" + slotId + "_animaltraits-trait"] = traitName; - attrs["repeating_animaltraits_" + slotId + "_animaltraits-mod"] = mod; + let slotId = generateRowID(); + attrs["repeating_animaltraits_" + slotId + "_animaltraits-trait"] = traitName; + attrs["repeating_animaltraits_" + slotId + "_animaltraits-mod"] = mod; + } }); // Process Behaviour (repeating) @@ -19586,7 +19628,9 @@ attrs["repeating_animalbehaviour_" + slotId + "_animalbehaviour"] = behaviour.trim(); }); - attrs.animal_notes = compendiumData["Description"]; + attrs.animal_notes = compendiumData["Description"].replaceAll("\n", " "); + + console.log("FINAL ATTRS: " + JSON.stringify(attrs, null, 4)); setAttrs(attrs); }); diff --git a/Mongoose Traveller 2e Official/README.md b/Mongoose Traveller 2e Official/README.md index b810a68597..a25d0b004d 100644 --- a/Mongoose Traveller 2e Official/README.md +++ b/Mongoose Traveller 2e Official/README.md @@ -140,5 +140,12 @@ This is the Official Mongoose Traveller 2nd Edition Character Sheet - Added max hits for robot so works on token - Added characteristics panel to Robot +### Version 1.1.14 +- Fixed weapon headers and fields width on resize on Ship Combat tab +- Changed DEX Mod label on Ship Combat Pilot tab to 'Charac. Mod' +- Added Characteristic Mod to initiative roll +- Changed Ship Combat Initiative button text to specify 'Available Thrust' +- Fixed Animal drag and drop parsing +- ![Image](Official%20Mongoose%20Publishing%20Traveller%202nd%20Edition.png) diff --git a/Mongoose Traveller 2e Official/translation.json b/Mongoose Traveller 2e Official/translation.json index e43527252f..492f2d1e4a 100644 --- a/Mongoose Traveller 2e Official/translation.json +++ b/Mongoose Traveller 2e Official/translation.json @@ -189,6 +189,7 @@ "gunnername-u": "Gunner Name", "gunnerskill-u": "Gunner Skill", "dexmod-u": "DEX Mod", + "characteristicmod-u": "Charac. Mod", "custommod-u": "Custom Mod", "custom-u": "Custom", "powerreq-u": "Power Requirements",