diff options
| author | 0xNul <57599792+0xNul@users.noreply.github.com> | 2025-10-30 10:15:37 -0700 |
|---|---|---|
| committer | 0xNul <57599792+0xNul@users.noreply.github.com> | 2025-10-30 10:15:37 -0700 |
| commit | 06e18ef5c60575c512cbd4b6703c76870ffd8661 (patch) | |
| tree | 119f927081912ddb4d00cd05040f79d85fe818d0 /src/votann_battle_simulator/weapon_abilities.clj | |
| parent | fdb44c4ed67dd44c1f837efecbe3c372495815e0 (diff) | |
update models and battle simulatormain
Diffstat (limited to 'src/votann_battle_simulator/weapon_abilities.clj')
| -rw-r--r-- | src/votann_battle_simulator/weapon_abilities.clj | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/votann_battle_simulator/weapon_abilities.clj b/src/votann_battle_simulator/weapon_abilities.clj index 2fb681f..146b682 100644 --- a/src/votann_battle_simulator/weapon_abilities.clj +++ b/src/votann_battle_simulator/weapon_abilities.clj @@ -65,6 +65,16 @@ (println "Dice count before " dice " after " rapid-fire-added) rapid-fire-added))) +(defn conversion [dice range] + (if (> range 12) + (let [conversion-added (map (fn [roll] + (if (>= roll 4) + 6 + roll)) dice)] + (println "Hit count before " dice " after " conversion-added) + conversion-added) + dice)) + (defn sustained-hits [modifier dice] (let [critical (count (filter #(= 6 %) dice))] (cond @@ -116,6 +126,12 @@ dice-rolls (let [ability (first abilities)] (cond + (not (nil? (re-find #"Conversion" ability))) + (do + (println "Applied Conversion hit ability for " (:name weapon)) + (recur (rest abilities) + (conversion dice-rolls 24))) + (not (nil? (re-find #"Sustained Hits" ability))) (do (println "Applied Sustained Hits hit ability for " (:name weapon)) |