Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprinting (real) #193

Merged
merged 5 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Content.IntegrationTests/Tests/Slipping/SlippingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async Task BananaSlipTest()
#pragma warning restore NUnit2045

// Walking over the banana slowly does not trigger a slip.
await SetKey(EngineKeyFunctions.Walk, BoundKeyState.Down);
await SetKey(EngineKeyFunctions.Walk, BoundKeyState.Up);
await Move(DirectionFlag.East, 1f);
#pragma warning disable NUnit2045
Assert.That(Delta(), Is.LessThan(0.5f));
Expand All @@ -47,7 +47,7 @@ public async Task BananaSlipTest()
AssertComp<KnockedDownComponent>(false, Player);

// Moving at normal speeds does trigger a slip.
await SetKey(EngineKeyFunctions.Walk, BoundKeyState.Up);
await SetKey(EngineKeyFunctions.Walk, BoundKeyState.Down);
await Move(DirectionFlag.West, 1f);
Assert.That(sys.Slipped, Does.Contain(Player));
AssertComp<KnockedDownComponent>(true, Player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public sealed class InputMoverComponent : Component

public const float LerpTime = 1.0f;

public bool Sprinting => (HeldMoveButtons & MoveButtons.Walk) == 0x0;
public bool Sprinting => (HeldMoveButtons & MoveButtons.Walk) != 0x0;

[ViewVariables(VVAccess.ReadWrite)]
public bool CanMove { get; set; } = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public sealed class MovementSpeedModifierComponent : Component
public const float DefaultFriction = 20f;
public const float DefaultFrictionNoInput = 20f;

public const float DefaultBaseWalkSpeed = 5f;
public const float DefaultBaseSprintSpeed = 3f;
public const float DefaultBaseWalkSpeed = 3f;
public const float DefaultBaseSprintSpeed = 5f;

[ViewVariables]
public float WalkSpeedModifier = 1.0f;
Expand Down
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/escape-menu/ui/options-menu.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ ui-options-function-move-up = Move Up
ui-options-function-move-left = Move Left
ui-options-function-move-down = Move Down
ui-options-function-move-right = Move Right
ui-options-function-walk = Walk
ui-options-function-walk = Run

ui-options-function-camera-rotate-left = Rotate left
ui-options-function-camera-rotate-right = Rotate right
Expand Down
48 changes: 24 additions & 24 deletions Resources/Prototypes/Entities/Mobs/NPCs/animals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
description: Some cultures find them terrifying, others crunchy on the teeth.
components:
- type: MovementSpeedModifier
baseWalkSpeed : 6
baseSprintSpeed : 3
baseWalkSpeed : 3
baseSprintSpeed : 6
- type: Sprite
drawdepth: Mobs
layers:
Expand Down Expand Up @@ -73,8 +73,8 @@
components:
- type: CombatMode
- type: MovementSpeedModifier
baseWalkSpeed : 7
baseSprintSpeed : 4
baseWalkSpeed : 4
baseSprintSpeed : 7
- type: Sprite
drawdepth: Mobs
layers:
Expand Down Expand Up @@ -315,8 +315,8 @@
description: Despite popular misconceptions, it's not actually made of butter.
components:
- type: MovementSpeedModifier
baseWalkSpeed : 6
baseSprintSpeed : 4
baseWalkSpeed : 4
baseSprintSpeed : 6
- type: Sprite
drawdepth: Mobs
layers:
Expand Down Expand Up @@ -727,8 +727,8 @@
description: A large marsupial herbivore. It has powerful hind legs, with nails that resemble long claws.
components:
- type: MovementSpeedModifier
baseWalkSpeed: 4.5
baseSprintSpeed: 3.5
baseWalkSpeed: 3.5
baseSprintSpeed: 4.5
- type: Sprite
drawdepth: Mobs
layers:
Expand Down Expand Up @@ -959,8 +959,8 @@
10: Critical
20: Dead
- type: MovementSpeedModifier
baseWalkSpeed : 5
baseSprintSpeed : 3
baseWalkSpeed : 3
baseSprintSpeed : 5
- type: Appearance
- type: DamageStateVisuals
states:
Expand Down Expand Up @@ -1104,8 +1104,8 @@
description: A harmless dragon.
components:
- type: MovementSpeedModifier
baseWalkSpeed : 3
baseSprintSpeed : 2
baseWalkSpeed : 2
baseSprintSpeed : 3
- type: Sprite
drawdepth: Mobs
layers:
Expand Down Expand Up @@ -1156,8 +1156,8 @@
description: And they called this a lizard?
components:
- type: MovementSpeedModifier
baseWalkSpeed : 3
baseSprintSpeed : 2
baseWalkSpeed : 2
baseSprintSpeed : 3
- type: Sprite
drawdepth: Mobs
layers:
Expand Down Expand Up @@ -1203,8 +1203,8 @@
description: Hop hop hop. Lookin' moist.
components:
- type: MovementSpeedModifier
baseWalkSpeed : 6
baseSprintSpeed : 4
baseWalkSpeed : 4
baseSprintSpeed : 6
- type: Sprite
drawdepth: Mobs
layers:
Expand Down Expand Up @@ -1267,8 +1267,8 @@
description: Infiltrates your domain, spies on you, and somehow still a cool pet.
components:
- type: MovementSpeedModifier
baseWalkSpeed : 6
baseSprintSpeed : 3
baseWalkSpeed : 3
baseSprintSpeed : 6
- type: Sprite
drawdepth: Mobs
layers:
Expand Down Expand Up @@ -1395,8 +1395,8 @@
description: A small penguin with a grenade strapped around its neck. Harvested by the Syndicate from icy shit-hole planets.
components:
- type: MovementSpeedModifier
baseWalkSpeed : 5
baseSprintSpeed : 3.5
baseWalkSpeed : 3.5
baseSprintSpeed : 5
- type: InputMover
- type: MobMover
- type: NpcFactionMember
Expand Down Expand Up @@ -2108,8 +2108,8 @@
description: Very slow animal. For people with low energy.
components:
- type: MovementSpeedModifier
baseWalkSpeed : 1.5
baseSprintSpeed : 1
baseWalkSpeed : 1
baseSprintSpeed : 1.5
- type: Sprite
drawdepth: Mobs
sprite: Mobs/Pets/sloth.rsi
Expand Down Expand Up @@ -2264,8 +2264,8 @@
40: Critical
60: Dead
- type: MovementSpeedModifier
baseWalkSpeed : 4
baseSprintSpeed : 2
baseWalkSpeed : 2
baseSprintSpeed : 4
- type: Appearance
- type: Inventory
speciesId: hamster
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
types:
Blunt: 20
- type: MovementSpeedModifier
baseWalkSpeed : 1.5
baseSprintSpeed : 1
baseWalkSpeed : 1
baseSprintSpeed : 1.5
8 changes: 4 additions & 4 deletions Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
components:
- type: CombatMode
- type: MovementSpeedModifier
baseWalkSpeed : 5
baseSprintSpeed : 3
baseWalkSpeed : 3
baseSprintSpeed : 5
- type: InputMover
- type: MobMover
- type: Reactive
Expand Down Expand Up @@ -203,8 +203,8 @@
components:
- type: CombatMode
- type: MovementSpeedModifier
baseWalkSpeed : 4
baseSprintSpeed : 3
baseWalkSpeed : 3
baseSprintSpeed : 4
- type: InputMover
- type: MobMover
- type: HTN
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
- type: Input
context: "ghost"
- type: MovementSpeedModifier
baseWalkSpeed: 6.5
baseSprintSpeed: 4
baseWalkSpeed: 4
baseSprintSpeed: 6.5
- type: Sprite
noRot: true
drawdepth: Ghosts
Expand Down
8 changes: 4 additions & 4 deletions Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
layer:
- MobLayer
- type: MovementSpeedModifier
baseWalkSpeed : 4
baseSprintSpeed : 3
baseWalkSpeed : 3
baseSprintSpeed : 4
- type: Sprite
noRot: true
drawdepth: Mobs
Expand Down Expand Up @@ -212,8 +212,8 @@
absorbed:
maxVol: 50
- type: MovementSpeedModifier
baseWalkSpeed: 3
baseSprintSpeed: 2
baseWalkSpeed: 2
baseSprintSpeed: 3
- type: NoSlip
- type: HTN
rootTask: CleanbotCompound
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
factions:
- SimpleNeutral
- type: MovementSpeedModifier
baseWalkSpeed : 4.5
baseSprintSpeed : 3
baseWalkSpeed : 3
baseSprintSpeed : 4.5
- type: HealthExaminable
examinableTypes:
- Blunt
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
scale: 0.8, 0.8
- type: Physics
- type: MovementSpeedModifier
baseWalkSpeed : 5
baseSprintSpeed : 3.5
baseWalkSpeed : 3.5
baseSprintSpeed : 5
- type: Fixtures
fixtures:
fix1:
Expand Down
16 changes: 8 additions & 8 deletions Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@
groups:
Brute: 5
- type: MovementSpeedModifier
baseWalkSpeed: 2.5
baseSprintSpeed: 2.0
baseWalkSpeed: 2.0
baseSprintSpeed: 2.5
- type: SlowOnDamage
speedModifierThresholds:
100: 0.4
Expand Down Expand Up @@ -220,8 +220,8 @@
- type: Stamina
excess: 1500
- type: MovementSpeedModifier
baseWalkSpeed: 3.8
baseSprintSpeed: 2.8
baseWalkSpeed : 2.8
baseSprintSpeed : 3.8
- type: MeleeWeapon
hidden: true
damage:
Expand Down Expand Up @@ -265,8 +265,8 @@
- type: Stamina
excess: 550
- type: MovementSpeedModifier
baseWalkSpeed: 4.2
baseSprintSpeed: 2.3
baseWalkSpeed : 2.3
baseSprintSpeed : 4.2
- type: MeleeWeapon
hidden: true
damage:
Expand Down Expand Up @@ -303,8 +303,8 @@
- type: Stamina
excess: 250
- type: MovementSpeedModifier
baseWalkSpeed: 6
baseSprintSpeed: 2.7
baseWalkSpeed : 2.7
baseSprintSpeed : 6
- type: MeleeWeapon
hidden: true
damage:
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
- type: Actions
- type: InputMover
- type: MovementSpeedModifier
baseSprintSpeed: 8
baseWalkSpeed: 12
baseSprintSpeed: 12
baseWalkSpeed: 8
- type: Physics
ignorePaused: true
bodyType: Kinematic
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/Player/dragon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
- type: MobMover
- type: InputMover
- type: MovementSpeedModifier
baseWalkSpeed: 5
baseSprintSpeed: 3
baseWalkSpeed: 3
baseSprintSpeed: 5
weightlessModifier: 1.5
- type: RandomSprite
available:
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/Player/guardian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
- type: MobMover
- type: InputMover
- type: MovementSpeedModifier
baseWalkSpeed: 5.5
baseSprintSpeed: 4
baseWalkSpeed: 4
baseSprintSpeed: 5.5
- type: DamageOnHighSpeedImpact
damage:
types:
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/Player/observer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
- state: animated
shader: unshaded
- type: MovementSpeedModifier
baseWalkSpeed: 10
baseSprintSpeed: 6
baseWalkSpeed: 6
baseSprintSpeed: 10
- type: MovementIgnoreGravity
- type: Pullable
- type: Speech
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
save: false
components:
- type: MovementSpeedModifier
baseSprintSpeed: 24
baseSprintSpeed: 25
baseWalkSpeed: 16
8 changes: 4 additions & 4 deletions Resources/Prototypes/Entities/Mobs/Player/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
# layer:
# - MobLayer
# - type: MovementSpeedModifier
# baseWalkSpeed : 4
# baseSprintSpeed : 3
# baseWalkSpeed : 3
# baseSprintSpeed : 4
# - type: Sprite
# noRot: true
# drawdepth: Mobs
Expand Down Expand Up @@ -224,8 +224,8 @@
# rules: ghost-role-information-onestar-mecha-rules
# - type: GhostTakeoverAvailable
# - type: MovementSpeedModifier
# baseWalkSpeed : 3
# baseSprintSpeed : 2
# baseWalkSpeed : 2
# baseSprintSpeed : 3
# - type: MobState
# allowedStates:
# - Alive
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/Species/diona.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
templateId: diona
- type: InventorySlots
- type: MovementSpeedModifier
baseWalkSpeed : 3.5
baseSprintSpeed : 1.5
baseWalkSpeed : 1.5
baseSprintSpeed : 3.5

- type: entity
save: false
Expand Down
Loading
Loading