Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
rpg-workshop
Commits
95e53691
Commit
95e53691
authored
Nov 11, 2021
by
Joe Ziemba
Browse files
convert all values to numbers for to hit calc
parent
5651f7f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/sbg/DisplayAttack.js
View file @
95e53691
...
...
@@ -7,7 +7,9 @@ export const DisplayAttack = ({ action, id }) => {
}
=
useContext
(
StatblockContext
)
let
{
dieNum
,
dmgDie
,
dex
,
reach
,
targets
,
dmgType
}
=
action
// Get hit mod
const
toHit
=
(
dex
?
abilities
.
dexMod
:
abilities
.
strMod
)
+
proficiency
const
toHit
=
(
dex
?
Number
(
abilities
.
dexMod
)
:
Number
(
abilities
.
strMod
))
+
Number
(
proficiency
)
// Get Damage Mod
let
avg
=
(
dieNum
*
dmgDie
)
/
2
+
toHit
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment