Add trajectory to grenades, various refactoring
This commit is contained in:
@@ -3,8 +3,8 @@ module Dodge.WallCreatureCollisions
|
||||
( colCrsWalls
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Data.DamageType
|
||||
import Dodge.Creature.State.Data
|
||||
--import Dodge.Data.DamageType
|
||||
--import Dodge.Creature.State.Data
|
||||
import Dodge.Zone
|
||||
import Dodge.Base
|
||||
import Dodge.Config.Data
|
||||
@@ -50,8 +50,10 @@ pushOutFromWalls rad wls p1 = case (getFirst . foldMap (First . pushOutFromWall
|
||||
pushOrCrush :: [(Point2,Point2)] -> Creature -> Creature
|
||||
pushOrCrush wls cr = case mapMaybe (pushOutFromWall (_crRad cr) cpos) wls of
|
||||
[] -> cr
|
||||
[p] -> cr & crPos .~ p
|
||||
_ -> cr & crState . crDamage %~ ( Blunt 50 cpos cpos cpos : )
|
||||
(p:_) -> cr & crPos .~ p
|
||||
-- (_:p:_) -> cr
|
||||
-- & crPos .~ p
|
||||
-- & crState . crDamage %~ ( Blunt 50 cpos cpos cpos : )
|
||||
where
|
||||
cpos = _crPos cr
|
||||
|
||||
|
||||
Reference in New Issue
Block a user