Allow pausable reloads with discrete progess steps

This commit is contained in:
2022-06-22 14:20:20 +01:00
parent 029b6daf8e
commit ac0948cb64
6 changed files with 60 additions and 76 deletions
+9 -8
View File
@@ -55,14 +55,14 @@ showSelectedConsumption cr ic = case ic of
showReloadProgress :: Creature -> ItemConsumption -> String
showReloadProgress cr ic = case cr ^?! crInvSel . iselAction of
ReloadAction i la _ -> show i ++ showLoadActionType la
ReloadAction i la _ -> show i ++ showLoadActionType la (_laLoaded ic)
_ -> case ic ^? laProgress . _Just . ix 0 of
Nothing -> show $ _laLoaded ic
Just la -> show (_actionTime la) ++ showLoadActionType la
Just la -> show (_actionTime la) ++ showLoadActionType la (_laLoaded ic)
showLoadProgress :: Int -> Maybe [LoadAction] -> String
showLoadProgress x mlas = case mlas ^? _Just . ix 0 of
Just la -> show (_actionTime la) ++ showLoadActionType la
Just la -> show (_actionTime la) ++ showLoadActionType la x
Nothing -> show x
showConsumption :: ItemConsumption -> String
@@ -71,11 +71,12 @@ showConsumption ic = case ic of
am@ChargeableAmmo{} -> show $ _wpCharge am
x@ItemItselfConsumable{} -> show (_icAmount x)
NoConsumption -> ""
showLoadActionType :: LoadAction -> String
showLoadActionType la = case la of
Eject {} -> "E"
Insert {} -> "L"
Prime {} -> "P"
showLoadActionType :: LoadAction -> Int -> String
showLoadActionType la x = case la of
LoadEject {} -> "E"
LoadInsert {} -> "L"
LoadAdd {} -> "A" ++ show x
LoadPrime {} -> "P"
-- & itInvDisplay .~ \it -> head (basicItemDisplay it) :
-- ["*FIRERATE:" ++ fromMaybe "" (maybeRateStatus it)
+1 -1
View File
@@ -149,7 +149,7 @@ repeater :: Item
repeater = rifle
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
& itType . iyBase .~ REPEATER
& itConsumption . laCycle .~ [loadEject 5, loadInsert 15 ,loadPrime 15]
& itConsumption . laCycle .~ [loadEject 20, loadInsert 20 ,loadPrime 20]
& itConsumption . laMax .~ 15
& itDimension . dimSPic .~ (\it -> noPic $ baseRifleShape
<> makeTinClipAt 0 (V3 10 (-2) 0) it