Hack together correct positioning of grenades from attached items
This commit is contained in:
@@ -21,6 +21,7 @@ data PJStabiliser
|
||||
| StabSpinIncrease
|
||||
|
||||
-- assumes the mscreen is in your inventory
|
||||
-- TODO take into account creature aimstance positioning
|
||||
createShell ::
|
||||
(Point3, Q.Quaternion Float) ->
|
||||
Maybe (NewInt ItmInt) ->
|
||||
@@ -41,9 +42,9 @@ createShell (p,q) mdetonator mscreen stab pjtype payload muz cr w =
|
||||
{ _pjPos = pos
|
||||
, _pjZ = 20
|
||||
, _pjZVel = 5
|
||||
, _pjVel = rotateV dir (V2 speed 0) + crvelcomponent
|
||||
, _pjVel = rotateV dir' (V2 speed 0) + crvelcomponent
|
||||
, _pjID = i
|
||||
, _pjDir = dir
|
||||
, _pjDir = dir'
|
||||
, _pjSpin = 0
|
||||
, _pjSpinFactor = spinfactor
|
||||
, _pjPayload = payload
|
||||
@@ -93,4 +94,5 @@ createShell (p,q) mdetonator mscreen stab pjtype payload muz cr w =
|
||||
.:~ i
|
||||
i = IM.newKey $ w ^. cWorld . lWorld . projectiles
|
||||
dir = _crDir cr + _mzRot muz
|
||||
pos = _crPos cr + xyV3 p + rotateV dir (_mzPos muz)
|
||||
pos = _crPos cr + rotateV dir (xyV3 p + rotateV (argV (Q.qToV2 q)) (_mzPos muz))
|
||||
dir' = dir + argV (Q.qToV2 q)
|
||||
|
||||
Reference in New Issue
Block a user