diff --git a/ghcidOutput b/ghcidOutput index 9e0f8b2c0..2d15968f1 100644 --- a/ghcidOutput +++ b/ghcidOutput @@ -1 +1 @@ -All good (615 modules, at 12:03:22) +All good (615 modules, at 12:12:25) diff --git a/graph/itemCombinations.gv b/graph/itemCombinations.gv index 66d8e434c..bad243141 100644 --- a/graph/itemCombinations.gv +++ b/graph/itemCombinations.gv @@ -22,7 +22,7 @@ digraph { 28 [shape=box ,label="EQUIP {_ibtEquip = TARGETINGHAT TargetCursor}"]; 31 [shape=box - ,label="ATTACH {_ibtAttach = AMMOATTACH TINMAG}"]; + ,label="AMMOMAG {_ibtAmmoMag = TINMAG}"]; 35 [shape=box ,label="HELD {_ibtHeld = BANGSTICK {_xNum = 1}}"]; 39 [shape=box diff --git a/src/Dodge/Data/Item/Use.hs b/src/Dodge/Data/Item/Use.hs index 3dcbf2075..c89c0a7e7 100644 --- a/src/Dodge/Data/Item/Use.hs +++ b/src/Dodge/Data/Item/Use.hs @@ -56,7 +56,7 @@ data ItemUse | AttachUse {_attachParams :: AttachParams} | AmmoMagUse - { _amagLoadStatus :: InternalAmmo + { _amagLoadStatus :: ReloadStatus , _amagParams :: AmmoParams } --deriving (Eq, Show, Read) --Generic, Flat) diff --git a/src/Dodge/Data/Item/Use/Consumption.hs b/src/Dodge/Data/Item/Use/Consumption.hs index cd0eda35d..bb2be0d1f 100644 --- a/src/Dodge/Data/Item/Use/Consumption.hs +++ b/src/Dodge/Data/Item/Use/Consumption.hs @@ -25,14 +25,7 @@ data HeldConsumption | NoConsumption deriving (Eq, Show, Read) --Generic, Flat) -data AmmoSource - = InternalSource InternalAmmo - | AboveSource - | BelowSource - | EitherSource - deriving (Eq, Show, Read) --Generic, Flat) - -data InternalAmmo = InternalAmmo +data ReloadStatus = ReloadStatus { _iaMax :: Int , _iaLoaded :: Int , _iaPrimed :: Bool @@ -64,10 +57,8 @@ newtype ItAmount = ItAmount {_getItAmount :: Int} makeLenses ''HeldConsumption makeLenses ''LeftConsumption makeLenses ''ItAmount -makePrisms ''AmmoSource -makeLenses ''InternalAmmo -deriveJSON defaultOptions ''InternalAmmo -deriveJSON defaultOptions ''AmmoSource +makeLenses ''ReloadStatus +deriveJSON defaultOptions ''ReloadStatus deriveJSON defaultOptions ''HeldConsumption deriveJSON defaultOptions ''LeftConsumption deriveJSON defaultOptions ''ItAmount diff --git a/src/Dodge/Item/Ammo.hs b/src/Dodge/Item/Ammo.hs index dd3d93aac..6fc1727f3 100644 --- a/src/Dodge/Item/Ammo.hs +++ b/src/Dodge/Item/Ammo.hs @@ -15,7 +15,7 @@ tinMag = .~ AmmoMagUse { _amagParams = BulletParams defaultBullet , _amagLoadStatus = - InternalAmmo + ReloadStatus { _iaMax = 15 , _iaLoaded = 15 , _iaPrimed = True @@ -51,7 +51,7 @@ shellMag = .~ AmmoMagUse { _amagParams = BulletParams defaultBullet , _amagLoadStatus = - InternalAmmo + ReloadStatus { _iaMax = 15 , _iaLoaded = 15 , _iaPrimed = True diff --git a/src/Dodge/Item/Display.hs b/src/Dodge/Item/Display.hs index 6cea26821..67b77907d 100644 --- a/src/Dodge/Item/Display.hs +++ b/src/Dodge/Item/Display.hs @@ -171,7 +171,7 @@ showReloadProgress _ itm = fromMaybe [] $ do -- where -- ic = itm ^?! itUse . heldConsumption -showLoadActionType :: LoadAction -> InternalAmmo -> String +showLoadActionType :: LoadAction -> ReloadStatus -> String showLoadActionType la as = case la of LoadEject{} -> "E" LoadInsert{} -> "L" diff --git a/src/Dodge/Item/InventoryColor.hs b/src/Dodge/Item/InventoryColor.hs index 0f9d2b3b6..3d694b387 100644 --- a/src/Dodge/Item/InventoryColor.hs +++ b/src/Dodge/Item/InventoryColor.hs @@ -12,4 +12,4 @@ itemInvColor itm = case itm ^. itType . iyBase of CONSUMABLE {} -> blue CRAFT {} -> green ATTACH {} -> orange - AMMOMAG {} -> greyN 0.5 + AMMOMAG {} -> greyN 0.8 diff --git a/src/Dodge/Reloading.hs b/src/Dodge/Reloading.hs index fb1f6abcc..4ce517ee3 100644 --- a/src/Dodge/Reloading.hs +++ b/src/Dodge/Reloading.hs @@ -56,7 +56,7 @@ tryStartLoading cr = fromMaybe cr $ do -- InternalSource ia -> return $ startLoading ia cr -- AboveSource -> return cr -startLoading :: InternalAmmo -> Creature -> Creature +startLoading :: ReloadStatus -> Creature -> Creature startLoading ic cr = case ic ^? iaProgress . _Just . ix 0 of Just la -> cr & startLoadingStep la Nothing -> case ic ^. iaCycle of @@ -71,13 +71,13 @@ startLoading ic cr = case ic ^? iaProgress . _Just . ix 0 of startLoadingStep :: LoadAction -> Creature -> Creature startLoadingStep la cr = cr & crManipulation . manObject . inInventory . iselAction .~ ReloadAction (_actionTime la) la -rotateActionProgress :: InternalAmmo -> InternalAmmo +rotateActionProgress :: ReloadStatus -> ReloadStatus rotateActionProgress ic = case ic ^. iaProgress of Just (_ : la : las) -> ic & iaProgress . _Just .~ (la : las) _ | _iaLoaded ic < _iaMax ic -> ic & iaProgress ?~ _iaCycle ic _ -> ic & iaProgress .~ Nothing -doLoadAction :: LoadAction -> InternalAmmo -> InternalAmmo +doLoadAction :: LoadAction -> ReloadStatus -> ReloadStatus doLoadAction la ic = case la of LoadEject{} -> ic & iaLoaded .~ 0 & iaPrimed .~ False LoadInsert{} -> ic & iaLoaded .~ _iaMax ic