Move towards unifying weapon barrels

This commit is contained in:
2023-05-20 15:29:46 +01:00
parent f2183e9954
commit 03611c6b95
6 changed files with 18 additions and 19 deletions
+5 -1
View File
@@ -63,6 +63,7 @@ module Dodge.Item.Weapon.TriggerType (
blCheck,
) where
import Control.Applicative
import qualified SDL
import Data.Foldable
import Data.Maybe
@@ -497,7 +498,10 @@ crAtMuzPos f it cr = f it (cr & crPos +.+.~ (aimingMuzzlePos cr it *.* unitVecto
applyInaccuracy :: ChainEffect
applyInaccuracy f it = withRandomDirI acc f it
where
acc = _brlInaccuracy . _gunBarrels $ _itParams it
acc = fromMaybe 0 $
(it ^? itParams . gunBarrels . brlList . ix 0 . barlInaccuracy)
<|>
(it ^? itParams . gunBarrels . brlInaccuracy)
-- | Applies the effect to a randomly rotated creature.
withRandomDirI ::