+
@@ -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",