From 003fc85cd6ba2e20285c8ed7e5781386ae77d35d Mon Sep 17 00:00:00 2001 From: DatDamnZotz Date: Wed, 25 Nov 2020 10:15:34 -0700 Subject: [PATCH] Add versatile roll button --- src/clj/orcpub/styles/core.clj | 4 +++- src/cljs/orcpub/dnd/e5/views.cljs | 13 ++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/clj/orcpub/styles/core.clj b/src/clj/orcpub/styles/core.clj index 75cfc419f..97eef5229 100644 --- a/src/clj/orcpub/styles/core.clj +++ b/src/clj/orcpub/styles/core.clj @@ -1092,7 +1092,7 @@ [:.roll-button {:color :white - :min-width "35px" + :min-width "68px" :font-weight 600 :font-size "14px" :border :none @@ -1100,6 +1100,8 @@ :padding "6px 6px" :margin-right "2px" :margin-left "2px" + :margin-bottom "2px" + :margin-top "2px" :cursor :pointer :background-image "linear-gradient(to bottom, #f1a20f, #dbab50)"}] diff --git a/src/cljs/orcpub/dnd/e5/views.cljs b/src/cljs/orcpub/dnd/e5/views.cljs index 5155d6105..66efd5b1d 100644 --- a/src/cljs/orcpub/dnd/e5/views.cljs +++ b/src/cljs/orcpub/dnd/e5/views.cljs @@ -2787,10 +2787,12 @@ (doall (map (fn [[weapon-key {:keys [equipped?]}]] - (let [{:keys [name description ranged? ::weapon/type ::weapon/damage-die-count ::weapon/damage-die] :as weapon} (all-weapons-map weapon-key) + (let [{:keys [name description ranged? ::weapon/type ::weapon/damage-die-count ::weapon/damage-die ::weapon/versatile] :as weapon} (all-weapons-map weapon-key) proficient? (if has-weapon-prof (has-weapon-prof weapon)) expanded? (@expanded-details weapon-key) damage-modifier (weapon-damage-modifier weapon) + versatile-damage-die-count (:orcpub.dnd.e5.weapons/damage-die-count versatile) + versatile-damage-die (:orcpub.dnd.e5.weapons/damage-die versatile) droll (str damage-die-count "d" damage-die)] (when (not= type :ammunition) ^{:key weapon-key} @@ -2804,7 +2806,6 @@ [:div (weapon-attack-description-short weapon)] (when expanded? - (prn weapon) (weapon-details weapon weapon-damage-modifier))] [:td (roll-button (str name " attack: ") @@ -2814,7 +2815,13 @@ (str name " damage: ") (str damage-die-count "d" damage-die (common/mod-str (weapon-damage-modifier weapon))) :text (str damage-die-count "d" damage-die (common/mod-str (weapon-damage-modifier weapon))) - :style {:width "100%"})] + :style {:width "100%"}) + (when versatile + (roll-button + (str name " versatile damage: ") + (str versatile-damage-die-count "d" versatile-damage-die (common/mod-str (weapon-damage-modifier weapon))) + :text (str "v " versatile-damage-die-count "d" versatile-damage-die (common/mod-str (weapon-damage-modifier weapon))) + :style {:width "100%"}))] [:td.pointer [:div.orange #_(if (not mobile?)