Add fun playtime messages

This commit is contained in:
SilicaAndPina 2021-04-16 03:33:33 +12:00
parent 8069dd8578
commit 23e5004cbc
3 changed files with 42 additions and 19 deletions

View file

@ -13,6 +13,10 @@ namespace HISP.Game
// Message Queue
public static string MessageQueueHeader;
// Timed Messages
public static string PlaytimeMessageFormat;
public static string[] RngMessages;
// Mod
public static string ModIsleMessage;
public static string ModSplatterballEarnedYouFormat;
@ -2016,6 +2020,11 @@ namespace HISP.Game
{
return HorseCompanionEquipMessageFormat.Replace("%HORSENAME%", horseName).Replace("%ITEM%", itemName);
}
public static string FormatPlaytimeMessage(int hours)
{
return PlaytimeMessageFormat.Replace("%TOTALHOURS%", hours.ToString());
}
public static string FormatHorseCompanionSelected(int icon, string name)
{
return HorseCompnaionMenuCurrentCompanionFormat.Replace("%ICONID%", icon.ToString()).Replace("%NAME%", name);

View file

@ -75,6 +75,15 @@ namespace HISP.Server
}
}
if (totalMinutesElapsed % (2 * 60) == 0)
{
string ptMessage = Messages.RngMessages[GameServer.RandomNumberGenerator.Next(0, Messages.RngMessages.Length)];
byte[] playTimeMessage = PacketBuilder.CreateChat(Messages.FormatPlaytimeMessage(totalMinutesElapsed / 60) + ptMessage, PacketBuilder.CHAT_BOTTOM_RIGHT);
SendPacket(playTimeMessage);
}
bool gotoPrision = false;
foreach(HorseInstance horse in LoggedinUser.HorseInventory.HorseList)
{
@ -184,13 +193,14 @@ namespace HISP.Server
}
if (totalMinutesElapsed % 5 == 0)
LoggedinUser.Thirst--;
if (totalMinutesElapsed % 5 == 0)
if (totalMinutesElapsed % 10 == 0)
LoggedinUser.Hunger--;
if (totalMinutesElapsed % 10 == 0)
if (totalMinutesElapsed % 15 == 0)
LoggedinUser.Tiredness--;
}

View file

@ -884,6 +884,10 @@ namespace HISP.Server
Map.NewUserStartX = gameData.messages.new_user.starting_x;
Map.NewUserStartY = gameData.messages.new_user.starting_y;
// Timed Messages
Messages.PlaytimeMessageFormat = gameData.messages.timed_messages.playtime_message;
Messages.RngMessages = gameData.messages.timed_messages.rng_message.ToObject<string[]>();
// Auto Sell
Messages.AutoSellNotStandingInSamePlace = gameData.messages.meta.auto_sell.not_standing_sameplace;
Messages.AutoSellSuccessFormat = gameData.messages.meta.auto_sell.success;