258 lines
13 KiB
Haskell
258 lines
13 KiB
Haskell
{-# LANGUAGE LambdaCase #-}
|
|
module Dodge.Item.Info
|
|
( itemInfo
|
|
) where
|
|
|
|
import Dodge.Item.InvSize
|
|
import Data.Char
|
|
--import qualified Data.Map.Strict as M
|
|
import Dodge.Data.Item
|
|
--import Dodge.Module.Info
|
|
import LensHelp
|
|
--import StringHelp
|
|
|
|
itemInfo :: Item -> String
|
|
itemInfo itm =
|
|
itmBaseInfo itm ++ " " ++ itmUsageInfo itm
|
|
++ itmSpaceInfo itm
|
|
|
|
itmSpaceInfo :: Item -> String
|
|
itmSpaceInfo itm = case itInvHeight itm of
|
|
1 -> " It takes up one inventory slot. "
|
|
x -> " It takes up " ++ showInt x ++ " inventory slots. "
|
|
|
|
itmBaseInfo :: Item -> String
|
|
itmBaseInfo itm = case itm ^. itType of
|
|
HELD hit -> heldInfo hit
|
|
EQUIP eit -> equipInfo eit
|
|
CRAFT fit -> craftInfo fit
|
|
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
|
|
_ -> "THIS SHOULD NOT BE DISPLAYED"
|
|
|
|
ammoMagInfo :: AmmoMagType -> String
|
|
ammoMagInfo = \case
|
|
TINMAG -> "A small tin magazine for containing bullets. "
|
|
DRUMMAG -> "A mid-sized magazine for containing bullets. "
|
|
BELTMAG -> "A belt with attachable bullets. "
|
|
SHELLMAG -> "A container for a projectile. "
|
|
BATTERY -> "A store of electrical potential energy. "
|
|
CHEMFUELPOUCH -> "A small tank for containing flammable liquids. "
|
|
|
|
attachInfo :: AttachType -> String
|
|
attachInfo = \case
|
|
ZOOMSCOPE -> "An optical zoom. "
|
|
BULLETSYNTH -> "An item that prints bullets, when supplied with power. "
|
|
REMOTESCREEN -> "A display screen. Can be linked to projectiles. "
|
|
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 {}
|
|
_ -> "INCOMPLETE, TODO FINISH"
|
|
|
|
showInt :: Int -> String
|
|
showInt i = case i of
|
|
0 -> "zero"
|
|
1 -> "one"
|
|
2 -> "two"
|
|
3 -> "three"
|
|
4 -> "four"
|
|
5 -> "five"
|
|
6 -> "six"
|
|
7 -> "seven"
|
|
8 -> "eight"
|
|
9 -> "nine"
|
|
10 -> "ten"
|
|
11 -> "eleven"
|
|
12 -> "a dozen"
|
|
_ -> "more than a dozen"
|
|
|
|
heldInfo :: HeldItemType -> String
|
|
heldInfo hit = case hit of
|
|
BLINKERUNSAFE -> "A device that allows local teleportation. Potentially hazardous around walls."
|
|
BLINKER -> "A device that allows local teleportation."
|
|
BANGSTICK 1 -> "A firearm with a short barrel that requires reloading after each shot."
|
|
BANGSTICK i -> over _head toUpper (showInt i) ++ " small gun barrels strapped together. Each barrel must be individually loaded, but not all need be loaded for the weapon to fire. All loaded barrels discharge simultaneously, with significant spread."
|
|
PISTOL -> "A small firearm fed by a magazine. The entire magazine must be replaced when reloading the weapon."
|
|
MACHINEPISTOL -> "A small firearm automatically, and extremely rapidly, fed by a magazine. The entire magazine must be replaced when reloading the weapon."
|
|
AUTOPISTOL -> "A small firearm automatically fed by a magazine. The entire magazine must be replaced when reloading the weapon."
|
|
SMG -> "A small firearm with an attached stock for stability."
|
|
BANGCONE -> "A container for debris. Exposive action propels the debris away from the user. Quite unweildy."
|
|
BLUNDERBUSS -> "A container for debris on the end of a stick. Explosive action propels the debris away from the user."
|
|
GRAPECANNON 1 -> "A large container for debris on the end of a stick. Explosive action propels the debris away from the user."
|
|
GRAPECANNON i -> "An " ++ replicate (i -1) 'X' ++ "L container for debris on the end of a stick. Explosive action propels the debris away from the user."
|
|
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."
|
|
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."
|
|
BANGROD -> "A firearm with a long barrel that requires reloading after each shot."
|
|
ELEPHANTGUN -> "A firearm with a long barrel that requires reloading after each shot. Its stopping power is only nominal."
|
|
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."
|
|
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."
|
|
FLAMEWALL -> "A weapon that squirts out burning fuel all around the user."
|
|
BLOWTORCH -> "A weapon that produces a concentrated flame."
|
|
SPARKGUN -> "A weapon that produces an arc of electricity. The arc will attempt to discharge at a nearby object."
|
|
TESLAGUN -> "A weapon that discharges a sustained arc of electricity. The arc will attempt to discharge at a nearby object."
|
|
LASER -> "A device that, when electrically powered, continuously emits photons in a narrow beam."
|
|
TRACTORGUN -> "An item that produces a beam of gravitons."
|
|
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."
|
|
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."
|
|
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 ++ "."
|
|
TIMESTOPPER -> "A device that temporarily pauses time."
|
|
REWINDER -> "A device that rewinds time a short amount."
|
|
TIMESCROLLER -> "A device that can be used to scroll through recent events."
|
|
|
|
equipInfo :: EquipItemType -> String
|
|
equipInfo eit = case eit of
|
|
MAGSHIELD -> "A device designed to repulse nearby metallic objects."
|
|
FLAMESHIELD -> "A device designed to repulse nearby flames."
|
|
FRONTARMOUR -> "A device designed to shield from the front."
|
|
WRISTARMOUR -> "A device that projects a forcefield."
|
|
INVISIBILITYEQUIPMENT _ -> "A device that bends light around its user."
|
|
BRAINHAT -> "An iq enhancer. Useless."
|
|
HAT -> "A hat."
|
|
HEADLAMP -> "A torch strapped to a hat."
|
|
POWERLEGS -> "Strength enhancing legs."
|
|
SPEEDLEGS -> "Speed enhancing legs."
|
|
JUMPLEGS -> "Jump enhancing legs."
|
|
FUELPACK -> "A liquid container with attached hose."
|
|
BULLETBELTPACK -> "A container holding a long belt of bullets."
|
|
BULLETBELTBRACER -> "A container holding a long belt of bullets."
|
|
BATTERYPACK -> "A collection of batteries with a universal adapter."
|
|
WRIST_ECG -> "A wristworn device that detects the hearts electrical activity."
|
|
|
|
--targetingInfo :: TargetingType -> String
|
|
--targetingInfo tt = case tt of
|
|
-- TARGETLASER -> "creates a laser, the end of which becomes the target."
|
|
-- TargetRBPress -> "creates a fixed target."
|
|
-- TargetRBLine -> "creates a line target."
|
|
-- TargetRBCreature -> "targets a creature."
|
|
-- TargetCursor -> "creates a moving target."
|
|
|
|
craftInfo :: CraftType -> String
|
|
craftInfo fit = case fit of
|
|
PIPE -> "A rigid cylinder."
|
|
TUBE -> "A wide rigid cylinder."
|
|
HARDWARE -> "A collection of equipment and devices useful for general construction."
|
|
SPRING -> "An object that exerts an opposing force when compressed or stretched."
|
|
HOSE -> "A flexible cylinder."
|
|
TAPE -> "A strip of material with an adhesive side."
|
|
CAN -> "A small metal cylindrical container."
|
|
TIN -> "A small metal continer."
|
|
STEELDRUM -> "A metal cylindrical container."
|
|
PLANK -> "A sturdy piece of wood."
|
|
GLASSSHARD -> "A broken piece of glass."
|
|
SCRAPMETAL -> "A broken piece of metal."
|
|
PUMP -> "A device that can create pressure."
|
|
MOTOR -> "A device that can create rotational force."
|
|
TRANSFORMER -> "A device that can step up or down voltage and current."
|
|
PRISM -> "An object that refracts light."
|
|
THERMOMETER -> "An object that measures temperature."
|
|
LIGHTER -> "A device that can create a small flame."
|
|
MAGNET -> "A device that attracts according to its dipoles."
|
|
ANTIMATTER -> "A collection of material with inverse quantum values."
|
|
PLATE -> "A flat rigid sheet."
|
|
TRANSMITTER -> "A device that can emit radio signals."
|
|
MICROCHIP -> "A miniturized collection of electronic circuits."
|
|
HARDDRIVE -> "A device designed to store data when unpowered."
|
|
RAM -> "A device that can store data when powered."
|
|
AIUNIT -> "A general purpose artificial intelligence unit."
|
|
CAMERA -> "A device designed to capture light signals."
|
|
MINIDISPLAY -> "A device designed to display pictures."
|
|
LED -> "A light emitting diode."
|
|
NAILBOX -> "A box of wood fastenings."
|
|
IRONBAR -> "A rigid piece of metal."
|
|
LIGHTSENSOR -> "A device that detects photons."
|
|
HEATSENSOR -> "An object that detects temperature."
|
|
SOUNDSENSOR -> "A device that detects air vibration."
|
|
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."
|
|
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."
|
|
-- FLASHMODULE -> "A device that converts projectiles into flashbang projectiles."
|
|
-- BULBODYCRAFT be -> "A device that converts bullets into " ++ displayBulletBody be ++ " projectiles."
|
|
-- TELEPORTMODULE -> "A device that allows for near-instant translocation across space."
|
|
-- TIMEMODULE -> "A device that can affect temporality."
|
|
-- SIZEMODULE -> "A device that can affect physical size."
|
|
-- GRAVITYMODULE -> "A device that can affect gravitational fields."
|
|
-- TARGETMODULE _ -> "A targeting module."
|
|
-- FLAKCRAFT -> "Creates flak bullets."
|
|
-- FRAGCRAFT -> "Creates fragmentation bullets."
|
|
|
|
detectorInfo :: Detector -> String
|
|
detectorInfo d = case d of
|
|
ITEMDETECTOR -> "items"
|
|
CREATUREDETECTOR -> "creatures"
|
|
WALLDETECTOR -> "walls"
|
|
|
|
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."
|
|
EQUIP _ -> "This item can be equipped " ++ itmEquipSiteInfo itm ++ "."
|
|
CRAFT _ -> ""
|
|
_ -> "THIS SHOULD NOT BE DISPLAYED"
|
|
|
|
heldPositionInfo :: Item -> String
|
|
heldPositionInfo = maybe undefined aimStanceInfo . (^? itUse . heldAim . aimStance)
|
|
|
|
aimStanceInfo :: AimStance -> String
|
|
aimStanceInfo as = case as of
|
|
TwoHandUnder -> "It is held in two hands and tucked under the shoulder."
|
|
TwoHandOver -> "It is held in two hands and over the shoulder."
|
|
TwoHandFlat -> "It is held in two hands at its sides."
|
|
OneHand -> "It is held in one hand."
|
|
|
|
itmEquipSiteInfo :: Item -> String
|
|
itmEquipSiteInfo = maybe "" equipSiteInfo . (^? itUse . uequipEffect . eeType)
|
|
|
|
equipSiteInfo :: EquipType -> String
|
|
equipSiteInfo es = case es of
|
|
GoesOnHead -> " on the head"
|
|
GoesOnChest -> " on the chest"
|
|
GoesOnBack -> " on the back"
|
|
GoesOnWrist -> " on a wrist"
|
|
GoesOnLegs -> " on both legs"
|
|
|
|
--makeCommaList :: [String] -> String
|
|
--makeCommaList [] = ""
|
|
--makeCommaList [x] = x ++ "."
|
|
--makeCommaList [x, y] = x ++ " and " ++ y ++ "."
|
|
--makeCommaList (x : xs) = x ++ ", " ++ makeCommaList xs
|