fix: Fixes mount stamina, adds Pub46+ Ethereal stamina (#1716)

### Summary
* Makes mount stamina significantly faster.
* Reduces absolute reset from 24 hours to 4 hours.
* Adds Pub 46+ Ethereal stamina where the stamina is global to all mounts for the player
* Removes serialization of stamina entirely because it's ok if it gets reset during shard restarts.
This commit is contained in:
Kamron Batman 2024-04-05 21:05:16 -07:00 • committed by GitHub
parent c63bf84ad4
commit 90fa2e09de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 160 additions and 176 deletions

View file

@ -37,10 +37,10 @@ public abstract partial class BaseMount : BaseCreature, IMount
public virtual bool AllowMaleRider => true;
public virtual bool AllowFemaleRider => true;
// Stamina System - 1 step per 10 seconds and 3840 steps max = 9.667 hours
// Stamina System - 1 step per 1 second and 3840 steps max = 64 minutes
public virtual int StepsMax => 3840;
public virtual int StepsGainedPerIdleTime => 1;
public virtual TimeSpan IdleTimePerStepsGain => TimeSpan.FromSeconds(10);
public virtual TimeSpan IdleTimePerStepsGain => TimeSpan.FromSeconds(1);
[Hue]
[CommandProperty(AccessLevel.GameMaster)]

View file

@ -145,7 +145,7 @@ namespace Server.Mobiles
public virtual int StepsMax => 3840; // Should be same as horse
public virtual int StepsGainedPerIdleTime => 1;
public virtual TimeSpan IdleTimePerStepsGain => TimeSpan.FromSeconds(10);
public virtual TimeSpan IdleTimePerStepsGain => TimeSpan.FromSeconds(1);
public void OnRiderDamaged(int amount, Mobile from, bool willKill)
{

View file

@ -4293,7 +4293,8 @@ namespace Server.Mobiles
if (stamGain > 0)
{
Stam += stamGain;
// 64 food = 3,640 steps
// 61 food = 3,840 steps
StaminaSystem.RegenSteps(this as IHasSteps, stamGain * 4);
}

View file

@ -30,11 +30,10 @@ public partial class VirtualMountItem : Item, IMountItem, IMount
}
}
public int Steps { get; set; }
public int StepsMax => 400;
// If this is ever equipped by a player, steps are treated the same as Ethereal mounts
public int StepsMax => 3840;
public int StepsGainedPerIdleTime => 1;
public TimeSpan IdleTimePerStepsGain => TimeSpan.FromSeconds(10);
public TimeSpan IdleTimePerStepsGain => TimeSpan.FromSeconds(1);
public void OnRiderDamaged(int amount, Mobile from, bool willKill)
{