This commit is contained in:
2022-06-06 16:22:47 +01:00
parent 27a5b9b774
commit b92305798f
11 changed files with 116 additions and 77 deletions
+5 -3
View File
@@ -5,6 +5,7 @@ import Dodge.Data
import Dodge.Base.Coordinate
import Dodge.Creature.Impulse.Movement
import Dodge.Update.UsingInput
import Dodge.InputFocus
--import Dodge.Config.KeyConfig
import Geometry
@@ -15,12 +16,13 @@ import qualified Data.Set as S
import Data.Maybe
{- | The AI equivalent for your control. -}
yourControl :: Creature -> World -> World
yourControl cr w = case w ^? hud . hudElement . subInventory . onInputLine of
Just True -> w
_ -> w
yourControl cr w
| hasTerminalFocus w = w
| otherwise = 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. -}