Allow for ingame terminal input
This commit is contained in:
@@ -14,10 +14,12 @@ import qualified Data.Set as S
|
||||
import Data.Maybe
|
||||
{- | The AI equivalent for your control. -}
|
||||
yourControl :: Creature -> World -> World
|
||||
yourControl cr w = w
|
||||
& creatures . ix (_crID cr) %~
|
||||
(wasdWithAiming w (_mvSpeed $ _crMvType cr) . mouseActionsCr (_mouseButtons w))
|
||||
& updateUsingInput
|
||||
yourControl cr w = case w ^? hud . hudElement . subInventory . termParams . termInput . _Just of
|
||||
Just _ -> w
|
||||
_ -> w
|
||||
& creatures . ix (_crID cr) %~
|
||||
(wasdWithAiming w (_mvSpeed $ _crMvType cr) . mouseActionsCr (_mouseButtons w))
|
||||
& updateUsingInput
|
||||
-- note the order of operation, setting the posture first--this prevents the twist fire bug
|
||||
|
||||
{- | Turn key presses into creature movement. -}
|
||||
|
||||
Reference in New Issue
Block a user