Tweak "magnets" that affect bullet movement
This commit is contained in:
+8
-4
@@ -30,7 +30,6 @@ import Dodge.Laser.Update
|
||||
import Dodge.LinearShockwave.Update
|
||||
import Dodge.ListDisplayParams
|
||||
import Dodge.Machine.Update
|
||||
import Dodge.Magnet.Update
|
||||
import Dodge.Menu
|
||||
import Dodge.ModificationEffect
|
||||
import Dodge.PosEvent
|
||||
@@ -251,10 +250,12 @@ scrollTimeForward w = case w ^? timeFlow . futureWorlds . _head of
|
||||
_ <- w ^? timeFlow . scrollItemID . unNInt
|
||||
return id -- pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix i) . itUse . leftConsumption . wpCharge .~ ramount
|
||||
|
||||
|
||||
-- | The update step.
|
||||
functionalUpdate :: Universe -> Universe
|
||||
functionalUpdate u =
|
||||
checkEndGame
|
||||
. over (uvWorld . cWorld . lWorld) updateMagnets
|
||||
. over uvWorld (cWorld . lWorld . lClock +~ 1)
|
||||
. over uvWorld updateDistortions
|
||||
. over uvWorld updateCreatureSoundPositions
|
||||
@@ -282,7 +283,6 @@ functionalUpdate u =
|
||||
. over uvWorld (updateIMl' (_projectiles . _lWorld . _cWorld) updateProjectile)
|
||||
. over uvWorld updateClouds
|
||||
. over uvWorld updateGusts
|
||||
. over uvWorld (updateMIM (cWorld . lWorld . magnets) (doMagnetUpdate . _mgUpdate))
|
||||
. over uvWorld (updateIMl' (_terminals . _lWorld . _cWorld) tmUpdate)
|
||||
-- . updateIMl _machines mcChooseUpdate
|
||||
. over uvWorld (updateIMl' (_machines . _lWorld . _cWorld) updateMachine)
|
||||
@@ -304,6 +304,10 @@ functionalUpdate u =
|
||||
. set (uvWorld . cWorld . lWorld . lights) []
|
||||
$ over uvWorld updatePastWorlds u
|
||||
|
||||
updateMagnets :: LWorld -> LWorld
|
||||
updateMagnets lw = lw & oldMagnets .~ (lw ^. magnets)
|
||||
& magnets .~ mempty
|
||||
|
||||
checkTermDist :: World -> World
|
||||
checkTermDist w = fromMaybe w $ do
|
||||
tmid <- w ^? hud . hudElement . subInventory . termID
|
||||
@@ -657,8 +661,8 @@ updateInstantBullets w = case w ^. cWorld . lWorld . instantBullets of
|
||||
-- ps -> let (w',ps') = mapAccumR (\a b -> _ptUpdate b a b) (w {_instantParticles=[]}) ps
|
||||
-- in updateInstantParticles $ w' & particles .++~ catMaybes ps'
|
||||
|
||||
updateMIM :: ASetter' World (IM.IntMap a) -> (a -> a -> Maybe a) -> World -> World
|
||||
updateMIM f up = f %~ IM.mapMaybe (dbArg up)
|
||||
--updateMIM :: ASetter' World (IM.IntMap a) -> (a -> a -> Maybe a) -> World -> World
|
||||
--updateMIM f up = f %~ IM.mapMaybe (dbArg up)
|
||||
|
||||
-- Note that this updates the randgen
|
||||
--updateCreatures :: World -> World
|
||||
|
||||
Reference in New Issue
Block a user