make hands calculations more accurate to swf

This commit is contained in:
SilicaAndPina 2021-02-06 20:09:16 +13:00
parent d5762c3b07
commit be88fc102c
3 changed files with 10 additions and 7 deletions

View file

@ -515,13 +515,16 @@ namespace HISP.Game.Horse
int i = GameServer.RandomNumberGenerator.Next(indx, max);
return HorseNames[i];
}
public static double CalculateHands(int height)
public static double CalculateHands(int height, bool isBreedViewer)
{
return ((double)height / 4.0);
if(isBreedViewer)
return ((double)height / 4.00);
else
return ((double)height / 4.08);
}
public static string BreedViewerSwf(HorseInstance horse, string terrainTileType)
{
double hands = CalculateHands(horse.AdvancedStats.Height);
double hands = CalculateHands(horse.AdvancedStats.Height, true);
string swf = "breedviewer.swf?terrain=" + terrainTileType + "&breed=" + horse.Breed.Swf + "&color=" + horse.Color + "&hands=" + hands.ToString();
if (horse.Equipment.Saddle != null)

View file

@ -877,9 +877,9 @@ namespace HISP.Game
{
return HorseDescriptionFormat.Replace("%DESCRIPTION%", Description);
}
public static string FormatHorseHandsHigh(string color, string breed,string sex, int handsHigh)
public static string FormatHorseHandsHigh(string color, string breed,string sex, double handsHigh)
{
return HorseHandsHeightFormat.Replace("%COLOR%", color).Replace("%SEX%", sex).Replace("%HANDS%", handsHigh.ToString()).Replace("%BREED%", breed);
return HorseHandsHeightFormat.Replace("%COLOR%", color).Replace("%SEX%", sex).Replace("%HANDS%", handsHigh.ToString("0.0")).Replace("%BREED%", breed);
}
public static string FormatHorseExperience(int experience)
{

View file

@ -1390,7 +1390,7 @@ namespace HISP.Game
string message = "";
message += Messages.FormatHorseName(horse.Name);
message += Messages.FormatHorseDescription(horse.Description);
message += Messages.FormatHorseHandsHigh(horse.Color, horse.Breed.Name, horse.Sex, Convert.ToInt32(Math.Floor(HorseInfo.CalculateHands(horse.AdvancedStats.Height))));
message += Messages.FormatHorseHandsHigh(horse.Color, horse.Breed.Name, horse.Sex, HorseInfo.CalculateHands(horse.AdvancedStats.Height, false));
message += Messages.FormatHorseExperience(horse.BasicStats.Experience);
if (horse.TrainTimer > 0)
@ -1464,7 +1464,7 @@ namespace HISP.Game
message += Messages.FormatHorseAdvancedStat(personalityStat.BreedValue, personalityStat.CompanionOffset, personalityStat.TackOffset, personalityStat.MaxValue);
message += Messages.FormatHorseBreedDetails(horse.Breed.Name, horse.Breed.Description);
message += Messages.FormatHorseHeight(Convert.ToInt32(Math.Floor(HorseInfo.CalculateHands(horse.Breed.BaseStats.MinHeight))), Convert.ToInt32(Math.Floor(HorseInfo.CalculateHands(horse.Breed.BaseStats.MaxHeight))));
message += Messages.FormatHorseHeight(Convert.ToInt32(Math.Floor(HorseInfo.CalculateHands(horse.Breed.BaseStats.MinHeight,false))), Convert.ToInt32(Math.Floor(HorseInfo.CalculateHands(horse.Breed.BaseStats.MaxHeight,false))));
message += Messages.FormatPossibleColors(horse.Breed.Colors);