Refactor shells

This commit is contained in:
2024-12-27 23:04:59 +00:00
parent 9168acf12e
commit 233fe5995c
8 changed files with 44 additions and 55 deletions
+4 -11
View File
@@ -12,12 +12,6 @@ import Geometry
import qualified IntMapHelp as IM
import LensHelp
homingDrawType :: ProjectileHoming -> ProjectileDraw
homingDrawType ht = case ht of
NoHoming -> DrawShell
HomeUsingRemoteScreen {} -> DrawRemoteShell
HomeUsingTargeting {} -> DrawRemoteShell
-- assumes the mscreen is in your inventory
createShell :: ProjectileHoming
-> Maybe (NewInt ItmInt)
@@ -34,7 +28,6 @@ createShell homing mdetonator mscreen smokestatus pjtype payload muz cr w = w
, _prjZ = 20
, _prjZVel = 5
, _prjVel = rotateV dir (V2 speed 0) + cr ^. crPos - cr ^. crOldPos
, _prjDraw = homingDrawType homing
, _prjID = i
-- , _prjAcc = rotateV dir (V2 3 0)
, _prjDir = dir
@@ -45,7 +38,7 @@ createShell homing mdetonator mscreen smokestatus pjtype payload muz cr w = w
[ CollisionEffectPU (homing ^? phRemoteID) mdetonator mscreen
, TimePU
, StartSpinPU (lifespan - 15) (_crID cr) spinamount
, RemoteDirectionPU (lifespan - thrustdelay) 0 homing
, RemoteDirectionPU (lifespan - thrustdelay) 0
, ReduceSpinPU (1 - spindrag * 2 / 200)
] <> thrustorgrav
, _prjType = pjtype
@@ -53,13 +46,13 @@ createShell homing mdetonator mscreen smokestatus pjtype payload muz cr w = w
where
speed = case pjtype of
Grenade -> 4
Rocket -> 1
Rocket{} -> 1
lifespan = case pjtype of
Grenade -> 150
Rocket -> 350
Rocket{} -> 350
thrustorgrav = case pjtype of
Grenade -> [ApplyGravityPU]
Rocket -> [ThrustPU (lifespan - thrustdelay) 0 smokestatus]
Rocket{} -> [ThrustPU (lifespan - thrustdelay) 0 smokestatus]
spindrag = 1
spinamount = 2
thrustdelay = 20