Flatten values in creature manipulation data types

This commit is contained in:
2024-09-24 21:50:21 +01:00
parent fe00af0e73
commit 25cec10313
24 changed files with 69 additions and 86 deletions
+3 -2
View File
@@ -226,7 +226,7 @@ shootTractorBeam _ cr w = w & cWorld . lWorld . tractorBeams .:~ tractorBeamAt'
dir = _crDir cr
outpos = fst $ collidePointWallsFilter (const True) cpos xpos w
power = _attractionPower . _itParams $ _crInv cr IM.! itRef
itRef = cr ^?! crManipulation . manObject . inInventory . imRootItem -- unsafe!! TODO change
itRef = cr ^?! crManipulation . manObject . imRootItem -- unsafe!! TODO change
tractorBeamAt' :: Point2 -> Point2 -> Float -> Point2 -> TractorBeam
tractorBeamAt' pos outpos dir power =
@@ -471,7 +471,8 @@ shootTeslaArc itm cr mz w =
w'
& cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itRef . itParams .~ ip
where
itRef = cr ^?! crManipulation . manObject . inInventory . imRootItem -- unsafe!! TODO change
-- use items item location instead
itRef = cr ^?! crManipulation . manObject . imRootItem -- unsafe!! TODO change
(w', ip) = makeTeslaArc (_itParams itm) pos dir w
pos = _crPos cr + rotateV (_crDir cr) (_mzPos mz + aimingWeaponZeroPos cr itm)
dir = _crDir cr + _mzRot mz