Make ammo magazines into own item type
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user