Files
loop/src/Dodge/Item/AimStance.hs
T
2026-04-01 10:04:22 +01:00

69 lines
2.0 KiB
Haskell

{-# LANGUAGE LambdaCase #-}
module Dodge.Item.AimStance (itemAimStance,itemBaseStance) where
--module Dodge.Item.AimStance (itemAimStance) where
import Dodge.Data.Item
import Dodge.Data.ComposedItem
import Dodge.Data.DoubleTree
import Control.Lens
import Dodge.Data.AimStance
itemAimStance :: DTree CItem -> AimStance
itemAimStance dt
| islasweapon = TwoHandFlat
| otherwise = itemBaseStance $ dt ^. dtValue . _1
where
islasweapon = dt ^. dtValue . _1 . itType == CRAFT TRANSFORMER
&& islas (dt ^? dtRight . ix 0 . dtValue . _2) -- == Just LaserWeaponSF
islas = \case
Just (LaserWeaponXSF {}) -> True
_ -> False
itemBaseStance :: Item -> AimStance
itemBaseStance itm = case itm ^. itType of
HELD hit -> heldAimStance hit
LASER -> TwoHandFlat
_ -> OneHand
heldAimStance :: HeldItemType -> AimStance
heldAimStance = \case
BANGSTICK{} -> OneHand
REWINDER -> OneHand
TIMESTOPPER -> OneHand
TIMESCROLLER -> OneHand
PISTOL -> OneHand
MACHINEPISTOL -> OneHand
AUTOPISTOL -> OneHand
SMG -> TwoHandTwist
BANGCONE -> OneHand
BLUNDERBUSS -> TwoHandTwist
GRAPECANNON{} -> TwoHandTwist
MINIGUNX{} -> TwoHandTwist
VOLLEYGUN{} -> TwoHandFlat
RIFLE -> TwoHandTwist
ALTERIFLE -> TwoHandTwist
AUTORIFLE -> TwoHandTwist
BURSTRIFLE -> TwoHandTwist
BANGROD -> TwoHandTwist
ELEPHANTGUN -> TwoHandTwist
AMR -> TwoHandTwist
AUTOAMR -> TwoHandTwist
SNIPERRIFLE -> TwoHandTwist
FLAMESPITTER -> OneHand
FLAMETHROWER -> TwoHandTwist
FLAMETORRENT -> TwoHandTwist
FLAMEWALL -> TwoHandTwist
BLOWTORCH -> TwoHandTwist
TESLACOIL -> TwoHandFlat
TRACTORGUN -> TwoHandTwist
RLAUNCHER -> TwoHandTwist
RLAUNCHERX{} -> TwoHandTwist
GLAUNCHER -> TwoHandTwist
POISONSPRAYER -> TwoHandTwist
SHATTERGUN -> TwoHandTwist
LED -> OneHand
FLATSHIELD -> TwoHandFlat
KEYCARD {} -> OneHand
BLINKER -> OneHand
BLINKERUNSAFE -> OneHand