Total Complexity | 2 |
Complexity/F | 0 |
Lines of Code | 21 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | /* eslint-env node */ |
||
3 | 'use strict'; |
||
4 | |||
5 | const jsonfile = require('jsonfile'); |
||
6 | |||
7 | let unlocks = jsonfile.readFileSync('build/data/unlocks.json'); |
||
8 | let elements = jsonfile.readFileSync('build/data/elements.json'); |
||
9 | |||
10 | for(let element in elements){ |
||
11 | if(elements[element].disabled){ |
||
12 | continue; |
||
13 | } |
||
14 | |||
15 | // Generate element unlocks |
||
16 | unlocks[element] = { |
||
17 | condition: 'player.elements.'+element+'.unlocked' |
||
18 | }; |
||
19 | } |
||
20 | |||
21 | jsonfile.writeFileSync('build/data/unlocks.json', unlocks, { |
||
22 | spaces: 2 |
||
23 | }); |
||
24 |