Partially implement grenades down chasms
This commit is contained in:
@@ -25,12 +25,12 @@ updateCreature cr = chasmTest cr . case _crType cr of
|
||||
|
||||
chasmTest :: Creature -> World -> World
|
||||
chasmTest cr w
|
||||
| _crZVel cr < 0 = w & cWorld . lWorld . creatures . ix (_crID cr) . crZVel -~ 1
|
||||
| _crZVel cr < 0 = w & cWorld . lWorld . creatures . ix (_crID cr) . crZVel -~ 0.5
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crZ +~ _crZVel cr
|
||||
| Just (x,y) <- List.find g (foldMap loopPairs $ w ^. cWorld . chasms) = w
|
||||
& soundContinue (CrChasm (_crID cr)) (_crPos cr) debrisS (Just 100)
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crPos -~ normalizeV (vNormal (x-y))
|
||||
| any f (w ^. cWorld . chasms) = w & cWorld . lWorld . creatures . ix (_crID cr) . crZVel -~ 1
|
||||
| any f (w ^. cWorld . chasms) = w & cWorld . lWorld . creatures . ix (_crID cr) . crZVel -~ 0.5
|
||||
| otherwise = w
|
||||
where
|
||||
g = uncurry $ circOnSeg (_crPos cr) (crRad $ cr ^. crType)
|
||||
|
||||
Reference in New Issue
Block a user