Add no weapon start
This commit is contained in:
@@ -67,31 +67,6 @@ dropByState cr w = foldr (copyItemToFloor cr) w is
|
||||
DropSpecific xs -> xs
|
||||
DropAmount n -> take n $ evalState (shuffle $ IM.keys $ _crInv cr) (_randGen w)
|
||||
|
||||
{- Copy an inventory item to the floor. -}
|
||||
copyItemToFloor
|
||||
:: Creature
|
||||
-> Int -- ^ Inventory position
|
||||
-> World
|
||||
-> World
|
||||
copyItemToFloor cr i w = case _crInv cr IM.! i of
|
||||
NoItem -> w
|
||||
it -> over floorItems (IM.insert flid theflit)
|
||||
. updateLocation
|
||||
$ set randGen g w
|
||||
where
|
||||
(rot, g) = randomR (-pi,pi) $ _randGen w
|
||||
offset = _crRad cr *.* unitVectorAtAngle rot
|
||||
updateLocation w = case it ^? itID of
|
||||
Just (Just i) -> w & itemPositions . ix i .~ OnFloor flid
|
||||
_ -> w
|
||||
flid = newKey $ _floorItems w
|
||||
theflit = FlIt
|
||||
{_flIt = it
|
||||
,_flItPos = offset +.+ _crPos cr
|
||||
,_flItRot = rot
|
||||
,_flItID = flid
|
||||
}
|
||||
|
||||
|
||||
setOldPos :: Creature -> Creature
|
||||
setOldPos cr = set crOldPos (_crPos cr) cr
|
||||
|
||||
Reference in New Issue
Block a user