Fix double INT on drone attack rolls, and separate out the different bonuses.

This commit is contained in:
Karlinator
2020-09-01 15:11:44 +02:00
parent bad1316175
commit 930de0f73b
2 changed files with 9 additions and 3 deletions
@@ -42,7 +42,7 @@ fieldset.repeating_drones
.weapon
input(type="hidden", name=`attr_drone_weapon${num}_active`, value="0").hider
.display
button(type="roll", name=`roll_drone_weapon${num}_attack`, value!=`&{template:swn-attack} {{charname=@{drone_name} (^{DRONE})}} {{title=@{drone_weapon${num}_name}}} {{attack=[[1d20 + @{drone_weapon${num}_attack}[AB] + @{intelligence_mod}[Intelligence] @{drone_weapon${num}_burst} @{modifier_query}]]}} {{damage=[[@{drone_weapon${num}_damage} + @{intelligence_mod}[Intelligence] @{drone_weapon${num}_burst}]]}} {{burst=[[0@{drone_weapon${num}_burst}]]}} {{mod=[[0 @{modifier_query}]]}}`).invisible-button
button(type="roll", name=`roll_drone_weapon${num}_attack`, value!=`&{template:swn-attack} {{charname=@{drone_name} (^{DRONE})}} {{title=@{drone_weapon${num}_name}}} {{attack=[[1d20 + @{drone_weapon${num}_skill}[Skill] + @{drone_weapon${num}_ab}[Weapon AB] + @{attack_bonus}[AB] + @{intelligence_mod}[Intelligence] @{drone_weapon${num}_burst} @{modifier_query}]]}} {{damage=[[@{drone_weapon${num}_damage} + @{intelligence_mod}[Intelligence] @{drone_weapon${num}_burst}]]}} {{burst=[[0@{drone_weapon${num}_burst}]]}} {{mod=[[0 @{modifier_query}]]}}`).invisible-button
div
span(name=`attr_drone_weapon${num}_name`).name.space-after
input(type="hidden", name=`attr_drone_weapon${num}_attack`, value="0").add-plus
@@ -55,6 +55,7 @@ fieldset.repeating_drones
|  / 
span(name=`attr_drone_weapon${num}_ammo_max`)
.edit.weapon-grid.rep-grid
input(type="hidden", name=`attr_drone_weapon${num}_skill`, value="0")
+fake-text-input().center
input(type="checkbox", name=`attr_drone_weapon${num}_active`, value="1")
+text-input(`drone_weapon${num}_name`)
@@ -2982,12 +2982,15 @@
`${prefix}_drone_weapon1_ab`,
`${prefix}_drone_weapon1_active`,
`${prefix}_drone_weapon1_attack`,
`${prefix}_drone_weapon1_skill`,
`${prefix}_drone_weapon2_ab`,
`${prefix}_drone_weapon2_active`,
`${prefix}_drone_weapon2_attack`,
`${prefix}_drone_weapon2_skill`,
`${prefix}_drone_weapon3_ab`,
`${prefix}_drone_weapon3_active`,
`${prefix}_drone_weapon3_attack`,
`${prefix}_drone_weapon3_skill`,
]);
}, ["attack_bonus", "intelligence_mod", "skill_pilot", "skill_program"]);
getAttrs(sourceAttrs, v => {
@@ -2998,9 +3001,11 @@
const setting = prefixes.reduce((m, prefix) => {
[1, 2, 3].filter(num => v[`${prefix}_drone_weapon${num}_active`] === "1")
.forEach(num => {
m[`${prefix}_drone_weapon${num}_attack`] = intMod +
((skillMod === -1) ? -2 : skillMod) + attackBonus +
m[`${prefix}_drone_weapon${num}_attack`] = intMod + attackBonus +
((skillMod === -1) ? -2 : skillMod) +
parseInt(v[[`${prefix}_drone_weapon${num}_ab`]] || 0);
m[`${prefix}_drone_weapon${num}_skill`] =
((skillMod === -1) ? -2 : skillMod);
});
return m;
}, {});