Cleanup
This commit is contained in:
@@ -42,7 +42,7 @@ moduleModification imt = case imt of
|
|||||||
& itTargeting .~ targetRBPress
|
& itTargeting .~ targetRBPress
|
||||||
& itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
|
& itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
|
||||||
-- for the camera: the simplest option is to remove all zoom/offset
|
-- for the camera: the simplest option is to remove all zoom/offset
|
||||||
& itUse . heldAim . aimZoom . itZoomFac .~ 1
|
& itUse . heldAim . aimZoom . izFac .~ 1
|
||||||
& itUse . heldAim . aimRange .~ 0
|
& itUse . heldAim . aimRange .~ 0
|
||||||
|
|
||||||
-- a better option would be to involve a "scope" centered on the firing
|
-- a better option would be to involve a "scope" centered on the firing
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ stackedInventory :: [Item]
|
|||||||
stackedInventory =
|
stackedInventory =
|
||||||
[ burstRifle
|
[ burstRifle
|
||||||
, pipe
|
, pipe
|
||||||
|
, timeScrollGun
|
||||||
, rewindGun
|
, rewindGun
|
||||||
, tractorGun
|
, tractorGun
|
||||||
, autoPistol
|
, autoPistol
|
||||||
|
|||||||
@@ -40,8 +40,9 @@ data TimeFlowStatus
|
|||||||
, _scrollItemLocation :: Int
|
, _scrollItemLocation :: Int
|
||||||
}
|
}
|
||||||
| RewindLeftClick
|
| RewindLeftClick
|
||||||
{ _reverseAmount :: Int }
|
{ _reverseAmount :: Int
|
||||||
|
, _scrollItemLocation :: Int
|
||||||
|
}
|
||||||
|
|
||||||
data CWGen = CWGen
|
data CWGen = CWGen
|
||||||
{ _cwgParams :: GenParams
|
{ _cwgParams :: GenParams
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ data PressType = InitialPress
|
|||||||
| LongPress
|
| LongPress
|
||||||
deriving (Eq,Show)
|
deriving (Eq,Show)
|
||||||
|
|
||||||
|
data MouseButtonInfo = MouseButtonInfo
|
||||||
|
{ _mbHeldDown :: Bool
|
||||||
|
, _mbFlags :: [MouseButtonFlag]
|
||||||
|
}
|
||||||
|
data MouseButtonFlag
|
||||||
|
= PressedStartRewind
|
||||||
|
|
||||||
data Input = Input
|
data Input = Input
|
||||||
{ _mousePos :: Point2
|
{ _mousePos :: Point2
|
||||||
, _mouseMoving :: Bool
|
, _mouseMoving :: Bool
|
||||||
|
|||||||
@@ -70,9 +70,9 @@ data AimStance
|
|||||||
--deriving (Eq, Show, Ord, Enum, Read) --Generic, Flat)
|
--deriving (Eq, Show, Ord, Enum, Read) --Generic, Flat)
|
||||||
|
|
||||||
data ItZoom = ItZoom
|
data ItZoom = ItZoom
|
||||||
{ _itZoomMax :: Float
|
{ _izMax :: Float
|
||||||
, _itZoomMin :: Float
|
, _izMin :: Float
|
||||||
, _itZoomFac :: Float
|
, _izFac :: Float
|
||||||
}
|
}
|
||||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ volleyGun i =
|
|||||||
& itUse . heldAim . aimWeight .~ 6
|
& itUse . heldAim . aimWeight .~ 6
|
||||||
& itUse . heldAim . aimRange .~ 1
|
& itUse . heldAim . aimRange .~ 1
|
||||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
& itUse . heldAim . aimStance .~ TwoHandFlat
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_itZoomFac = 1.5}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||||
& itUse . heldAim . aimHandlePos .~ 5
|
& itUse . heldAim . aimHandlePos .~ 5
|
||||||
& itUse . heldAim . aimMuzPos .~ 15
|
& itUse . heldAim . aimMuzPos .~ 15
|
||||||
& itUse . heldConsumption . laMax .~ i
|
& itUse . heldConsumption . laMax .~ i
|
||||||
@@ -82,7 +82,7 @@ rifle =
|
|||||||
& itUse . heldConsumption . laCycle .~ [loadEject 5, loadInsert 5, loadPrime 5]
|
& itUse . heldConsumption . laCycle .~ [loadEject 5, loadInsert 5, loadPrime 5]
|
||||||
& itUse . heldAim . aimWeight .~ 6
|
& itUse . heldAim . aimWeight .~ 6
|
||||||
& itUse . heldAim . aimRange .~ 1
|
& itUse . heldAim . aimRange .~ 1
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_itZoomFac = 2}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 2}
|
||||||
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
|
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
|
||||||
|
|
||||||
repeater :: Item
|
repeater :: Item
|
||||||
@@ -118,7 +118,7 @@ miniGunUse i =
|
|||||||
& heldAim . aimWeight .~ 6
|
& heldAim . aimWeight .~ 6
|
||||||
& heldAim . aimRange .~ 1
|
& heldAim . aimRange .~ 1
|
||||||
& heldAim . aimStance .~ TwoHandTwist
|
& heldAim . aimStance .~ TwoHandTwist
|
||||||
& heldAim . aimZoom .~ defaultItZoom{_itZoomFac = 1.5}
|
& heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||||
& heldConsumption
|
& heldConsumption
|
||||||
.~ defaultBulletLoadable
|
.~ defaultBulletLoadable
|
||||||
{ _laMax = 1500
|
{ _laMax = 1500
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ bangRod =
|
|||||||
& itUse . heldAim . aimWeight .~ 8
|
& itUse . heldAim . aimWeight .~ 8
|
||||||
& itUse . heldAim . aimRange .~ 1
|
& itUse . heldAim . aimRange .~ 1
|
||||||
& itUse . heldAim . aimStance .~ OneHand
|
& itUse . heldAim . aimStance .~ OneHand
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_itZoomFac = 1.5}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||||
& itUse . heldAim . aimHandlePos .~ 5
|
& itUse . heldAim . aimHandlePos .~ 5
|
||||||
& itUse . heldAim . aimMuzPos .~ 30
|
& itUse . heldAim . aimMuzPos .~ 30
|
||||||
& itUse . heldConsumption . laAmmoType .~ hvBullet
|
& itUse . heldConsumption . laAmmoType .~ hvBullet
|
||||||
@@ -70,11 +70,11 @@ sniperRifle =
|
|||||||
elephantGun
|
elephantGun
|
||||||
& itType . iyBase .~ HELD SNIPERRIFLE
|
& itType . iyBase .~ HELD SNIPERRIFLE
|
||||||
& itParams . gunBarrels .~ SingleBarrel 0
|
& itParams . gunBarrels .~ SingleBarrel 0
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_itZoomMax = 0.5, _itZoomMin = 0.5}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5}
|
||||||
& itUse . heldScroll .~ HeldScrollZoom -- zoomLongGun
|
& itUse . heldScroll .~ HeldScrollZoom -- zoomLongGun
|
||||||
& itScope .~ ZoomScope (V2 0 0) 0 1 0.5 False
|
& itScope .~ ZoomScope (V2 0 0) 0 1 0.5 False
|
||||||
& itTargeting .~ targetLaser
|
& itTargeting .~ targetLaser
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_itZoomFac = 1}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1}
|
||||||
|
|
||||||
machineGun :: Item
|
machineGun :: Item
|
||||||
machineGun =
|
machineGun =
|
||||||
@@ -85,7 +85,7 @@ machineGun =
|
|||||||
& itUse . heldAim . aimWeight .~ 8
|
& itUse . heldAim . aimWeight .~ 8
|
||||||
& itUse . heldAim . aimRange .~ 1
|
& itUse . heldAim . aimRange .~ 1
|
||||||
& itUse . heldAim . aimStance .~ TwoHandTwist
|
& itUse . heldAim . aimStance .~ TwoHandTwist
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_itZoomFac = 1.5}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||||
& itUse . heldDelay .~ VariableRate{_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
|
& itUse . heldDelay .~ VariableRate{_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
|
||||||
& itUse . heldConsumption . laMax .~ 100
|
& itUse . heldConsumption . laMax .~ 100
|
||||||
& itUse . heldConsumption . laCycle .~ [loadEject 10, loadInsert 40, loadPrime 10]
|
& itUse . heldConsumption . laCycle .~ [loadEject 10, loadInsert 40, loadPrime 10]
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ flameThrower =
|
|||||||
& itUse . heldDelay .~ NoDelay
|
& itUse . heldDelay .~ NoDelay
|
||||||
& itUse . heldMods .~ FlameThrowerMod
|
& itUse . heldMods .~ FlameThrowerMod
|
||||||
& itUse . heldAim . aimWeight .~ 5
|
& itUse . heldAim . aimWeight .~ 5
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_itZoomMax = 5, _itZoomMin = 1.5}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
|
||||||
& itUse . heldAim . aimStance .~ TwoHandTwist
|
& itUse . heldAim . aimStance .~ TwoHandTwist
|
||||||
& itUse . heldAim . aimHandlePos .~ 0
|
& itUse . heldAim . aimHandlePos .~ 0
|
||||||
& itUse . heldAim . aimMuzPos .~ 18
|
& itUse . heldAim . aimMuzPos .~ 18
|
||||||
|
|||||||
@@ -64,5 +64,5 @@ clickDetector dt =
|
|||||||
& itUse . heldUse .~ HeldDetectorEffect dt --detectorEffect dt
|
& itUse . heldUse .~ HeldDetectorEffect dt --detectorEffect dt
|
||||||
& itUse . heldMods .~ AmmoUseCheckMod
|
& itUse . heldMods .~ AmmoUseCheckMod
|
||||||
& itUse . heldAim . aimRange .~ 1
|
& itUse . heldAim . aimRange .~ 1
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_itZoomFac = 1}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1}
|
||||||
& itType . iyBase .~ HELD (HELDDETECTOR dt)
|
& itType . iyBase .~ HELD (HELDDETECTOR dt)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ setRemoteBombScope itid pj w = case w ^?! cWorld . lWorld . itemLocations . ix i
|
|||||||
. scopePos
|
. scopePos
|
||||||
.~ (_prPos pj -.- (w ^?! cWorld . lWorld . creatures . ix cid . crPos))
|
.~ (_prPos pj -.- (w ^?! cWorld . lWorld . creatures . ix cid . crPos))
|
||||||
& cWorld . lWorld . creatures . ix cid . crInv . ix invid . itUse . heldAim . aimZoom
|
& cWorld . lWorld . creatures . ix cid . crInv . ix invid . itUse . heldAim . aimZoom
|
||||||
.~ (defaultItZoom{_itZoomMax = 0.5, _itZoomMin = 0.5})
|
.~ (defaultItZoom{_izMax = 0.5, _izMin = 0.5})
|
||||||
_ -> w
|
_ -> w
|
||||||
|
|
||||||
setRemoteScope :: Int -> Point2 -> World -> World
|
setRemoteScope :: Int -> Point2 -> World -> World
|
||||||
|
|||||||
+5
-2
@@ -14,7 +14,7 @@ useL :: Luse -> Item -> Creature -> World -> World
|
|||||||
useL lu = case lu of
|
useL lu = case lu of
|
||||||
LDoNothing -> const $ const id
|
LDoNothing -> const $ const id
|
||||||
LRewind -> useRewindGun
|
LRewind -> useRewindGun
|
||||||
LTimeScroll -> useTimeScrollGun
|
LTimeScroll -> hammerCheckL useTimeScrollGun
|
||||||
LShrink -> hammerCheckL useShrinkGun
|
LShrink -> hammerCheckL useShrinkGun
|
||||||
LBlink -> hammerCheckL (shootL $ const blinkActionMousePos)
|
LBlink -> hammerCheckL (shootL $ const blinkActionMousePos)
|
||||||
LUnsafeBlink -> hammerCheckL (shootL $ const unsafeBlinkAction)
|
LUnsafeBlink -> hammerCheckL (shootL $ const unsafeBlinkAction)
|
||||||
@@ -30,7 +30,10 @@ useTimeScrollGun itm _ w = w & cWorld . timeFlow .~ ScrollTimeFlow
|
|||||||
|
|
||||||
useRewindGun :: Item -> Creature -> World -> World
|
useRewindGun :: Item -> Creature -> World -> World
|
||||||
useRewindGun itm _ w = w
|
useRewindGun itm _ w = w
|
||||||
& cWorld . timeFlow .~ RewindLeftClick (itm ^?! itUse . leftConsumption . wpCharge)
|
& cWorld . timeFlow .~ RewindLeftClick
|
||||||
|
{ _reverseAmount = itm ^?! itUse . leftConsumption . wpCharge
|
||||||
|
, _scrollItemLocation = _itID itm
|
||||||
|
}
|
||||||
|
|
||||||
--useRewindGun _ _ w = case w ^. cwTime . rewindWorlds of
|
--useRewindGun _ _ w = case w ^. cwTime . rewindWorlds of
|
||||||
-- [w'] -> w & cwTime . maybeWorld .~ Just' w'
|
-- [w'] -> w & cwTime . maybeWorld .~ Just' w'
|
||||||
|
|||||||
@@ -50,22 +50,22 @@ crHoldReloading cr w =
|
|||||||
|
|
||||||
tryStartLoading :: Creature -> Creature
|
tryStartLoading :: Creature -> Creature
|
||||||
tryStartLoading cr = case cr ^? crInv . ix (crSel cr) . itUse . heldConsumption of
|
tryStartLoading cr = case cr ^? crInv . ix (crSel cr) . itUse . heldConsumption of
|
||||||
Just hc -> tryStartLoading' hc cr
|
Just hc -> startLoading hc cr
|
||||||
Nothing -> cr
|
Nothing -> cr
|
||||||
|
|
||||||
tryStartLoading' :: HeldConsumption -> Creature -> Creature
|
startLoading :: HeldConsumption -> Creature -> Creature
|
||||||
tryStartLoading' ic cr = case ic ^? laProgress . _Just . ix 0 of
|
startLoading ic cr = case ic ^? laProgress . _Just . ix 0 of
|
||||||
Just la -> cr & startLoadAction la
|
Just la -> cr & startLoadingStep la
|
||||||
Nothing -> case ic ^? laCycle of
|
Nothing -> case ic ^? laCycle of
|
||||||
Nothing -> cr
|
Nothing -> cr
|
||||||
Just [] -> error ("item has empty load cycle" ++ show (cr ^?! crInv . ix (crSel cr) . itType))
|
Just [] -> error ("item has empty load cycle" ++ show (cr ^?! crInv . ix (crSel cr) . itType))
|
||||||
Just _ | _laLoaded ic >= _laMax ic -> cr
|
Just _ | _laLoaded ic >= _laMax ic -> cr
|
||||||
Just (la : las) ->
|
Just (la : las) ->
|
||||||
cr & startLoadAction la
|
cr & startLoadingStep la
|
||||||
& crInv . ix (crSel cr) . itUse . heldConsumption . laProgress ?~ (la : las)
|
& crInv . ix (crSel cr) . itUse . heldConsumption . laProgress ?~ (la : las)
|
||||||
|
|
||||||
startLoadAction :: LoadAction -> Creature -> Creature
|
startLoadingStep :: LoadAction -> Creature -> Creature
|
||||||
startLoadAction la cr = cr & crInvSel . iselAction .~ ReloadAction (_actionTime la) la NoHammer
|
startLoadingStep la cr = cr & crInvSel . iselAction .~ ReloadAction (_actionTime la) la NoHammer
|
||||||
|
|
||||||
rotateActionProgress :: HeldConsumption -> HeldConsumption
|
rotateActionProgress :: HeldConsumption -> HeldConsumption
|
||||||
rotateActionProgress ic = case ic ^? laProgress . _Just of
|
rotateActionProgress ic = case ic ^? laProgress . _Just of
|
||||||
|
|||||||
+13
-3
@@ -5,11 +5,21 @@ import Dodge.Data.Universe
|
|||||||
--import Data.Maybe
|
--import Data.Maybe
|
||||||
--import ShortShow
|
--import ShortShow
|
||||||
--import qualified Data.Map.Strict as M
|
--import qualified Data.Map.Strict as M
|
||||||
import qualified IntMapHelp as IM
|
--import qualified IntMapHelp as IM
|
||||||
|
|
||||||
testStringInit :: Universe -> [String]
|
testStringInit :: Universe -> [String]
|
||||||
testStringInit u =
|
testStringInit u =
|
||||||
[ show $ IM.keys $ u ^?! uvWorld . cWorld . lWorld . creatures . ix 0 . crInv ]
|
[ showTimeFlow $ u ^. uvWorld . cWorld . timeFlow
|
||||||
|
]
|
||||||
|
|
||||||
|
showTimeFlow :: TimeFlowStatus -> String
|
||||||
|
showTimeFlow tfs = case tfs of
|
||||||
|
RewindingNow -> "RewindingNow"
|
||||||
|
DeathTime i -> "DeathTime"++show i
|
||||||
|
RewindingLastFrame -> "RewindingLastFrame"
|
||||||
|
NormalTimeFlow -> "NormalTimeFlow"
|
||||||
|
ScrollTimeFlow {_reverseAmount = ra } -> "ScrollTimeFlow" ++ show ra
|
||||||
|
RewindLeftClick {_reverseAmount = ra } -> "RewindLeftClick" ++ show ra
|
||||||
|
|
||||||
-- [ show $ u ^? uvScreenLayers . _head . scOffset
|
-- [ show $ u ^? uvScreenLayers . _head . scOffset
|
||||||
-- ]
|
-- ]
|
||||||
-- ++ [ shortShow $ u ^?! uvWorld . cWorld . lWorld . creatures . ix 0 . crPos
|
-- ++ [ shortShow $ u ^?! uvWorld . cWorld . lWorld . creatures . ix 0 . crPos
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ functionalUpdate' :: Universe -> Universe
|
|||||||
functionalUpdate' u = case u ^. uvWorld . cWorld . timeFlow of
|
functionalUpdate' u = case u ^. uvWorld . cWorld . timeFlow of
|
||||||
NormalTimeFlow -> functionalUpdate u
|
NormalTimeFlow -> functionalUpdate u
|
||||||
ScrollTimeFlow smoothing _ _ _ -> over uvWorld (doTimeScroll smoothing) u
|
ScrollTimeFlow smoothing _ _ _ -> over uvWorld (doTimeScroll smoothing) u
|
||||||
|
RewindLeftClick 0 _ -> u
|
||||||
|
RewindLeftClick _ _ -> over uvWorld scrollTimeBack u & uvWorld . cWorld . timeFlow .~ NormalTimeFlow
|
||||||
_ -> u
|
_ -> u
|
||||||
|
|
||||||
doTimeScroll :: Int -> World -> World
|
doTimeScroll :: Int -> World -> World
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ notAtTerminal w = isNothing $ w ^? hud . hudElement . subInventory . termID
|
|||||||
zoomFromItem ::
|
zoomFromItem ::
|
||||||
ItZoom ->
|
ItZoom ->
|
||||||
Float
|
Float
|
||||||
zoomFromItem ItZoom{_itZoomMax = zMax, _itZoomMin = zMin, _itZoomFac = zFac} =
|
zoomFromItem ItZoom{_izMax = zMax, _izMin = zMin, _izFac = zFac} =
|
||||||
min zMax $ max zMin zFac
|
min zMax $ max zMin zFac
|
||||||
|
|
||||||
clipZoom ::
|
clipZoom ::
|
||||||
|
|||||||
Reference in New Issue
Block a user