Merge branch 'master' of ssh://git.xkjq.uk:30001/justin/dodge

This commit is contained in:
Ross
2021-03-21 17:53:01 +00:00
52 changed files with 350 additions and 394 deletions
+1 -17
View File
@@ -39,22 +39,6 @@ import Foreign.ForeignPtr
import Control.Concurrent
---}
--killCr :: World -> (World -> World) -> Creature -> ((World -> World,StdGen), Maybe Creature)
--killCr w f cr = ((g . f, _randGen w),Nothing)
-- where crBeforeDeath = colCrWall w $ cr
-- addCorpse = insertNewKey $ uncurry translate (_crPos crBeforeDeath)
-- $ rotate (radToDeg (_crDir cr))
-- (_crCorpse cr)
-- maybeIt = evalState (maybeTakeOne $ IM.elems (_crInv cr)) (_randGen w)
-- insertIt = case maybeIt of
-- Just it -> createItemAt (offset +.+ _crPos crBeforeDeath)
-- (FlIt {_flIt=it,_flItPos=(0,0),_flItRot=rot,_flItID=0})
-- Nothing -> id
-- offset = _crRad cr *.* unitVectorAtAngle rot
-- (rot,_) = randomR (-pi,pi) $ _randGen w
-- g = stopSoundFrom (CrWeaponSound (_crID cr)) . over decorations addCorpse . insertIt
factionIs :: Faction -> Creature -> Bool
factionIs f c = (_faction $ _crState $ c) == f
@@ -1888,7 +1872,7 @@ spCrRadFac = 8^2
yourControl :: World -> (World -> World,StdGen) -> Creature -> ((World -> World,StdGen), Maybe Creature)
yourControl w (f,g) cr = ( (mouseActionsWorld (_mouseButtons w) . f, g)
, Just $ mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed strafeSpeed 0 cr
, Just . crAutoReload . mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed strafeSpeed 0 cr
)
where strafeSpeed = 8 * equipFactor * (fromMaybe 1 $ yourItem w ^? itAimingSpeed)
speed = 3 * equipFactor