2018-03-05 08:04:53 -05:00
|
|
|
using System;
|
|
|
|
|
using ACE.Server.Physics.Common;
|
|
|
|
|
|
2018-02-20 08:38:34 -05:00
|
|
|
namespace ACE.Server.Physics.Animation
|
|
|
|
|
{
|
|
|
|
|
public class MovementSystem
|
|
|
|
|
{
|
2019-03-29 03:48:23 -04:00
|
|
|
public static float GetJumpHeight(float burden, uint jumpSkill, float power, float scaling)
|
2018-03-04 23:50:42 -05:00
|
|
|
{
|
2019-12-15 09:54:16 -05:00
|
|
|
power = Math.Clamp(power, 0.0f, 1.0f);
|
2018-03-05 08:04:53 -05:00
|
|
|
|
2019-03-29 03:48:23 -04:00
|
|
|
var result = EncumbranceSystem.GetBurdenMod(burden) * (jumpSkill / (jumpSkill + 1300.0f) * 22.2f + 0.05f) * power / scaling;
|
2018-03-05 08:04:53 -05:00
|
|
|
|
|
|
|
|
if (result < 0.35f)
|
|
|
|
|
result = 0.35f;
|
|
|
|
|
|
|
|
|
|
return result;
|
2018-03-04 23:50:42 -05:00
|
|
|
}
|
|
|
|
|
|
2018-07-30 01:35:48 -04:00
|
|
|
public static double GetRunRate(float burden, int runSkill, float scaling)
|
2018-03-04 23:50:42 -05:00
|
|
|
{
|
2018-07-30 01:35:48 -04:00
|
|
|
var loadMod = EncumbranceSystem.GetBurdenMod(burden);
|
2018-03-05 08:04:53 -05:00
|
|
|
|
2018-05-18 09:37:46 -04:00
|
|
|
if (runSkill >= 800.0f) // max run speed?
|
2018-03-05 08:04:53 -05:00
|
|
|
return 18.0f / 4.0f;
|
|
|
|
|
else
|
2018-05-15 00:34:53 -04:00
|
|
|
return ((loadMod * ((float)runSkill / (runSkill + 200) * 11) + 4) / scaling) / 4.0f;
|
2018-03-04 23:50:42 -05:00
|
|
|
}
|
|
|
|
|
|
2018-07-30 01:35:48 -04:00
|
|
|
public static int JumpStaminaCost(float power, float burden, bool pk)
|
2018-03-04 23:50:42 -05:00
|
|
|
{
|
2018-03-05 08:04:53 -05:00
|
|
|
if (pk)
|
2018-07-30 01:35:48 -04:00
|
|
|
return (int)((power + 1.0f) * 100.0f);
|
2018-03-05 08:04:53 -05:00
|
|
|
else
|
2018-07-30 01:35:48 -04:00
|
|
|
return (int)Math.Ceiling((burden + 0.5f) * power * 8.0f + 2.0f);
|
2018-03-04 23:50:42 -05:00
|
|
|
}
|
2019-03-29 03:48:23 -04:00
|
|
|
|
|
|
|
|
public static float GetJumpPower(uint stamina, float burden, bool pk)
|
|
|
|
|
{
|
|
|
|
|
if (pk)
|
|
|
|
|
return stamina / 100.0f - 1.0f;
|
|
|
|
|
else
|
|
|
|
|
return (stamina - 2.0f) / (burden * 8.0f + 4.0f);
|
|
|
|
|
}
|
2018-02-20 08:38:34 -05:00
|
|
|
}
|
|
|
|
|
}
|