gotchi-battler-game-logic 4.0.13 → 4.0.15

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.
@@ -1,112 +1,10 @@
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']
1
+ const AUTO_ATTACK_MULTIPLIER = 0.85
2
+ const COUNTER_ATTACK_MULTIPLIER = 0.5
4
3
 
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
- }
4
+ const DEFAULT_MAX_STATUSES = 9
100
5
 
101
6
  module.exports = {
102
- PASSIVES,
103
- DEBUFF_STATUSES,
104
- BUFF_STATUSES,
105
- BUFF_MULT_EFFECTS,
106
- BUFF_FLAT_EFFECTS,
107
- BUFFS,
108
- DEBUFF_MULT_EFFECTS,
109
- DEBUFF_FLAT_EFFECTS,
110
- DEBUFFS,
111
- MULTS
7
+ AUTO_ATTACK_MULTIPLIER,
8
+ COUNTER_ATTACK_MULTIPLIER,
9
+ DEFAULT_MAX_STATUSES
112
10
  }
@@ -1,4 +1,5 @@
1
1
  const STATUSES = require('./statuses.json')
2
+ const { DEFAULT_MAX_STATUSES } = require('./constants')
2
3
 
3
4
  const getTeamGotchis = (team) => {
4
5
  return [...team.formation.front, ...team.formation.back].filter(x => x)
@@ -89,14 +90,18 @@ const getNextToAct = (team1, team2, rng) => {
89
90
 
90
91
  aliveGotchis.sort((a, b) => a.actionDelay - b.actionDelay)
91
92
 
92
- let toAct = aliveGotchis.filter(gotchi => gotchi.actionDelay === aliveGotchis[0].actionDelay)
93
+ // actionDelay is stored at 3 decimal precision; compare using scaled ints to avoid float-equality issues.
94
+ const minActionDelay = Math.round(aliveGotchis[0].actionDelay * 1000)
95
+ let toAct = aliveGotchis.filter(gotchi => Math.round(gotchi.actionDelay * 1000) === minActionDelay)
93
96
 
94
97
  // If only one gotchi can act then return it
95
98
  if (toAct.length === 1) return getFormationPosition(team1, team2, toAct[0].id)
96
99
 
97
100
  // Lowest speeds win tiebreaker
98
101
  toAct.sort((a, b) => a.speed - b.speed)
99
- toAct = toAct.filter(gotchi => gotchi.speed === toAct[0].speed)
102
+ // speed is stored at 1 decimal precision; compare using scaled ints to avoid float-equality issues.
103
+ const minSpeed = Math.round(toAct[0].speed * 10)
104
+ toAct = toAct.filter(gotchi => Math.round(gotchi.speed * 10) === minSpeed)
100
105
 
101
106
  // If only one gotchi can act then return it
102
107
 
@@ -298,8 +303,6 @@ const getHealFromMultiplier = (healingGotchi, target, multiplier) => {
298
303
  const getModifiedStats = (gotchi) => {
299
304
  const statMods = {}
300
305
 
301
- const decimalStats = ['criticalRate', 'criticalDamage']
302
-
303
306
  gotchi.statuses.forEach(statusCode => {
304
307
  const statusStatMods = {}
305
308
  const status = getStatusByCode(statusCode)
@@ -320,10 +323,11 @@ const getModifiedStats = (gotchi) => {
320
323
  throw new Error(`Invalid value type for status ${statusCode}: ${statModifier.valueType}`)
321
324
  }
322
325
 
323
- if (decimalStats.includes(statModifier.statName)) {
324
- statChange = Math.round(statChange * 100) / 100
325
- } else {
326
+ // Preserve our stat precision model.
327
+ if (statModifier.statName === 'health') {
326
328
  statChange = Math.round(statChange)
329
+ } else {
330
+ statChange = Math.round(statChange * 10) / 10
327
331
  }
328
332
 
329
333
  if (statusStatMods[statModifier.statName]) {
@@ -352,6 +356,16 @@ const getModifiedStats = (gotchi) => {
352
356
  }
353
357
  })
354
358
 
359
+ // Normalize precision after all mods (avoid accumulating float noise).
360
+ for (const key of ['speed', 'attack', 'defense', 'criticalRate', 'criticalDamage', 'resist', 'focus']) {
361
+ if (typeof modifiedGotchi[key] === 'number' && Number.isFinite(modifiedGotchi[key])) {
362
+ modifiedGotchi[key] = Math.round(modifiedGotchi[key] * 10) / 10
363
+ }
364
+ }
365
+ if (typeof modifiedGotchi.health === 'number' && Number.isFinite(modifiedGotchi.health)) {
366
+ modifiedGotchi.health = Math.round(modifiedGotchi.health)
367
+ }
368
+
355
369
  // Enforce practical lower bounds for certain stats regardless of whether they were modified by statuses
356
370
  if (modifiedGotchi.defense < 1) {
357
371
  modifiedGotchi.defense = 1
@@ -460,7 +474,7 @@ const addStatusToGotchi = (gotchi, statusCode, count) => {
460
474
 
461
475
  const status = getStatusByCode(statusCode)
462
476
 
463
- const maxStack = status.maxStack || 3
477
+ const maxStack = status.maxStack || DEFAULT_MAX_STATUSES
464
478
 
465
479
  // Only allow a maximum of maxStack of the same status
466
480
  const currentStacks = gotchi.statuses.filter(x => x === status.code).length
@@ -519,6 +533,8 @@ const prepareTeams = (allAliveGotchis, team1, team2) => {
519
533
 
520
534
  // Apply stat items
521
535
  applyStatItems(allAliveGotchis)
536
+ // Apply crystals
537
+ applyCrystals(allAliveGotchis)
522
538
 
523
539
  allAliveGotchis.forEach(x => {
524
540
  // Add statuses property to all gotchis
@@ -606,8 +622,21 @@ const getLogGotchis = (allAliveGotchis) => {
606
622
  const applyStatItems = (gotchis) => {
607
623
  gotchis.forEach(gotchi => {
608
624
  // Apply stat items
609
- if (gotchi.item && gotchi.item.stat && gotchi.item.statValue) {
610
- gotchi[gotchi.item.stat] += gotchi.item.statValue
625
+ // Support both shapes:
626
+ // - gotchi.itemExpanded: full item object (preferred)
627
+ // - gotchi.item: full item object (legacy)
628
+ const item = gotchi.itemExpanded || gotchi.item
629
+ if (item && item.stat && item.statValue != null) {
630
+ const v = Number(item.statValue)
631
+ if (!Number.isFinite(v)) return
632
+ gotchi[item.stat] += v
633
+
634
+ // Preserve stat precision model
635
+ if (item.stat === 'health') {
636
+ gotchi.health = Math.round(gotchi.health)
637
+ } else {
638
+ gotchi[item.stat] = Math.round(gotchi[item.stat] * 10) / 10
639
+ }
611
640
  }
612
641
  })
613
642
  }
@@ -620,8 +649,64 @@ const applyStatItems = (gotchis) => {
620
649
  const removeStatItems = (gotchis) => {
621
650
  gotchis.forEach(gotchi => {
622
651
  // Remove stat items
623
- if (gotchi.item && gotchi.item.stat && gotchi.item.statValue) {
624
- gotchi[gotchi.item.stat] -= gotchi.item.statValue
652
+ const item = gotchi.itemExpanded || gotchi.item
653
+ if (item && item.stat && item.statValue != null) {
654
+ const v = Number(item.statValue)
655
+ if (!Number.isFinite(v)) return
656
+ gotchi[item.stat] -= v
657
+
658
+ if (item.stat === 'health') {
659
+ gotchi.health = Math.round(gotchi.health)
660
+ } else {
661
+ gotchi[item.stat] = Math.round(gotchi[item.stat] * 10) / 10
662
+ }
663
+ }
664
+ })
665
+ }
666
+
667
+ /**
668
+ * Apply crystals to gotchis.
669
+ * Expects crystals to be present as crystalSlot{n}Expanded objects (preferred).
670
+ */
671
+ const applyCrystals = (gotchis) => {
672
+ gotchis.forEach((gotchi) => {
673
+ for (let i = 1; i <= 6; i++) {
674
+ const crystal = gotchi[`crystalSlot${i}Expanded`]
675
+ if (!crystal || !crystal.stat || crystal.statValue == null) continue
676
+
677
+ const v = Number(crystal.statValue)
678
+ if (!Number.isFinite(v)) continue
679
+
680
+ gotchi[crystal.stat] += v
681
+
682
+ if (crystal.stat === 'health') {
683
+ gotchi.health = Math.round(gotchi.health)
684
+ } else {
685
+ gotchi[crystal.stat] = Math.round(gotchi[crystal.stat] * 10) / 10
686
+ }
687
+ }
688
+ })
689
+ }
690
+
691
+ /**
692
+ * Remove crystals from gotchis (for log replays if needed).
693
+ */
694
+ const removeCrystals = (gotchis) => {
695
+ gotchis.forEach((gotchi) => {
696
+ for (let i = 1; i <= 6; i++) {
697
+ const crystal = gotchi[`crystalSlot${i}Expanded`]
698
+ if (!crystal || !crystal.stat || crystal.statValue == null) continue
699
+
700
+ const v = Number(crystal.statValue)
701
+ if (!Number.isFinite(v)) continue
702
+
703
+ gotchi[crystal.stat] -= v
704
+
705
+ if (crystal.stat === 'health') {
706
+ gotchi.health = Math.round(gotchi.health)
707
+ } else {
708
+ gotchi[crystal.stat] = Math.round(gotchi[crystal.stat] * 10) / 10
709
+ }
625
710
  }
626
711
  })
627
712
  }
@@ -682,9 +767,11 @@ const focusCheck = (attackingTeam, attackingGotchi, targetGotchi, rng) => {
682
767
  if (attackingTeamGotchis.find(gotchi => gotchi.id === targetGotchi.id)) {
683
768
  return true
684
769
  } else {
685
- // Status apply chance is clamp(0.5 + (FOC - RES) / 400, 0.15, 0.95)
686
- // This reduces how often we saturate at the clamp endpoints (0.15/0.95) when Focus/Resist grades differ.
687
- const chance = Math.max(Math.min(0.5 + (modifiedAttackingGotchi.focus - modifiedTargetGotchi.resist) / 400, 0.95), 0.15)
770
+ // Status apply chance is clamp(0.5 + (FOC - RES) / K, 0.15, 0.95)
771
+ // With the new 0.1-precision stat scale, Focus/Resist are much smaller, so we use a smaller K
772
+ // to keep FOC/RES impactful. Design target: ±20 should saturate clamps.
773
+ const K = 40
774
+ const chance = Math.max(Math.min(0.5 + (modifiedAttackingGotchi.focus - modifiedTargetGotchi.resist) / K, 0.95), 0.15)
688
775
 
689
776
  const result = rng() < chance
690
777
 
@@ -730,6 +817,8 @@ module.exports = {
730
817
  getLogGotchis,
731
818
  applyStatItems,
732
819
  removeStatItems,
820
+ applyCrystals,
821
+ removeCrystals,
733
822
  getTeamStats,
734
823
  getStatusByCode,
735
824
  getTeamSpecialBars,
@@ -2,14 +2,14 @@
2
2
  {
3
3
  "code": "spd_up",
4
4
  "name": "Speed Buff",
5
- "description": "+15% SPD per stack",
5
+ "description": "+10% SPD per stack",
6
6
  "category": "stat_modifier",
7
7
  "isBuff": true,
8
8
  "maxStack": null,
9
9
  "statModifiers": [
10
10
  {
11
11
  "statName": "speed",
12
- "value": 15,
12
+ "value": 10,
13
13
  "valueType": "percent"
14
14
  }
15
15
  ]
@@ -17,14 +17,14 @@
17
17
  {
18
18
  "code": "atk_up",
19
19
  "name": "Attack Buff",
20
- "description": "+8% ATK per stack",
20
+ "description": "+10% ATK per stack",
21
21
  "category": "stat_modifier",
22
22
  "isBuff": true,
23
23
  "maxStack": null,
24
24
  "statModifiers": [
25
25
  {
26
26
  "statName": "attack",
27
- "value": 8,
27
+ "value": 10,
28
28
  "valueType": "percent"
29
29
  }
30
30
  ]
@@ -32,14 +32,14 @@
32
32
  {
33
33
  "code": "def_up",
34
34
  "name": "Defense Buff",
35
- "description": "+8% DEF per stack",
35
+ "description": "+10% DEF per stack",
36
36
  "category": "stat_modifier",
37
37
  "isBuff": true,
38
38
  "maxStack": null,
39
39
  "statModifiers": [
40
40
  {
41
41
  "statName": "defense",
42
- "value": 8,
42
+ "value": 10,
43
43
  "valueType": "percent"
44
44
  }
45
45
  ]
@@ -47,74 +47,74 @@
47
47
  {
48
48
  "code": "crt_up",
49
49
  "name": "Critical-Rate Buff",
50
- "description": "+2 CRT per stack",
50
+ "description": "+10% CRT per stack",
51
51
  "category": "stat_modifier",
52
52
  "isBuff": true,
53
53
  "maxStack": null,
54
54
  "statModifiers": [
55
55
  {
56
56
  "statName": "criticalRate",
57
- "value": 2,
58
- "valueType": "flat"
57
+ "value": 10,
58
+ "valueType": "percent"
59
59
  }
60
60
  ]
61
61
  },
62
62
  {
63
63
  "code": "crd_up",
64
64
  "name": "Critical-Damage Buff",
65
- "description": "+8 CRD per stack",
65
+ "description": "+10% CRD per stack",
66
66
  "category": "stat_modifier",
67
67
  "isBuff": true,
68
68
  "maxStack": null,
69
69
  "statModifiers": [
70
70
  {
71
71
  "statName": "criticalDamage",
72
- "value": 8,
73
- "valueType": "flat"
72
+ "value": 10,
73
+ "valueType": "percent"
74
74
  }
75
75
  ]
76
76
  },
77
77
  {
78
78
  "code": "res_up",
79
79
  "name": "Resistance Buff",
80
- "description": "+14 RES per stack",
80
+ "description": "+10% RES per stack",
81
81
  "category": "stat_modifier",
82
82
  "isBuff": true,
83
83
  "maxStack": null,
84
84
  "statModifiers": [
85
85
  {
86
86
  "statName": "resist",
87
- "value": 14,
88
- "valueType": "flat"
87
+ "value": 10,
88
+ "valueType": "percent"
89
89
  }
90
90
  ]
91
91
  },
92
92
  {
93
93
  "code": "foc_up",
94
94
  "name": "Focus Buff",
95
- "description": "+12 FOC per stack",
95
+ "description": "+10% FOC per stack",
96
96
  "category": "stat_modifier",
97
97
  "isBuff": true,
98
98
  "maxStack": null,
99
99
  "statModifiers": [
100
100
  {
101
101
  "statName": "focus",
102
- "value": 12,
103
- "valueType": "flat"
102
+ "value": 10,
103
+ "valueType": "percent"
104
104
  }
105
105
  ]
106
106
  },
107
107
  {
108
108
  "code": "spd_down",
109
109
  "name": "Speed Debuff",
110
- "description": "-15% SPD per stack",
110
+ "description": "-10% SPD per stack",
111
111
  "category": "stat_modifier",
112
112
  "isBuff": false,
113
113
  "maxStack": null,
114
114
  "statModifiers": [
115
115
  {
116
116
  "statName": "speed",
117
- "value": -15,
117
+ "value": -10,
118
118
  "valueType": "percent"
119
119
  }
120
120
  ]
@@ -122,14 +122,14 @@
122
122
  {
123
123
  "code": "atk_down",
124
124
  "name": "Attack Debuff",
125
- "description": "-8% ATK per stack",
125
+ "description": "-10% ATK per stack",
126
126
  "category": "stat_modifier",
127
127
  "isBuff": false,
128
128
  "maxStack": null,
129
129
  "statModifiers": [
130
130
  {
131
131
  "statName": "attack",
132
- "value": -8,
132
+ "value": -10,
133
133
  "valueType": "percent"
134
134
  }
135
135
  ]
@@ -137,14 +137,14 @@
137
137
  {
138
138
  "code": "def_down",
139
139
  "name": "Defense Debuff",
140
- "description": "-8% DEF per stack",
140
+ "description": "-10% DEF per stack",
141
141
  "category": "stat_modifier",
142
142
  "isBuff": false,
143
143
  "maxStack": null,
144
144
  "statModifiers": [
145
145
  {
146
146
  "statName": "defense",
147
- "value": -8,
147
+ "value": -10,
148
148
  "valueType": "percent"
149
149
  }
150
150
  ]
@@ -152,60 +152,60 @@
152
152
  {
153
153
  "code": "crt_down",
154
154
  "name": "Critical-Rate Debuff",
155
- "description": "-2 CRT per stack",
155
+ "description": "-10% CRT per stack",
156
156
  "category": "stat_modifier",
157
157
  "isBuff": false,
158
158
  "maxStack": null,
159
159
  "statModifiers": [
160
160
  {
161
161
  "statName": "criticalRate",
162
- "value": -2,
163
- "valueType": "flat"
162
+ "value": -10,
163
+ "valueType": "percent"
164
164
  }
165
165
  ]
166
166
  },
167
167
  {
168
168
  "code": "crd_down",
169
169
  "name": "Critical-Damage Debuff",
170
- "description": "-8 CRD per stack",
170
+ "description": "-10% CRD per stack",
171
171
  "category": "stat_modifier",
172
172
  "isBuff": false,
173
173
  "maxStack": null,
174
174
  "statModifiers": [
175
175
  {
176
176
  "statName": "criticalDamage",
177
- "value": -8,
178
- "valueType": "flat"
177
+ "value": -10,
178
+ "valueType": "percent"
179
179
  }
180
180
  ]
181
181
  },
182
182
  {
183
183
  "code": "res_down",
184
184
  "name": "Resistance Debuff",
185
- "description": "-14 RES per stack",
185
+ "description": "-10% RES per stack",
186
186
  "category": "stat_modifier",
187
187
  "isBuff": false,
188
188
  "maxStack": null,
189
189
  "statModifiers": [
190
190
  {
191
191
  "statName": "resist",
192
- "value": -14,
193
- "valueType": "flat"
192
+ "value": -10,
193
+ "valueType": "percent"
194
194
  }
195
195
  ]
196
196
  },
197
197
  {
198
198
  "code": "foc_down",
199
199
  "name": "Focus Debuff",
200
- "description": "-12 FOC per stack",
200
+ "description": "-10% FOC per stack",
201
201
  "category": "stat_modifier",
202
202
  "isBuff": false,
203
203
  "maxStack": null,
204
204
  "statModifiers": [
205
205
  {
206
206
  "statName": "focus",
207
- "value": -12,
208
- "valueType": "flat"
207
+ "value": -10,
208
+ "valueType": "percent"
209
209
  }
210
210
  ]
211
211
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gotchi-battler-game-logic",
3
- "version": "4.0.13",
3
+ "version": "4.0.15",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "mocha \"tests/**/*.test.js\"",
@@ -6,7 +6,7 @@ const CrystalSchema = z.object({
6
6
  slot: z.number().int().min(1).max(6),
7
7
  rarity: z.enum(['common', 'uncommon', 'rare', 'legendary', 'mythical', 'godlike']),
8
8
  stat: z.enum(['speed', 'health', 'attack', 'defense', 'criticalRate', 'criticalDamage', 'resist', 'focus']),
9
- statValue: z.number().int(),
9
+ statValue: z.number()
10
10
  })
11
11
 
12
12
  module.exports = { CrystalSchema }
package/schemas/gotchi.js CHANGED
@@ -6,19 +6,19 @@ const { CrystalSchema } = require('./crystal')
6
6
 
7
7
  const GotchiSchema = z.object({
8
8
  id: z.number().int(),
9
- onchainId: z.number().int(),
9
+ onchainId: z.number().int().nullable().optional(), // monsters don't have onchain ids
10
10
  name: z.string(),
11
11
  type: z.enum(['gotchi', 'spirit', 'monster']),
12
12
  visualCode: z.string(),
13
13
  level: z.number().int(),
14
- speed: z.number().int(),
14
+ speed: z.number(),
15
15
  health: z.number().int(),
16
- attack: z.number().int(),
17
- defense: z.number().int(),
16
+ attack: z.number(),
17
+ defense: z.number(),
18
18
  criticalRate: z.number(),
19
- criticalDamage: z.number().int(),
20
- resist: z.number().int(),
21
- focus: z.number().int(),
19
+ criticalDamage: z.number(),
20
+ resist: z.number(),
21
+ focus: z.number(),
22
22
 
23
23
  // Foreign keys
24
24
  gotchiClass: z.string(),
package/schemas/item.js CHANGED
@@ -7,7 +7,7 @@ const ItemSchema = z.object({
7
7
  image: z.string(),
8
8
  rarity: z.enum(['common', 'uncommon', 'rare', 'legendary', 'mythical', 'godlike']),
9
9
  stat: z.enum(['speed', 'health', 'attack', 'defense', 'criticalRate', 'criticalDamage', 'resist', 'focus']),
10
- statValue: z.number().int()
10
+ statValue: z.number()
11
11
  })
12
12
 
13
13
  module.exports = { ItemSchema }