Partial (not working) refactor of damages, energyballs

This commit is contained in:
2025-06-07 12:22:06 +01:00
parent 2b39152060
commit e914555728
10 changed files with 265 additions and 290 deletions
+4 -9
View File
@@ -24,14 +24,6 @@ updateBullet w bu
-- have to be slightly carefull not to accelerate bullets using magnets
| otherwise = second (Just . updateBulVel) . hitEffFromBul w $ applyMagnetsToBul bu w
buDamages :: Bullet -> [Damage]
buDamages bu = case _buPayload bu of
BulBall {} -> []
BulPlain x -> [Damage PIERCING x 0 0 0]
BulFlak -> []
BulFrag -> []
BulGas -> []
-- do we want this to drain energy from the deflection source?
applyMagnetsToBul :: Bullet -> World -> Bullet
applyMagnetsToBul bu = foldl' doMagnetBuBu bu . _oldMagnets . _lWorld . _cWorld
@@ -172,8 +164,11 @@ hitEffFromBul w bu = case _buEffect bu of
hitstream = thingsHit sp (sp + _buVel bu) w
setFromToDams :: Bullet -> Point2 -> [Damage]
setFromToDams bu p = map f (buDamages bu)
setFromToDams bu p = case _bu of
BullPlain x -> [Piercing x p v]
_ -> []
where
v = _buVel bu
f = (dmFrom .~ _buPos bu) . (dmAt .~ p) . (dmTo .~ _buPos bu +.+ _buVel bu)
damageThingHit :: Bullet -> (Point2, Either Creature Wall) -> World -> World