diff --git a/Alien Roleplaying Game/Alien-Roleplaying-Game.html b/Alien Roleplaying Game/Alien-Roleplaying-Game.html index d75d9c90fd..88cc09d78e 100644 --- a/Alien Roleplaying Game/Alien-Roleplaying-Game.html +++ b/Alien Roleplaying Game/Alien-Roleplaying-Game.html @@ -6,10 +6,11 @@ v2.0 Richard W: Added ship tab v2.01 Richard W: Fixed Rolltemplate AllProps and Stress hits v3.00 Richard W: Added encumbrance and list tab indicators, API dice rolls - v3.01 Richard W: AFixed roll names to make macros work + v3.01 Richard W: Fixed roll names to make macros work + v3.02 Richard W: Fixed armament roll rangemod to calculate on load --> - + @@ -1745,7 +1746,7 @@
-
@@ -1888,23 +1889,35 @@ --> -
+
- v3.01
(2022-01-10)
+ v3.02
(2022-01-19)
-
- Fixed macros not working due to roll names being duplicated. +
+ Fixed armament roll issue by calculating rangemod at sheet load.
+
+
+
+ v3.01
(2022-01-10)
+
+
+
+ Fixed macros not working due to roll names being duplicated. +
+
+
+
v3.00
(2021-12-28)
-
+
Added configuration tab for sheet level options and customizations, like input fields and background image.
-
+
Added support for API rolls using the Alien RPG dice roller script. This requires a Pro account.
@@ -3039,8 +3052,8 @@ /* */ // CALCULATE Health on("change:strength change:tough sheet:opened", (eventinfo) => { - clog("Change detected: Health"); - clog(`Eventinfo: ${JSON.stringify(eventinfo)}`); + //clog("Change detected: Health"); + //clog(`Eventinfo: ${JSON.stringify(eventinfo)}`); getAttrs(["strength", "tough", "health_calc"], (values) => { const strength = int(values.strength), tough = int(values.tough), @@ -3117,7 +3130,7 @@ const food = Math.ceil(int(values.food)/4), water = Math.ceil(int(values.water)/4), encumb = food + water; - clog(`Food ${food}, water ${water} and encumberance ${encumb}`); + //clog(`Food ${food}, water ${water} and encumberance ${encumb}`); setAttrs({ encumbrance_consum: encumb }); @@ -3137,16 +3150,16 @@ carrycap = (strength*2) + packmule, config = values.config_advencumbrance, encumb = int(values.encumbrance); - clog(`Carry cap and pack mule: pack mule ${packmule}, strength ${strength} and carry cap ${carrycap}`); - clog(`Test total ${total} for nonzero value: ${total != 0}`); - clog(`advanced encumbrance: ${values.config_advencumbrance}`); + //clog(`Carry cap and pack mule: pack mule ${packmule}, strength ${strength} and carry cap ${carrycap}`); + //clog(`Test total ${total} for nonzero value: ${total != 0}`); + //clog(`advanced encumbrance: ${values.config_advencumbrance}`); var overencumbered = 0, overloaded = 0, total = 0; ( config == "on" ) ? total = encumb_calc : total = encumb; ( total > carrycap ) ? overencumbered = 1 : overencumbered = 0; ( total > (carrycap*2) ) ? overloaded = 1 : overloaded = 0; - clog(`Manual encumbrance is ${encumb}, calculated encumbrance is ${encumb_calc} and total is ${total}`); - clog(`Overencumbered: ${total > carrycap}`); - clog(`overloaded: ${total > (carrycap*2)}`); + //clog(`Manual encumbrance is ${encumb}, calculated encumbrance is ${encumb_calc} and total is ${total}`); + //clog(`Overencumbered: ${total > carrycap}`); + //clog(`overloaded: ${total > (carrycap*2)}`); //if ( total > carrycap ) overencumbered = 1; //if ( total > (carrycap*2) ) overloaded = 1; //if ( encumb > carrycap ) overenc_manual = 0; @@ -3169,7 +3182,7 @@ const target = arma+"_targetrange"; const rangemod = arma+"_rangemod"; //clog("Armament: "+arma+" Target: "+target+" Range mod: "+rangemod); - on(`change:${target}`, (eventInfo) => { + on(`change:${target} sheet:opened`, (eventInfo) => { getAttrs([target, rangemod], (values) => { //clog("Armament changed: "+target+" value: "+values[target]+" current range mod: "+values[rangemod]); var actual = 0; @@ -3235,7 +3248,7 @@ // Set Ship logs 2nd tab indicator on(`change:log16 change:log17 change:log18 change:log19 change:log20 change:log21 change:log22 change:log23 change:log24 change:log25 change:log26 change:log27 change:log28 change:log29 change:log30 sheet:opened`, (eventInfo) => { getAttrs(["log16", "log17", "log18", "log19", "log20", "log21", "log22", "log23", "log24", "log25", "log26", "log27", "log28", "log29", "log30"], (values) => { - clog("log values for button status: "+JSON.stringify(values)); + //clog("log values for button status: "+JSON.stringify(values)); const button = "logs2_tab"; var active = "-"; @@ -3243,10 +3256,10 @@ if( values[`log${i}`] != "" ) { active = "II"; } - clog("value: "+ JSON.stringify(values[`log${i}`]) +", active: "+ active); + //clog("value: "+ JSON.stringify(values[`log${i}`]) +", active: "+ active); } - clog("active eor : "+active); + //clog("active eor : "+active); setAttrs({ [button]: active },{silent:true}); @@ -3257,7 +3270,7 @@ // Set Ship logs 3rd tab indicator on(`change:log31 change:log32 change:log33 change:log34 change:log35 change:log36 change:log37 change:log38 change:log39 change:log40 change:log41 change:log42 change:log43 change:log44 change:log45 sheet:opened`, (eventInfo) => { getAttrs(["log31", "log32", "log33", "log34", "log35", "log36", "log37", "log38", "log39", "log40", "log41", "log42", "log43", "log44", "log45"], (values) => { - clog("log values for button status: "+JSON.stringify(values)); + //clog("log values for button status: "+JSON.stringify(values)); const button = "logs3_tab"; var active = "-"; @@ -3265,10 +3278,10 @@ if( values[`log${i}`] != "" ) { active = "III"; } - clog("value: "+ JSON.stringify(values[`log${i}`]) +", active: "+ active); + //clog("value: "+ JSON.stringify(values[`log${i}`]) +", active: "+ active); } - clog("active eor : "+active); + //clog("active eor : "+active); setAttrs({ [button]: active },{silent:true}); @@ -3279,10 +3292,10 @@ talents = {"one": "I", "two": "II", "three": "III", "four": "IV", "five": "V", "six": "VI", "seven": "VII", "eight": "VIII"}; _.each(Object.keys(talents), (tal) => { on(`change:talent_${tal} sheet:opened`, function() { - clog(`Current talent: ${tal}, current value: ${talents[tal]}`); + //clog(`Current talent: ${tal}, current value: ${talents[tal]}`); getAttrs([`talent_${tal}`], function(v){ var talentname = v[`talent_${tal}`]; - clog("Talent output: "+ (talentname.length > 0) ? talents[`${tal}`] : "-"); + //clog("Talent output: "+ (talentname.length > 0) ? talents[`${tal}`] : "-"); var txt = (talentname.length > 0) ? talents[`${tal}`] : "-"; setAttrs({[`tal_${tal}`]: txt}); });