Cleanup
This commit is contained in:
@@ -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. -}
|
||||
|
||||
Reference in New Issue
Block a user