Tweak rockets, smoke

This commit is contained in:
2024-12-28 10:08:14 +00:00
parent 1507b8d3ed
commit 2abb70334f
6 changed files with 41 additions and 19 deletions
+4 -3
View File
@@ -16,10 +16,11 @@ import LensHelp
createShell :: RocketHoming
-> Maybe (NewInt ItmInt)
-> Maybe (NewInt ItmInt)
-> Bool
-- -> Bool
-> ProjectileType
-> Payload -> Muzzle -> Creature -> World -> World
createShell homing mdetonator mscreen smokestatus pjtype payload muz cr w = w
--createShell homing mdetonator mscreen smokestatus pjtype payload muz cr w = w
createShell homing mdetonator mscreen pjtype payload muz cr w = w
& updatescreen
& updatedetonator
& cWorld . lWorld . projectiles . at i
@@ -52,7 +53,7 @@ createShell homing mdetonator mscreen smokestatus pjtype payload muz cr w = w
Rocket{} -> 350
thrustorgrav = case pjtype of
Grenade -> [ApplyGravityPU]
Rocket{} -> [ThrustPU (lifespan - thrustdelay) 0 smokestatus]
Rocket{} -> [ThrustPU (lifespan - thrustdelay) 0]
spindrag = 1
spinamount = 2
thrustdelay = 20
+4 -4
View File
@@ -33,8 +33,8 @@ upProjectile pu pj = case pu of
mscreenid
pj
TimePU -> decTimMvVel pj
ThrustPU st et smoke
| act st et -> doThrust pj smoke
ThrustPU st et
| act st et -> doThrust pj (pj ^? prjType . rkSmoke . _Just)
| otherwise -> id
StartSpinPU t cid spinamount
| time == t -> trySpinByCID cid spinamount pj
@@ -112,7 +112,7 @@ destroyProjectile mitid pjid w =
guard $ itm == pjid
return $ pointerToItemLocation loc . itUse . uaParams . apLinkedProjectile .~ Nothing
doThrust :: Projectile -> Bool -> World -> World
doThrust :: Projectile -> Maybe RocketSmoke -> World -> World
doThrust pj smoke w =
w
& randGen .~ g
@@ -127,7 +127,7 @@ doThrust pj smoke w =
where
lifetime = fst . randomR lt $ _randGen w
lt
| smoke = (50, 200)
| smoke == Just ReducedRocketSmoke = (50, 200)
| otherwise = (300, 500)
trailfadetime = fst . randomR (100, 300) $ _randGen w
accel = rotateV (pj ^. prjDir) (V2 3 0)