dont think so, that has the same problem, here is my implementation of your formula with a textbox (to verify accuracy):
updateStamina()
{
self endon("disconnect");
if(self hasPerk("specialty_longersprint"))
{
self.maxsprintcount = 7.0;
}
else
{
self.maxsprintcount = 3.5;
}
self.sprintcount = self.maxsprintcount;
for(;;)
{
if(self isSprinting() && self.sprintcount > 0)
{
self.sprintcount = self.sprintcount - 0.1;
}
else if(self.sprintcount < 0.5)
{
self.sprintcount = self.sprintcount + 0.05;
}
else if(self.sprintcount < self.maxsprintcount)
{
self.sprintcount = self.sprintcount + 0.1;
}
self.sprintcount = max(0, min(self.sprintcount, self.maxsprintcount));
staminaPercentage = int((self.sprintcount / self.maxsprintcount) * 100);
if(isDefined(self.staminaText))
{
self.staminaText setText("Stamina: " + staminaPercentage + "%");
if(staminaPercentage <= 25)
{
self.staminaText.color = (200, 0, 0);
}
else
{
self.staminaText.color = (0, 200, 0);
}
}
wait 0.05;
}
}