gotchi-battler-game-logic 2.0.8 → 3.0.0

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.
@@ -0,0 +1,37 @@
1
+ {
2
+ "godlike": {
3
+ "brs": 783,
4
+ "traits": [-10, 109],
5
+ "eyes": 94
6
+ },
7
+ "mythical": {
8
+ "brs": 690,
9
+ "traits": [-5, 104],
10
+ "eyes": 92
11
+ },
12
+ "legendary": {
13
+ "brs": 638,
14
+ "traits": [-1, 100],
15
+ "eyes": 90
16
+ },
17
+ "rare": {
18
+ "brs": 597,
19
+ "traits": [4, 95],
20
+ "eyes": 89
21
+ },
22
+ "uncommon": {
23
+ "brs": 556,
24
+ "traits": [12, 87],
25
+ "eyes": 87
26
+ },
27
+ "common": {
28
+ "brs": 501,
29
+ "traits": [19, 80],
30
+ "eyes": 83
31
+ },
32
+ "garbage": {
33
+ "brs": 400,
34
+ "traits": [49, 50],
35
+ "eyes": 50
36
+ }
37
+ }
@@ -0,0 +1,10 @@
1
+ [
2
+ ["avg-magic", "avg-physical"],
3
+ ["avg-magic", "avg-physical"],
4
+ ["avg-magic", "avg-physical"],
5
+ ["avg-magic", "avg-physical"],
6
+ ["avg-magic", "avg-physical"],
7
+ ["avg-magic", "avg-physical"],
8
+ ["avg-magic", "avg-magic"],
9
+ ["avg-physical", "avg-physical"]
10
+ ]
@@ -63,5 +63,10 @@
63
63
  "id": 15,
64
64
  "name": "RF8 100K GHST Tournament",
65
65
  "gameLogicVersion": "v1.6"
66
+ },
67
+ {
68
+ "id": 18,
69
+ "name": "RF9 100K GHST Tournament 1",
70
+ "gameLogicVersion": "v1.7"
66
71
  }
67
72
  ]
@@ -18,7 +18,7 @@ const main = async (battleId, seed, gameLogicVersion) => {
18
18
  if (!gameVersions[gameLogicVersion]) throw new Error('Invalid game logic version')
19
19
 
20
20
  const gameLoop = gameVersions[gameLogicVersion].gameLoop
21
-
21
+
22
22
  const res = await axios.get(`https://storage.googleapis.com/gotchi-battler-live_battles/v1/${battleId}.json`)
23
23
 
24
24
  if (!res || !res.data || !res.data.layout) {
@@ -29,11 +29,20 @@ const main = async (battleId, seed, gameLogicVersion) => {
29
29
  // Transform the logs to in-game teams
30
30
  const teams = logToInGameTeams(res.data)
31
31
 
32
+ // If the game logic has a removeStatItems function, call it
33
+ // This is so the item buffs don't get applied twice
34
+ const helpers = require(`../game-logic/${gameLogicVersion}/helpers`)
35
+
36
+ if (helpers.removeStatItems) {
37
+ helpers.removeStatItems(helpers.getAlive(teams[0]))
38
+ helpers.removeStatItems(helpers.getAlive(teams[1]))
39
+ }
40
+
32
41
  try {
33
42
  // Run the game loop
34
43
  const logs = await gameLoop(teams[0], teams[1], seed, true)
35
44
 
36
- fs.writeFileSync(path.join(__dirname, 'output', `${battleId}_${Date.now()}.json`), JSON.stringify(logs, null, '\t'))
45
+ // fs.writeFileSync(path.join(__dirname, 'output', `${battleId}_${Date.now()}.json`), JSON.stringify(logs, null, '\t'))
37
46
 
38
47
  // Validate the results
39
48
  compareLogs(res.data, logs)