module Dodge.LockAndKey where
import Dodge.Data
import Dodge.Tree
import Dodge.LevelGen.Data
import Dodge.Room
import Dodge.RandomHelp
import Dodge.Creature
--import Dodge.Item.Equipment

import System.Random
import Control.Monad.State

-- (const $ return $ chainUses $ map singleUseAll [door,lasTunnel,door] , return FlatShield )
--    ,

lockRoomKeyItems :: RandomGen g => [ (Int -> State g (SubCompTree Room) , State g ItemIdentity ) ]
lockRoomKeyItems = 
    [(lasCenSensEdge, takeOne [Launcher] )
    ,(const slowDoorRoomRunPast, return MiniGun)
    ]

itemRooms :: RandomGen g => [(ItemIdentity, State g (SubCompTree Room))]
itemRooms = 
    [ (Launcher , corridorBoss launcherCrit ) 
    , (MiniGun  , join $ takeOne [roomMiniIntro, minigunFakeout] )
    ]

corridorBoss :: RandomGen g => Creature -> State g (SubCompTree Room)
corridorBoss cr = do
    endroom <- bossRoom cr
    return $ treeFromPost (replicate 5 $ PassDown corridor) 
                            (PassDown endroom)

