Tweak scrolling, particularly zooming

This commit is contained in:
2023-01-07 19:50:44 +00:00
parent 6b259fa200
commit d4122b2d6f
7 changed files with 42 additions and 37 deletions
-1
View File
@@ -108,7 +108,6 @@ maybeWarmupStatus it = case it ^? itUse . heldDelay . warmMax of
maybeModeStatus :: Item -> Maybe String
maybeModeStatus it = case it ^? itUse . heldScroll of
Just HeldScrollCharMode{_hsCharMode = (c :<| _)} -> Just [' ', c]
Just HeldScrollInt{_hsInt = i} -> Just $ show i
_ -> Nothing
maybeRateStatus :: Item -> Maybe String
+13 -5
View File
@@ -1,11 +1,19 @@
module Dodge.Item.Weapon.ZoomScope where
import Dodge.Data.Creature
import Dodge.Data.Item
import LensHelp
-- should be possible without the creature
zoomLongGun :: Float -> Creature -> Item -> Item
zoomLongGun x _
| x > 0 = itScope . scopeZoomChange %~ (max 15 . (+ 4))
| x < 0 = itScope . scopeZoomChange %~ (min (-15) . subtract 4)
zoomLongGun :: Float -> Item -> Item
zoomLongGun x
| x > 0 = itScope . scopeZoomChange %~ (max 0 . (+ xi))
| x < 0 = itScope . scopeZoomChange %~ (min 0 . (+ xi))
| otherwise = id
where
xi | x > 2 = 20
| x > 1 = 4
| x > 0 = 1
| x < -2 = - 20
| x < -1 = - 4
| x < -0 = - 1
| otherwise = 0