Rename ItemAttachments

This commit is contained in:
2022-06-15 08:21:53 +01:00
parent 485c42eb24
commit bf1bfa5453
15 changed files with 98 additions and 80 deletions
+5 -5
View File
@@ -26,7 +26,7 @@ scrollCharMode x _
incCharMode
:: Item
-> Item
incCharMode = itAttachment . itCharMode %~ cycleL
incCharMode = itAttachment . atCharMode %~ cycleL
where
cycleL (x :<| xs) = xs |> x
cycleL xs = xs
@@ -34,7 +34,7 @@ incCharMode = itAttachment . itCharMode %~ cycleL
decCharMode
:: Item
-> Item
decCharMode = itAttachment . itCharMode %~ cycleR
decCharMode = itAttachment . atCharMode %~ cycleR
where
cycleR (xs :|> x) = x <| xs
cycleR xs = xs
@@ -43,7 +43,7 @@ charFiringStratI
:: [(Char, ChainEffect)] -- ^ Different firing effects for different characters
-> ChainEffect
charFiringStratI strats eff item cr w = case w ^? creatures . ix cid . crInv
. ix (_crInvSel $ _creatures w IM.! cid) . itAttachment . itCharMode of
. ix (_crInvSel $ _creatures w IM.! cid) . itAttachment . atCharMode of
Just (c :<| _) -> fromMaybe id (Prelude.lookup c strats) eff item cr w
_ -> w
where
@@ -55,10 +55,10 @@ changeFuse
-> Item
-> Item
changeFuse scrollAmount _ it = it
& ( itAttachment .~ ItFuse newTime )
& ( itAttachment .~ AttachFuse newTime )
& ( itUse . useAim . aimZoom .~ defaultItZoom{_itZoomMax = zm, _itZoomMin = zm} )
where
oldTime = _itFuseTime $ _itAttachment it
oldTime = _atFuseTime $ _itAttachment it
newTime = min 90 $ max 20 $ oldTime - round (5 * scrollAmount)
zm = 50 / fromIntegral newTime