From 37a862bf58a8ff0f8e77703b8b84bce97eeaa6af Mon Sep 17 00:00:00 2001 From: johnmoney-code <64189467+johnmoney-code@users.noreply.github.com> Date: Mon, 13 Jul 2020 09:04:58 -0700 Subject: [PATCH] Only War (Enhanced) code improvements (#6960) * refactoring and small corrections changed page # in Advancements tab to type 'text' code refactoring for carry-capacity switch statement and insanity/corruption range checks fixed typo in sheet.json * improved CSS, refactoring changed "Page #" in the Advancements tab to input type: text refactored range check for Insanity/Corruption refactored Unnatural Characteristics styling fixed incorrect comment in carryweight sheetworker improved css grid for armor display overall removed css grid in armor display cells Added disclaimer next to Efffective Psy Rating Added WIP framework for sheetworker psykana calculations --- Only-War-Enhanced/OnlyWarEnhanced.css | 96 ++++------ Only-War-Enhanced/OnlyWarEnhanced.html | 250 ++++++++++++++++++------- Only-War-Enhanced/sheet.json | 2 +- 3 files changed, 219 insertions(+), 129 deletions(-) diff --git a/Only-War-Enhanced/OnlyWarEnhanced.css b/Only-War-Enhanced/OnlyWarEnhanced.css index a694d459c2..576fe02158 100644 --- a/Only-War-Enhanced/OnlyWarEnhanced.css +++ b/Only-War-Enhanced/OnlyWarEnhanced.css @@ -278,31 +278,32 @@ _____________ start of grid structure for unnatural characteristics, size dropdo .sheet-unnat_centering { grid-area: e1; margin-left: 50px; } .sheet-unnat_centering_container { display: grid; - grid-template-columns: auto auto auto; + justify-items:center; + grid-template-columns: 1fr 1fr 1fr; grid-template-areas: - 'e0 e1 e2'; + '. e1 .'; } -.sheet-mythicgs_width { width: 40px; } -.sheet-mythicgs1 { grid-area: amy1; font-size: 15px; font-family: inherit; letter-spacing: 0px; text-align: center; } -.sheet-mythicgs2 { grid-area: amy2; z-index: 1; position: relative; } -.sheet-mythicgs3 { grid-area: amy3; z-index: 1; position: relative; } -.sheet-mythicgs4 { grid-area: amy4; z-index: 1; position: relative; } -.sheet-mythicgs5 { grid-area: amy5; z-index: 1; position: relative; } -.sheet-mythicgs6 { grid-area: amy6; z-index: 1; position: relative; } -.sheet-mythicgs7 { grid-area: amy7; z-index: 1; position: relative; } -.sheet-mythicgs8 { grid-area: amy8; z-index: 1; position: relative; } -.sheet-mythicgs9 { grid-area: amy9; z-index: 1; position: relative; } -.sheet-mythicgs11 { grid-area: amy10; z-index: 1; position: relative; } -.sheet-mythicgs12 { grid-area: amy11; font-family: inherit; font-size: 14px; text-align: center; } -.sheet-mythicgs13 { grid-area: amy12; font-family: inherit; font-size: 14px; text-align: center; } -.sheet-mythicgs14 { grid-area: amy13; font-family: inherit; font-size: 14px; text-align: center; } -.sheet-mythicgs15 { grid-area: amy14; font-family: inherit; font-size: 14px; text-align: center; } -.sheet-mythicgs16 { grid-area: amy15; font-family: inherit; font-size: 14px; text-align: center; } -.sheet-mythicgs17 { grid-area: amy16; font-family: inherit; font-size: 14px; text-align: center; } -.sheet-mythicgs18 { grid-area: amy17; font-family: inherit; font-size: 14px; text-align: center; } -.sheet-mythicgs19 { grid-area: amy18; font-family: inherit; font-size: 14px; text-align: center; } -.sheet-mythicgs20 { grid-area: amy19; font-family: inherit; font-size: 14px; text-align: center; } +.sheet-unnatgs_width { width: 40px; } +.sheet-unnatgs1 { grid-area: amy1; font-size: 15px; font-family: inherit; letter-spacing: 0px; text-align: center; } +.sheet-unnatgs2 { grid-area: amy2; z-index: 1; position: relative; } +.sheet-unnatgs3 { grid-area: amy3; z-index: 1; position: relative; } +.sheet-unnatgs4 { grid-area: amy4; z-index: 1; position: relative; } +.sheet-unnatgs5 { grid-area: amy5; z-index: 1; position: relative; } +.sheet-unnatgs6 { grid-area: amy6; z-index: 1; position: relative; } +.sheet-unnatgs7 { grid-area: amy7; z-index: 1; position: relative; } +.sheet-unnatgs8 { grid-area: amy8; z-index: 1; position: relative; } +.sheet-unnatgs9 { grid-area: amy9; z-index: 1; position: relative; } +.sheet-unnatgs11 { grid-area: amy10; z-index: 1; position: relative; } +.sheet-unnatgs12 { grid-area: amy11; font-family: inherit; font-size: 14px; text-align: center; } +.sheet-unnatgs13 { grid-area: amy12; font-family: inherit; font-size: 14px; text-align: center; } +.sheet-unnatgs14 { grid-area: amy13; font-family: inherit; font-size: 14px; text-align: center; } +.sheet-unnatgs15 { grid-area: amy14; font-family: inherit; font-size: 14px; text-align: center; } +.sheet-unnatgs16 { grid-area: amy15; font-family: inherit; font-size: 14px; text-align: center; } +.sheet-unnatgs17 { grid-area: amy16; font-family: inherit; font-size: 14px; text-align: center; } +.sheet-unnatgs18 { grid-area: amy17; font-family: inherit; font-size: 14px; text-align: center; } +.sheet-unnatgs19 { grid-area: amy18; font-family: inherit; font-size: 14px; text-align: center; } +.sheet-unnatgs20 { grid-area: amy19; font-family: inherit; font-size: 14px; text-align: center; } .sheet-characteristics_unnat { display: grid; @@ -746,53 +747,32 @@ display: inline-block; } .sheet-armor_display_gs1 { grid-area: ad1; } -.sheet-armor_display_grid1 { - display: grid; - width: 300px; - grid-template-columns: 0% auto 3%; - grid-template-areas: - 'ad0 ad1 ad0'; -} - .sheet-armor_display_gs2 { grid-area: ad2; } .sheet-armor_display_gs3 { grid-area: ad3; } .sheet-armor_display_gs4 { grid-area: ad4; } -.sheet-armor_display_grid2 { +.sheet-armor_display_grid1 { display: grid; - width: 300px; - grid-template-columns: 33% auto 33%; + justify-items: center; + align-content: space-around; + grid-template-columns: 1fr 1fr 1fr; + column-gap: 10px; + row-gap: 15px; grid-template-areas: + '. ad1 .' 'ad2 ad3 ad4'; } .sheet-armor_display_gs5 { grid-area: ad5; } .sheet-armor_display_gs6 { grid-area: ad6; } -.sheet-armor_display_grid3 { +.sheet-armor_display_grid2 { display: grid; - width: 300px; - grid-template-columns: 50% 50%; + justify-items: center; + grid-template-columns: 1fr 2fr 2fr 1fr; + column-gap: 15px; grid-template-areas: - 'ad5 ad6'; + '. ad5 ad6 .'; } -.sheet-armor_cell_gs1 { grid-area: ae1; font-size: 12pt; width: 80%; text-align: center; align-self: center; } -.sheet-armor_cell_gs2 { grid-area: ae2; font-size: 12pt; width: 80%; text-align: center; align-self: center; } -.sheet-armor_cell_gs3 { grid-area: ae3; font-size: 12pt; width: 80%; text-align: center; align-self: center; } -.sheet-armor_cell_gs4 { grid-area: ae4; font-size: 12pt; width: 80%; text-align: center; align-self: center; } -.sheet-armor_cell_grid { - display: grid; - align-items: center; - width: 60px; - grid-template-columns: 50px; - grid template-rows: 10px 10px 10px 10px; - grid-template-areas: - 'ae1' - 'ae2' - 'ae3' - 'ae4'; -} - - .sheet-equipment_cybernetics_grid { margin: 0px 50.5px 0.6px 0px; position: relative; @@ -949,8 +929,8 @@ ______________________________ start of Psykana tab ____________________________ display: grid; grid-template-columns: 39% 1% 60%; grid-template-areas: - 'e1 e0 e3' - 'e2 e0 e3'; + 'e1 . e3' + 'e2 . e3'; } .sheet-psykana_info { grid-area: e1; background:#6E8B3D; border-radius: 10px; padding: 2px; margin-bottom: 5px; } @@ -1048,7 +1028,7 @@ ______________________________ start of Psykana tab ____________________________ display: grid; grid-template-columns: auto auto auto auto auto auto auto auto auto auto; grid-template-areas: - 'pa19 pa19 pa20 pa20 pa20 pa21 pa22 pa0 pa0 pa0'; + 'pa19 pa19 pa20 pa20 pa20 pa21 pa22 . . . '; } diff --git a/Only-War-Enhanced/OnlyWarEnhanced.html b/Only-War-Enhanced/OnlyWarEnhanced.html index 20b822ccaa..4ad50be892 100644 --- a/Only-War-Enhanced/OnlyWarEnhanced.html +++ b/Only-War-Enhanced/OnlyWarEnhanced.html @@ -27,7 +27,7 @@
- + @@ -144,25 +144,25 @@
-

Unnatural Characteristics

- - - - - - - - - -

WS

-

BS

-

STR

-

TOU

-

AGI

-

INT

-

PER

-

WP

-

FEL

+

Unnatural Characteristics

+ + + + + + + + + +

WS

+

BS

+

STR

+

TOU

+

AGI

+

INT

+

PER

+

WP

+

FEL

@@ -171,7 +171,7 @@
-

Size

+

Size

-

Character Movement

- - - - +

Character Movement

+ + + +

Half

Full

Charge

Run

-

Weight Capacity

- - - +

Weight Capacity

+ + +

Carry

Lift

Push

@@ -1119,21 +1119,20 @@
+

Armor Display

-
-
Head
- -
(1-10)
- +
+

Head

+ +

(1-10)

+
-
-

Arm R

@@ -1159,7 +1158,9 @@
-
+
+
+

Leg R

@@ -1176,8 +1177,8 @@
-
+

Cybernetics

@@ -1296,10 +1297,10 @@
- + - +
@@ -1366,8 +1367,8 @@

Insanity

- - + +
Disorders
@@ -1377,8 +1378,8 @@

Corruption

- - + +
Malignancies and Mutations
@@ -1405,34 +1406,48 @@
Class
Limit
Psy Rating
- - + +
Push Level
- - + +
Sustaining?
# Powers
- +
Effective PR
- + + + + + +
+ (EPR * 5 not yet added to Focus Power Tests) +
+ +
@@ -1475,11 +1490,13 @@
Sustained
+
Focus Power
+
- + @@ -1855,7 +1872,7 @@ full_move: (move_mod * 2), charge_move: (move_mod * 3), run_move: (move_mod * 6), - carry: (carry_calc * 1), //taking out the *1 will cause attr_carry to freeze when carry_calc is set to 1 or 0 + carry: (carry_calc * 1), //taking out the * 1 seems to cause attr_carry to freeze when carry_mod is set to 1 or 0 lift: (carry_calc * 2), push: (carry_calc * 4), }); @@ -1955,27 +1972,27 @@ insanity_degree: ('Stable') }); } - if (insanity_pts > 9 && insanity_pts <= 39) { + else if (insanity_pts <= 39) { setAttrs({ insanity_degree: ('Unsettled') }); } - if (insanity_pts > 39 && insanity_pts <= 59) { + else if (insanity_pts <= 59) { setAttrs({ insanity_degree: ('Disturbed') }); } - if (insanity_pts > 39 && insanity_pts <= 79) { + else if (insanity_pts <= 79) { setAttrs({ insanity_degree: ('Unhinged') }); } - if (insanity_pts > 79 && insanity_pts <= 99) { + else if (insanity_pts <= 99) { setAttrs({ insanity_degree: ('Deranged') }); } - if (insanity_pts > 99) { + else { setAttrs({ insanity_degree: ('Terminally Insane') }); @@ -1986,38 +2003,130 @@ corruption_degree: ('Pure') }); } - if (corruption_pts > 0 && corruption_pts <= 30) { + else if (corruption_pts <= 30) { setAttrs({ corruption_degree: ('Tainted') }); } - if (corruption_pts > 30 && corruption_pts <= 60) { + else if (corruption_pts <= 60) { setAttrs({ corruption_degree: ('Soiled') }); } - if (corruption_pts > 60 && corruption_pts <= 90) { + else if (corruption_pts <= 90) { setAttrs({ corruption_degree: ('Debased') }); } - if (corruption_pts > 90 && corruption_pts <= 99) { + else if (corruption_pts <= 99) { setAttrs({ corruption_degree: ('Profane') }); } - if (corruption_pts > 99) { + else { setAttrs({ corruption_degree: ('Damned') }); } - }); }); + // ___________________________________________________________________________ + // _______________________psychic info sheet worker___________________________ + // ___________________________________________________________________________ + + /* TODO: debug this sheetworker. If we can make it work, we can rewrite the HTML to refer here. + + on('sheet:opened change:psykana_class change:psykana_limit', function() { + getAttrs([ + 'psykana_class','psykana_limit' + ], function(values) { + + var psykana_class = parseInt(values['psykana_class'], 10) || 0; + var psykana_limit = parseInt(values['psykana_limit'], 10) || 0; + + setAttrs({ + effective_psy_rating: (4); + }); + }); + }); + */ + /* + on('sheet:opened change:psykana_class change:psykana_limit change:psy_push change:psy_rating change:psykana_sustain change:psykana_sustain_count', function() { + getAttrs([ + 'psykana_class','psykana_limit','psy_push','psy_rating','psykana_sustain','psykana_sustain_count' + ], function(values) { + + var psykana_class = parseInt(values['psykana_class'], 10) || 0; + var psykana_limit = parseInt(values['psykana_limit'], 10) || 0; + var psykana_push = parseInt(values['psykana_push'], 10) || 0; + var psy_rating = parseInt(values['psy_rating'], 10) || 0; + var psykana_sustain = parseInt(values['psykana_sustain'], 10) || 0; + var psykana_sustain_count = parseInt(values['psykana_sustain_count'], 10) || 0; + + setAttrs({ + effective_psy_rating = 4; + }); + /* + var psykana_limit_factor; + var push_addend; + var sustain_count_addend; + + + + /* + if (psykana_limit == 0) { + psykana_limit_factor = 0.5, + } + if (psykana_limit === 1) { + psykana_limit_factor = 1; + } + if (psykana_limit === 2) { + psykana_limit_factor = 1; + push_addend = psykana_push; + } + + if (psykana_sustain == 1) { + sustain_count_addend = psykana_sustain_count; + } + + setAttrs({ + effective_psy_rating: (psy_rating * psykana_limit_factor + push_addend) + }); + + //end of psy rating calc, start of psychic phenomena calc + + var unfettered_addend = 0; + var push_addend = 0 + var sustain_addend = 0; + + if (psykana_class == 1 && psykana_limit == 1) || (psykana_class == 2 && psykana_limit == 1) { + unfettered_addend = 10; + } + if (psykana_class == 0 && psykana_limit == 2) { + push_addend = 10; + } + if (psykana_class == 1 && psykana_limit == 2) { + push_addend = 5 * psykana_push; + } + if (psykana_class == 2 && psykana_limit == 2) { + push_addend = 10 * psykana_push; + } + if (psykana_sustain == 1) { + sustain_addend = 10; + } + + setAttrs({ + psykana_phenomena = unfettered_addend + push_addend + sustain_addend, + }); + + }); + }); + */ + // ___________________________________________________________________________ // ____________________gear cost/weight sheet worker__________________________ // ___________________________________________________________________________ @@ -2215,6 +2324,7 @@ {{/description}} + {{#scatter-range}}
{{character}} scatters
diff --git a/Only-War-Enhanced/sheet.json b/Only-War-Enhanced/sheet.json index d4fa19fe06..5edc40866a 100644 --- a/Only-War-Enhanced/sheet.json +++ b/Only-War-Enhanced/sheet.json @@ -1,7 +1,7 @@ { "html": "OnlyWarEnhanced.html", "css": "OnlyWarEnhanced.css", - "author": "Jason Lee", + "authors": "Jason Lee", "roll20userid": "685637", "preview": "preview.png", "instructions": "This sheet is designed for use in Roll20. It is based on the Warhammer 40000: Only War ttrpg by Fantasy Flight Games, and derived from the Halo Mythic 3.5 Roll20 sheet made by Omran Losinno and Michael van Weelde.\r\rThere is a universal header that applies to all in-sheet tabs. This header section consists of five grid sub-sections: first logo and core character details, second characteristics, third Unnatural characteristics plus physical calculations such as movement and carrying capacity, fourth initiative roller and alternate in-sheet tabs, and fifth has all other numbers that should be accessible on-hand by the player such as wounds, fate points, and fatigue. These tabs are composed of different sections: core character information such as skills and special abilities, a page to list Comrades and the abilities the player may use with them, a list of equipment both used in and out of combat such as weapons or cybernetics, an experience page to differentiate unspent/spent experience points toward an automatically tracked total sum number, a player-kept journal tab to list complete/incomplete objectives in a mission, keep a history of your character's time spent, and track Insanity/Corruption, a tab for characters with psychic ability to show related stats, and a settings tab to allow the player to apply technical changes to the sheet if needed, such as applying an Initiative tiebreaker or replace the character sheet with a vehicle one.",