lol-constants 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,7 @@ import './generate-item-keys';
6
6
  import './generate-item-names';
7
7
  import './generate-rune-ids';
8
8
  import './generate-rune-names';
9
+ import './generate-rune-picking-relationships';
9
10
  import './generate-rune-sets-by-rune-names';
10
11
  import './generate-rune-sets';
11
12
  import './generate-spell-ids-by-name';
@@ -8,6 +8,7 @@ require("./generate-item-keys");
8
8
  require("./generate-item-names");
9
9
  require("./generate-rune-ids");
10
10
  require("./generate-rune-names");
11
+ require("./generate-rune-picking-relationships");
11
12
  require("./generate-rune-sets-by-rune-names");
12
13
  require("./generate-rune-sets");
13
14
  require("./generate-spell-ids-by-name");
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const runesReforged_json_1 = __importDefault(require("../runesReforged.json"));
7
+ const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
8
+ (async () => {
9
+ const constant = 'RunePickingRelationships';
10
+ const relationships = {};
11
+ // Determine all of the runes (2-3) that each rune in the game
12
+ // has a horizontal-set "relationship" with.
13
+ // It means that they are dependent on that rune
14
+ // for picking purposes.
15
+ // Only one rune can be picked per h-set.
16
+ for (const category of runesReforged_json_1.default) {
17
+ for (const { runes, } of category.slots) {
18
+ for (const { id: baseRuneId, } of runes) {
19
+ // Assign each of the neighboring runes to this rune's r-ship array.
20
+ for (const { id, } of runes) {
21
+ // Let us simply assume that there is no such thing as a relationship
22
+ // with oneself, therefore skip.
23
+ if (baseRuneId == id)
24
+ continue;
25
+ if (!relationships[baseRuneId])
26
+ relationships[baseRuneId] = [];
27
+ relationships[baseRuneId].push(String(id));
28
+ }
29
+ }
30
+ }
31
+ }
32
+ // Create workshop arrays for each horizontal-set of stat runes.
33
+ const offense = ['5005', '5007', '5008'];
34
+ const flex = ['5002f', '5003f', '5008f'];
35
+ const defense = ['5001', '5002', '5003'];
36
+ for (let hSet of [
37
+ offense,
38
+ flex,
39
+ defense,
40
+ ]) {
41
+ for (let baseStatRuneId of hSet) {
42
+ for (let statRuneId of hSet) {
43
+ // Skip self
44
+ if (baseStatRuneId == statRuneId)
45
+ continue;
46
+ if (!relationships[baseStatRuneId])
47
+ relationships[baseStatRuneId] = [];
48
+ relationships[baseStatRuneId].push(statRuneId);
49
+ }
50
+ }
51
+ }
52
+ await (0, writeToTmpFile_1.writeToTmpFile)(constant, {
53
+ constName: constant,
54
+ comment: `All of the runes and their relationships to other runes in terms of picking. Only one rune can be picked in a rune horizontal-set, each main rune that has a relationship to another rune unselects the other rune if the main rune is picked.`,
55
+ json: relationships,
56
+ });
57
+ })();
@@ -13,6 +13,9 @@ const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
13
13
  SecondaryTrees: {},
14
14
  Keystones: {},
15
15
  StatRunes: {},
16
+ // No HSets for now
17
+ // RunesByHSet: {},
18
+ // StatRunesByHSet: [],
16
19
  };
17
20
  const keystoneHSetIdx = 0;
18
21
  let totalRuneAmt = 0;
@@ -39,15 +42,29 @@ const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
39
42
  if (currentHSetIdx == keystoneHSetIdx) {
40
43
  runeSets.Keystones[id] = runeName;
41
44
  }
45
+ // No HSets for now
46
+ // Add to RunesByHSet
47
+ // if (!(runeTreeName in runeSets.RunesByHSet)) runeSets.RunesByHSet[runeTreeName] = []
48
+ // if (!runeSets.RunesByHSet[runeTreeName]![currentHSetIdx]) runeSets.RunesByHSet[runeTreeName]![currentHSetIdx] = {}
49
+ // runeSets.RunesByHSet[runeTreeName]![currentHSetIdx]![id] = runeName
42
50
  }
43
51
  ++currentHSetIdx;
44
52
  }
45
53
  }
54
+ // No HSets for now
55
+ // let currentRuneIdx = 0
56
+ // let currentHSetIdx = 0
46
57
  let statRuneId;
47
58
  for (statRuneId in StatRunes_1.StatRunes) {
48
59
  totalRuneAmt += 1;
49
60
  // Add to StatRunes
50
61
  runeSets.StatRunes[statRuneId] = StatRunes_1.StatRunes[statRuneId];
62
+ // No HSets for now
63
+ // // Add to StatRunesByHSet
64
+ // if (!runeSets.StatRunesByHSet[currentHSetIdx]) runeSets.StatRunesByHSet[currentHSetIdx] = {}
65
+ // runeSets.StatRunesByHSet[currentHSetIdx]![statRuneId] = StatRunes[ statRuneId ]
66
+ // ++currentRuneIdx
67
+ // if (currentRuneIdx % 3 == 0) ++currentHSetIdx
51
68
  }
52
69
  // Write to file
53
70
  await (0, writeToTmpFile_1.writeToTmpFile)(constant, {
@@ -73,7 +90,17 @@ const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
73
90
  6: '...StatRunes',
74
91
  },
75
92
  keysToSpread: [1, 2, 3, 4, 5, 6],
76
- }, {
93
+ },
94
+ // No HSets for now
95
+ // {
96
+ // constName: 'RunesByHSet',
97
+ // json: runeSets.RunesByHSet,
98
+ // },
99
+ // {
100
+ // constName: 'StatRunesByHSet',
101
+ // json: runeSets.StatRunesByHSet,
102
+ // },
103
+ {
77
104
  constName: constant,
78
105
  comment: `Contains all Rune IDs that are known to man in the game of League of Legends. Sorted by various useful categories. There are a total of ${totalRuneAmt} runes in the game.`,
79
106
  json: {
@@ -82,6 +109,9 @@ const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
82
109
  'Keystones': 'Keystones',
83
110
  'StatRunes': 'StatRunes',
84
111
  'All': 'All',
112
+ // No HSets for now
113
+ // 'RunesByHSet': 'RunesByHSet',
114
+ // 'StatRunesByHSet': 'StatRunesByHSet',
85
115
  },
86
116
  keysToSpread: [
87
117
  'PrimaryTrees',
@@ -89,6 +119,9 @@ const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
89
119
  'Keystones',
90
120
  'StatRunes',
91
121
  'All',
122
+ // No HSets for now
123
+ // 'RunesByHSet',
124
+ // 'StatRunesByHSet',
92
125
  ],
93
126
  });
94
127
  })();
@@ -0,0 +1,77 @@
1
+ /**
2
+ * All of the runes and their relationships to other runes in terms of picking. Only one rune can be picked in a rune horizontal-set, each main rune that has a relationship to another rune unselects the other rune if the main rune is picked.
3
+ */
4
+ export declare const RunePickingRelationships: {
5
+ readonly "5001": readonly ["5002", "5003"];
6
+ readonly "5002": readonly ["5001", "5003"];
7
+ readonly "5003": readonly ["5001", "5002"];
8
+ readonly "5005": readonly ["5007", "5008"];
9
+ readonly "5007": readonly ["5005", "5008"];
10
+ readonly "5008": readonly ["5005", "5007"];
11
+ readonly "8005": readonly ["8008", "8021", "8010"];
12
+ readonly "8008": readonly ["8005", "8021", "8010"];
13
+ readonly "8009": readonly ["9101", "9111"];
14
+ readonly "8010": readonly ["8005", "8008", "8021"];
15
+ readonly "8014": readonly ["8017", "8299"];
16
+ readonly "8017": readonly ["8014", "8299"];
17
+ readonly "8021": readonly ["8005", "8008", "8010"];
18
+ readonly "8105": readonly ["8135", "8134", "8106"];
19
+ readonly "8106": readonly ["8135", "8134", "8105"];
20
+ readonly "8112": readonly ["8124", "8128", "9923"];
21
+ readonly "8120": readonly ["8136", "8138"];
22
+ readonly "8124": readonly ["8112", "8128", "9923"];
23
+ readonly "8126": readonly ["8139", "8143"];
24
+ readonly "8128": readonly ["8112", "8124", "9923"];
25
+ readonly "8134": readonly ["8135", "8105", "8106"];
26
+ readonly "8135": readonly ["8134", "8105", "8106"];
27
+ readonly "8136": readonly ["8120", "8138"];
28
+ readonly "8138": readonly ["8136", "8120"];
29
+ readonly "8139": readonly ["8126", "8143"];
30
+ readonly "8143": readonly ["8126", "8139"];
31
+ readonly "8210": readonly ["8234", "8233"];
32
+ readonly "8214": readonly ["8229", "8230"];
33
+ readonly "8224": readonly ["8226", "8275"];
34
+ readonly "8226": readonly ["8224", "8275"];
35
+ readonly "8229": readonly ["8214", "8230"];
36
+ readonly "8230": readonly ["8214", "8229"];
37
+ readonly "8232": readonly ["8237", "8236"];
38
+ readonly "8233": readonly ["8210", "8234"];
39
+ readonly "8234": readonly ["8210", "8233"];
40
+ readonly "8236": readonly ["8237", "8232"];
41
+ readonly "8237": readonly ["8232", "8236"];
42
+ readonly "8242": readonly ["8451", "8453"];
43
+ readonly "8275": readonly ["8224", "8226"];
44
+ readonly "8299": readonly ["8014", "8017"];
45
+ readonly "8304": readonly ["8306", "8313"];
46
+ readonly "8306": readonly ["8304", "8313"];
47
+ readonly "8313": readonly ["8306", "8304"];
48
+ readonly "8316": readonly ["8321", "8345"];
49
+ readonly "8321": readonly ["8316", "8345"];
50
+ readonly "8345": readonly ["8321", "8316"];
51
+ readonly "8347": readonly ["8410", "8352"];
52
+ readonly "8351": readonly ["8360", "8369"];
53
+ readonly "8352": readonly ["8347", "8410"];
54
+ readonly "8360": readonly ["8351", "8369"];
55
+ readonly "8369": readonly ["8351", "8360"];
56
+ readonly "8401": readonly ["8446", "8463"];
57
+ readonly "8410": readonly ["8347", "8352"];
58
+ readonly "8429": readonly ["8444", "8473"];
59
+ readonly "8437": readonly ["8439", "8465"];
60
+ readonly "8439": readonly ["8437", "8465"];
61
+ readonly "8444": readonly ["8429", "8473"];
62
+ readonly "8446": readonly ["8463", "8401"];
63
+ readonly "8451": readonly ["8453", "8242"];
64
+ readonly "8453": readonly ["8451", "8242"];
65
+ readonly "8463": readonly ["8446", "8401"];
66
+ readonly "8465": readonly ["8437", "8439"];
67
+ readonly "8473": readonly ["8429", "8444"];
68
+ readonly "9101": readonly ["9111", "8009"];
69
+ readonly "9103": readonly ["9104", "9105"];
70
+ readonly "9104": readonly ["9105", "9103"];
71
+ readonly "9105": readonly ["9104", "9103"];
72
+ readonly "9111": readonly ["9101", "8009"];
73
+ readonly "9923": readonly ["8112", "8124", "8128"];
74
+ readonly "5002f": readonly ["5003f", "5008f"];
75
+ readonly "5003f": readonly ["5002f", "5008f"];
76
+ readonly "5008f": readonly ["5002f", "5003f"];
77
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RunePickingRelationships = void 0;
4
+ /**
5
+ * All of the runes and their relationships to other runes in terms of picking. Only one rune can be picked in a rune horizontal-set, each main rune that has a relationship to another rune unselects the other rune if the main rune is picked.
6
+ */
7
+ exports.RunePickingRelationships = { "5001": ["5002", "5003"], "5002": ["5001", "5003"], "5003": ["5001", "5002"], "5005": ["5007", "5008"], "5007": ["5005", "5008"], "5008": ["5005", "5007"], "8005": ["8008", "8021", "8010"], "8008": ["8005", "8021", "8010"], "8009": ["9101", "9111"], "8010": ["8005", "8008", "8021"], "8014": ["8017", "8299"], "8017": ["8014", "8299"], "8021": ["8005", "8008", "8010"], "8105": ["8135", "8134", "8106"], "8106": ["8135", "8134", "8105"], "8112": ["8124", "8128", "9923"], "8120": ["8136", "8138"], "8124": ["8112", "8128", "9923"], "8126": ["8139", "8143"], "8128": ["8112", "8124", "9923"], "8134": ["8135", "8105", "8106"], "8135": ["8134", "8105", "8106"], "8136": ["8120", "8138"], "8138": ["8136", "8120"], "8139": ["8126", "8143"], "8143": ["8126", "8139"], "8210": ["8234", "8233"], "8214": ["8229", "8230"], "8224": ["8226", "8275"], "8226": ["8224", "8275"], "8229": ["8214", "8230"], "8230": ["8214", "8229"], "8232": ["8237", "8236"], "8233": ["8210", "8234"], "8234": ["8210", "8233"], "8236": ["8237", "8232"], "8237": ["8232", "8236"], "8242": ["8451", "8453"], "8275": ["8224", "8226"], "8299": ["8014", "8017"], "8304": ["8306", "8313"], "8306": ["8304", "8313"], "8313": ["8306", "8304"], "8316": ["8321", "8345"], "8321": ["8316", "8345"], "8345": ["8321", "8316"], "8347": ["8410", "8352"], "8351": ["8360", "8369"], "8352": ["8347", "8410"], "8360": ["8351", "8369"], "8369": ["8351", "8360"], "8401": ["8446", "8463"], "8410": ["8347", "8352"], "8429": ["8444", "8473"], "8437": ["8439", "8465"], "8439": ["8437", "8465"], "8444": ["8429", "8473"], "8446": ["8463", "8401"], "8451": ["8453", "8242"], "8453": ["8451", "8242"], "8463": ["8446", "8401"], "8465": ["8437", "8439"], "8473": ["8429", "8444"], "9101": ["9111", "8009"], "9103": ["9104", "9105"], "9104": ["9105", "9103"], "9105": ["9104", "9103"], "9111": ["9101", "8009"], "9923": ["8112", "8124", "8128"], "5002f": ["5003f", "5008f"], "5003f": ["5002f", "5008f"], "5008f": ["5002f", "5003f"] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lol-constants",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "League of Legends constants and data resources, such as champion, item, runes reforged, summoner spells.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",