Make aimStance record into function

This commit is contained in:
2025-06-03 15:19:35 +01:00
parent 589603e474
commit a17961eac7
20 changed files with 297 additions and 262 deletions
+31 -27
View File
@@ -1,14 +1,17 @@
{-# LANGUAGE LambdaCase #-}
module Dodge.Item.Info
( itemInfo
) where
import Dodge.Item.InvSize
module Dodge.Item.Info (
itemInfo,
) where
import Data.Char
--import qualified Data.Map.Strict as M
import Dodge.Data.Item
import Dodge.Item.AimStance
import Dodge.Item.InvSize
--import Dodge.Module.Info
import LensHelp
--import StringHelp
itemInfo :: Item -> String
@@ -29,14 +32,14 @@ itmBaseInfo itm = case itm ^. itType of
DETECTOR d -> "A device that detects " ++ detectorInfo d ++ " in an expanding radius."
ATTACH t -> attachInfo t
AMMOMAG t -> ammoMagInfo t
-- TARGETING {_ibtTargeting :: TargetingType}
-- BULLETMOD {_ibtBulletMod :: BulletMod}
-- STICKYMOD
-- ITEMSCAN
-- MAPPER
-- INTROSCAN {_ibtIntroScanType :: IntroScanType}
-- DETECTOR {_ibtDetector :: Detector}
-- ARHUD
-- TARGETING {_ibtTargeting :: TargetingType}
-- BULLETMOD {_ibtBulletMod :: BulletMod}
-- STICKYMOD
-- ITEMSCAN
-- MAPPER
-- INTROSCAN {_ibtIntroScanType :: IntroScanType}
-- DETECTOR {_ibtDetector :: Detector}
-- ARHUD
_ -> "THIS SHOULD NOT BE DISPLAYED"
ammoMagInfo :: AmmoMagType -> String
@@ -56,12 +59,12 @@ attachInfo = \case
JOYSTICK -> "A control device. Can be used to control certain projectiles. "
GIMBAL -> "A device that can stabilize moving objects. "
GYROSCOPE -> "A device that can sustain angular velocity. "
-- UNDERBARRELSLOT
-- REMOTEDETONATOR
-- SMOKEREDUCER
-- HOMINGMODULE
-- AUGMENTEDHUD
-- SHELLPAYLOAD {}
-- UNDERBARRELSLOT
-- REMOTEDETONATOR
-- SMOKEREDUCER
-- HOMINGMODULE
-- AUGMENTEDHUD
-- SHELLPAYLOAD {}
_ -> "INCOMPLETE, TODO FINISH"
showInt :: Int -> String
@@ -98,7 +101,7 @@ heldInfo hit = case hit of
MINIGUNX i -> over _head toUpper (showInt i) ++ " gun barrels that revolve rapidly around a central stick. Requires considerable time to warm up, but has an extremely rapid rate of fire. It is also extremely difficult to stabilise."
VOLLEYGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Each barrel requires a separate magazine. All barrels must be loaded to fire."
RIFLE -> "A firearm with a mid length barrel that requires reloading after each shot."
-- REPEATER -> "A firearm fed by a magazine. The entire magazine must be replaced when reloading the weapon."
-- REPEATER -> "A firearm fed by a magazine. The entire magazine must be replaced when reloading the weapon."
AUTORIFLE -> "A firearm automatically fed by a magazine. The entire magazine must be replaced when reloading the weapon."
ALTERIFLE -> "A firearm with a mid length barrel that requires reloading after each shot. Alternates between two magazines."
BURSTRIFLE -> "A firearm that rapidly fires three projectiles from its magazine. The entire magazine must be replaced when reloading the weapon."
@@ -107,7 +110,7 @@ heldInfo hit = case hit of
AMR -> "An antimateriel rifle, designed to disable military equipment. Its long barrel is fed by a magazine that must be replaced when reloading the weapon."
AUTOAMR -> "An automatic antimateriel rifle, designed to disable military equipment. Its long barrel is fed by a magazine that must be replaced when reloading the weapon."
SNIPERRIFLE -> "A firearm designed with long range capability in mind. Its long barrel requires reloading after each shot."
-- MACHINEGUN -> "A heavy firearm whose rate of fire increases during a barrage."
-- MACHINEGUN -> "A heavy firearm whose rate of fire increases during a barrage."
FLAMESPITTER -> "A weapon that globs out burning fuel."
FLAMETHROWER -> "A weapon that squirts out burning fuel."
FLAMETORRENT -> "A weapon that streams out burning fuel in a torrent."
@@ -120,10 +123,10 @@ heldInfo hit = case hit of
GLAUNCHER -> "A large tube that can launch projectiles."
RLAUNCHER -> "A large tube that can launch self propelled projectiles. Moving the tube after launch will cause the projectile to spin."
RLAUNCHERX i -> over _head toUpper (showInt i) ++ " tubes that can launch self propelled projectiles. Tubes that do not face forward launch their projecitles at an angle."
-- REMOTELAUNCHER -> "A large tube that can launch self propelled projectiles. Contains a transmitter allowing for remote control of launched projectiles."
-- REMOTELAUNCHER -> "A large tube that can launch self propelled projectiles. Contains a transmitter allowing for remote control of launched projectiles."
POISONSPRAYER -> "A weapon that releases noxious gases."
SHATTERGUN -> "A seismic device that shatters hard items in its line of fire."
-- FORCEFIELDGUN -> "A device that produces a durable forcefield."
-- FORCEFIELDGUN -> "A device that produces a durable forcefield."
TORCH -> "A stick with a light on the end."
FLATSHIELD -> "A panel of metal that blocks unwanted objects from the front of the user."
KEYCARD i -> "A keycard. It is labelled " ++ show i ++ "."
@@ -197,9 +200,10 @@ craftInfo fit = case fit of
MICROPHONE -> "A device that measures air vibration."
CREATURESENSOR -> "A device for detecting living beings."
WIRE -> "A small thin object that conducts electricity."
-- BATTERY -> "A store of electical potential energy."
-- BATTERY -> "A store of electical potential energy."
FUELCELL -> "A devices that converts chemical energy into electricity."
PORTABLEFUSION -> "A miniature nuclear reactor."
-- GASINJECTOR -> "A device that can inject small quantities of gas into objects."
-- ENERGYBALLCRAFT ebt -> "A device that can create " ++ addIndefiniteArticle (displayEnergyBallType ebt) ++ " effect."
-- FRAGMODULE -> "A device that converts projectiles into fragmentation projectiles."
@@ -222,15 +226,15 @@ detectorInfo d = case d of
itmUsageInfo :: Item -> String
itmUsageInfo itm = case itm ^. itType of
HELD _ -> heldPositionInfo itm
-- LEFT _ ->
-- "This item can be equipped" ++ itmEquipSiteInfo itm
-- ++ ". When equipped, it can be activated."
-- LEFT _ ->
-- "This item can be equipped" ++ itmEquipSiteInfo itm
-- ++ ". When equipped, it can be activated."
EQUIP _ -> "This item can be equipped " ++ itmEquipSiteInfo itm ++ "."
CRAFT _ -> ""
_ -> "THIS SHOULD NOT BE DISPLAYED"
heldPositionInfo :: Item -> String
heldPositionInfo = maybe undefined aimStanceInfo . (^? itUse . heldAim . aimStance)
heldPositionInfo = aimStanceInfo . aStance
aimStanceInfo :: AimStance -> String
aimStanceInfo as = case as of