Cleanup launcher code
This commit is contained in:
@@ -16,8 +16,8 @@ homingDrawType ht = case ht of
|
||||
HomeUsingTargeting {} -> DrawRemoteShell
|
||||
|
||||
-- assumes the mscreen is in your inventory
|
||||
createShell :: ProjectileHoming -> AmmoParams -> Muzzle -> Item -> Creature -> World -> World
|
||||
createShell homing aparams muz it cr w = w
|
||||
createShell :: ProjectileHoming -> Payload -> Muzzle -> Creature -> World -> World
|
||||
createShell homing payload muz cr w = w
|
||||
& updatescreen
|
||||
& cWorld . lWorld . projectiles . at i
|
||||
?~ Shell
|
||||
@@ -30,20 +30,21 @@ createShell homing aparams muz it cr w = w
|
||||
, _prjAcc = rotateV dir (V2 3 0)
|
||||
, _prjDir = dir
|
||||
, _prjSpin = 0
|
||||
, _prjPayload = _ampPayload aparams
|
||||
, _prjPayload = payload
|
||||
, _prjTimer = 350
|
||||
, _prjUpdates =
|
||||
[ CollisionEffectPU (homing ^? phRemoteID) --Just screenid)
|
||||
, TimePU
|
||||
, StartSpinPU 335 (_crID cr) (_shellSpinAmount params)
|
||||
, StartSpinPU 335 (_crID cr) spinamount
|
||||
, RemoteDirectionPU (350 - thrustdelay) 0 homing
|
||||
, ThrustPU (350 - thrustdelay) 0
|
||||
, ReduceSpinPU (1 - fromIntegral (_shellSpinDrag params) * 2 / 200)
|
||||
, ReduceSpinPU (1 - spindrag * 2 / 200)
|
||||
]
|
||||
}
|
||||
where
|
||||
thrustdelay = _shellThrustDelay params
|
||||
params = _itParams it
|
||||
spindrag = 1
|
||||
spinamount = 2
|
||||
thrustdelay = 20
|
||||
updatescreen = fromMaybe id $ do
|
||||
screenid <- homing ^? phRemoteID
|
||||
return $ pointerToItemID screenid . itUse
|
||||
|
||||
Reference in New Issue
Block a user