Tweak pause camera movement
This commit is contained in:
@@ -53,13 +53,12 @@ foldCr xs cr w = foldl' f w xs
|
||||
stateUpdate :: (Creature -> World -> World) -> Creature -> World -> World
|
||||
stateUpdate f =
|
||||
foldCr
|
||||
[ doDamage -- these three
|
||||
, checkDeath -- must be in
|
||||
, clearDamage -- this order 24/7/22
|
||||
, internalUpdate
|
||||
[ doDamage -- these two
|
||||
, checkDeath -- must be in this order 24/7/22
|
||||
, internalHammerUpdate
|
||||
, f
|
||||
, movementSideEff
|
||||
, upInv -- upInv must be called before invSideEff 22.05.23
|
||||
, updateInv -- upInv must be called before invSideEff 22.05.23
|
||||
, invSideEff
|
||||
, equipmentEffects
|
||||
, heldAimEffects
|
||||
@@ -76,6 +75,7 @@ heldAimEffects cr = fromMaybe id $ do
|
||||
checkDeath :: Creature -> World -> World
|
||||
checkDeath cr w
|
||||
| _crHP cr > 0 = w
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crState . csDamage .~ []
|
||||
| otherwise =
|
||||
w
|
||||
-- & creatures . at (_crID cr) .~ Nothing
|
||||
@@ -139,8 +139,8 @@ bloodPuddleAt p w =
|
||||
where
|
||||
(q, g) = randInCirc 10 & runState $ _randGen w
|
||||
|
||||
internalUpdate :: Creature -> World -> World
|
||||
internalUpdate cr =
|
||||
internalHammerUpdate :: Creature -> World -> World
|
||||
internalHammerUpdate cr =
|
||||
cWorld . lWorld . creatures . ix (_crID cr)
|
||||
%~ ( (crHammerPosition %~ moveHammerUp)
|
||||
. stepReloading
|
||||
@@ -156,11 +156,6 @@ dropByState cr w = foldr (dropItem cr) w $ case cr ^. crState . csDropsOnDeath o
|
||||
DropSpecific xs -> xs
|
||||
DropAmount n -> take n $ evalState (shuffle $ IM.keys $ _crInv cr) (_randGen w)
|
||||
|
||||
clearDamage :: Creature -> World -> World
|
||||
clearDamage cr w =
|
||||
w
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crState . csDamage .~ []
|
||||
|
||||
doDamage :: Creature -> World -> World
|
||||
doDamage cr w =
|
||||
w
|
||||
@@ -225,8 +220,8 @@ useEquipment cr i = useE (_eeUse (_equipEffect $ _itUse itm)) itm cr
|
||||
itm = _crInv cr IM.! i
|
||||
|
||||
-- a map updating all inventory items
|
||||
upInv :: Creature -> World -> World
|
||||
upInv cr = cWorld . lWorld . creatures . ix (_crID cr) . crInv %~ IM.mapWithKey (itemUpdate cr)
|
||||
updateInv :: Creature -> World -> World
|
||||
updateInv cr = cWorld . lWorld . creatures . ix (_crID cr) . crInv %~ IM.mapWithKey (itemUpdate cr)
|
||||
|
||||
-- a loop going over equipped items
|
||||
equipmentEffects :: Creature -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user