Skip to content

Commit

Permalink
Bioroid talent not supported Unbound-Legends#48
Browse files Browse the repository at this point in the history
- check for "Inorganic" talent when calculating strain threshold
- add "cybernetics" flag to certain gear
  • Loading branch information
koljatm-edeka committed Jun 6, 2021
1 parent 2cc922a commit 35cef94
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 17 deletions.
41 changes: 27 additions & 14 deletions packages/emporium/src/assets/data/gear/SOTB.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@
"page": 104,
"modifier": {
"strainThreshold": -1
}
},
"cybernetics": true
},
"cybereyes": {
"name": "Cybereyes",
Expand All @@ -362,7 +363,8 @@
"1 Free Rank"
],
"strainThreshold": -1
}
},
"cybernetics": true
},
"cyberlimbAgility": {
"name": "Cyberlimb (Agility)",
Expand All @@ -376,7 +378,8 @@
"1 Free Rank"
],
"strainThreshold": -1
}
},
"cybernetics": true
},
"cyberlimbBrawn": {
"name": "Cyberlimb (Brawn)",
Expand All @@ -388,7 +391,8 @@
"modifier": {
"Brawn": 1,
"strainThreshold": -1
}
},
"cybernetics": true
},
"cyberHeart": {
"name": "Cyber Heart",
Expand All @@ -400,7 +404,8 @@
"modifier": {
"woundThreshold": 2,
"strainThreshold": -1
}
},
"cybernetics": true
},
"cyberLungs": {
"name": "Cyber Lungs",
Expand All @@ -414,7 +419,8 @@
"1 Free Rank"
],
"strainThreshold": -1
}
},
"cybernetics": true
},
"cyberLiver": {
"name": "Cyber Liver",
Expand All @@ -428,7 +434,8 @@
"1 Free Rank"
],
"strainThreshold": -1
}
},
"cybernetics": true
},
"enhancedHearing": {
"name": "Enhanced Hearing",
Expand All @@ -442,7 +449,8 @@
"1 Free Rank"
],
"strainThreshold": -1
}
},
"cybernetics": true
},
"enhancedReflexes": {
"name": "Enhanced Reflexes",
Expand All @@ -459,7 +467,8 @@
"1 Free Rank"
],
"strainThreshold": -1
}
},
"cybernetics": true
},
"skulljack": {
"name": "Skulljack",
Expand All @@ -479,7 +488,8 @@
"1 Free Rank"
],
"strainThreshold": -1
}
},
"cybernetics": true
},
"spinalModem": {
"name": "Spinal Modem",
Expand All @@ -500,7 +510,8 @@
"1 Free Rank"
],
"strainThreshold": -1
}
},
"cybernetics": true
},
"painEditor": {
"name": "Pain Editor",
Expand All @@ -511,7 +522,8 @@
"page": 106,
"modifier": {
"strainThreshold": -1
}
},
"cybernetics": true
},
"subdermalArmor": {
"name": "Sub-Dermal Armor",
Expand All @@ -523,7 +535,8 @@
"modifier": {
"soak": 1,
"strainThreshold": -1
}
},
"cybernetics": true
},
"catClaws": {
"name": "Cat Claws",
Expand Down Expand Up @@ -613,4 +626,4 @@
"book": "SOTB",
"page": 108
}
}
}
13 changes: 10 additions & 3 deletions packages/emporium/src/redux/selectors/strainThreshold.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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 => {
Expand All @@ -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 +
Expand Down

0 comments on commit 35cef94

Please sign in to comment.