This commit is contained in:
2024-12-28 10:31:58 +00:00
parent 39a76f758a
commit e028c54948
10 changed files with 91 additions and 102 deletions
+13 -17
View File
@@ -13,36 +13,32 @@ import qualified IntMapHelp as IM
import LensHelp
-- assumes the mscreen is in your inventory
createShell :: RocketHoming
createShell ::Maybe (NewInt ItmInt)
-> Maybe (NewInt ItmInt)
-> Maybe (NewInt ItmInt)
-- -> Bool
-> ProjectileType
-> Payload -> Muzzle -> Creature -> World -> World
--createShell homing mdetonator mscreen smokestatus pjtype payload muz cr w = w
createShell homing mdetonator mscreen pjtype payload muz cr w = w
createShell mdetonator mscreen pjtype payload muz cr w = w
& updatescreen
& updatedetonator
& cWorld . lWorld . projectiles . at i
?~ Shell
{ _prjPos = pos
, _prjZ = 20
, _prjZVel = 5
, _prjVel = rotateV dir (V2 speed 0) + cr ^. crPos - cr ^. crOldPos
, _prjID = i
-- , _prjAcc = rotateV dir (V2 3 0)
, _prjDir = dir
, _prjSpin = 0
, _prjPayload = payload
, _prjTimer = lifespan
, _prjUpdates =
{ _pjPos = pos
, _pjZ = 20
, _pjZVel = 5
, _pjVel = rotateV dir (V2 speed 0) + cr ^. crPos - cr ^. crOldPos
, _pjID = i
, _pjDir = dir
, _pjSpin = 0
, _pjPayload = payload
, _pjTimer = lifespan
, _pjUpdates =
[ CollisionEffectPU mdetonator mscreen
, TimePU
, StartSpinPU (lifespan - 15) (_crID cr) spinamount
, RemoteDirectionPU (lifespan - thrustdelay) 0
, ReduceSpinPU (1 - spindrag * 2 / 200)
] <> thrustorgrav
, _prjType = pjtype
, _pjType = pjtype
}
where
speed = case pjtype of