-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_loadrepositories.js
39 lines (28 loc) · 1.06 KB
/
_loadrepositories.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var uuid = require('uuid');
var fb = require('./firebase.config');
// PERKS
var perkList = require("./data/perks/perks.json");
var perks = {};
perkList.forEach(p => perks[uuid.v4()] = p);
fb.child('perks').set(perks);
// EFFECTS
var boonList = require('./data/effects/boons.json');
var condiList = require('./data/effects/condis.json');
var statusList = require('./data/effects/status.json');
var effects = {};
boonList.forEach(b => b.type = 'boon');
condiList.forEach(b => b.type = 'condition');
statusList.forEach(b => b.type = 'status');
boonList.forEach(e => effects[uuid.v4()] = e);
condiList.forEach(e => effects[uuid.v4()] = e);
statusList.forEach(e => effects[uuid.v4()] = e);
fb.child('effects').set(effects);
// POWERS
var powerList = require('./data/powers/_base.json')
.concat(require('./data/powers/arms.json'))
.concat(require('./data/powers/elemental-magic.json'))
.concat(require('./data/powers/shadow-arts.json'));
var powers = {};
powerList.forEach(p => powers[uuid.v4()] = p);
fb.child('powers').set(powers);
console.log('all set');