Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:Orcpub/orcpub into opdevelop
Browse files Browse the repository at this point in the history
  • Loading branch information
datdamnzotz committed May 7, 2020
2 parents 175d944 + cef22b7 commit c88a088
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/cljc/orcpub/dnd/e5/display.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
(or (:name (equipment-map equipment-kw))
(if (string? equipment-kw)
equipment-kw
(common/kw-to-name equipment-kw))))
(common/kw-to-name equipment-kw true))))

(defn unit-amount-description [{:keys [units amount singular plural] :or {amount 1 plural (plural-map units)}}]
(str amount " " (if (not= 1 amount)
Expand Down
19 changes: 14 additions & 5 deletions src/cljs/orcpub/character_builder.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,8 @@
[:th.p-5 "Base"]
[:th.p-5 "Con"]
[:th.p-5 "Misc"]
[:th.p-5 "Total"]])
[:th.p-5 "Total"]
[:th.p-5 ""]])

(defn hp-selection-name-level [selection]
(let [[_ class-kw _ level-kw _] (::entity/path selection)
Expand Down Expand Up @@ -1319,7 +1320,8 @@
[:td.p-5 first-class-hit-die]
[:td.p-5 con-bonus-str]
[:td.p-5 (common/bonus-str (+ misc-bonus cls-level-bonus))]
[:td.p-5 (+ (:hit-die first-class) level-bonus)]])
[:td.p-5 (+ (:hit-die first-class) level-bonus)]
[:td.p5]])
(doall
(map-indexed
(fn [j level-value]
Expand All @@ -1337,14 +1339,20 @@
:value (:value level-value)}]]
[:td.p-5 con-bonus-str]
[:td.p-5 (common/bonus-str (+ misc-bonus cls-level-bonus))]
[:td.p-5 (+ (:value level-value) level-bonus)]])
[:td.p-5 (+ (:value level-value) level-bonus)]
[:td.p-5 [:button.roll-button
{:on-click (fn [e]
(let [value (js/parseInt (dice/die-roll (-> levels cls :hit-die)))]
(dispatch [:set-level-hit-points built-template character level-value value])))}
"d" (-> levels cls :hit-die)]]])
level-values))
[:tr
[:td.p-5 "Total"]
[:td.p-5 total-base-hps]
[:td.p-5 (common/bonus-str total-con-bonus)]
[:td.p-5 (common/bonus-str total-misc-bonus)]
[:td.p-5 (+ total-base-hps total-con-bonus total-misc-bonus)]]]]]))
[:td.p-5 (+ total-base-hps total-con-bonus total-misc-bonus)]
[:td.p-5]]]]]))
classes))
(if (> (count classes) 1)
[:div.m-t-20
Expand All @@ -1357,7 +1365,8 @@
[:td.p-5 total-base-hps]
[:td.p-5 (common/bonus-str total-con-bonus)]
[:td.p-5 (common/bonus-str total-misc-bonus)]
[:td.p-5 total-hps]]]]])]))
[:td.p-5 total-hps]
[:td.p-5]]]]])]))

(defn remaining-adjustments-fn [built-template character]
#(Math/abs (entity/count-remaining built-template character %)))
Expand Down
46 changes: 23 additions & 23 deletions src/cljs/orcpub/dnd/e5/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3016,8 +3016,8 @@
none-item
(map
(fn [[key]]
(let [{:keys [name]} (all-armor-map key)]
{:title name
(let [{:keys [name] :as item} (all-armor-map key)]
{:title (weapon-name item)
:value key}))
carried-armor))
:value (or worn-armor (-> best-armor-combo :armor :key))
Expand All @@ -3029,8 +3029,8 @@
none-item
(map
(fn [[key]]
(let [{:keys [name]} (all-armor-map key)]
{:title name
(let [{:keys [name] :as item} (all-armor-map key)]
{:title (weapon-name item)
:value key}))
carried-shields))
:value (or wielded-shield (-> best-armor-combo :shield :key))
Expand All @@ -3048,8 +3048,8 @@
none-item
(map
(fn [[key]]
(let [{:keys [name]} (all-weapons-map key)]
{:title name
(let [{:keys [name] :as item} (all-weapons-map key)]
{:title (weapon-name item)
:value key}))
carried-weapons))
:value main-hand-weapon-kw
Expand All @@ -3070,28 +3070,28 @@
dual-wield-weapon?)))
(map
(fn [[key]]
(let [{:keys [name]} (all-weapons-map key)]
{:title name
(let [{:keys [name] :as item} (all-weapons-map key)]
{:title (weapon-name item)
:value key}))))
carried-weapons))
:value off-hand-weapon-kw
:on-change (wield-handler ::char/wield-off-hand-weapon id)}])
#_[:div.flex.flex-wrap
[equipped-section-dropdown
"Attuned Magic Item 1"
{:items [none-item]
:value nil
:on-change (fn [])}]
[equipped-section-dropdown
"Attuned Magic Item 2"
{:items [none-item]
:value nil
:on-change (fn [])}]
[equipped-section-dropdown
"Attuned Magic Item 3"
{:items [none-item]
:value nil
:on-change (fn [])}]]])]])
[equipped-section-dropdown
"Attuned Magic Item 1"
{:items [none-item]
:value nil
:on-change (fn [])}]
[equipped-section-dropdown
"Attuned Magic Item 2"
{:items [none-item]
:value nil
:on-change (fn [])}]
[equipped-section-dropdown
"Attuned Magic Item 3"
{:items [none-item]
:value nil
:on-change (fn [])}]]])]])

(defn combat-details [num-columns id]
(let [weapon-profs @(subscribe [::char/weapon-profs id])
Expand Down

0 comments on commit c88a088

Please sign in to comment.