diff --git a/Mongoose_Traveller2e/MongooseTraveller.css b/Mongoose_Traveller2e/MongooseTraveller.css index 67ec2c4ce0b7..2c9e5b3dc23a 100644 --- a/Mongoose_Traveller2e/MongooseTraveller.css +++ b/Mongoose_Traveller2e/MongooseTraveller.css @@ -1920,8 +1920,13 @@ sheet-vehicle h3 { margin-bottom: 3px; } +/* Do not know why I've had to do this but header spans just do not line up */ +.sheet-laf-header-offset span:nth-child(n + 3) { + margin-left: -10px; +} + .sheet-laf-weaponlist { - grid-template-columns: 0.3fr 2.5fr 1.25fr 1fr 1fr 1fr 1fr 1fr 1fr; + grid-template-columns: 0.3fr 2fr 0.75fr 1fr 1fr 0.5fr 0.5fr 0.5fr 0.5fr 0.5fr 0.7fr; margin-bottom: 3px; } @@ -1930,14 +1935,17 @@ sheet-vehicle h3 { } .sheet-laf-weaponlist textarea { - grid-column: 1 / 10; -/* height: 30px !important; */ + grid-column: 1 / 12; } .sheet-laf-weaponlist select { width: 85px; } +.sheet-laf-weaponlist input { + width: 100% !important; +} + .sheet-laf-ship { grid-template-columns: 2fr 5fr 1fr 5fr 1fr 1fr 1fr; margin-bottom: 3px; diff --git a/Mongoose_Traveller2e/MongooseTraveller.html b/Mongoose_Traveller2e/MongooseTraveller.html index 4db3cb48421e..142bbbe259a3 100644 --- a/Mongoose_Traveller2e/MongooseTraveller.html +++ b/Mongoose_Traveller2e/MongooseTraveller.html @@ -1956,14 +1956,21 @@

Armour


Weapons

-
- Roll Weapon - Skill Total DM - Damage TL - Range KG - Magazine +
+ Roll + Weapon + Skill Total + DM + Damage + TL + Range + KG + Mag. + Auto + Mode
+ @@ -1978,6 +1985,12 @@

Weapons

+ +
@@ -1995,6 +2008,12 @@

Weapons

+ +
@@ -2012,6 +2031,12 @@

Weapons

+ +
@@ -2029,6 +2054,12 @@

Weapons

+ +
@@ -2046,6 +2077,12 @@

Weapons

+ +
@@ -2063,6 +2100,12 @@

Weapons

+ +
@@ -2082,6 +2125,12 @@

Weapons

+ +
@@ -2670,7 +2719,7 @@

Armour

Weapons

-
+
Roll Weapon Skill Total @@ -2680,8 +2729,10 @@

Weapons

Range KG Magazine + Auto + Mode
-
+
@@ -2695,10 +2746,16 @@

Weapons

+ +
-
+
@@ -2714,6 +2771,12 @@

Weapons

+ +
@@ -6212,30 +6275,65 @@

Trade Log

console.log("MgT2E: Roll weapon: " + JSON.stringify(info)); - getAttrs(["weapon_damage-" + weapon], values => { + getAttrs(["weapon_damage-" + weapon, "weapon_auto-" + weapon, "weapon_automode-" + weapon], values => { + + // Check if auto is set, + let autoValue = +values["weapon_auto-" + weapon]; + console.log("MgT2E: Auto: " + autoValue); + let burstDamage = 0; + let weaponSuffix = ""; + let fullAuto = false; + if(autoValue > 0) { + + // Need to check the mode, single, burst or full-auto, if full auto then need to run the + // roll template multiple times + switch(values["weapon_automode-" + weapon]) { + case "Single": + // normal combat rules + autoValue = 1; + break; + case "Burst": + // Add auto value to damage + burstDamage = autoValue; + autoValue = 1; + break; + case "Full-Auto": + fullAuto = true; + break; + default: + console.log("Unknown value for auto-mode: " + values["weapon_damage-automode-" + weapon]); + } + } + else { + autoValue = 1; + } const wD = formatWeaponDamage(values["weapon_damage-" + weapon]); - startRoll("@{whispertoggle}&{template:combat@{alt_rolltemplate_val}} {{character=@{character_name}}} {{weapon=@{weapon_name-" + weapon + "}}} {{effect=[[0D6]]}} @{ro_default_rolltype} + @{weapon_DM-" + weapon + "}[DM] + @{weapon_skill-" + weapon + "}[Skill] @{ro_default_mod}]]}} {{damage=[[" + wD.weaponDamage + "]]}} {{effect=''}} {{range=@{weapon_range-" + weapon + "}}}", (results) => { - const toHit = results.results.roll.result; - var damage = results.results.damage.result - - console.log("MgT2E: Roll weapon: " + JSON.stringify(results.results.damage)); - var effect = 0; - if(toHit > 8 && !wD.isDestructive) { - damage += (toHit - 8); - effect = toHit - 8; - } - - finishRoll( - results.rollId, - { - roll: toHit, - damage: damage, - effect: effect + for(let i=1; i<=autoValue; i++) { + // If doing Full-Auto then add a suffix + weaponSuffix = fullAuto ? " [" + i + "]" : ""; + startRoll("@{whispertoggle}&{template:combat@{alt_rolltemplate_val}} {{character=@{character_name}}} {{weapon=@{weapon_name-" + weapon + "}" + weaponSuffix + "}} {{effect=[[0D6]]}} @{ro_default_rolltype} + @{weapon_DM-" + weapon + "}[DM] + @{weapon_skill-" + weapon + "}[Skill] @{ro_default_mod}]]}} {{damage=[[" + wD.weaponDamage + "+" + burstDamage + "]]}} {{effect=''}} {{range=@{weapon_range-" + weapon + "}}}", (results) => { + const toHit = results.results.roll.result; + var damage = results.results.damage.result + + console.log("MgT2E: Roll weapon: " + JSON.stringify(results.results.damage)); + var effect = 0; + if(toHit > 8 && !wD.isDestructive) { + damage += (toHit - 8); + effect = toHit - 8; } - ); - }); + + finishRoll( + results.rollId, + { + roll: toHit, + damage: damage, + effect: effect + } + ); + }); + } }); }); }); @@ -6248,29 +6346,67 @@

Trade Log

const weaponSkill = "repeating_weapons_" + rowId + "_weapon_skill-rep"; const weaponDamage = "repeating_weapons_" + rowId + "_weapon_damage-rep"; const weaponRange = "repeating_weapons_" + rowId + "_weapon_range-rep"; - - getAttrs([weaponDamage], values => { + const weaponAuto = "repeating_weapons_" + rowId + "_weapon_auto-rep"; + const weaponAutoMode = "repeating_weapons_" + rowId + "_weapon_automode-rep"; + + getAttrs([weaponDamage, weaponAuto, weaponAutoMode], values => { + + // Check if auto is set, + let autoValue = +values[weaponAuto]; + console.log("MgT2E: Auto: " + autoValue); + let burstDamage = 0; + let weaponSuffix = ""; + let fullAuto = false; + if(autoValue > 0) { + + // Need to check the mode, single, burst or full-auto, if full auto then need to run the + // roll template multiple times + switch(values[weaponAutoMode]) { + case "Single": + // normal combat rules + autoValue = 1; + break; + case "Burst": + // Add auto value to damage + burstDamage = autoValue; + autoValue = 1; + break; + case "Full-Auto": + fullAuto = true; + break; + default: + console.log("Unknown value for auto-mode: " + values[weaponAutoMode]); + } + } + else { + autoValue = 1; + } const wD = formatWeaponDamage(values[weaponDamage]); - startRoll("@{whispertoggle}&{template:combat@{alt_rolltemplate_val}} {{character=@{character_name}}} {{weapon=@{" + weaponName + "}}} {{effect=[[0D6]]}} @{ro_default_rolltype} + @{" + weaponDM + "}[DM] + @{" + weaponSkill + "}[Skill] @{ro_default_mod}]]}} {{damage=[[" + wD.weaponDamage + "]]}} {{range=@{" + weaponRange + "}}}", (results) => { - const toHit = results.results.roll.result; - var damage = results.results.damage.result - var effect = 0; - if(toHit > 8 && !wD.isDestructive) { - damage += (toHit - 8); - effect = toHit - 8; - } + for(let i=1; i<=autoValue; i++) { + // If doing Full-Auto then add a suffix + weaponSuffix = fullAuto ? " [" + i + "]" : ""; - finishRoll( - results.rollId, - { - roll: toHit, - damage: damage, - effect: effect + startRoll("@{whispertoggle}&{template:combat@{alt_rolltemplate_val}} {{character=@{character_name}}} {{weapon=@{" + weaponName + "}" + weaponSuffix + "}} {{effect=[[0D6]]}} @{ro_default_rolltype} + @{" + weaponDM + "}[DM] + @{" + weaponSkill + "}[Skill] @{ro_default_mod}]]}} {{damage=[[" + wD.weaponDamage + "+" + burstDamage + "]]}} {{range=@{" + weaponRange + "}}}", (results) => { + const toHit = results.results.roll.result; + var damage = results.results.damage.result + var effect = 0; + if(toHit > 8 && !wD.isDestructive) { + damage += (toHit - 8); + effect = toHit - 8; } - ); - }); + + finishRoll( + results.rollId, + { + roll: toHit, + damage: damage, + effect: effect + } + ); + }); + } }); }); @@ -9790,6 +9926,10 @@

Trade Log

+ + + +
diff --git a/Mongoose_Traveller2e/translation.json b/Mongoose_Traveller2e/translation.json index 717ca9f34d74..d6f2d9e872ca 100644 --- a/Mongoose_Traveller2e/translation.json +++ b/Mongoose_Traveller2e/translation.json @@ -87,13 +87,15 @@ "weaponstitle-u": "Weapons", "weaponroll-u": "Roll", "weaponweapon-u": "Weapon", - "weaponskilltotal-u": "Skill Total", + "weaponskilltotal-u": "Skill", "weapondicemod-u": "DM", "weapondamage-u": "Damage", "weapontechlevel-u": "TL", "weaponrange-u": "Range", "weaponweight-u": "KG", - "weaponmagazine-u": "Magazine", + "weaponmagazine-u": "Mag.", + "weaponauto-u": "Auto", + "weaponautomode-u": "Mode", "powerstitle-u": "Powers", "notestitle-u": "Notes", "legacy-u": "Legacy",