From: xangelo Date: Thu, 13 Jul 2023 17:20:19 +0000 (-0400) Subject: fix: casting now uses INT instead of CON X-Git-Tag: v0.1.1~2 X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=223bc6d8d6a9e1a3d55a343ee10fc7638242ae45;p=risinglegends.git fix: casting now uses INT instead of CON Fighting was defaulting to constitution instead of intelligence for calculating magical damage. --- 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!`);