From 35cef9405b4629d457a51fddd824bd23d54f227d Mon Sep 17 00:00:00 2001 From: Kolja Markwardt Date: Sun, 6 Jun 2021 22:03:29 +0200 Subject: [PATCH] Bioroid talent not supported #48 - check for "Inorganic" talent when calculating strain threshold - add "cybernetics" flag to certain gear --- .../emporium/src/assets/data/gear/SOTB.json | 41 ++++++++++++------- .../src/redux/selectors/strainThreshold.tsx | 13 ++++-- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/packages/emporium/src/assets/data/gear/SOTB.json b/packages/emporium/src/assets/data/gear/SOTB.json index 58ff94e0..6a243208 100644 --- a/packages/emporium/src/assets/data/gear/SOTB.json +++ b/packages/emporium/src/assets/data/gear/SOTB.json @@ -348,7 +348,8 @@ "page": 104, "modifier": { "strainThreshold": -1 - } + }, + "cybernetics": true }, "cybereyes": { "name": "Cybereyes", @@ -362,7 +363,8 @@ "1 Free Rank" ], "strainThreshold": -1 - } + }, + "cybernetics": true }, "cyberlimbAgility": { "name": "Cyberlimb (Agility)", @@ -376,7 +378,8 @@ "1 Free Rank" ], "strainThreshold": -1 - } + }, + "cybernetics": true }, "cyberlimbBrawn": { "name": "Cyberlimb (Brawn)", @@ -388,7 +391,8 @@ "modifier": { "Brawn": 1, "strainThreshold": -1 - } + }, + "cybernetics": true }, "cyberHeart": { "name": "Cyber Heart", @@ -400,7 +404,8 @@ "modifier": { "woundThreshold": 2, "strainThreshold": -1 - } + }, + "cybernetics": true }, "cyberLungs": { "name": "Cyber Lungs", @@ -414,7 +419,8 @@ "1 Free Rank" ], "strainThreshold": -1 - } + }, + "cybernetics": true }, "cyberLiver": { "name": "Cyber Liver", @@ -428,7 +434,8 @@ "1 Free Rank" ], "strainThreshold": -1 - } + }, + "cybernetics": true }, "enhancedHearing": { "name": "Enhanced Hearing", @@ -442,7 +449,8 @@ "1 Free Rank" ], "strainThreshold": -1 - } + }, + "cybernetics": true }, "enhancedReflexes": { "name": "Enhanced Reflexes", @@ -459,7 +467,8 @@ "1 Free Rank" ], "strainThreshold": -1 - } + }, + "cybernetics": true }, "skulljack": { "name": "Skulljack", @@ -479,7 +488,8 @@ "1 Free Rank" ], "strainThreshold": -1 - } + }, + "cybernetics": true }, "spinalModem": { "name": "Spinal Modem", @@ -500,7 +510,8 @@ "1 Free Rank" ], "strainThreshold": -1 - } + }, + "cybernetics": true }, "painEditor": { "name": "Pain Editor", @@ -511,7 +522,8 @@ "page": 106, "modifier": { "strainThreshold": -1 - } + }, + "cybernetics": true }, "subdermalArmor": { "name": "Sub-Dermal Armor", @@ -523,7 +535,8 @@ "modifier": { "soak": 1, "strainThreshold": -1 - } + }, + "cybernetics": true }, "catClaws": { "name": "Cat Claws", @@ -613,4 +626,4 @@ "book": "SOTB", "page": 108 } -} \ No newline at end of file +} diff --git a/packages/emporium/src/redux/selectors/strainThreshold.tsx b/packages/emporium/src/redux/selectors/strainThreshold.tsx index acb4a66e..485b34df 100644 --- a/packages/emporium/src/redux/selectors/strainThreshold.tsx +++ b/packages/emporium/src/redux/selectors/strainThreshold.tsx @@ -1,7 +1,7 @@ import { get } from 'lodash-es'; import { createSelector } from 'reselect'; -import {talentCount } from './talentCount'; -import {equipmentStats } from './equipmentStats'; +import { talentCount } from './talentCount'; +import { equipmentStats } from './equipmentStats'; const archetype = state => state.archetype; const archetypes = state => state.archetypes; @@ -45,6 +45,9 @@ const calcStrain = createSelector( 0 ); + // see if character has "Inorganic" talent + const inorganic = get(archetypes, `${archetype}.talents`, []).includes('Inorganic'); + //check for Gear const Gear = Object.keys(equipmentStats) .map(key => { @@ -55,16 +58,20 @@ const calcStrain = createSelector( ), carried = get(equipmentStats, `${key}.carried`, false), equipped = get(equipmentStats, `${key}.equipped`, false), + cybernetics = get(equipmentStats, `${key}.cybernetics`, false), kind = get(equipmentStats, `${key}.type`, ''); if ((carried && kind !== 'armor') || equipped) { + if (inorganic && cybernetics) { + return 0; + } return +modifier; } else { return 0; } }) .reduce((acc, num) => acc + num, 0); - +console.log('\x1b[35m%s\x1b[0m', '>> startingThreshold +\n startingWillpower +\n creationWillpower +\n talentModifier +\n Gear', startingThreshold, startingWillpower, creationWillpower , talentModifier ,Gear) return ( startingThreshold + startingWillpower +