diff --git a/Dark Heresy Advanced 2nd Edition/API Scripts/DH_Degrees_Weapons.js b/Dark Heresy Advanced 2nd Edition/API Scripts/DH_Degrees_Weapons.js index 20830e1f6d..26fbf2dc4e 100644 --- a/Dark Heresy Advanced 2nd Edition/API Scripts/DH_Degrees_Weapons.js +++ b/Dark Heresy Advanced 2nd Edition/API Scripts/DH_Degrees_Weapons.js @@ -11,33 +11,72 @@ //Rolls a d100 and calculates the success or fail results to the chat window. var Roll40k = Roll40k || (function(){ - - var rollResultForRoll40k = function (token, attribute, modifier) { - var roll = randomInteger(100); - var modTarget = parseInt(attribute) + parseInt(modifier); - var output1 = token + ' has a modified target of ' + modTarget + ' and rolled a ' + roll + '. '; - var output2, degOfSuc; - //Form output message based on result - if (roll === 1) { - output2 = '' + token + ' rolled a 1 and automatically succeeds by 1 degree.'; - } - else if (roll === 100) { - output2 = '' + token + ' rolled a 100 and automatically fails by 1 degree.'; - } - else if (roll <= modTarget) { - degOfSuc = Math.floor((modTarget - roll) / 10) + 1; - output2 = '' + token + ' succeeds by ' + degOfSuc + ' degree(s).'; - } - else { - degOfSuc = Math.floor((roll - modTarget) / 10) + 1; - output2 = '' + token + ' fails by ' + degOfSuc + ' degree(s).'; - } - //Return output - return output1 + '

' + output2; - }, - processInlinerolls = function(msg) { - if (_.has(msg, 'inlinerolls')) { - return _.chain(msg.inlinerolls) + + //Addition of tracking for used Psy Rating to use in flavor text and for Psy Damage roll if needed. Created by Oosh. + on('ready', () => { + const rxRoll = /^!roll40k\s/i; + const rxLabel = /(\d+)\[mymod\]/i; + + on('chat:message', (msg) => { + if (rxRoll.test(msg.content) && msg.inlinerolls) { + let sender = msg.who.replace(/\(gm\)/i, ''); + + // Grab and verify data proceeding [mymod] is added. + reqRoll = msg.inlinerolls.find(r => rxLabel.test(r.expression)); + if (!reqRoll) return /*sendChat('modifierBot', `/w "${sender}" Something went horribly wrong in reqRoll. Please reinstall universe.`)*/; + + // Grab the query value and set to a variable. + psyU = reqRoll.expression.match(rxLabel)[1]; + if (!psyU) return /*sendChat('modifierBot', `/w "${sender}" Something went horribly wrong in psyU. Please reinstall universe.`)*/; + + // Grab the @{character_name} reference from the roll expression + let charName = msg.content.match(/^!roll40k\s+([^,]+)/i)[1]; + let char = (findObjs({type: 'character', name: charName})||[])[0] + if (!char) return sendChat('modifierBot', `/w "${sender}" Something went horribly wrong. Please reinstall universe.`); + let charId = char.id; + + // Update the attribute if it exists, or create it if it doesn't + let attr = (findObjs({type: 'attribute', characterid: charId, name: 'psyuse'})||[])[0]; + if (!attr) createObj('attribute', {characterid: charId, name:'psyuse', current: psyU}); + else attr.set({current: psyU}); + } + }); + + var rollResultForRoll40k = function (token, attribute, modifier) { + var roll = randomInteger(100); + var modTarget = parseInt(attribute) + parseInt(modifier); + var output2 = token + ' has a modified target of ' + modTarget + ' and rolled a ' + roll + '. '; + var output3, degOfSuc; + //Form output message based on result + if (roll === 1) { + degOfSuc = Math.floor((modTarget - roll) / 10) + 1; + output3 = '' + token + ' rolled a 1 and critically succeeds with ' + degOfSuc + ' degree(s)!'; + } + else if (roll === 100) { + degOfSuc = Math.floor((roll - modTarget) / 10) + 1; + output3 = '' + token + ' rolled a 100 and critically fails with ' + degOfSuc + ' degree(s)!'; + } + else if (roll <= modTarget) { + degOfSuc = Math.floor((modTarget - roll) / 10) + 1; + output3 = '' + token + ' succeeds by ' + degOfSuc + ' degree(s).'; + } + else { + degOfSuc = Math.floor((roll - modTarget) / 10) + 1; + output3 = '' + token + ' fails by ' + degOfSuc + ' degree(s).'; + } + //Return output: modified to have psy and non-psy output. + if (!reqRoll) { + log("weapon output"); + return output2 + '

' + output3; + }else { + log("psy output"); + var output1 = 'Psy Rating: ' + psyU + ''; + return output1 + '

' + output2 + '

' + output3; + } + }, + processInlinerolls = function(msg) { + if (_.has(msg, 'inlinerolls')) { + return _.chain(msg.inlinerolls) .reduce(function(previous, current, index) { previous['$[[' + index + ']]'] = current.results.total || 0; return previous; @@ -46,27 +85,29 @@ var Roll40k = Roll40k || (function(){ return previous.replace(index, current); }, msg.content) .value(); - } else { - return msg.content; - } - }; + } else { + return msg.content; + } + }; - /** Interpret the chat commands. **/ - on('chat:message', function (msg) { - 'use strict'; - var cmdName = '!roll40k '; - if (msg.type === 'api' && msg.content.indexOf(cmdName) !== -1) { - let content = processInlinerolls(msg); - var paramArray = content.slice(cmdName.length).split(','); - if (paramArray.length !== 3) { - sendChat(msg.who, '/w ' + msg.who + ' You must specify three comma-separated ' + - 'parameters for the !roll40k command.'); + /** Interpret the chat commands. **/ + on('chat:message', function (msg) { + 'use strict'; + var cmdName = '!roll40k '; + if (msg.type === 'api' && msg.content.indexOf(cmdName) !== -1) { + let content = processInlinerolls(msg); + var paramArray = content.slice(cmdName.length).split(','); + if (paramArray.length !== 3) { + sendChat(msg.who, '/w ' + msg.who + ' You must specify three comma-separated ' + + 'parameters for the !roll40k command.'); + } + else { + log("Success!"); + var result = rollResultForRoll40k(paramArray[0].trim(), + paramArray[1].trim(), paramArray[2].trim()); + sendChat(msg.who, result); + } } - else { - var result = rollResultForRoll40k(paramArray[0].trim(), - paramArray[1].trim(), paramArray[2].trim()); - sendChat(msg.who, result); - } - } + }); }); }()) \ No newline at end of file diff --git a/Dark Heresy Advanced 2nd Edition/darkheresy2ndedition.css b/Dark Heresy Advanced 2nd Edition/darkheresy2ndedition.css index fbd2212109..6a3d392e11 100644 --- a/Dark Heresy Advanced 2nd Edition/darkheresy2ndedition.css +++ b/Dark Heresy Advanced 2nd Edition/darkheresy2ndedition.css @@ -13,7 +13,8 @@ .charsheet input.sheet-tab5:checked ~ div.sheet-section-journal, .charsheet input.sheet-tab6:checked ~ div.sheet-section-vehicles, .charsheet input.sheet-tab7:checked ~ div.sheet-section-psykana, -.charsheet input.sheet-tab8:checked ~ div.sheet-section-social { +.charsheet input.sheet-tab8:checked ~ div.sheet-section-social, +.charsheet input.sheet-tab9:checked ~ div.sheet-section-ship { display: block; } @@ -63,6 +64,7 @@ .charsheet input.sheet-tab6:checked + span.sheet-tab6, .charsheet input.sheet-tab7:checked + span.sheet-tab7, .charsheet input.sheet-tab8:checked + span.sheet-tab8, +.charsheet input.sheet-tab9:checked + span.sheet-tab9, .charsheet input.sheet-tab99:checked + span.sheet-tab99 { background: #6d131b; color: #eaeaea; diff --git a/Dark Heresy Advanced 2nd Edition/darkheresy2ndedition.html b/Dark Heresy Advanced 2nd Edition/darkheresy2ndedition.html index 6b80f382a3..144708fdc0 100644 --- a/Dark Heresy Advanced 2nd Edition/darkheresy2ndedition.html +++ b/Dark Heresy Advanced 2nd Edition/darkheresy2ndedition.html @@ -22,6 +22,9 @@ Social + + +Ship

@@ -739,7 +742,7 @@
- +
@@ -2721,7 +2724,7 @@

- Section separator + Divider

@@ -2782,7 +2785,7 @@

- Section separator + Divider
@@ -2899,7 +2902,7 @@
Personality:
- Section separator + Divider

@@ -3423,7 +3426,7 @@
- Section separator + Divider

Journal Entry

@@ -3493,7 +3496,7 @@

- Section separator + Divider

Psychic Powers

@@ -3546,8 +3549,11 @@
Pen:
-
-
+
+
+ +
@@ -3598,8 +3604,11 @@
Pen:
-
-
+
+
+ +
@@ -3672,9 +3681,11 @@
Special:
-
+!ammo @{character_id} repeating_Rangedweapons_@{my_hidden_row_id}_Rangedweaponclip [[?{Ammo?|Single,-1|Semi-Auto,-@{Rangedweaponsemi}|Full Auto,-@{Rangedweaponfull}}*?{Firing Mode?|Normal,1|Overcharge,2|Maximal,3|Overload,4}]]"> Hit +
@@ -3712,7 +3723,10 @@
Special:
-
+
+ +
@@ -3877,7 +3891,7 @@ - Section separator + Divider
@@ -3952,6 +3966,331 @@
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+

Weapons Components

+
+ + + + + + + + + + + +
+

Name

+
+

Type

+
+

Strength

+
+

Crit

+
+

Damage

+
+

Range

+
+

Location

+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +
+ + +

Essential Components

+
+ + + + + + + + +
+

Name

+
+

Power

+
+

Space

+
+

SP

+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ + +
+

Supplemental Components

+ + +
+ + + + + + + + +

Name

+

Power

+

Space

+

SP

+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+

Complications/Past History

+ +
+
+
+

Skill Modifiers

+ +
+
+
+

Special Actions

+ +
+
+

Notes

+ +
+
+
+
@@ -4029,7 +4368,7 @@
- Section separator + Divider @@ -4038,14 +4377,14 @@ - +
{{name}}
Section separatorDivider
{{dhdescription}}
- +
Scatter Diagram
Section separatorDivider
Scatter Diagram
@@ -4151,17 +4490,15 @@ on('change:strength change:toughness sheet:opened',function() }); }); -/*on('change:repeating_ShipEssentialComponents',function(){ - TAS.repeatingSimpleSum('ShipEssentialComponents','ShipEssentialComponentPower','ShipEssentialComponentsPowerTotal'); +on('change:repeating_ShipEssentialComponents change:repeating_ShipSupplementalComponents sheet:opened', function() +{ + /* Finds total power for ship based off usage from Essential and Supplemental Components */ + repeatingSum('ShipEssentialComponentsPowerTotal','ShipEssentialComponents','ShipEssentialComponentPower'); + repeatingSum('ShipSupplementalComponentsPowerTotal','ShipSupplementalComponents','ShipSupplementalComponentPower'); + + /* Finds total space for ship based off usage from Eseential and Supplemental Components */ + repeatingSum('ShipEssentialComponentsSpaceTotal','ShipEssentialComponents','ShipEssentialComponentSpace'); + repeatingSum('ShipSupplementalComponentsSpaceTotal','ShipSupplementalComponents','ShipSupplementalComponentSpace'); }); -on('change:repeating_ShipSupplementalComponents',function(){ - TAS.repeatingSimpleSum('ShipSupplementalComponents','ShipSupplementalComponentPower','ShipSupplementalComponentsPowerTotal'); -}); -on('change:repeating_ShipEssentialComponents',function(){ - TAS.repeatingSimpleSum('ShipEssentialComponents','ShipEssentialComponentSpace','ShipEssentialComponentsSpaceTotal'); -}); -on('change:repeating_ShipSupplementalComponents',function(){ - TAS.repeatingSimpleSum('ShipSupplementalComponents','ShipSupplementalComponentSpace','ShipSupplementalComponentsSpaceTotal'); -}); -*/ + \ No newline at end of file diff --git a/Dark Heresy Advanced 2nd Edition/readme.md b/Dark Heresy Advanced 2nd Edition/readme.md index 1836287756..0efd78333e 100644 --- a/Dark Heresy Advanced 2nd Edition/readme.md +++ b/Dark Heresy Advanced 2nd Edition/readme.md @@ -17,12 +17,12 @@ o Gear o Backpack/Vest o Stored Gear > Gear Calculations: All calculations are done for you regarding Gear now. The information is also displayed so that you can verify that it is working correctly, these calculations include: -o Finding Strength and Toughness Bonus and adding them together ( SB+TB: ) -o Using the SB+TB modifier to give your character’s starting weight ( Base: ) -o Location to insert Backpack/Vest weight bonuses ( Pack Bonus: | Vest Bonus: ) -o Adding up the different sections’ total weight ( Pack Weight: | Total Stored Weight: | Total Weight: ) -o Character’s maximum carry weight ( Max: ) -o Remaining weight before being encumbered ( Available: ) +o Finding Strength and Toughness Bonus and adding them together (SB+TB:) +o Using the SB+TB modifier to give your character’s starting weight (Base:) +o Location to insert Backpack/Vest weight bonuses (Pack Bonus: | Vest Bonus:) +o Adding up the different sections’ total weight (Pack Weight: | Total Stored Weight: | Total Weight:) +o Character’s maximum carry weight (Max:) +o Remaining weight before being encumbered (Available:) -If you have ides for changes or need something fixed in the DH2E Advanced Character Sheet you are welcome to DM Dustin S on Roll20 +If you have ideas for changes or need something fixed in the DH2E Advanced Character Sheet you are welcome to DM Dustin S on Roll20 > Dustin S. | Roll20: Online virtual tabletop diff --git a/Dark Heresy Advanced 2nd Edition/translation.json b/Dark Heresy Advanced 2nd Edition/translation.json index 9d3fc1bb9c..1ebec1e0a8 100644 --- a/Dark Heresy Advanced 2nd Edition/translation.json +++ b/Dark Heresy Advanced 2nd Edition/translation.json @@ -7,6 +7,7 @@ "vehicles-u":"Vehicles", "psykana-u":"Psykana", "social-u":"Social", + "ship-u":"Ship", "character-name-u":"Character Name:", "home-world-u":"Home World:", "homeworlds-u":"Homeworlds", @@ -437,10 +438,10 @@ "lost-foot-u":"Lost Foot", "lost-leg-u":"Lost Leg", "cybernetic-modifiers-u":"Cybernetics Modifiers", - "bionic-left-arm-u":"Bionic Arm (left): ", + "bionic-left-arm-u":"Bionic Arm (Left): ", "bionic-right-arm-u":"Bionic Arm (Right): ", "machine-trait-u":"Machine Trait: ", - "left-leg-bionic-u":"Bionic Leg Toughness Bonus(left): ", + "left-leg-bionic-u":"Bionic Leg (Left): ", "right-leg-bionic-u":"Bionic Leg (Right): ", "special-abilities-u":"Special Abilities", "skills-u":"Skills", diff --git a/Dark Heresy Advanced 2nd Edition/~$readme.md b/Dark Heresy Advanced 2nd Edition/~$readme.md deleted file mode 100644 index 5b6be8b2c7..0000000000 Binary files a/Dark Heresy Advanced 2nd Edition/~$readme.md and /dev/null differ diff --git a/Dark Heresy Advanced 2nd Edition/~WRL3502.tmp b/Dark Heresy Advanced 2nd Edition/~WRL3502.tmp deleted file mode 100644 index 44b311cd09..0000000000 --- a/Dark Heresy Advanced 2nd Edition/~WRL3502.tmp +++ /dev/null @@ -1,8 +0,0 @@ -This is an Advanced character sheet for the Dark Heresy 2nd Edition role-playing game. It differs greatly from the standard character sheet available and utilizes API scripts to accurately (and correctly) provide dice rolls measuring Degrees of Success and Degrees of Failure. It has been redesigned to include a multitude of differing features and organizations. - -The changes include tabbed divisions for organization, repeatable fields added to gear items, cybernetics, psychic powers, skills and talents, provided an 'Other skill' field for overflow of Trade/Lore/Specializations of Operate, and built-in macros for variable initiative rolls. - -Note: The following API Scripts must be utilized in your API console for this sheet to work properly; - - DH Degrees of Success for Skill by Jack D: https://github.com/Roll20/roll20-character-sheets/blob/master/Dark%20Heresy%20Advanced%202nd%20Edition/API%20Scripts/DH_Degrees_Skills.js - - DH Degrees of Success for Weapons by Jack D: https://github.com/Roll20/roll20-character-sheets/blob/master/Dark%20Heresy%20Advanced%202nd%20Edition/API%20Scripts/DH_Degrees_Weapons.js - - Ammo Count by Aaron C. Meadow: https://github.com/shdwjk/Roll20API/blob/master/Ammo/Ammo.js \ No newline at end of file