Improve scope zooming
This commit is contained in:
@@ -28,6 +28,7 @@ data Scope = NoScope
|
||||
{_scopePos :: Point2 -- ^ a camera offset
|
||||
,_scopeZoomChange :: Int
|
||||
,_scopeZoom :: Float
|
||||
,_scopeDefaultZoom :: Float
|
||||
,_scopeIsCamera :: Bool -- ^ if the camera offset is also the center of vision
|
||||
}
|
||||
|
||||
|
||||
@@ -132,8 +132,9 @@ sniperRifle = elephantGun
|
||||
& itParams . gunBarrels .~ SingleBarrel 0
|
||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5}
|
||||
& itUse . heldScroll .~ zoomLongGun
|
||||
& itScope .~ ZoomScope (V2 0 0) 0 1 False
|
||||
& itScope .~ ZoomScope (V2 0 0) 0 1 0.5 False
|
||||
& itTargeting .~ targetLaser
|
||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
|
||||
machineGun :: Item
|
||||
machineGun = bangRod
|
||||
& itName .~ "MACHINEGUN"
|
||||
|
||||
@@ -297,7 +297,7 @@ longGun = defaultGun
|
||||
& useAim . aimZoom .~ defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5}
|
||||
& heldScroll .~ zoomLongGun
|
||||
, _itAttachment = NoItAttachment
|
||||
, _itScope = ZoomScope (V2 0 0) 0 1 False
|
||||
, _itScope = ZoomScope (V2 0 0) 0 1 0.1 False
|
||||
-- , _itEffect = itemLaserScopeEffect
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import LensHelp
|
||||
|
||||
zoomLongGun :: Float -> Creature -> Item -> Item
|
||||
zoomLongGun x _
|
||||
| x > 0 = itScope . scopeZoomChange %~ (max 5 . (+5))
|
||||
| x < 0 = itScope . scopeZoomChange %~ (min (-5) . subtract 5)
|
||||
| x > 0 = itScope . scopeZoomChange %~ (max 10 . (+3))
|
||||
| x < 0 = itScope . scopeZoomChange %~ (min (-10) . subtract 3)
|
||||
| otherwise = id
|
||||
--zoomLongGun x _ = itScope . scopeZoomChange .~ round (signum x)
|
||||
|
||||
Reference in New Issue
Block a user