Fix bug in room position generation
This commit is contained in:
@@ -477,7 +477,6 @@ data Equipment = Equipment
|
|||||||
_itUseAimStance :: Item -> AimStance
|
_itUseAimStance :: Item -> AimStance
|
||||||
_itUseAimStance = _aimStance . _useAim . _itUse
|
_itUseAimStance = _aimStance . _useAim . _itUse
|
||||||
|
|
||||||
|
|
||||||
data ItemConsumption
|
data ItemConsumption
|
||||||
= LoadableAmmo
|
= LoadableAmmo
|
||||||
{ _laType :: AmmoType
|
{ _laType :: AmmoType
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ module Dodge.PlacementSpot
|
|||||||
, rpIsOnPath
|
, rpIsOnPath
|
||||||
, rpIsOffPath
|
, rpIsOffPath
|
||||||
, rpOffPathEdge
|
, rpOffPathEdge
|
||||||
|
, rpOnPathEdge
|
||||||
, useUnusedLnk
|
, useUnusedLnk
|
||||||
, psRandRanges
|
, psRandRanges
|
||||||
, useRoomPosCond
|
, useRoomPosCond
|
||||||
@@ -86,6 +87,12 @@ rpOffPathEdge pe = any f . _rpType
|
|||||||
where
|
where
|
||||||
f rt = maybe False (any (== pe)) (rt ^? offPathEdges)
|
f rt = maybe False (any (== pe)) (rt ^? offPathEdges)
|
||||||
|
|
||||||
|
-- test whether a roomPos is on the path with a given from edge value
|
||||||
|
rpOnPathEdge :: PathEdge -> RoomPos -> Bool
|
||||||
|
rpOnPathEdge pe = any f . _rpType
|
||||||
|
where
|
||||||
|
f rt = maybe False (any (== pe)) (rt ^? onPathEdges)
|
||||||
|
|
||||||
resetPLUse :: PlacementSpot -> PlacementSpot
|
resetPLUse :: PlacementSpot -> PlacementSpot
|
||||||
resetPLUse (PSPos f g fallback) = PSPos f' g fallback
|
resetPLUse (PSPos f g fallback) = PSPos f' g fallback
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ roomRect x y xn yn = defaultRoom
|
|||||||
,PathFromEdge East (xn-a)
|
,PathFromEdge East (xn-a)
|
||||||
,PathFromEdge West a
|
,PathFromEdge West a
|
||||||
]
|
]
|
||||||
posps' = map (over _1 (+.+ V2 20 20)) $ gridPoints'' xd (xn+1) yd (xn+1)
|
posps' = map (over _1 (+.+ V2 20 20)) $ gridPoints'' xd (xn+1) yd (yn+1)
|
||||||
interposps' = map (over _1 (+.+ V2 (20 + xd/2) (20 + yd/2))) $ gridPoints'' xd xn yd yn
|
interposps' = map (over _1 (+.+ V2 (20 + xd/2) (20 + yd/2))) $ gridPoints'' xd xn yd yn
|
||||||
makeoffpos (p,a) = RoomPos p 0 (S.singleton $ RoomPosOffPath $ makerpedges' a) NotLink 0
|
makeoffpos (p,a) = RoomPos p 0 (S.singleton $ RoomPosOffPath $ makerpedges' a) NotLink 0
|
||||||
makerpedges' (a,b) = S.fromList
|
makerpedges' (a,b) = S.fromList
|
||||||
|
|||||||
Reference in New Issue
Block a user