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