Implement introspection items

This commit is contained in:
2025-01-01 15:20:46 +00:00
parent dae0e0591c
commit 08685909be
11 changed files with 181 additions and 154 deletions
+7
View File
@@ -67,6 +67,7 @@ itemBaseName = \case
BULLETMOD (BulletModEffect btt) -> show btt
STICKYMOD -> "STICKYMOD"
ITEMSCANNER -> "ITEMSCANNER"
INTROSCAN t -> show t
showAttachItem :: AttachType -> String
showAttachItem t = case t of
@@ -106,8 +107,14 @@ itemNumberDisplay cr ci
-- | UseAttach (APLinkProjectile i) <- ci ^. _1 . itUse = [show i]
| UseAttach (APProjectiles x) <- ci ^. _1 . itUse = [show x]
| UseScope OpticScope{_opticZoom = x} <- ci ^. _1 . itUse = [shortShow x]
| Just t <- ci ^? _1 . itType . ibtIntroScanType = [introScanDisplay cr t]
| otherwise = mempty
introScanDisplay :: Creature -> IntroScanType -> String
introScanDisplay cr = \case
HEALTH -> shortShow (cr ^. crHP)
MAXHEALTH -> shortShow (cr ^. crMaxHP)
displayPulse :: Int -> String
displayPulse 0 = "*****"
displayPulse x = take 5 $ drop y "----^-----"
+1
View File
@@ -42,6 +42,7 @@ itemSPic it = case it ^. itType of
BULLETMOD{} -> defSPic
STICKYMOD -> defSPic
ITEMSCANNER -> defSPic
INTROSCAN {} -> defSPic
craftItemSPic :: CraftType -> Shape
craftItemSPic = \case
+7
View File
@@ -16,6 +16,7 @@ module Dodge.Item.Scope (
bulletPayloadModule,
smokeReducer,
itemScanner,
introScan,
) where
import Dodge.Item.Attach
@@ -47,6 +48,12 @@ stickyMod =
& itType .~ STICKYMOD
& itUse .~ UseNothing
introScan :: IntroScanType -> Item
introScan t =
defaultHeldItem
& itType .~ INTROSCAN t
& itUse .~ UseNothing
itemScanner :: Item
itemScanner =
defaultHeldItem