Make ammo magazines into own item type

This commit is contained in:
2024-06-22 12:03:32 +01:00
parent 35a56eef56
commit 8e127f0603
17 changed files with 258 additions and 255 deletions
+3 -2
View File
@@ -82,11 +82,11 @@ itemBaseName it = case _iyBase $ _itType it of
EQUIP eit -> showEquipItem eit
CONSUMABLE cit -> show cit
ATTACH ait -> showAttachItem ait
AMMOMAG ait -> show ait
showAttachItem :: AttachType -> String
showAttachItem t = case t of
SCROLLATTACH x -> show x
AMMOATTACH x -> show x
TARGETATTACH x -> show x
showEquipItem :: EquipItemType -> String
@@ -124,6 +124,7 @@ itemNumberDisplay cr itm = case iu of
CraftUse x -> [show $ x ^. getItAmount]
ConsumeUse {_useAmount = x} -> [show $ x ^. getItAmount]
AttachUse {} -> [showReloadProgress cr itm]
AmmoMagUse {} -> [showReloadProgress cr itm]
-- this could be cleaner here...
where
iu = itm ^?! itUse
@@ -153,7 +154,7 @@ showEquipmentNumber _ itm = case _eeUse ee of
showReloadProgress :: Creature -> Item -> String
showReloadProgress _ itm = fromMaybe [] $ do
ia <- itm ^? itUse . attachParams . ammoLoadStatus
ia <- itm ^? itUse . amagLoadStatus
return $ case ia ^? iaProgress . _Just . ix 0 of
Nothing -> maybe "" show $ ia ^? iaLoaded
Just la -> showLoadActionType la ia