Move toward shell storing update as list

This commit is contained in:
2022-07-20 11:49:10 +01:00
parent 6eb09a991e
commit 577cf0c44e
8 changed files with 162 additions and 34 deletions
+3 -7
View File
@@ -6,6 +6,7 @@ module Dodge.Item.Weapon.Launcher
) where
import Dodge.Data
import Dodge.Payload
import Dodge.Base.Collide
import Dodge.Reloading.Action
import Dodge.EnergyBall
import Dodge.Default.Weapon
@@ -16,6 +17,7 @@ import Dodge.Item.Weapon.Remote
import Dodge.Item.Weapon.TriggerType
import Dodge.Movement.Turn
import Dodge.Base
import Dodge.Base.Collide
import Dodge.Zone
import Dodge.SoundLogic
import Dodge.WorldEvent.Cloud
@@ -84,7 +86,6 @@ launcherX i = launcher
, useTimeCheck
, withSoundStart tap4S
, useAmmoAmount i
]
usePjCreation :: Item -> Creature -> World -> World
usePjCreation it = _amPjCreation (_laAmmoType (_itConsumption it)) it
@@ -291,12 +292,6 @@ moveRemoteShell cid itid pj w
smokeGen = shellTrailCloud $ addZ 20 $ oldPos +.+ r1 +.+ 30 *.* normalizeV (oldPos -.- newPos)
doExplosion = explodeRemoteRocket itid i $ stopSoundFrom (ShellSound i) w
anythingHitCirc :: Float -> Point2 -> Point2 -> World -> Bool
anythingHitCirc rad sp ep w = hitCr || isJust (sequence hitWl)
where
hitCr = runIdentity $ S.any_ (const True) $ overlap1SegCrs sp ep $ crsNearSeg sp ep w
hitWl = collideCircWallsStream sp ep rad $ wlsNearPoint ep w
-- this should probably be wallsOnLine or something
explodeRemoteRocket
:: Int -- ^ Item id
-> Int -- ^ Projectile id
@@ -341,6 +336,7 @@ makeShell it cr theupdate w = w & projectiles %~ IM.insert i Shell
, _prjSpin = 0
, _prjPayload = _amPayload $ _laAmmoType am
, _prjTimer = 50
, _prjUpdates = []
}
where
i = IM.newKey $ _props w