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

235 fix natural unarmored ac stack #412

Merged
7 changes: 4 additions & 3 deletions src/cljc/orcpub/dnd/e5/template_base.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
(es/make-entity
{?armor-class (+ 10 (?ability-bonuses ::char5e/dex))
?base-armor-class (+ 10 (?ability-bonuses ::char5e/dex)
?natural-ac-bonus
;; Checks whether barbarian unarmored bonus exists (or is higher) than natural AC/Draconic Bloodline AC
(if (> ?unarmored-ac-bonus ?natural-ac-bonus ) 0 ?natural-ac-bonus)
?magical-ac-bonus)
?levels {}
?ac-bonus 0
Expand Down Expand Up @@ -119,7 +120,7 @@
{}
?ability-bonuses)
?total-levels (apply + (map (fn [[k {l :class-level}]] l) ?levels))

?class-level (fn [class-kw] (get-in ?levels [class-kw :class-level]))
?barbarian-level (?class-level :barbarian)
?bard-level (?class-level :bard)
Expand All @@ -132,7 +133,7 @@
?sorcerer-level (?class-level :sorcerer)
?warlock-level (?class-level :warlock)
?wizard-level (?class-level :wizard)

?proficiency-bonus-increase 0
?prof-bonus (+ (int (/ (dec ?total-levels) 4)) 2 ?proficiency-bonus-increase)
?default-skill-bonus {}
Expand Down