Rethink damage data type, work on damage sensors
This commit is contained in:
@@ -118,12 +118,15 @@ shieldWall crid = defaultWall
|
||||
,_wlStructure = CreaturePart crid shieldWallDamage
|
||||
}
|
||||
|
||||
shieldWallDamage :: DamageType -> Wall -> Int -> World -> World
|
||||
shieldWallDamage dt wl crid w = case dt of
|
||||
Lasering {_dmFrom=df,_dmAt=da} ->
|
||||
shieldWallDamage :: Damage -> Wall -> Int -> World -> World
|
||||
shieldWallDamage dm wl crid w = case _dmType dm of
|
||||
Lasering ->
|
||||
w & instantParticles .:~ lasRayAt 5 (da +.+ normalizeV (df -.- da)) (reflDirWall df da wl)
|
||||
d | isMovementDam d -> w & creatures . ix crid . crState . crDamage .:~ d
|
||||
d | isMovementDam dm -> w & creatures . ix crid . crState . crDamage .:~ dm
|
||||
_ -> w
|
||||
where
|
||||
df = _dmFrom dm
|
||||
da = _dmAt dm
|
||||
|
||||
createShieldWall :: Creature -> Int -> World -> World
|
||||
createShieldWall cr invid w = case _itEffectID $ _itEffect it of
|
||||
|
||||
Reference in New Issue
Block a user