Tweak scrolling, particularly zooming
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user