Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for weapons buttons not displaying correctly. #483

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cljc/orcpub/dice.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
sides (or (parse-int sides-str))
plus-minus (if (= "-" plus-minus-str)
-1
1)
raw-mod (or (parse-int mod-str) 0)
+1)
raw-mod (or (parse-int mod-str) +0)
mod (* raw-mod plus-minus)
rolls (roll-n num sides)
total (apply + mod rolls)]
Expand Down
4 changes: 2 additions & 2 deletions src/cljs/orcpub/dnd/e5/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2239,7 +2239,7 @@
(if (boolean show-button)
(roll-button
(str title " check: ")
(str "1d20" v)
(str "1d20" (common/mod-str v))
:text v
:style {:font-size "24px" :padding "2px 8px"})
v)]]])
Expand Down Expand Up @@ -2802,7 +2802,7 @@
[:td (roll-button
(str name " attack: ")
(str "1d20" (common/mod-str (weapon-attack-modifier weapon)))
:text (str "1d20" (common/bonus-str (weapon-attack-modifier weapon))))]
:text (str "1d20" (common/mod-str (weapon-attack-modifier weapon))))]
[:td (roll-button
(str name " damage: ")
(str damage-die-count "d" damage-die (common/mod-str (weapon-damage-modifier weapon)))
Expand Down