From 223bc6d8d6a9e1a3d55a343ee10fc7638242ae45 Mon Sep 17 00:00:00 2001 From: xangelo Date: Thu, 13 Jul 2023 13:20:19 -0400 Subject: [PATCH] fix: casting now uses INT instead of CON Fighting was defaulting to constitution instead of intelligence for calculating magical damage. --- src/server/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/api.ts b/src/server/api.ts index 24da483..ac29843 100644 --- a/src/server/api.ts +++ b/src/server/api.ts @@ -282,9 +282,9 @@ io.on('connection', async socket => { return; } - const primaryStat = data.action === 'attack' ? player.strength : player.constitution; - const boostStat = data.action === 'attack' ? boost.strength : boost.constitution; const attackType = data.action === 'attack' ? 'physical' : 'magical'; + const primaryStat = data.action === 'attack' ? player.strength : player.intelligence; + const boostStat = data.action === 'attack' ? boost.strength : boost.intelligence; const playerDamage = Math.floor(((primaryStat + boostStat) * 1.3) + boost.damage); const skillsUsed: Record = {}; @@ -312,7 +312,7 @@ io.on('connection', async socket => { await updatePlayerSkills(player.id, skillsUsed); - const playerFinalDamage = (attackType === 'magical' && !anyDamageSpells) ? 0 : Math.floor(playerDamage + playerDamageAfterMasteries); + const playerFinalDamage = (data.action === 'cast' && !anyDamageSpells) ? 0 : Math.floor(playerDamage + playerDamageAfterMasteries); const playerFinalHeal = Math.floor(boost.hp + hpHealAfterMasteries); roundData.roundDetails.push(`You targeted the monsters ${data.target.toUpperCase()} with ${attackType} damage!`); -- 2.25.1