Start splitting off creature control more sensibly
This commit is contained in:
@@ -19,13 +19,20 @@ import qualified SDL
|
||||
-- | The AI equivalent for your control.
|
||||
yourControl :: Creature -> World -> World
|
||||
yourControl cr w
|
||||
| inTermFocus w = w & updateUsingInput -- do we really want to do this?
|
||||
| inputFocus w = w
|
||||
| intopinv = w & cWorld . lWorld . creatures . ix (_crID cr)
|
||||
%~ wasdWithAiming w (_mvSpeed $ _crMvType cr)
|
||||
| otherwise =
|
||||
w
|
||||
& cWorld . lWorld . creatures . ix (_crID cr)
|
||||
%~ (wasdWithAiming w (_mvSpeed $ _crMvType cr) . mouseActionsCr (_mouseButtons (_input w)))
|
||||
& updateUsingInput
|
||||
where
|
||||
intopinv = fromMaybe False $ do
|
||||
subinv <- w ^? hud . hudElement . subInventory
|
||||
Just $ case subinv of
|
||||
NoSubInventory -> True
|
||||
_ -> False
|
||||
|
||||
--dimCreatureLight :: Creature -> World -> World
|
||||
--dimCreatureLight cr = cWorld . lWorld . tempLightSources .:~ tlsTimeRadColPos 1 300 0.1 (addZ 100 $ _crPos cr)
|
||||
|
||||
Reference in New Issue
Block a user