2018-03-05 08:04:53 -05:00
|
|
|
namespace ACE.Server.Physics.Common
|
|
|
|
|
{
|
|
|
|
|
public class EncumbranceSystem
|
|
|
|
|
{
|
2018-07-30 01:35:48 -04:00
|
|
|
public static int EncumbranceCapacity(int strength, int numAugs)
|
2018-03-05 08:04:53 -05:00
|
|
|
{
|
|
|
|
|
if (strength <= 0) return 0;
|
|
|
|
|
|
2018-07-30 01:35:48 -04:00
|
|
|
var bonusBurden = 30 * numAugs;
|
2018-03-05 08:04:53 -05:00
|
|
|
|
|
|
|
|
if (bonusBurden >= 0)
|
|
|
|
|
{
|
|
|
|
|
if (bonusBurden > 150)
|
|
|
|
|
bonusBurden = 150;
|
|
|
|
|
|
|
|
|
|
return 150 * strength + strength * bonusBurden;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return 150 * strength;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-30 01:35:48 -04:00
|
|
|
public static float GetBurden(int capacity, int encumbrance)
|
2018-03-05 08:04:53 -05:00
|
|
|
{
|
|
|
|
|
if (capacity <= 0) return 3.0f;
|
|
|
|
|
|
|
|
|
|
if (encumbrance >= 0)
|
2018-07-30 01:35:48 -04:00
|
|
|
return (float)encumbrance / capacity;
|
2018-03-05 08:04:53 -05:00
|
|
|
else
|
|
|
|
|
return 0.0f;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-30 01:35:48 -04:00
|
|
|
public static float GetBurdenMod(float burden)
|
2018-03-05 08:04:53 -05:00
|
|
|
{
|
2018-07-30 01:35:48 -04:00
|
|
|
if (burden < 1.0f) return 1.0f;
|
2018-03-05 08:04:53 -05:00
|
|
|
|
2018-07-30 01:35:48 -04:00
|
|
|
if (burden < 2.0f)
|
|
|
|
|
return 2.0f - burden;
|
2018-03-05 08:04:53 -05:00
|
|
|
else
|
|
|
|
|
return 0.0f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|