Fix awards and icons

This commit is contained in:
Bluzume 2021-11-07 18:42:36 -05:00
parent f3e80cad74
commit 84250eb17e
6 changed files with 20 additions and 6 deletions

@ -1 +1 @@
Subproject commit 0f9268907fb3cd9d0da9c8ab1cba8308de0e5656
Subproject commit a044032daca22e2d76d54d1e5e073e6527eb43de

View file

@ -511,6 +511,12 @@ namespace HISP.Game.Chat
case "PERSONALITY":
instance.AdvancedStats.Personality = amount;
break;
case "HEIGHT":
instance.AdvancedStats.Height = amount;
break;
case "COLOR":
instance.Color = args[2].ToLower();
break;
case "EXPERIENCE":
instance.BasicStats.Experience = amount;
break;

View file

@ -997,6 +997,7 @@ namespace HISP.Game
// Awards
public static string AwardOthersFormat;
public static string AwardHeader;
public static string NoAwards;
public static string AwardFormat;
@ -2514,6 +2515,10 @@ namespace HISP.Game
{
return ConsumeItemFormat.Replace("%ITEM%", itemName);
}
public static string FormatAwardHeaderOthers(string username)
{
return AwardOthersFormat.Replace("%USERNAME%", username);
}
public static string FormatAwardEntry(int iconId, string title, int moneyBonus)
{
return AwardFormat.Replace("%ICON%", iconId.ToString()).Replace("%NAME%", title).Replace("%BONUS%", moneyBonus.ToString("N0", CultureInfo.InvariantCulture));

View file

@ -1056,6 +1056,11 @@ namespace HISP.Game
message += Messages.FormatOtherHorsesMeta(pronoun);
message += buildHorseList(user, false);
message += Messages.FormatAwardHeaderOthers(user.Username);
foreach (Award.AwardEntry award in user.Awards.AwardsEarned)
message += Messages.FormatAwardEntry(award.IconId, award.Title, award.MoneyBonus);
}
@ -1089,9 +1094,6 @@ namespace HISP.Game
foreach (Award.AwardEntry award in user.Awards.AwardsEarned)
message += Messages.FormatAwardEntry(award.IconId, award.Title, award.MoneyBonus);
message += Messages.BackToMap;
message += Messages.MetaTerminator;
return message;

View file

@ -525,12 +525,12 @@ namespace HISP.Player
icon = Messages.NewUserIcon;
if (Subscribed)
{
int months = (DateTime.UtcNow.Month - SubscribedUntil.Month) + 12 * (DateTime.UtcNow.Year - SubscribedUntil.Year);
int months = (SubscribedUntil.Month - DateTime.UtcNow.Month) + ((SubscribedUntil.Year - DateTime.UtcNow.Year) * 12);
if (months <= 1)
icon = Messages.MonthSubscriptionIcon;
else if (months <= 3)
icon = Messages.ThreeMonthSubscripitionIcon;
else
else if(months <= (12+3))
icon = Messages.YearSubscriptionIcon;
}
if (Moderator)

View file

@ -2042,6 +2042,7 @@ namespace HISP.Server
// Awards
Messages.AwardHeader = gameData.messages.meta.awards_page.awards_header;
Messages.AwardOthersFormat = gameData.messages.meta.awards_page.awards_head;
Messages.NoAwards = gameData.messages.meta.awards_page.no_awards;
Messages.AwardFormat = gameData.messages.meta.awards_page.award_format;