@massif/lancer-data 3.1.7 → 4.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/pull_request_template.md +15 -15
- package/.github/workflows/deploy-npm.yml +13 -13
- package/.github/workflows/lcp-version-bump.yml +21 -21
- package/README.md +1373 -1373
- package/index.js +31 -30
- package/lib/actions.json +296 -464
- package/lib/backgrounds.json +221 -221
- package/lib/core_bonuses.json +156 -87
- package/lib/downtime_actions.json +203 -0
- package/lib/frames.json +1844 -1844
- package/lib/glossary.json +157 -157
- package/lib/info.json +7 -7
- package/lib/manufacturers.json +47 -47
- package/lib/mods.json +24 -21
- package/lib/pilot_gear.json +33 -11
- package/lib/rules.json +53 -53
- package/lib/skills.json +155 -155
- package/lib/statuses.json +126 -111
- package/lib/systems.json +191 -61
- package/lib/tables.json +28 -28
- package/lib/tags.json +319 -319
- package/lib/talents.json +1347 -1346
- package/lib/weapons.json +58 -20
- package/package.json +29 -29
- package/scripts/aptitude_export.js +134 -134
- package/scripts/build.js +14 -14
- package/scripts/output/equipment.csv +86 -86
- package/scripts/test.js +19 -19
- package/scripts/util.js +127 -0
- package/scripts/rename.js +0 -74
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
SOURCE,NAME,MELEE,RANGED,SURVIVABILITY,MANUVERABILITY,SUPPORT,CONTROL
|
|
2
|
-
GMS,ANTI-MATERIEL RIFLE,0,32,0,0,0,0
|
|
3
|
-
GMS,ASSAULT RIFLE,0,14,0,0,0,0
|
|
4
|
-
GMS,CHARGED BLADE,6,0,0,0,0,0
|
|
5
|
-
GMS,CYCLONE PULSE RIFLE,0,63,0,0,0,0
|
|
6
|
-
GMS,HEAVY CHARGED BLADE,14,0,0,0,0,0
|
|
7
|
-
GMS,HEAVY MACHINE GUN,0,32,0,0,0,0
|
|
8
|
-
GMS,HEAVY MELEE WEAPON,15,0,0,0,0,0
|
|
9
|
-
GMS,HOWITZER,0,40,0,0,0,0
|
|
10
|
-
GMS,MISSILE RACK,0,10,0,0,0,0
|
|
11
|
-
GMS,MORTAR,0,21,0,0,0,0
|
|
12
|
-
GMS,NEXUS (HUNTER-KILLER),0,9,0,0,0,0
|
|
13
|
-
GMS,NEXUS (LIGHT),0,7,0,0,0,0
|
|
14
|
-
GMS,PISTOL,0,7,0,0,0,0
|
|
15
|
-
GMS,SEGMENT KNIFE,3,0,0,0,0,0
|
|
16
|
-
GMS,ROCKET-PROPELLED GRENADE,0,24,0,0,0,0
|
|
17
|
-
GMS,SHOTGUN,0,5,0,0,0,0
|
|
18
|
-
GMS,TACTICAL KNIFE,2,0,0,0,0,0
|
|
19
|
-
GMS,TACTICAL MELEE WEAPON,8,0,0,0,0,0
|
|
20
|
-
GMS,THERMAL LANCE,0,30,0,0,0,0
|
|
21
|
-
GMS,THERMAL PISTOL,0,10,0,0,0,0
|
|
22
|
-
GMS,THERMAL RIFLE,0,8,0,0,0,0
|
|
23
|
-
IPS-N,CHAIN AXE,9,0,0,0,0,0
|
|
24
|
-
IPS-N,BRISTLECROWN FLECHETTE LAUNCHER,0,3,0,0,0,0
|
|
25
|
-
IPS-N,NANOCARBON SWORD,33,0,0,0,0,0
|
|
26
|
-
IPS-N,ASSAULT CANNON,0,14,0,0,0,0
|
|
27
|
-
IPS-N,CONCUSSION MISSILES,0,4,0,0,0,0
|
|
28
|
-
IPS-N,LEVIATHAN HEAVY ASSAULT CANNON,0,7,0,0,0,0
|
|
29
|
-
IPS-N,CUTTER MKII PLASMA TORCH,0,0,0,0,0,0
|
|
30
|
-
IPS-N,WAR PIKE,5,0,0,0,0,0
|
|
31
|
-
IPS-N,POWER KNUCKLES,2,0,0,0,0,0
|
|
32
|
-
IPS-N,HAND CANNON,0,7,0,0,0,0
|
|
33
|
-
IPS-N,BOLT THROWER,0,25,0,0,0,0
|
|
34
|
-
IPS-N,KINETIC HAMMER,32,0,0,0,0,0
|
|
35
|
-
IPS-N,DECK-SWEEPER AUTOMATIC SHOTGUN,0,9,0,0,0,0
|
|
36
|
-
IPS-N,DAISY CUTTER,0,47,0,0,0,0
|
|
37
|
-
IPS-N,CATALYTIC HAMMER,6,0,0,0,0,0
|
|
38
|
-
IPS-N,IMPACT LANCE,5,0,0,0,0,0
|
|
39
|
-
IPS-N,IMPALER NAILGUN,0,8,0,0,0,0
|
|
40
|
-
IPS-N,COMBAT DRILL,39,0,0,0,0,0
|
|
41
|
-
SSC,MAGNETIC CANNON,0,18,0,0,0,0
|
|
42
|
-
SSC,VULTURE DMR,0,19,0,0,0,0
|
|
43
|
-
SSC,RAILGUN,0,71,0,0,0,0
|
|
44
|
-
SSC,VEIL RIFLE,0,23,0,0,0,0
|
|
45
|
-
SSC,BURST LAUNCHER,0,14,0,0,0,0
|
|
46
|
-
SSC,RAIL RIFLE,0,25,0,0,0,0
|
|
47
|
-
SSC,SHOCK KNIFE,0,0,0,0,0,0
|
|
48
|
-
SSC,SHARANGA MISSILES,0,12,0,0,0,0
|
|
49
|
-
SSC,GANDIVA MISSILES,0,25,0,0,0,0
|
|
50
|
-
SSC,PINAKA MISSILES,0,34,0,0,0,0
|
|
51
|
-
SSC,FOLD KNIFE,2,0,0,0,0,0
|
|
52
|
-
SSC,VIJAYA ROCKETS,0,4,0,0,0,0
|
|
53
|
-
SSC,VARIABLE SWORD,0,0,0,0,0,0
|
|
54
|
-
SSC,ORACLE LMG-I,0,14,0,0,0,0
|
|
55
|
-
HORUS,NANOBOT WHIP,23,0,0,0,0,0
|
|
56
|
-
HORUS,SWARM/HIVE NANITES,0,3,0,0,0,0
|
|
57
|
-
HORUS,AUTOPOD,0,10,0,0,0,0
|
|
58
|
-
HORUS,VORPAL GUN,0,13,0,0,0,0
|
|
59
|
-
HORUS,GHOUL NEXUS,0,10,0,0,0,0
|
|
60
|
-
HORUS,GHAST NEXUS,0,18,0,0,0,0
|
|
61
|
-
HORUS,ANNIHILATION NEXUS,0,35,0,0,0,0
|
|
62
|
-
HORUS,CATALYST PISTOL,0,6,0,0,0,0
|
|
63
|
-
HORUS,ARC PROJECTOR,0,8,0,0,0,0
|
|
64
|
-
HORUS,SMARTGUN,0,12,0,0,0,0
|
|
65
|
-
HORUS,MIMIC GUN,0,NaN,0,0,0,0
|
|
66
|
-
HORUS,AUTOGUN,0,10,0,0,0,0
|
|
67
|
-
HA,SIEGE CANNON,0,23,0,0,0,0
|
|
68
|
-
HA,KRAKATOA THERMOBARIC FLAMETHROWER,0,13,0,0,0,0
|
|
69
|
-
HA,PLASMA THROWER,0,52,0,0,0,0
|
|
70
|
-
HA,STUB CANNON,0,3,0,0,0,0
|
|
71
|
-
HA,GRAVITY GUN,0,0,0,0,0,0
|
|
72
|
-
HA,DISPLACER,0,11,0,0,0,0
|
|
73
|
-
HA,SHATTERHEAD COLONY MISSILES,0,14,0,0,0,0
|
|
74
|
-
HA,SOL-PATTERN LASER RIFLE,0,7,0,0,0,0
|
|
75
|
-
HA,ANDROMEDA-PATTERN HEAVY LASER RIFLE,0,17,0,0,0,0
|
|
76
|
-
HA,TACHYON LANCE,0,25,0,0,0,0
|
|
77
|
-
HA,ANNIHILATOR,0,8,0,0,0,0
|
|
78
|
-
HA,TORCH,3,0,0,0,0,0
|
|
79
|
-
,Fuel Rod Gun,0,5,0,0,0,0
|
|
80
|
-
,Prototype Weapon,0,15,0,0,0,0
|
|
81
|
-
,Prototype Weapon,0,15,0,0,0,0
|
|
82
|
-
,Prototype Weapon,0,21,0,0,0,0
|
|
83
|
-
undefined,Latch Drone,0,0,0,0,0,0
|
|
84
|
-
undefined,M35 Mjolnir,0,0,0,0,0,0
|
|
85
|
-
undefined,Apocalypse Rail,0,0,0,0,0,0
|
|
86
|
-
undefined,ZF4 SOLIDCORE,0,0,0,0,0,0
|
|
1
|
+
SOURCE,NAME,MELEE,RANGED,SURVIVABILITY,MANUVERABILITY,SUPPORT,CONTROL
|
|
2
|
+
GMS,ANTI-MATERIEL RIFLE,0,32,0,0,0,0
|
|
3
|
+
GMS,ASSAULT RIFLE,0,14,0,0,0,0
|
|
4
|
+
GMS,CHARGED BLADE,6,0,0,0,0,0
|
|
5
|
+
GMS,CYCLONE PULSE RIFLE,0,63,0,0,0,0
|
|
6
|
+
GMS,HEAVY CHARGED BLADE,14,0,0,0,0,0
|
|
7
|
+
GMS,HEAVY MACHINE GUN,0,32,0,0,0,0
|
|
8
|
+
GMS,HEAVY MELEE WEAPON,15,0,0,0,0,0
|
|
9
|
+
GMS,HOWITZER,0,40,0,0,0,0
|
|
10
|
+
GMS,MISSILE RACK,0,10,0,0,0,0
|
|
11
|
+
GMS,MORTAR,0,21,0,0,0,0
|
|
12
|
+
GMS,NEXUS (HUNTER-KILLER),0,9,0,0,0,0
|
|
13
|
+
GMS,NEXUS (LIGHT),0,7,0,0,0,0
|
|
14
|
+
GMS,PISTOL,0,7,0,0,0,0
|
|
15
|
+
GMS,SEGMENT KNIFE,3,0,0,0,0,0
|
|
16
|
+
GMS,ROCKET-PROPELLED GRENADE,0,24,0,0,0,0
|
|
17
|
+
GMS,SHOTGUN,0,5,0,0,0,0
|
|
18
|
+
GMS,TACTICAL KNIFE,2,0,0,0,0,0
|
|
19
|
+
GMS,TACTICAL MELEE WEAPON,8,0,0,0,0,0
|
|
20
|
+
GMS,THERMAL LANCE,0,30,0,0,0,0
|
|
21
|
+
GMS,THERMAL PISTOL,0,10,0,0,0,0
|
|
22
|
+
GMS,THERMAL RIFLE,0,8,0,0,0,0
|
|
23
|
+
IPS-N,CHAIN AXE,9,0,0,0,0,0
|
|
24
|
+
IPS-N,BRISTLECROWN FLECHETTE LAUNCHER,0,3,0,0,0,0
|
|
25
|
+
IPS-N,NANOCARBON SWORD,33,0,0,0,0,0
|
|
26
|
+
IPS-N,ASSAULT CANNON,0,14,0,0,0,0
|
|
27
|
+
IPS-N,CONCUSSION MISSILES,0,4,0,0,0,0
|
|
28
|
+
IPS-N,LEVIATHAN HEAVY ASSAULT CANNON,0,7,0,0,0,0
|
|
29
|
+
IPS-N,CUTTER MKII PLASMA TORCH,0,0,0,0,0,0
|
|
30
|
+
IPS-N,WAR PIKE,5,0,0,0,0,0
|
|
31
|
+
IPS-N,POWER KNUCKLES,2,0,0,0,0,0
|
|
32
|
+
IPS-N,HAND CANNON,0,7,0,0,0,0
|
|
33
|
+
IPS-N,BOLT THROWER,0,25,0,0,0,0
|
|
34
|
+
IPS-N,KINETIC HAMMER,32,0,0,0,0,0
|
|
35
|
+
IPS-N,DECK-SWEEPER AUTOMATIC SHOTGUN,0,9,0,0,0,0
|
|
36
|
+
IPS-N,DAISY CUTTER,0,47,0,0,0,0
|
|
37
|
+
IPS-N,CATALYTIC HAMMER,6,0,0,0,0,0
|
|
38
|
+
IPS-N,IMPACT LANCE,5,0,0,0,0,0
|
|
39
|
+
IPS-N,IMPALER NAILGUN,0,8,0,0,0,0
|
|
40
|
+
IPS-N,COMBAT DRILL,39,0,0,0,0,0
|
|
41
|
+
SSC,MAGNETIC CANNON,0,18,0,0,0,0
|
|
42
|
+
SSC,VULTURE DMR,0,19,0,0,0,0
|
|
43
|
+
SSC,RAILGUN,0,71,0,0,0,0
|
|
44
|
+
SSC,VEIL RIFLE,0,23,0,0,0,0
|
|
45
|
+
SSC,BURST LAUNCHER,0,14,0,0,0,0
|
|
46
|
+
SSC,RAIL RIFLE,0,25,0,0,0,0
|
|
47
|
+
SSC,SHOCK KNIFE,0,0,0,0,0,0
|
|
48
|
+
SSC,SHARANGA MISSILES,0,12,0,0,0,0
|
|
49
|
+
SSC,GANDIVA MISSILES,0,25,0,0,0,0
|
|
50
|
+
SSC,PINAKA MISSILES,0,34,0,0,0,0
|
|
51
|
+
SSC,FOLD KNIFE,2,0,0,0,0,0
|
|
52
|
+
SSC,VIJAYA ROCKETS,0,4,0,0,0,0
|
|
53
|
+
SSC,VARIABLE SWORD,0,0,0,0,0,0
|
|
54
|
+
SSC,ORACLE LMG-I,0,14,0,0,0,0
|
|
55
|
+
HORUS,NANOBOT WHIP,23,0,0,0,0,0
|
|
56
|
+
HORUS,SWARM/HIVE NANITES,0,3,0,0,0,0
|
|
57
|
+
HORUS,AUTOPOD,0,10,0,0,0,0
|
|
58
|
+
HORUS,VORPAL GUN,0,13,0,0,0,0
|
|
59
|
+
HORUS,GHOUL NEXUS,0,10,0,0,0,0
|
|
60
|
+
HORUS,GHAST NEXUS,0,18,0,0,0,0
|
|
61
|
+
HORUS,ANNIHILATION NEXUS,0,35,0,0,0,0
|
|
62
|
+
HORUS,CATALYST PISTOL,0,6,0,0,0,0
|
|
63
|
+
HORUS,ARC PROJECTOR,0,8,0,0,0,0
|
|
64
|
+
HORUS,SMARTGUN,0,12,0,0,0,0
|
|
65
|
+
HORUS,MIMIC GUN,0,NaN,0,0,0,0
|
|
66
|
+
HORUS,AUTOGUN,0,10,0,0,0,0
|
|
67
|
+
HA,SIEGE CANNON,0,23,0,0,0,0
|
|
68
|
+
HA,KRAKATOA THERMOBARIC FLAMETHROWER,0,13,0,0,0,0
|
|
69
|
+
HA,PLASMA THROWER,0,52,0,0,0,0
|
|
70
|
+
HA,STUB CANNON,0,3,0,0,0,0
|
|
71
|
+
HA,GRAVITY GUN,0,0,0,0,0,0
|
|
72
|
+
HA,DISPLACER,0,11,0,0,0,0
|
|
73
|
+
HA,SHATTERHEAD COLONY MISSILES,0,14,0,0,0,0
|
|
74
|
+
HA,SOL-PATTERN LASER RIFLE,0,7,0,0,0,0
|
|
75
|
+
HA,ANDROMEDA-PATTERN HEAVY LASER RIFLE,0,17,0,0,0,0
|
|
76
|
+
HA,TACHYON LANCE,0,25,0,0,0,0
|
|
77
|
+
HA,ANNIHILATOR,0,8,0,0,0,0
|
|
78
|
+
HA,TORCH,3,0,0,0,0,0
|
|
79
|
+
,Fuel Rod Gun,0,5,0,0,0,0
|
|
80
|
+
,Prototype Weapon,0,15,0,0,0,0
|
|
81
|
+
,Prototype Weapon,0,15,0,0,0,0
|
|
82
|
+
,Prototype Weapon,0,21,0,0,0,0
|
|
83
|
+
undefined,Latch Drone,0,0,0,0,0,0
|
|
84
|
+
undefined,M35 Mjolnir,0,0,0,0,0,0
|
|
85
|
+
undefined,Apocalypse Rail,0,0,0,0,0,0
|
|
86
|
+
undefined,ZF4 SOLIDCORE,0,0,0,0,0,0
|
package/scripts/test.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
var currentDir = process.cwd();
|
|
3
|
-
var files = fs.readdirSync('./lib');
|
|
4
|
-
let contents = ""
|
|
5
|
-
let valid = true
|
|
6
|
-
|
|
7
|
-
files.forEach(filename => {
|
|
8
|
-
contents = fs.readFileSync(`./lib/${filename}`, 'utf-8')
|
|
9
|
-
try {
|
|
10
|
-
JSON.parse(contents)
|
|
11
|
-
} catch (e) {
|
|
12
|
-
console.error(`invalid JSON in ${filename}`);
|
|
13
|
-
valid = false;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
if (!valid) {
|
|
18
|
-
throw "One or more JSON files are invalid."
|
|
19
|
-
}
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
var currentDir = process.cwd();
|
|
3
|
+
var files = fs.readdirSync('./lib');
|
|
4
|
+
let contents = ""
|
|
5
|
+
let valid = true
|
|
6
|
+
|
|
7
|
+
files.forEach(filename => {
|
|
8
|
+
contents = fs.readFileSync(`./lib/${filename}`, 'utf-8')
|
|
9
|
+
try {
|
|
10
|
+
JSON.parse(contents)
|
|
11
|
+
} catch (e) {
|
|
12
|
+
console.error(`invalid JSON in ${filename}`);
|
|
13
|
+
valid = false;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
if (!valid) {
|
|
18
|
+
throw "One or more JSON files are invalid."
|
|
19
|
+
}
|
package/scripts/util.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
const folderPath = '../lib';
|
|
8
|
+
const ignore = ['manufacturers.json', 'weapons.json', 'systems.json', 'mods.json'];
|
|
9
|
+
|
|
10
|
+
const ignoreWords = ['{VAL}', '({VAL})', '{VAL}+', 'HP', 'GRIT', 'SP', 'AP', '(AP)'];
|
|
11
|
+
|
|
12
|
+
function decapitalize() {
|
|
13
|
+
function decap(string) {
|
|
14
|
+
const words = string.split(' ');
|
|
15
|
+
const capitalizedWords = words.map((word) => {
|
|
16
|
+
if (ignoreWords.some((x) => x === word)) return word;
|
|
17
|
+
else if (word === word.toUpperCase()) {
|
|
18
|
+
return word.toLowerCase().replace(/\b\w/g, (l) => l.toUpperCase());
|
|
19
|
+
} else {
|
|
20
|
+
return word;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const capitalizedString = capitalizedWords.join(' ');
|
|
24
|
+
return capitalizedString;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
fs.readdir(folderPath, (err, files) => {
|
|
28
|
+
if (err) {
|
|
29
|
+
console.error('Error reading folder:', err);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
files.forEach((file) => {
|
|
34
|
+
if (ignore.some((x) => x === file)) return;
|
|
35
|
+
const filePath = path.join(folderPath, file);
|
|
36
|
+
console.log(filePath);
|
|
37
|
+
|
|
38
|
+
fs.readFile(filePath, 'utf8', (err, data) => {
|
|
39
|
+
if (err) {
|
|
40
|
+
console.error('Error reading file:', file, err);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
let fixed = 0;
|
|
46
|
+
const jsonObject = JSON.parse(data);
|
|
47
|
+
if (Array.isArray(jsonObject)) {
|
|
48
|
+
jsonObject.forEach((e) => {
|
|
49
|
+
if (e.name) {
|
|
50
|
+
if (e.name.includes('ERR:')) return;
|
|
51
|
+
if (e.name === e.name.toUpperCase()) {
|
|
52
|
+
const decapped = decap(e.name);
|
|
53
|
+
if (e.name !== decapped) {
|
|
54
|
+
// console.log('decapped:', e.name, decapped);
|
|
55
|
+
e.name = decapped;
|
|
56
|
+
fixed++;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
fs.writeFile(filePath, JSON.stringify(jsonObject, null, 2), (err) => {
|
|
62
|
+
if (err) {
|
|
63
|
+
console.error('Error writing file:', file, err);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
console.log(`fixed: ${fixed} in file: ${file}`);
|
|
69
|
+
}
|
|
70
|
+
} catch (err) {
|
|
71
|
+
console.error('Error parsing JSON in file:', file, err);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function expandEffect() {
|
|
79
|
+
fs.readdir(folderPath, (err, files) => {
|
|
80
|
+
if (err) {
|
|
81
|
+
console.error('Error reading directory:', err);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
files.forEach((file) => {
|
|
86
|
+
if (path.extname(file) === '.json') {
|
|
87
|
+
const filePath = path.join(folderPath, file);
|
|
88
|
+
|
|
89
|
+
fs.readFile(filePath, 'utf8', (err, data) => {
|
|
90
|
+
if (err) {
|
|
91
|
+
console.error(`Error reading file ${file}:`, err);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
try {
|
|
96
|
+
let jsonData = JSON.parse(data);
|
|
97
|
+
let modified = false;
|
|
98
|
+
|
|
99
|
+
jsonData = jsonData.map((obj) => {
|
|
100
|
+
if (obj.hasOwnProperty('effect') && typeof obj.effect === 'string') {
|
|
101
|
+
obj.effect = { description: obj.effect };
|
|
102
|
+
modified = true;
|
|
103
|
+
}
|
|
104
|
+
return obj;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
if (modified) {
|
|
108
|
+
fs.writeFile(filePath, JSON.stringify(jsonData, null, 2), 'utf8', (err) => {
|
|
109
|
+
if (err) {
|
|
110
|
+
console.error(`Error writing file ${file}:`, err);
|
|
111
|
+
} else {
|
|
112
|
+
console.log(`Updated ${file}`);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
} catch (parseError) {
|
|
117
|
+
console.error(`Error parsing JSON in file ${file}:`, parseError);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// run
|
|
126
|
+
|
|
127
|
+
expandEffect();
|
package/scripts/rename.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
|
|
5
|
-
const path = require('path');
|
|
6
|
-
|
|
7
|
-
const folderPath = './lib';
|
|
8
|
-
const ignore = ['manufacturers.json', 'weapons.json', 'systems.json', 'mods.json'];
|
|
9
|
-
|
|
10
|
-
const ignoreWords = ['{VAL}', '({VAL})', '{VAL}+', 'HP', 'GRIT', 'SP', 'AP', '(AP)'];
|
|
11
|
-
|
|
12
|
-
function decap(string) {
|
|
13
|
-
const words = string.split(' ');
|
|
14
|
-
const capitalizedWords = words.map((word) => {
|
|
15
|
-
if (ignoreWords.some((x) => x === word)) return word;
|
|
16
|
-
else if (word === word.toUpperCase()) {
|
|
17
|
-
return word.toLowerCase().replace(/\b\w/g, (l) => l.toUpperCase());
|
|
18
|
-
} else {
|
|
19
|
-
return word;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const capitalizedString = capitalizedWords.join(' ');
|
|
23
|
-
return capitalizedString;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
fs.readdir(folderPath, (err, files) => {
|
|
27
|
-
if (err) {
|
|
28
|
-
console.error('Error reading folder:', err);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
files.forEach((file) => {
|
|
33
|
-
if (ignore.some((x) => x === file)) return;
|
|
34
|
-
const filePath = path.join(folderPath, file);
|
|
35
|
-
console.log(filePath);
|
|
36
|
-
|
|
37
|
-
fs.readFile(filePath, 'utf8', (err, data) => {
|
|
38
|
-
if (err) {
|
|
39
|
-
console.error('Error reading file:', file, err);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
try {
|
|
44
|
-
let fixed = 0;
|
|
45
|
-
const jsonObject = JSON.parse(data);
|
|
46
|
-
if (Array.isArray(jsonObject)) {
|
|
47
|
-
jsonObject.forEach((e) => {
|
|
48
|
-
if (e.name) {
|
|
49
|
-
if (e.name.includes('ERR:')) return;
|
|
50
|
-
if (e.name === e.name.toUpperCase()) {
|
|
51
|
-
const decapped = decap(e.name);
|
|
52
|
-
if (e.name !== decapped) {
|
|
53
|
-
// console.log('decapped:', e.name, decapped);
|
|
54
|
-
e.name = decapped;
|
|
55
|
-
fixed++;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
fs.writeFile(filePath, JSON.stringify(jsonObject, null, 2), (err) => {
|
|
61
|
-
if (err) {
|
|
62
|
-
console.error('Error writing file:', file, err);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
console.log(`fixed: ${fixed} in file: ${file}`);
|
|
68
|
-
}
|
|
69
|
-
} catch (err) {
|
|
70
|
-
console.error('Error parsing JSON in file:', file, err);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
});
|