Remove PickOnePlacements

This commit is contained in:
2025-09-02 12:02:44 +01:00
parent f279494a02
commit 7b28ec15d1
7 changed files with 8 additions and 23 deletions
-6
View File
@@ -11,7 +11,6 @@ import Control.Monad.State
import Data.Bifunctor
import Data.Foldable
import qualified Data.IntSet as IS
import Data.Maybe
import Dodge.Base.NewID
import Dodge.Data.GenWorld
import Dodge.Path
@@ -34,15 +33,10 @@ placeSpot (w, rm) plmnt = case plmnt of
Placement{_plSpot = PSPos extract eff fallback} ->
placeSpotUsingLink w rm plmnt extract eff fallback
Placement{} -> placePlainPSSpot w rm plmnt shift
PlacementUsingPos p subpl -> placeSpot (w, rm) (subpl (shiftPoint3By shift p))
RandomPlacement rplmnt -> placeRandomPlacement rplmnt w rm
PickOnePlacement i pl -> ((placePickOne i pl rm w, rm), [])
where
shift = _rmShift rm
placePickOne :: Int -> Placement -> Room -> GenWorld -> GenWorld
placePickOne i pl rm = genPlacements %~ IM.insertWith (++) i [(pl, fromJust (_rmMID rm))]
placeRandomPlacement ::
State StdGen Placement ->
GenWorld ->
+1 -1
View File
@@ -5,7 +5,7 @@ import Dodge.Item
import RandomHelp
{- Probabilites of the type of the first floor weapon. -}
randFirstWeapon :: State StdGen Item
randFirstWeapon :: RandomGen g => State g Item
randFirstWeapon =
takeOne $
replicate 10 pistol
-5
View File
@@ -25,9 +25,4 @@ shiftPlacement shift plmnt = case plmnt of
Placement{} ->
plmnt & plSpot %~ shiftPSBy shift
& plIDCont %~ fmap (fmap (fmap $ shiftPlacement shift))
PlacementUsingPos p f ->
PlacementUsingPos
(shiftPoint3By shift p)
(fmap (shiftPlacement shift) f)
RandomPlacement rpl -> RandomPlacement $ fmap (shiftPlacement shift) rpl
PickOnePlacement i pl -> PickOnePlacement i (shiftPlacement shift pl)