add messages for real time quiz

This commit is contained in:
SilicaAndPina 2021-04-16 00:09:17 +12:00
parent 661320317f
commit 753abb5231
5 changed files with 81 additions and 7 deletions

View file

@ -158,6 +158,9 @@ namespace HISP.Game.Chat
else if (message.ToUpper().StartsWith("!HEAR"))
return Command.UnMute(message, args, user);
else if (message.ToUpper().StartsWith("!QUIZ"))
return Command.Quiz(message, args, user);
else if (message.ToUpper().StartsWith("!WARP"))
return Command.Warp(message, args, user);

View file

@ -368,6 +368,32 @@ namespace HISP.Game.Chat
return true;
}
public static bool Quiz(string message, string[] args, User user)
{
bool quizActive = false;
// TODO: Check quiz event is running.
if (quizActive)
{
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message.Substring(1));
byte[] enteredRealTimeQuiz = PacketBuilder.CreateChat(Messages.EventEnteredRealTimeQuiz, PacketBuilder.CHAT_BOTTOM_RIGHT);
user.LoggedinClient.SendPacket(enteredRealTimeQuiz);
byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT);
user.LoggedinClient.SendPacket(chatPacket);
return true;
}
else
{
byte[] quizUnavailable = PacketBuilder.CreateChat(Messages.EventUnavailableRealTimeQuiz, PacketBuilder.CHAT_BOTTOM_RIGHT);
user.LoggedinClient.SendPacket(quizUnavailable);
return false;
}
}
public static bool Mute(string message, string[] args, User user)
{
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message.Substring(1));

View file

@ -65,6 +65,16 @@ namespace HISP.Game
public static string SocialTypeFormat;
public static string SocialPlayerNoLongerNearby;
// Events : Real Time Quiz
public static string EventMetaRealTimeQuizFormat;
public static string EventStartRealTimeQuiz;
public static string EventEndRealTimeQuiz;
public static string EventBonusRealTimeQuizFormat;
public static string EventWinBonusRealTimeQuizFormat;
public static string EventWinRealTimeQuizFormat;
public static string EventUnavailableRealTimeQuiz;
public static string EventEnteredRealTimeQuiz;
// Events : Real Time Riddles
public static string EventStartRealTimeRiddleFormat;
public static string EventEndRealTimeRiddle;
@ -144,7 +154,7 @@ namespace HISP.Game
// Trading : Messages
public static string TradeWaitingForOthersToAcceptMessage;
public static string TradeRequiresBothPlayersMessage;
public static string TradeCanceledBecuasePlayerMovedMessage;
@ -1114,8 +1124,7 @@ namespace HISP.Game
// Click
public static string NothingInterestingHere;
// Event : Tack Shop Giveaway
// Throwables
public static string FormatModSplatterBallAwardedOther(string username)
@ -1130,8 +1139,27 @@ namespace HISP.Game
{
return itemFormat.Replace("%USERNAME%", username);
}
// Tack Shop Giveaway
// Event : Real Time Quiz
public static string FormatEventRealTimeQuizMeta(int questionNo, int totalMistakes, string category, string question)
{
return EventMetaRealTimeQuizFormat.Replace("%QUESTIONNUMBER%", questionNo.ToString()).Replace("%MISTAKES%", questionNo.ToString()).Replace("%CATEGORY%", category).Replace("%QUESTIONTEXT%", question);
}
public static string FormatEventRealTimeQuizBonus(int bonusMoney)
{
return EventBonusRealTimeQuizFormat.Replace("%MONEY%", bonusMoney.ToString("N0", CultureInfo.InvariantCulture));
}
public static string FormatEventRealTimeQuizWinBonus(int bonusMoney)
{
return EventWinBonusRealTimeQuizFormat.Replace("%MONEY%", bonusMoney.ToString("N0", CultureInfo.InvariantCulture));
}
public static string FormatEventRealTimeQuizWin(string winner)
{
return EventWinRealTimeQuizFormat.Replace("%USERNAME%", winner);
}
// Event : Tack Shop Giveaway
public static string FormatEventTackShopGiveawayEnd(string shopName, string townName)
{
return EventEndTackShopGiveawayFormat.Replace("%SHOPNAME%", shopName).Replace("%TOWN%", townName);

View file

@ -952,6 +952,17 @@ namespace HISP.Server
// Message Queue
Messages.MessageQueueHeader = gameData.messages.message_queue;
// Events : Real Time Quiz
Messages.EventMetaRealTimeQuizFormat = gameData.messages.events.real_time_quiz.event_meta;
Messages.EventStartRealTimeQuiz = gameData.messages.events.real_time_quiz.event_start;
Messages.EventEndRealTimeQuiz = gameData.messages.events.real_time_quiz.event_end;
Messages.EventBonusRealTimeQuizFormat = gameData.messages.events.real_time_quiz.event_bonus;
Messages.EventWinBonusRealTimeQuizFormat = gameData.messages.events.real_time_quiz.event_win_bonus;
Messages.EventWinRealTimeQuizFormat = gameData.messages.events.real_time_quiz.event_win;
Messages.EventUnavailableRealTimeQuiz = gameData.messages.events.real_time_quiz.event_unavailable;
Messages.EventEnteredRealTimeQuiz = gameData.messages.events.real_time_quiz.event_entered;
// Events : Real Time Riddle
Messages.EventStartRealTimeRiddleFormat = gameData.messages.events.real_time_riddle.event_start;