Move towards allowing equipable targeting items
This commit is contained in:
@@ -64,8 +64,8 @@ upProjectile pu pj = case pu of
|
||||
PJSpin t cid spinamount
|
||||
| ain t -> trySpinByCID cid spinamount pj
|
||||
| otherwise -> id
|
||||
PJTrack st et itid
|
||||
| act st et -> pjTrack itid pj
|
||||
PJTrack st et crid
|
||||
| act st et -> pjTrack crid pj
|
||||
| otherwise -> id
|
||||
PJReduceSpin x -> reduceSpinBy x pj
|
||||
PJRemoteDirection st et cid itid
|
||||
@@ -136,10 +136,10 @@ trySpinByCID cid i pj w = w & cWorld . lWorld . projectiles . ix pjid . prjSpin
|
||||
spinFactor = 5 * (6 - fromIntegral i)
|
||||
|
||||
pjTrack :: Int -> Proj -> World -> World
|
||||
pjTrack itid pj w = rotateToTarget pj w
|
||||
pjTrack crid pj w = rotateToTarget pj w
|
||||
where
|
||||
rotateToTarget _ = fromMaybe id $ do
|
||||
tpos <- w ^? itPoint . itUse . heldTargeting . tgPos . _Just
|
||||
tpos <- w ^? cWorld . lWorld . creatures . ix crid . crTargeting . ctPos . _Just
|
||||
return $
|
||||
cWorld . lWorld . projectiles . ix (_prjID pj) . prjSpin
|
||||
.~ turnToAmount
|
||||
@@ -147,7 +147,7 @@ pjTrack itid pj w = rotateToTarget pj w
|
||||
(_prjPos pj)
|
||||
tpos
|
||||
(argV $ _prjAcc pj)
|
||||
itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid
|
||||
--itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid
|
||||
|
||||
reduceSpinBy :: Float -> Proj -> World -> World
|
||||
reduceSpinBy x pj = cWorld . lWorld . projectiles . ix (_prjID pj) . prjSpin *~ x
|
||||
|
||||
Reference in New Issue
Block a user