Fix shockwave damage radius for walls

This commit is contained in:
2025-10-28 08:09:44 +00:00
parent 20042fcf8d
commit d6c4d3d609
16 changed files with 137 additions and 314 deletions
+12 -11
View File
@@ -13,7 +13,7 @@ import Dodge.Item.Location
import Dodge.Movement.Turn
import Dodge.Payload
import Dodge.SoundLogic
import Dodge.WorldEvent.Cloud
--import Dodge.WorldEvent.Cloud
import Dodge.WorldEvent.Sound
import Geometry
import qualified IntMapHelp as IM
@@ -126,7 +126,8 @@ tryThrust pj = fromMaybe id $ do
return $ doThrust pj x . pjRemoteSetDirection y pj
doThrust :: Projectile -> Maybe RocketSmoke -> World -> World
doThrust pj smoke w =
--doThrust pj smoke w =
doThrust pj _ w =
w
& randGen .~ g
& cWorld . lWorld . projectiles . ix i . pjVel . _xy %~ (\v -> accel + frict *^ v)
@@ -136,15 +137,15 @@ doThrust pj smoke w =
(vel + rotateV (pi + sparkD) accel `v2z` 0)
3
10
& makeCloudAt
RocketSmoke
lifetime
(sp + r1 + 30 *^ signorm (sp - ep))
-- & makeCloudAt
-- RocketSmoke
-- lifetime
-- (sp + r1 + 30 *^ signorm (sp - ep))
where
lifetime = fst . randomR lt $ _randGen w
lt
| smoke == Just ReducedRocketSmoke = (50, 200)
| otherwise = (300, 500)
-- lifetime = fst . randomR lt $ _randGen w
-- lt
-- | smoke == Just ReducedRocketSmoke = (50, 200)
-- | otherwise = (300, 500)
accel = rotateV (pj ^. pjDir) (V2 3 0)
i = _pjID pj
sp = pj ^. pjPos
@@ -152,7 +153,7 @@ doThrust pj smoke w =
ep = sp + vel
(frict, g) = randomR (0.6, 0.9) $ _randGen w
(sparkD, _) = randomR (-0.2, 0.2) $ _randGen w
r1 = addZ 0 $ randInCirc 10 & evalState $ _randGen w
-- r1 = addZ 0 $ randInCirc 10 & evalState $ _randGen w
doBarrelSpin :: Int -> Float -> Projectile -> World -> World
doBarrelSpin cid i pj w =