diff --git a/Forge/Forge.css b/Forge/Forge.css index f96d154d4f..32f5b2df6f 100644 --- a/Forge/Forge.css +++ b/Forge/Forge.css @@ -89,7 +89,6 @@ h3 { .sheet-rolltemplate-rolllow table, .sheet-rolltemplate-roll table, .sheet-rolltemplate-spell table, -.sheet-rolltemplate-weapondmg table, .sheet-rolltemplate-weapon table{ background-color:antiquewhite; border:1px solid #c1875d; @@ -103,7 +102,6 @@ h3 { .sheet-rolltemplate-rolllow table th, .sheet-rolltemplate-roll table th, .sheet-rolltemplate-spell table th, -.sheet-rolltemplate-weapondmg table th, .sheet-rolltemplate-weapon table th{ background-color:antiquewhite; text-align:center; @@ -115,7 +113,6 @@ h3 { .sheet-rolltemplate-rolllow table td, .sheet-rolltemplate-roll table td, .sheet-rolltemplate-spell table td, -.sheet-rolltemplate-weapondmg table td, .sheet-rolltemplate-weapon table td{ padding: 2px; } @@ -124,7 +121,6 @@ h3 { .sheet-rolltemplate-rolllow table .inlinerollresult, .sheet-rolltemplate-roll table .inlinerollresult, .sheet-rolltemplate-spell table .inlinerollresult, -.sheet-rolltemplate-weapondmg table .inlinerollresult, .sheet-rolltemplate-weapon table .inlinerollresult{ border:none !important; background-color:inherit; diff --git a/Forge/Forge.html b/Forge/Forge.html index b4c222fee0..d302ec5011 100644 --- a/Forge/Forge.html +++ b/Forge/Forge.html @@ -56,7 +56,7 @@
- +
@@ -66,14 +66,22 @@
- +
- +
+
+ + + + + + +
@@ -88,32 +96,22 @@

Utility

- - - - - + + + -
-
- - +
/
- - +
/
-
-
-
- -
-
-
-
- +
+ + + +
@@ -121,25 +119,28 @@

Points

- - + + - - + + +
- - - - - - - - - - + + + + + + + + + + + +
@@ -149,27 +150,68 @@

Attacks

- - - - - - - + + + +   + + + + +
+ + - - - - + + +   + + + + + +
+
+
+ +
+
+ +

Abilities

+
+ + + + + + + + +
+
+
+
- - - + + + + + + + + + + +
@@ -180,7 +222,7 @@

Armor

- +
@@ -189,8 +231,8 @@
- - + +
@@ -200,18 +242,18 @@

Passives

- +
- +
-

Gear

+

Gear

Silver
@@ -223,8 +265,8 @@
- - + +
@@ -264,9 +306,49 @@ ); }); }); + + on("change:repeating_attacks:bdmg remove:repeating_attacks", function(eventInfo) { + getRepeatingFields("repeating_attacks", ["bdmg"], function(fieldValues){ + setAttrs({ + "foo_dmgc": sumFieldValues(fieldValues)*5 + }); + }); + }); + + on("remove:repeating_spells", function(eventinfo) { + getRepeatingFields("repeating_spells", ["adc"], function(fieldValues){ + setAttrs({ + "foo_atks": sumFieldValues(fieldValues) + }); + }); + }); + + on("change:repeating_armors:armorp remove:repeating_armors", function(eventinfo) { + getRepeatingFields("repeating_armors", ["armorp"], function(fieldValues){ + setAttrs({ + "foo_armor": sumFieldValues(fieldValues)*2 + }); + }); + }); + + on("change:repeating_items:slots remove:repeating_items", function(eventInfo) { + getRepeatingFields("repeating_items", ["slots"], function(fieldValues){ + setAttrs({ + "foo_slotsused": sumFieldValues(fieldValues) + }); + }); + }); + + on("change:repeating_passives:passcp remove:repeating_passives", function(eventInfo) { + getRepeatingFields("repeating_passives", ["passcp"], function(fieldValues){ + setAttrs({ + "foo_passives": sumFieldValues(fieldValues) + }); + }); + }); function sumFieldValues(fieldValues){ - let sum = 0; + var sum = 0; Object.values(fieldValues).forEach(element => sum += parseInt(element)||0); return sum; } @@ -277,9 +359,9 @@ callback(0); return; } - let fieldArray = []; - for (let j = 0; j < fieldNames.length; j++) { - for (let i = 0; i < ids.length; i++) { + var fieldArray = []; + for (var j = 0; j < fieldNames.length; j++) { + for (var i = 0; i < ids.length; i++) { fieldArray.push(sectionName + '_' + ids[i] + '_' + fieldNames[j]); } } @@ -289,10 +371,6 @@ }); } - function getCostOfPower(dc){ - return Math.max(0,Math.ceil((parseInt(dc))/5)); - } - on('change:iq change:dx change:emax' , function(eventInfo) { getAttrs( ["e"] , function(values) { @@ -312,77 +390,128 @@ ); }); }); - - on("change:repeating_attacks:pdc", function(eventInfo) { - getRepeatingFields("repeating_attacks", ["pdc"], function(fieldValues){ - let sendValues = {"foo_powers":0}; - let idName; - let propName; - let last_Ind; - for (const property in fieldValues) { - last_Ind = property.lastIndexOf("_"); - idName = property.substring(0, last_Ind); - propName = property.substring(last_Ind+1, property.length); - sendValues[idName + "_foo_e"] = getCostOfPower(fieldValues[property]); - if(parseInt(fieldValues[property])> 0){ - sendValues["foo_powers"] += 1; - } - } - setAttrs( sendValues , {silent:true} ); - }); + + function calculateChance(dc, subtractStat){ + if(dc == subtractStat + 1) + return 95; + return 100*Math.max(0, (20 - Math.max(0, dc - subtractStat-1)))/20; + } + + on("change:targetr", function(eventInfo){ + getAttrs( + ["iq", "dx", "tuf", "targetr"] + , function(values) { + var sendValues = {}; + sendValues["foo_tufperc"] = String(calculateChance(parseInt(values.targetr), parseInt(values.tuf))) + "%"; + sendValues["foo_dxperc"] = String(calculateChance(parseInt(values.targetr), parseInt(values.dx)))+ "%"; + sendValues["foo_iqperc"] = String(calculateChance(parseInt(values.targetr), parseInt(values.iq)))+ "%"; + setAttrs(sendValues,{silent:true}); + }); }); + + on("change:dx change:iq change:tuf", function(eventInfo) { + getAttrs( + ["iq", "dx", "tuf", "targetr"] + , function(values) { + var sendValuesFirst = {}; + sendValuesFirst["foo_tufperc"] = String(calculateChance(parseInt(values.targetr), parseInt(values.tuf))) + "%"; + sendValuesFirst["foo_dxperc"] = String(calculateChance(parseInt(values.targetr), parseInt(values.dx)))+ "%"; + sendValuesFirst["foo_iqperc"] = String(calculateChance(parseInt(values.targetr), parseInt(values.iq)))+ "%"; + setAttrs( sendValuesFirst , {silent:true} ); + getRepeatingFields("repeating_spells", ["adc", "dmg"], function(fieldValues){ + var sendValues = {}; + fieldValues.iq = values.iq; + fieldValues.dx = values.dx; + var incomingAtk; + for(const property in fieldValues){ + if(property[0] == 'r'){ + incomingAtk = property.substring(0, property.lastIndexOf("_")); + if(sendValues[incomingAtk + "_type"] == undefined){ + setTypeAndSuccess(sendValues, incomingAtk, fieldValues); + } + } + } + setAttrs(sendValues,{silent:true}); + }); + getRepeatingFields("repeating_attacks", ["type", "dmg"], function(fieldValues){ + var sendValues = {}; + var incomingAtk; + for(const property in fieldValues){ + if(property[property.length - 1] == 'e'){ + incomingAtk = property.substring(0, property.lastIndexOf("_")); + var subtractStat = getSubtractStat(fieldValues[incomingAtk + "_type"], values); + sendValues[incomingAtk + "_foo_success"] = calculateChance(parseInt(fieldValues[incomingAtk + "_dmg"])*2, subtractStat); + } + } + setAttrs(sendValues,{silent:true}); + }); + }); + }); + + function getSubtractStat(type, values){ + if(type == "@{tuf}"){ + return parseInt(values.tuf); + } + if(type == "@{dx}"){ + return parseInt(values.dx); + } + if(type == "@{iq}"){ + return parseInt(values.iq); + } + } - on("change:repeating_attacks:pdc change:repeating_attacks:dmg", function(eventInfo) { - let sendValues = {}; + on("change:repeating_attacks:dmg change:repeating_attacks:type", function(eventInfo) { const last_Ind = eventInfo.sourceAttribute.lastIndexOf("_"); const incomingAtk = eventInfo.sourceAttribute.substring(0, last_Ind); - getAttrs([ - incomingAtk + "_pdc", incomingAtk + "_dmg" - ] + + getAttrs( + [incomingAtk + "_type", incomingAtk + "_dmg", "iq", "dx", "tuf"] , function(values) { - // making sure we didnt go over 60 - if(parseInt(values[incomingAtk + "_pdc"]) + parseInt(values[incomingAtk + "_dmg"])*2 > 60){ - sendValues[eventInfo.sourceAttribute] = eventInfo.previousValue; - values[incomingAtk + eventInfo.sourceAttribute.substring(last_Ind, eventInfo.sourceAttribute.length)] = eventInfo.previousValue; - } - // set buttons - if(parseInt(values[incomingAtk + "_pdc"]) >= parseInt(values[incomingAtk + "_dmg"])){ - sendValues[incomingAtk + "_type"] = "@{iq}" - }else{ - sendValues[incomingAtk + "_type"] = "@{dx}" - } + var sendValues = {}; + var subtractStat = getSubtractStat(values[incomingAtk + "_type"], values); + sendValues[incomingAtk + "_foo_success"] = calculateChance(parseInt(values[incomingAtk + "_dmg"])*2, subtractStat); setAttrs( sendValues , {silent:true} ); }); }); - on("change:repeating_items:slots", function(eventInfo) { - getRepeatingFields("repeating_items", ["slots"], function(fieldValues){ - setAttrs({ - "foo_slotsused": sumFieldValues(fieldValues) - }); - }); - }); - - on("change:repeating_armors:armor", function(eventInfo) { - getRepeatingFields("repeating_armors", ["armor"], function(fieldValues){ - let arSum = 0; - for (const property in fieldValues) { - arSum += parseInt(fieldValues[property])*2; - } - setAttrs({ - "foo_armor": arSum - }); - }); - }); - - on("change:repeating_passives:pass_cp", function(eventInfo) { - getRepeatingFields("repeating_passives", ["pass_cp"], function(fieldValues){ - setAttrs({ - "foo_passives": sumFieldValues(fieldValues) + on("change:repeating_spells:adc change:repeating_spells:dmg", function(eventInfo) { + + var sendValues = {}; + + const last_Ind = eventInfo.sourceAttribute.lastIndexOf("_"); + const incomingAtk = eventInfo.sourceAttribute.substring(0, last_Ind); + + getAttrs( + [incomingAtk + "_adc", incomingAtk + "_dmg", "iq", "dx"] + , function(values) { + var totalDC = parseInt(values[incomingAtk + "_adc"]) + parseInt(values[incomingAtk + "_dmg"])*2; + // making sure we didnt go over 60 + if(totalDC > 60){ + sendValues[eventInfo.sourceAttribute] = eventInfo.previousValue; + eventInfo.newValue = eventInfo.previousValue; + values[incomingAtk + eventInfo.sourceAttribute.substring(last_Ind, eventInfo.sourceAttribute.length)] = eventInfo.previousValue; + } + + setTypeAndSuccess(sendValues, incomingAtk, values); + setAttrs( sendValues , {silent:true} ); + getRepeatingFields("repeating_spells", ["adc"], function(fieldValues){ + setAttrs({ + "foo_atks": sumFieldValues(fieldValues) + }); }); }); }); + function setTypeAndSuccess(sendValues, incomingAtk, values){ + if(parseInt(values[incomingAtk + "_adc"]) >= parseInt(values[incomingAtk + "_dmg"])){ + sendValues[incomingAtk + "_type"] = "@{iq}" + sendValues[incomingAtk + "_foo_success"] ="IQ: " + String(calculateChance(parseInt(values[incomingAtk + "_adc"]) + parseInt(values[incomingAtk + "_dmg"])*2, parseInt(values.iq))) + "%"; + }else{ + sendValues[incomingAtk + "_type"] = "@{dx}" + sendValues[incomingAtk + "_foo_success"] ="DX: " + String(calculateChance(parseInt(values[incomingAtk + "_adc"]) + parseInt(values[incomingAtk + "_dmg"])*2, parseInt(values.dx))) + "%"; + } + } + on("sheet:opened", function(eventInfo){ getAttrs([ "first" @@ -400,9 +529,8 @@ ,"emax":0 ,"gold":100 ,"foo_armor":0 - ,"foo_dmg":0 ,"foo_passives":0 - ,"foo_powers":0 + ,"foo_atks":0 } , {silent:true} ); @@ -427,7 +555,7 @@ {{#rollTotal() roll 20}} CRIT SUCCESS! ({{roll}})
- You succeed, and get really lucky! Optionally you can gamble with a high or low. Success means you double the power. Fail means you just succeed. + You succeed, and get really lucky! Optionally you can gamble with a high or low. Success means you Double Crit. Fail means you just succeed. {{/rollTotal() roll 20}} {{#rollBetween() roll 2 19}} @@ -467,19 +595,60 @@ {{#rollWasCrit() roll}} CRIT SUCCESS! ({{roll}})
- Your attack auto hits. Double Power or Dmg. No E cost. + Your attack auto hits. Double Dmg {{dmg}} + {{dmg}}. + {{/rollWasCrit() roll}} + + {{#rollWasFumble() roll}} + CRIT FAIL! ({{roll}})
+ Your attack auto fails. Succeed a "high or low" or drop your weapon or fall prone. + {{/rollWasFumble() roll}} + + {{#rollBetween() roll 2 19}} + + {{#rollLess() total diff}} + {{total}} Fails.... Action wasted. + {{/rollLess() total diff}} + + {{#^rollLess() total diff}} + {{total}} Success.
+ Dmg: {{dmg}} + {{/^rollLess() total diff}} + + {{/rollBetween() roll 2 19}} + + + + + + + + + + + + + + +
+ {{name}} attacks with {{atkname}} Difficulty: {{diff}} +
+
+
+ {{#rollWasCrit() roll}} + CRIT SUCCESS! ({{roll}})
+ Your attack auto hits. Double Ability or Dmg. No E cost. {{#^rollTotal() dmg 0}}
Dmg: {{dmg}} {{/^rollTotal() dmg 0}} - {{#^rollTotal() pdc 0}} + {{#^rollTotal() adc 0}}
- Power: Subtract {{cost}} E. + Ability: Subtract {{cost}} E.
- {{power}} - {{/^rollTotal() pdc 0}} + {{ability}} + {{/^rollTotal() adc 0}}
- Optionally, gamble with a High-or-Low for even more Powers. A Fail loses all Crits. + Optionally, gamble with a High-or-Low for even more Benefits. A Fail loses all Crits. {{/rollWasCrit() roll}} {{#rollWasFumble() roll}} @@ -499,12 +668,12 @@
Dmg: {{dmg}} {{/^rollTotal() dmg 0}} - {{#^rollTotal() pdc 0}} + {{#^rollTotal() adc 0}}
- Power: Subtract {{cost}} E. + Ability: Subtract {{cost}} E.
- {{power}} - {{/^rollTotal() pdc 0}} + {{ability}} + {{/^rollTotal() adc 0}} {{/^rollLess() total diff}} {{/rollBetween() roll 2 19}} diff --git a/Forge/Forge.jpg b/Forge/Forge.jpg index f7c2f46374..874a98eeb5 100644 Binary files a/Forge/Forge.jpg and b/Forge/Forge.jpg differ