module Dodge.Item.Info where import Data.Char import Dodge.Data.Item import qualified Data.Map.Strict as M import LensHelp itemInfo :: Item -> String itemInfo itm = itmBaseInfo itm ++ " " ++ itmUsageInfo itm ++ itmSpaceInfo itm itmSpaceInfo :: Item -> String itmSpaceInfo itm = case (ceiling $ _itInvSize 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 . iyBase of HELD hit -> heldInfo hit LEFT lit -> leftInfo lit EQUIP eit -> equipInfo eit Consumable cit -> consumableInfo cit CRAFT fit -> craftInfo fit _ -> "THIS SHOULD NOT BE DISPLAYED" 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 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." REVOLVER -> "A small firearm fed by a revolving cylinder. Single shot and load." REVOLVERX i -> "A small firearm fed by "++ showInt i++ "revolving cylinders." 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 must be individually loaded, but not all need be loaded for the weapon to fire. All loaded barrels discharge simultaneously." 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." 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." LASGUN -> "A weapon that continuously emits photons in a narrow beam." LASCIRCLE -> "A extensive configuration of prisms and mirrors that produces multiple laser beams around its user." DUALBEAM -> "A weapon that emits two beams that converge at a selectable point in front of the user." LASWIDE _ -> "A weapon that continuously emits photons in a narrow beam. The beam expands as the weapon heats up." TRACTORGUN -> "An item that produces a beam of gravitons." LAUNCHER -> "A large tube that can launch self propelled projectiles. Moving the tube after launch will cause the projectile to spin." LAUNCHERX 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." DRONELAUNCHER -> "A device for launching drones." SHATTERGUN -> "A seismic device that shatters hard items in its line of fire." FORCEFIELDGUN -> "A device that produces a durable forcefield." HELDDETECTOR d -> "A device that detects "++detectorInfo d ++" in an expanding radius." TORCH -> "A stick with a light on the end." BINOCULARS -> "Two cylinders with lenses. Scroll to zoom." FLATSHIELD -> "A panel of metal that blocks unwanted objects from the front of the user." KEYCARD i -> "A keycard. It is labelled " ++ show i++ "." leftInfo :: LeftItemType -> String leftInfo lit = case lit of BOOSTER -> "A DEVICE THAT ALLOWS TRAVEL AT SPEED." STOPWATCH -> "A DEVICE THAT TEMPORARILY PAUSES TIME." REWINDWATCH -> "A DEVICE THAT REWINDS TIME A SHORT AMOUNT." SCROLLWATCH -> "A DEVICE THAT CAN BE USED TO SCROLL THROUGH RECENT EVENTS." BLINKER -> "A DEVICE THAT ALLOWS LOCAL TELEPORTATION." BLINKERUNSAFE -> "A DEVICE THAT ALLOWS LOCAL TELEPORTATION. POTENTIALLY HAZARDOUS AROUND WALLS." SHRINKER -> "A DEVICE THAT SHRINKS THE USER." SPAWNER -> "A DEVICE THAT SPAWNS CREATURES." 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" TARGETINGHAT tt -> "Headwear that "++ targetingInfo tt HEADLAMP -> "A TORCH STRAPPED TO A HAT." POWERLEGS -> "STRENGTH ENHANCING LEGS." SPEEDLEGS -> "SPEED ENHANCING LEGS." JUMPLEGS -> "JUMP ENHANCING LEGS." JETPACK -> "A DEVICE ENABLING FLIGHT." FUELPACK -> "A LIQUID CONTAINER WITH ATTACHED HOSE." BATTERYPACK -> "A COLLECTION OF BATTERIES WITH A UNIVERSAL ADAPTER." AUTODETECTOR d -> "A DEVICE THAT DETECTS "++detectorInfo d ++" IN AN EXPANDING RADIUS. PULSES AUTOMATICALLY. " targetingInfo :: TargetType -> 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." consumableInfo :: ConsumableItemType -> String consumableInfo cit = case cit of MEDKIT _ -> "A SELF-USE HEALING KIT." EXPLOSIVES -> "EXPLOSIVES." 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." INCENDIARYMODULE -> "A DEVICE THAT CONVERTS PROJECTILES INTO INCENDIARY PROJECTILES." STATICMODULE -> "A DEVICE THAT CONVERTS PROJECTILES INTO ELECTROSTATIC PROJECTILES." CONCUSSMODULE -> "A DEVICE THAT CONVERTS PROJECTILES INTO CONCUSSIVE PROJECTILES." FRAGMODULE -> "A DEVICE THAT CONVERTS PROJECTILES INTO FRAGMENTATION PROJECTILES." FLASHMODULE -> "A DEVICE THAT CONVERTS PROJECTILES INTO FLASHBANG PROJECTILES." BOUNCEMODULE -> "A DEVICE THAT CONVERTS PROJECTILES INTO BOUNCING PROJECTILES." PENMODULE -> "A DEVICE THAT CONVERTS PROJECTILES INTO PENTRATING 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." detectorInfo :: Detector -> String detectorInfo d = case d of ITEMDETECTOR -> "ITEMS" CREATUREDETECTOR -> "CREATURES" WALLDETECTOR -> "WALLS" itmUsageInfo :: Item -> String itmUsageInfo itm = case itm ^. itType . iyBase 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 ++ "." Consumable _ -> "THIS ITEM CAN BE CONSUMED." CRAFT _ -> "" _ -> "THIS SHOULD NOT BE DISPLAYED" heldPositionInfo :: Item -> String heldPositionInfo = maybe undefined aimStanceInfo . (^? itUse . heldAim . aimStance) aimStanceInfo :: AimStance -> String aimStanceInfo as = case as of TwoHandTwist -> "IT IS HELD IN TWO HANDS ALONG ITS LENGTH." TwoHandFlat -> "IT IS HELD IN TWO HANDS AT ITS SIDES." OneHand -> "IT IS HELD IN ONE HAND." LeaveHolstered -> "IT IS TO BE LEFT HOLSTERED." itmEquipSiteInfo :: Item -> String itmEquipSiteInfo = maybe "" equipSiteInfo . (^? itUse . equipEffect . eeSite) equipSiteInfo :: EquipSite -> 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" GoesOnSpecial -> " IN A UNIQUE LOCATION" itmModuleInfo :: M.Map ModuleSlot ItemModuleType -> String itmModuleInfo m | m == mempty = "IT CANNOT BE MODIFIED WITHOUT CHANGING ITS FORM ENTIRELY." | otherwise = "IT CAN BE MODIFIED " moduleInfo :: ModuleSlot -> String moduleInfo imt = case imt of ModBullet -> "WITH A NEW BULLET TYPE" ModBulletSpawn -> "TO CHANGE ITS BULLET PAYLOAD" ModRifleMag -> "TO CHANGE ITS MAGAZINE" ModAutoMag -> "TO CHANGE ITS MAGAZINE" ModTarget -> "BY ADDING A TARGETING SYSTEM" ModBulletTrajectory -> "TO CHANGE THE TRAJECTORY OF FIRED BULLETS" ModLauncherHoming -> "TO CHANGE ITS HOMING SYSTEM" ModBattery -> "TO CHANGE ITS BATTERY SYSTEM" ModTeleport -> "TO CHANGE ITS TELEPORT SYSTEM" ModDualBeam -> "TO CHANGE ITS DUAL BEAMS" ModHeldAttach -> "BY ADDING AN ATTACHEMENT"