diff --git a/Medievo Oscuro/medievooscuro_v2.html b/Medievo Oscuro/medievooscuro_v2.html index 55ac16c54e..e2c808c013 100644 --- a/Medievo Oscuro/medievooscuro_v2.html +++ b/Medievo Oscuro/medievooscuro_v2.html @@ -69,10 +69,10 @@
BASE
CC
PRO
-
ataque
ATAQUE
+
ataque
-
defensa +
milagro @@ -289,13 +289,18 @@
- + - + + + + + @@ -2159,6 +2164,44 @@ on("change:maldad change:bondad sheet:opened", function (event) { }); +/* DAÑO COMBATE BONO */ +on("change:repeating_armas:armatipo change:bono_cue change:bono_per sheet:opened", function() { + + getSectionIDs("repeating_armas", function(ids) { + + let attrs = ["bono_cue", "bono_per"]; + + ids.forEach(id => { + attrs.push(`repeating_armas_${id}_armatipo`); + }); + + getAttrs(attrs, function(values) { + + let update = {}; + + ids.forEach(id => { + const tipo = values[`repeating_armas_${id}_armatipo`]; + + let bono = 0; + + if (tipo === "@{ataque_cc}") { + bono = parseInt(values["bono_cue"]) || 0; + } + else if (tipo === "@{ataque_pro}") { + bono = parseInt(values["bono_per"]) || 0; + } + else { + // caso "-" + bono = 0; + } + + update[`repeating_armas_${id}_bonodañocombate`] = bono; + }); + + setAttrs(update); + }); + }); +}); \ No newline at end of file