Work on weapon attachments

This commit is contained in:
2023-09-25 13:38:47 +01:00
parent f9c6769262
commit 0a7f5079ad
12 changed files with 28 additions and 34 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ medkit :: Int -> Item
medkit i =
defaultConsumable
& itUse . cUse .~ CHeal i
& itType . iyBase .~ Consumable (MEDKIT i)
& itType . iyBase .~ CONSUMABLE (MEDKIT i)
heal25 :: Int -> World -> Maybe World
heal25 = heal 25
+5 -3
View File
@@ -79,7 +79,6 @@ itemString = head . basicItemDisplay
itemBaseName :: Item -> String
itemBaseName it = case _iyBase $ _itType it of
NoItemType -> show "NoItemType"
CRAFT str -> show str
HELD hit -> case hit ^? xNum of
Just i -> takeWhile (/= ' ') (show hit) ++ show i
@@ -87,7 +86,7 @@ itemBaseName it = case _iyBase $ _itType it of
LEFT lit -> show lit
EQUIP eit -> showEquipItem eit
AMMO ait -> show ait
Consumable cit -> show cit
CONSUMABLE cit -> show cit
ATTACH ait -> show ait
showEquipItem :: EquipItemType -> String
@@ -121,7 +120,10 @@ itemNumberDisplay cr itm = case iu of
HeldUse{} -> [showReloadProgress cr itm]
LeftUse{} -> [showAutoRechargeProgress (_leftConsumption iu)]
EquipUse{} -> showEquipmentNumber cr itm
_ -> [show $ iu ^?! useAmount . getItAmount]
CraftUse x -> [show $ x ^. getItAmount]
ConsumeUse {_useAmount = x} -> [show $ x ^. getItAmount]
AttachUse {} -> []
where
iu = itm ^?! itUse
+1 -2
View File
@@ -18,13 +18,12 @@ import ShapePicture
itemSPic :: Item -> SPic
itemSPic it =
M.foldMapWithKey (modulesSPic it) (_iyModules $ _itType it) <> case it ^. itType . iyBase of
NoItemType -> over _1 (colorSH magenta) defSPic
CRAFT _ -> defSPic
HELD ht -> heldItemSPic ht it
LEFT lt -> leftItemSPic lt it
EQUIP et -> equipItemSPic et it
AMMO {} -> defSPic
Consumable{} -> defSPic
CONSUMABLE{} -> defSPic
ATTACH {} -> defSPic
equipItemSPic :: EquipItemType -> Item -> SPic
+2 -2
View File
@@ -99,8 +99,8 @@ miniGunUse i =
& heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& heldConsumption
.~ (defaultBulletLoadable & laSource .~ AboveSource)
& heldConsumption . laSource . _InternalSource . iaCycle
.~ [loadEject 40, loadInsert 40, loadPrime 40]
-- & heldConsumption . laSource . _InternalSource . iaCycle
-- .~ [loadEject 40, loadInsert 40, loadPrime 40]
miniGunX :: Int -> Item
miniGunX i =
+2 -2
View File
@@ -23,7 +23,7 @@ itmBaseInfo itm = case itm ^. itType . iyBase of
HELD hit -> heldInfo hit
LEFT lit -> leftInfo lit
EQUIP eit -> equipInfo eit
Consumable cit -> consumableInfo cit
CONSUMABLE cit -> consumableInfo cit
CRAFT fit -> craftInfo fit
_ -> "THIS SHOULD NOT BE DISPLAYED"
@@ -222,7 +222,7 @@ itmUsageInfo itm = case itm ^. itType . iyBase of
"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."
CONSUMABLE _ -> "This item can be consumed."
CRAFT _ -> ""
_ -> "THIS SHOULD NOT BE DISPLAYED"