-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <cmath> | ||
|
||
#include "ArenaPlayerUtils.h" | ||
|
||
int ArenaPlayerUtils::getBaseSpeed(int speedAttribute, int encumbranceMod) | ||
{ | ||
return ((((speedAttribute * 20) / 256) * (256 - encumbranceMod)) / 256) + 20; | ||
} | ||
|
||
int ArenaPlayerUtils::getMoveSpeed(int baseSpeed) | ||
{ | ||
return baseSpeed; | ||
} | ||
|
||
int ArenaPlayerUtils::getTurnSpeed(int baseSpeed) | ||
{ | ||
return (baseSpeed / 2) + 13; | ||
} | ||
|
||
int ArenaPlayerUtils::getChasmFallSpeed(int frame) | ||
{ | ||
return static_cast<int>(std::pow(2, 2 + (frame / 2))); | ||
} | ||
|
||
int ArenaPlayerUtils::getJumpUnitsPerFrame(int frame) | ||
{ | ||
return 10 - (2 * frame); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef ARENA_PLAYER_UTILS_H | ||
#define ARENA_PLAYER_UTILS_H | ||
|
||
namespace ArenaPlayerUtils | ||
{ | ||
int getBaseSpeed(int speedAttribute, int encumbranceMod); | ||
int getMoveSpeed(int baseSpeed); | ||
int getTurnSpeed(int baseSpeed); | ||
|
||
constexpr int AccelerationRate = 32; | ||
constexpr int AccelerationMax = 256; | ||
constexpr int DecelerationRate = 64; | ||
|
||
constexpr int ChasmHeightDeltaDryChasm = -80; | ||
constexpr int ChasmHeightSwimmingInterior = -25; | ||
constexpr int ChasmHeightSwimmingCity = -50; | ||
constexpr int ChasmHeightSwimmingWild = -10; | ||
constexpr int ChasmHeightRowBoatInterior = -10; | ||
constexpr int ChasmHeightRowBoatWild = -1; | ||
|
||
constexpr int ChasmMagnetUnitsPerFrame = 16; | ||
int getChasmFallSpeed(int frame); | ||
|
||
constexpr int ChasmClimbingUnitsPerFrame = 6; | ||
|
||
constexpr int JumpFrameCount = 10; | ||
constexpr int JumpFrameCountAcrobat = JumpFrameCount * 2; | ||
constexpr int JumpDisallowedCameraHeightUnits = 60; // Or in voxel column with any chasm. | ||
constexpr int StandingJumpForwardUnits = 30; // (dist*pc.attr[STRENGTH])/128 | ||
int getJumpUnitsPerFrame(int frame); | ||
|
||
} | ||
|
||
#endif |