Test making walking movement slightly more floaty
This commit is contained in:
@@ -99,7 +99,7 @@ startCr =
|
|||||||
& crInv .~ mempty
|
& crInv .~ mempty
|
||||||
& crFaction .~ PlayerFaction
|
& crFaction .~ PlayerFaction
|
||||||
-- & crMvType .~ MvWalking yourDefaultSpeed
|
-- & crMvType .~ MvWalking yourDefaultSpeed
|
||||||
& crType .~ Avatar (PulseStatus 55 0) Flesh 50 50 50 3 AvPosture LeftForward 0
|
& crType .~ Avatar (PulseStatus 55 0) Flesh 50 50 50 AvPosture LeftForward 0
|
||||||
|
|
||||||
-- | Items you start with.
|
-- | Items you start with.
|
||||||
startInvList :: [Item]
|
startInvList :: [Item]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import Control.Lens
|
|||||||
|
|
||||||
crMvType :: Creature -> CrMvType
|
crMvType :: Creature -> CrMvType
|
||||||
crMvType cr = case _crType cr of
|
crMvType cr = case _crType cr of
|
||||||
Avatar {_avMoveSpeed = s} -> MvWalking s
|
Avatar {} -> MvWalking 1.5
|
||||||
ChaseCrit {} -> defaultChaseMvType
|
ChaseCrit {} -> defaultChaseMvType
|
||||||
HoverCrit {} -> defaultChaseMvType & mvSpeed .~ 0.1
|
HoverCrit {} -> defaultChaseMvType & mvSpeed .~ 0.1
|
||||||
SwarmCrit -> defaultChaseMvType
|
SwarmCrit -> defaultChaseMvType
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ updateCarriage' cid cr w = \case
|
|||||||
(chooseFootSound ff)
|
(chooseFootSound ff)
|
||||||
Nothing
|
Nothing
|
||||||
& over (cWorld . lWorld . creatures . ix cid . crType) resetStride
|
& over (cWorld . lWorld . creatures . ix cid . crType) resetStride
|
||||||
_ -> w
|
& tocr . crPos +~ 0.1 *^ (cr ^. crOldPos - oop)
|
||||||
|
_ -> w & tocr . crPos +~ 0.5 *^ (cr ^. crOldPos - oop)
|
||||||
Floating -> w
|
Floating -> w
|
||||||
Flying {_zSpeed = dz, _flyInertia = x} ->
|
Flying {_zSpeed = dz, _flyInertia = x} ->
|
||||||
w & cWorld . lWorld . creatures . ix cid . crPos . _xy +~ x *^ f (cr ^. crOldPos . _xy - oop ^. _xy)
|
w & cWorld . lWorld . creatures . ix cid . crPos . _xy +~ x *^ f (cr ^. crOldPos . _xy - oop ^. _xy)
|
||||||
@@ -38,11 +39,13 @@ updateCarriage' cid cr w = \case
|
|||||||
let v = 0.9 *^ (cr ^. crOldPos - oop & _z -~ 0.5)
|
let v = 0.9 *^ (cr ^. crOldPos - oop & _z -~ 0.5)
|
||||||
ep = cr ^. crPos + v
|
ep = cr ^. crPos + v
|
||||||
in if ep ^. _z < 0 && not (any (pointInPoly (ep ^. _xy)) (w ^. cWorld . chasms))
|
in if ep ^. _z < 0 && not (any (pointInPoly (ep ^. _xy)) (w ^. cWorld . chasms))
|
||||||
then w & cWorld . lWorld . creatures . ix cid . crPos .~ (ep & _z .~ 0)
|
then w & tocr . crPos .~ (ep & _z .~ 0)
|
||||||
& cWorld . lWorld . creatures . ix cid . crStance . carriage .~ OnGround
|
& cWorld . lWorld . creatures . ix cid . crStance . carriage .~ OnGround
|
||||||
else w & cWorld . lWorld . creatures . ix cid . crPos .~ ep
|
else w & cWorld . lWorld . creatures . ix cid . crPos .~ ep
|
||||||
OnGround {} -> w
|
OnGround {} -> w
|
||||||
|
& tocr . crPos +~ 0.8 *^ (cr ^. crOldPos - oop)
|
||||||
where
|
where
|
||||||
|
tocr = cWorld . lWorld . creatures . ix cid
|
||||||
oop = cr ^. crOldOldPos
|
oop = cr ^. crOldOldPos
|
||||||
f v | norm v > 10 = 10 *^ signorm v
|
f v | norm v > 10 = 10 *^ signorm v
|
||||||
| otherwise = v
|
| otherwise = v
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ updateLivingCreature cr =
|
|||||||
Avatar{} ->
|
Avatar{} ->
|
||||||
(cWorld . lWorld . creatures . ix 0 . crType . avatarPulse %~ updatePulse)
|
(cWorld . lWorld . creatures . ix 0 . crType . avatarPulse %~ updatePulse)
|
||||||
. crUpdate cid
|
. crUpdate cid
|
||||||
. yourControl cr
|
. yourControl
|
||||||
LampCrit{} -> updateLampoid cr
|
LampCrit{} -> updateLampoid cr
|
||||||
BarrelCrit bt -> updateBarreloid bt cr
|
BarrelCrit bt -> updateBarreloid bt cr
|
||||||
ChaseCrit{} -> \w ->
|
ChaseCrit{} -> \w ->
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
module Dodge.Creature.Vocalization (
|
module Dodge.Creature.Vocalization (
|
||||||
crWarningSounds,
|
crWarningSounds,
|
||||||
crDeathSounds,
|
crDeathSounds,
|
||||||
crVocalizationSound,
|
|
||||||
resetCrVocCoolDown,
|
resetCrVocCoolDown,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
@@ -14,16 +13,6 @@ import Dodge.SoundLogic.ExternallyGeneratedSounds
|
|||||||
import Sound.Data
|
import Sound.Data
|
||||||
import System.Random
|
import System.Random
|
||||||
|
|
||||||
crVocalizationSound :: Creature -> Maybe SoundID
|
|
||||||
crVocalizationSound cr = case cr ^. crType of
|
|
||||||
Avatar{} -> Nothing
|
|
||||||
ChaseCrit{} -> Just seagullChatterS
|
|
||||||
HoverCrit{} -> Just beep3QuickS
|
|
||||||
SwarmCrit -> Nothing
|
|
||||||
AutoCrit -> Nothing
|
|
||||||
BarrelCrit{} -> Nothing
|
|
||||||
LampCrit{} -> Nothing
|
|
||||||
|
|
||||||
crWarningSounds :: Creature -> [SoundID]
|
crWarningSounds :: Creature -> [SoundID]
|
||||||
crWarningSounds cr = case cr ^. crType of
|
crWarningSounds cr = case cr ^. crType of
|
||||||
Avatar{} -> mempty
|
Avatar{} -> mempty
|
||||||
|
|||||||
@@ -23,16 +23,12 @@ import NewInt
|
|||||||
import qualified SDL
|
import qualified SDL
|
||||||
|
|
||||||
-- | The AI equivalent for your control.
|
-- | The AI equivalent for your control.
|
||||||
yourControl :: Creature -> World -> World
|
yourControl :: World -> World
|
||||||
yourControl _ w
|
yourControl w
|
||||||
| inTextInputFocus w = w
|
| inTextInputFocus w = w
|
||||||
| NoSubInventory <- w ^. hud . subInventory =
|
| NoSubInventory <- w ^. hud . subInventory =
|
||||||
w
|
w
|
||||||
& cWorld
|
& cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w
|
||||||
. lWorld
|
|
||||||
. creatures
|
|
||||||
. ix 0
|
|
||||||
%~ wasdWithAiming w
|
|
||||||
& tryClickUse (w ^. input . mouseButtons)
|
& tryClickUse (w ^. input . mouseButtons)
|
||||||
& handleHotkeys
|
& handleHotkeys
|
||||||
| otherwise = w & cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w
|
| otherwise = w & cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w
|
||||||
@@ -147,7 +143,7 @@ wasdMovement lw inp cam speed = theMovement . setMvAim
|
|||||||
movAbs = rotateV (cam ^. camRot) $ normalizeV movDir
|
movAbs = rotateV (cam ^. camRot) $ normalizeV movDir
|
||||||
theMovement
|
theMovement
|
||||||
| movDir == V2 0 0 = id
|
| movDir == V2 0 0 = id
|
||||||
| otherwise = crMvAbsolute lw (speed *.* movAbs)
|
| otherwise = crMvAbsolute lw (speed *^ movAbs)
|
||||||
|
|
||||||
aimTurn :: LWorld -> Float -> Creature -> Creature
|
aimTurn :: LWorld -> Float -> Creature -> Creature
|
||||||
aimTurn lw a cr = creatureTurnTowardDir a (x * 0.2) cr
|
aimTurn lw a cr = creatureTurnTowardDir a (x * 0.2) cr
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ data CreatureType
|
|||||||
, _avStrength :: Int
|
, _avStrength :: Int
|
||||||
, _avDexterity :: Int
|
, _avDexterity :: Int
|
||||||
, _avIntelligence :: Int
|
, _avIntelligence :: Int
|
||||||
, _avMoveSpeed :: Float
|
|
||||||
, _avPosture :: AvatarPosture
|
, _avPosture :: AvatarPosture
|
||||||
, _footForward :: FootForward
|
, _footForward :: FootForward
|
||||||
, _strideAmount :: Float
|
, _strideAmount :: Float
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ applySetTerminalString var = case key' of
|
|||||||
-- "invcap" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crInvCapacity .~ round (fromJust val')
|
-- "invcap" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crInvCapacity .~ round (fromJust val')
|
||||||
-- "mass" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMass .~ fromJust val'
|
-- "mass" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMass .~ fromJust val'
|
||||||
-- "mvspeed" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMvType . mvSpeed .~ fromJust val'
|
-- "mvspeed" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMvType . mvSpeed .~ fromJust val'
|
||||||
"mvspeed" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crType . avMoveSpeed .~ fromJust val'
|
-- "mvspeed" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crType . avMoveSpeed .~ fromJust val'
|
||||||
_ -> showTerminalError ("set " ++ var)
|
_ -> showTerminalError ("set " ++ var)
|
||||||
where
|
where
|
||||||
(key, val) = getSplitString var
|
(key, val) = getSplitString var
|
||||||
|
|||||||
+16
-14
@@ -35,20 +35,22 @@ import Data.Monoid
|
|||||||
import RandomHelp
|
import RandomHelp
|
||||||
|
|
||||||
testStringInit :: Universe -> [String]
|
testStringInit :: Universe -> [String]
|
||||||
testStringInit u = u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crActionPlan . apStrategy . to show
|
testStringInit u = [show p, show op, show oop, show (op - oop), show . norm $ op - oop, show d]
|
||||||
<> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crActionPlan . apAction . to show
|
<> u ^.. tocr . crStance . carriage . to show
|
||||||
<> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crPerception . cpAttention . to show
|
where
|
||||||
<> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crPerception . cpAwareness . to show
|
tocr = uvWorld . cWorld . lWorld . creatures . ix 0
|
||||||
<> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crIntention . targetCr . to show
|
f = fromMaybe 0
|
||||||
<> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crIntention . mvToPoint . to show
|
p = f $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crPos
|
||||||
<> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crIntention . viewPoint . to show
|
op = f $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crOldPos
|
||||||
-- u = [show p, show op, show oop, show (op - oop), show . norm $ op - oop, show d]
|
oop = fromMaybe 0 $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crOldOldPos
|
||||||
-- where
|
d = fromMaybe 0 $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crDir
|
||||||
-- f = fromMaybe 0
|
-- u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crActionPlan . apStrategy . to show
|
||||||
-- p = f $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crPos . _xy
|
-- <> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crActionPlan . apAction . to show
|
||||||
-- op = f $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crOldPos . _xy
|
-- <> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crPerception . cpAttention . to show
|
||||||
-- oop = fromMaybe 0 $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crStance . carriage . oldOldPos
|
-- <> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crPerception . cpAwareness . to show
|
||||||
-- d = fromMaybe 0 $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crDir
|
-- <> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crIntention . targetCr . to show
|
||||||
|
-- <> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crIntention . mvToPoint . to show
|
||||||
|
-- <> u ^.. uvWorld . cWorld . lWorld . creatures . ix 1 . crIntention . viewPoint . to show
|
||||||
-- fmap show (u ^.. uvWorld . cWorld . lWorld . creatures . ix 0 . crWallTouch . each)
|
-- fmap show (u ^.. uvWorld . cWorld . lWorld . creatures . ix 0 . crWallTouch . each)
|
||||||
-- (fmap show $ u ^.. uvWorld . cWorld . lWorld . creatures . each . crStance . carriage)
|
-- (fmap show $ u ^.. uvWorld . cWorld . lWorld . creatures . each . crStance . carriage)
|
||||||
-- (fmap show $ u ^.. uvWorld . cWorld . lWorld . creatures . each . crStance . carriage . strideAmount)
|
-- (fmap show $ u ^.. uvWorld . cWorld . lWorld . creatures . each . crStance . carriage . strideAmount)
|
||||||
|
|||||||
@@ -2540,10 +2540,10 @@ addDoorAtNthLinkToggleInterrupt src/Dodge/Room/Warning.hs 47;" f
|
|||||||
addDoorAtNthLinkToggleTerminal src/Dodge/Room/Warning.hs 66;" f
|
addDoorAtNthLinkToggleTerminal src/Dodge/Room/Warning.hs 66;" f
|
||||||
addDoorToggleTerminal src/Dodge/Room/Warning.hs 41;" f
|
addDoorToggleTerminal src/Dodge/Room/Warning.hs 41;" f
|
||||||
addDoorToggleTerminal' src/Dodge/Room/Warning.hs 87;" f
|
addDoorToggleTerminal' src/Dodge/Room/Warning.hs 87;" f
|
||||||
addGib4 src/Dodge/Prop/Gib.hs 54;" f
|
addGib4 src/Dodge/Prop/Gib.hs 56;" f
|
||||||
addGibAt src/Dodge/Prop/Gib.hs 65;" f
|
addGibAt src/Dodge/Prop/Gib.hs 67;" f
|
||||||
addGibAtDir src/Dodge/Prop/Gib.hs 71;" f
|
addGibAtDir src/Dodge/Prop/Gib.hs 73;" f
|
||||||
addGibsAtDir src/Dodge/Prop/Gib.hs 42;" f
|
addGibsAtDir src/Dodge/Prop/Gib.hs 43;" f
|
||||||
addGirder src/Dodge/Room/Modify/Girder.hs 90;" f
|
addGirder src/Dodge/Room/Modify/Girder.hs 90;" f
|
||||||
addGirder' src/Dodge/Room/Modify/Girder.hs 111;" f
|
addGirder' src/Dodge/Room/Modify/Girder.hs 111;" f
|
||||||
addGirderEW src/Dodge/Room/Modify/Girder.hs 72;" f
|
addGirderEW src/Dodge/Room/Modify/Girder.hs 72;" f
|
||||||
@@ -4118,7 +4118,7 @@ makeCloudAt src/Dodge/WorldEvent/Cloud.hs 7;" f
|
|||||||
makeColorTermLine src/Dodge/Terminal.hs 124;" f
|
makeColorTermLine src/Dodge/Terminal.hs 124;" f
|
||||||
makeColorTermPara src/Dodge/Terminal.hs 121;" f
|
makeColorTermPara src/Dodge/Terminal.hs 121;" f
|
||||||
makeCorpse src/Dodge/Corpse/Make.hs 13;" f
|
makeCorpse src/Dodge/Corpse/Make.hs 13;" f
|
||||||
makeCrGibs src/Dodge/Prop/Gib.hs 18;" f
|
makeCrGibs src/Dodge/Prop/Gib.hs 19;" f
|
||||||
makeDebris src/Dodge/Block/Debris.hs 75;" f
|
makeDebris src/Dodge/Block/Debris.hs 75;" f
|
||||||
makeDebrisDirected src/Dodge/Block/Debris.hs 101;" f
|
makeDebrisDirected src/Dodge/Block/Debris.hs 101;" f
|
||||||
makeDebrisDirectedZ src/Dodge/Block/Debris.hs 81;" f
|
makeDebrisDirectedZ src/Dodge/Block/Debris.hs 81;" f
|
||||||
@@ -4168,6 +4168,7 @@ marimbaC5S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 591;" f
|
|||||||
marimbaE5S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 629;" f
|
marimbaE5S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 629;" f
|
||||||
marimbaG5S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 617;" f
|
marimbaG5S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 617;" f
|
||||||
materialColor src/Dodge/Material/Color.hs 8;" f
|
materialColor src/Dodge/Material/Color.hs 8;" f
|
||||||
|
materialGib src/Dodge/Prop/Gib.hs 95;" f
|
||||||
materialPenetrable src/Dodge/Bullet.hs 212;" f
|
materialPenetrable src/Dodge/Bullet.hs 212;" f
|
||||||
maxAmmo src/Dodge/Item/MaxAmmo.hs 6;" f
|
maxAmmo src/Dodge/Item/MaxAmmo.hs 6;" f
|
||||||
maxDamageType src/Dodge/Damage.hs 59;" f
|
maxDamageType src/Dodge/Damage.hs 59;" f
|
||||||
|
|||||||
Reference in New Issue
Block a user