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.
package/README.md CHANGED
@@ -33,8 +33,8 @@ The validate tournament script does the following:
33
33
  - Fetches the data of a tournament from the Gotchi Battler website
34
34
  - Loops through all the battles in the tournament, bracket by bracket, round by round
35
35
  - For each battle, the logs are fetched from the Gotchi Battler website
36
- - The battle is then simulated using the game logic
37
- - The result of the simulation is compared to the actual result of the battle
36
+ - The battle is then simulated locally using the game logic
37
+ - The result of this simulation is then compared to the logs from the Gotchi Battler website
38
38
 
39
39
  To validate the battles from the RF8 100K Tournament, run the following command:
40
40
 
@@ -46,5 +46,5 @@ Get the tournament id from the URL of the tournament page on the Gotchi Battler
46
46
 
47
47
 
48
48
  PLEASE NOTE:
49
- - Currently, only the tournaments from Rarity Farming season 8 are supported (Tournament IDs 13-15)
49
+ - Currently, only the tournaments from Rarity Farming season 8 and 9 are supported (Tournament IDs 13-15 + 18)
50
50
  - The script can take a while to run, in local testing it took around 20 minutes
@@ -3,5 +3,6 @@ module.exports = {
3
3
  'v1.5': require('./v1.5'),
4
4
  'v1.6': require('./v1.6'),
5
5
  'v1.7': require('./v1.7'),
6
- current: 'v1.7'
6
+ 'v1.8': require('./v1.8'),
7
+ current: 'v1.8'
7
8
  }
@@ -573,6 +573,20 @@ const applyStatItems = (gotchis) => {
573
573
  })
574
574
  }
575
575
 
576
+ /**
577
+ * Remove stat items from gotchis
578
+ * This is used when replaying a battle from logs where the stat items have already been applied
579
+ * @param {Array} gotchis An array of gotchis
580
+ */
581
+ const removeStatItems = (gotchis) => {
582
+ gotchis.forEach(gotchi => {
583
+ // Remove stat items
584
+ if (gotchi.item && gotchi.item.stat && gotchi.item.statValue) {
585
+ gotchi[gotchi.item.stat] -= gotchi.item.statValue
586
+ }
587
+ })
588
+ }
589
+
576
590
  module.exports = {
577
591
  getAlive,
578
592
  getFormationPosition,
@@ -592,5 +606,6 @@ module.exports = {
592
606
  scrambleGotchiIds,
593
607
  prepareTeams,
594
608
  getLogGotchis,
595
- applyStatItems
609
+ applyStatItems,
610
+ removeStatItems
596
611
  }
@@ -0,0 +1,135 @@
1
+ const PASSIVES = ['sharp_blades', 'cloud_of_zen', 'frenzy', 'fortify', 'spread_the_fear', 'cleansing_aura', 'channel_the_coven', 'clan_momentum']
2
+ const DEBUFF_STATUSES = ['bleed', 'stun', 'fear']
3
+ const BUFF_STATUSES = ['taunt']
4
+
5
+ const BUFF_MULT_EFFECTS = {
6
+ cloud_of_zen: {
7
+ magic: 0.138,
8
+ physical: 0.138
9
+ },
10
+ power_up_2: {
11
+ magic: 0.75,
12
+ physical: 0.50
13
+ },
14
+ frenzy: {
15
+ crit: 1.14
16
+ },
17
+ fortify: {
18
+ armor: 1
19
+ },
20
+ taunt: {
21
+ armor: 1.65
22
+ },
23
+ channel_the_coven: {
24
+ magic: 0.18
25
+ },
26
+ clan_momentum: {
27
+ physical: 0.16
28
+ }
29
+ }
30
+
31
+ const BUFF_FLAT_EFFECTS = {
32
+
33
+ }
34
+
35
+ // Combine all buffs
36
+ const BUFFS = [...PASSIVES, ...BUFF_STATUSES, ...Object.keys(BUFF_MULT_EFFECTS), ...Object.keys(BUFF_FLAT_EFFECTS)]
37
+
38
+ const DEBUFF_MULT_EFFECTS = {
39
+ fear: {
40
+ resist: 1
41
+ },
42
+ stun: {
43
+ speed: 0.23
44
+ }
45
+ }
46
+
47
+ const DEBUFF_FLAT_EFFECTS = {
48
+
49
+ }
50
+
51
+ // Combine all debuffs
52
+ const DEBUFFS = [...DEBUFF_STATUSES, ...Object.keys(DEBUFF_MULT_EFFECTS), ...Object.keys(DEBUFF_FLAT_EFFECTS)]
53
+
54
+ const MULTS = {
55
+ // General
56
+ FRONT_ROW_ATK_BONUS: 1.1,
57
+ FRONT_ROW_DEF_NERF: 0.8,
58
+ EXPIRE_LEADERSKILL: 0,
59
+ SPEED_PENALTY: 2.5,
60
+ MAX_STATUSES: 3,
61
+ CRIT_MULTIPLIER_FAST: 2,
62
+ CRIT_MULTIPLIER_SLOW: 2,
63
+ // Ninja
64
+ SHARP_BLADES_BLEED_CHANCE: 0.76,
65
+ BLEED_DAMAGE: 10,
66
+ SPECTRAL_STRIKE_DAMAGE: 1.25,
67
+ // Enlightened
68
+ // Cleaver
69
+ CLEAVE_DAMAGE: 1.55,
70
+ // Tank
71
+ COUNTER_SPEED_MULTIPLIER: 0.5,
72
+ FORTIFY_COUNTER_CHANCE: 32,
73
+ COUNTER_DAMAGE: 1.9,
74
+ FORTIFY_COUNTER_DAMAGE: 1.9,
75
+ // Cursed
76
+ SPREAD_THE_FEAR_CHANCE: 0.84,
77
+ SPREAD_THE_FEAR_SPEED_PENALTY: 0,
78
+ SPREAD_THE_FEAR_CURSE_DAMAGE: 1.3,
79
+ CURSE_DAMAGE: 1.2,
80
+ CURSE_HEAL: 1,
81
+ CURSE_SPEED_PENALTY: 0,
82
+ // Healer
83
+ CLEANSING_AURA_REGEN: 0.2,
84
+ CLEANSING_AURA_NON_HEALER_REGEN: 0.1,
85
+ CLEANSING_AURA_HEAL: 3.4,
86
+ CLEANSING_AURA_HEAL_SPEED_PENALTY: 1,
87
+ BLESSING_HEAL: 2.7,
88
+ BLESSING_HEAL_SPEED_PENALTY: 1,
89
+ BLESSING_HEAL_CRIT_MULTIPLIER: 1.25,
90
+ // Mage
91
+ CHANNEL_THE_COVEN_STUN_CHANCE: 0.9,
92
+ THUNDER_STUN_CHANCE: 0.65,
93
+ THUNDER_DAMAGE: 1,
94
+ // Troll
95
+ CLAN_MOMENTUM_CHANCE: 0.9,
96
+ DEVESTATING_SMASH_X2_CHANCE: 0.65,
97
+ DEVESTATING_SMASH_DAMAGE: 2.5,
98
+ DEVESTATING_SMASH_X2_DAMAGE: 1.9,
99
+ }
100
+
101
+ const passiveIcons = {
102
+ 'sharp_blades': 'https://game-icons.net/1x1/lorc/plain-dagger.html',
103
+ 'cloud_of_zen': 'https://game-icons.net/1x1/lorc/meditation.html',
104
+ 'frenzy': 'https://game-icons.net/1x1/lorc/totem-head.html',
105
+ 'fortify': 'https://game-icons.net/1x1/lorc/crenulated-shield.html',
106
+ 'spread_the_fear': 'https://game-icons.net/1x1/lorc/evil-book.html',
107
+ 'cleansing_aura': 'https://game-icons.net/1x1/lorc/aura.html',
108
+ 'channel_the_coven': 'https://game-icons.net/1x1/lorc/witch-flight.html',
109
+ 'clan_momentum': 'https://game-icons.net/1x1/delapouite/bully-minion.html'
110
+ }
111
+
112
+ const debuffIcons = {
113
+ 'bleed': 'https://game-icons.net/1x1/lorc/broken-heart.html',
114
+ 'stun': 'https://game-icons.net/1x1/sbed/electric.html',
115
+ 'fear': 'https://game-icons.net/1x1/lorc/screaming.html'
116
+ }
117
+
118
+ const buffIcons = {
119
+ 'taunt': 'https://game-icons.net/1x1/lorc/archery-target.html',
120
+ 'cloud_of_zen': 'https://game-icons.net/1x1/lorc/strong.html',
121
+ 'power_up_2': 'https://game-icons.net/1x1/delapouite/mighty-force.html'
122
+ }
123
+
124
+ module.exports = {
125
+ PASSIVES,
126
+ DEBUFF_STATUSES,
127
+ BUFF_STATUSES,
128
+ BUFF_MULT_EFFECTS,
129
+ BUFF_FLAT_EFFECTS,
130
+ BUFFS,
131
+ DEBUFF_MULT_EFFECTS,
132
+ DEBUFF_FLAT_EFFECTS,
133
+ DEBUFFS,
134
+ MULTS
135
+ }