Partial fix to jetPack

This commit is contained in:
2021-04-24 19:35:49 +02:00
parent 9af7dbda56
commit e23e076184
6 changed files with 18 additions and 262 deletions
+5 -4
View File
@@ -4,8 +4,8 @@ module Dodge.Creature.YourControl
import Dodge.Data
import Dodge.Base
import Dodge.CreatureAction
import Dodge.Creature.State
import Dodge.Update.UsingInput
import Dodge.CreatureState
import Dodge.Config.KeyConfig
import Geometry
@@ -23,9 +23,10 @@ yourControl :: World -> (World -> World,StdGen) -> Creature -> ((World -> World,
yourControl w (f,g) cr = ( (updateUsingInput . f, g)
, Just . crAutoReload . mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed strafeSpeed 0 cr
)
where strafeSpeed = _varMovementSpeedModifier w * equipFactor * (fromMaybe 1 $ yourItem w ^? itAimingSpeed)
speed = _varMovementSpeedModifier w * equipFactor
equipFactor = product $ map equipSpeed $ IM.elems $ _crInv $ _creatures w IM.! 0
where
strafeSpeed = _varMovementSpeedModifier w * equipFactor * (fromMaybe 1 $ yourItem w ^? itAimingSpeed)
speed = _varMovementSpeedModifier w * equipFactor
equipFactor = product $ map equipSpeed $ IM.elems $ _crInv $ _creatures w IM.! 0
wasdWithAiming :: World -> Float -> Float -> Int -> Creature -> Creature
wasdWithAiming w speed aimSpeed i cr