From efc21b7b5b3bc1d3020f4b9890b089f07f41189e Mon Sep 17 00:00:00 2001 From: SilicaAndPina Date: Fri, 25 Dec 2020 22:08:08 +1300 Subject: [PATCH] no message --- DataCollection/gamedata.json | 8 +++++++ .../Horse Isle Server/Game/Messages.cs | 22 ++++++++++++++++-- .../Horse Isle Server/Game/Meta.cs | 9 ++++++++ .../Horse Isle Server/Game/Npc.cs | 7 ++---- .../Horse Isle Server/Game/Quest.cs | 23 ++++++++++++++++++- .../Horse Isle Server/Server/GameDataJson.cs | 10 ++++++++ 6 files changed, 71 insertions(+), 8 deletions(-) diff --git a/DataCollection/gamedata.json b/DataCollection/gamedata.json index f49a68a..4e41f28 100644 --- a/DataCollection/gamedata.json +++ b/DataCollection/gamedata.json @@ -88,6 +88,14 @@ "end_of_meta":"^Z", "back_to_map":"^M", "long_full_line":"^L", + "quest_log":{ + "header_meta":"^ATYour Horse Isle Adventure Log^H", + "quest_format":"%TITLE% (%QUESTPOINTS%qp) [%DIFFICULTY%] %COMPLETION%
", + "not_complete":"NOT DONE", + "not_avalible":"UNAVAILABLE", + "completed":"COMPLETED", + "footer_format":"
You have completed %TOTALCOMPLETED% of %TOTALQUESTS% total adventures (%TOTALPERCENT%%)
You have earned %YOURQP%qp of %MAXQP%qp total (%QPERCENT%%)
(qp = quest points, they are a score of difficulty for each adventure)", + }, "stats_page":{ "stats_bar_format":"^ATPlayer %USERNAME%'s Details^H", "stats_area_format":"Currently %AREA%", diff --git a/Horse Isle Server/Horse Isle Server/Game/Messages.cs b/Horse Isle Server/Horse Isle Server/Game/Messages.cs index 081d137..91d743b 100644 --- a/Horse Isle Server/Horse Isle Server/Game/Messages.cs +++ b/Horse Isle Server/Horse Isle Server/Game/Messages.cs @@ -7,8 +7,6 @@ namespace HISP.Game public static int RequiredChatViolations; public static int DefaultInventoryMax; - - // Tools public static string BinocularsNothing; public static string MagnifyNothing; @@ -57,6 +55,16 @@ namespace HISP.Game public static string[] StatPlayerFormats; + // Quests Completed Page + public static string QuestLogHeader; + public static string QuestFormat; + + public static string QuestNotCompleted; + public static string QuestNotAvalible; + public static string QuestCompleted; + + public static string QuestFooterFormat; + // Announcements public static string NewUserMessage; public static string WelcomeFormat; @@ -216,6 +224,16 @@ namespace HISP.Game // Click public static string NothingInterestingHere; + + public static string FormatQuestFooter(int totalQuestsComplete, int totalQuests, int questPoints, int totalQuestPoints) + { + return QuestFooterFormat.Replace("%TOTALCOMPLETED%", totalQuestsComplete.ToString("N0")).Replace("%TOTALQUESTS%", totalQuests.ToString("N0")).Replace("%TOTALPERCENT%", ((totalQuestsComplete / totalQuests) * 100).ToString()).Replace("%YOURQP%", questPoints.ToString("N0")).Replace("%YOURQP%", totalQuestPoints.ToString("N0")).Replace("%QPERCENT%", ((totalQuestsComplete / totalQuests) * 100).ToString()); + } + public static string FormatQuestLogQuest(string questTitle, int questPoints, string difficulty, string completionStatus) + { + return QuestFormat.Replace("%TITLE%", questTitle).Replace("%QUESTPOINTS%", questPoints.ToString("N0")).Replace("%DIFFICULTY%", difficulty).Replace("%COMPLETION%", completionStatus); + } + public static string FormatPrivateNotes(string privateNotes) { return PrivateNotesMetaFormat.Replace("%PRIVATENOTES%", privateNotes); diff --git a/Horse Isle Server/Horse Isle Server/Game/Meta.cs b/Horse Isle Server/Horse Isle Server/Game/Meta.cs index 1caab0a..88ecf17 100644 --- a/Horse Isle Server/Horse Isle Server/Game/Meta.cs +++ b/Horse Isle Server/Horse Isle Server/Game/Meta.cs @@ -309,6 +309,15 @@ namespace HISP.Game return message; } + + public static string BuildQuestLog(User user) + { + string message = ""; + message += Messages.QuestLogHeader; + Quest.QuestEntry[] questList = Quest.GetPublicQuestList(); + foreach (Quest.QuestEntry quest in questList) + } + public static string BuildSpecialTileInfo(User user, World.SpecialTile specialTile) { string message = ""; diff --git a/Horse Isle Server/Horse Isle Server/Game/Npc.cs b/Horse Isle Server/Horse Isle Server/Game/Npc.cs index ead5125..962b3de 100644 --- a/Horse Isle Server/Horse Isle Server/Game/Npc.cs +++ b/Horse Isle Server/Horse Isle Server/Game/Npc.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; + namespace HISP.Game { diff --git a/Horse Isle Server/Horse Isle Server/Game/Quest.cs b/Horse Isle Server/Horse Isle Server/Game/Quest.cs index 6a22ab1..a5db973 100644 --- a/Horse Isle Server/Horse Isle Server/Game/Quest.cs +++ b/Horse Isle Server/Horse Isle Server/Game/Quest.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using System.IO; +using System.Linq; using HISP.Player; using HISP.Server; @@ -60,6 +60,27 @@ namespace HISP.Game public static List QuestList = new List(); + public static int GetTotalQuestPoints() + { + int totalQp = 0; + QuestEntry[] quests = GetPublicQuestList(); + foreach(QuestEntry quest in quests) + { + totalQp += quest.QuestPointsEarned; + } + return totalQp; + } + public static QuestEntry[] GetPublicQuestList() + { + List quests = QuestList.OrderBy(o => o.Title).ToList(); + foreach(QuestEntry quest in quests) + { + if (quest.Title == null) + quests.Remove(quest); + + } + return quests.ToArray(); + } public static bool ActivateQuest(User user, QuestEntry quest, bool npcActivation = false) { diff --git a/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs b/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs index cc88f4a..da8e215 100644 --- a/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs +++ b/Horse Isle Server/Horse Isle Server/Server/GameDataJson.cs @@ -438,6 +438,16 @@ namespace HISP.Server Messages.StatPlayerFormats = gameData.messages.meta.stats_page.player_stats.ToObject(); Messages.RandomMovement = gameData.messages.random_movement; + + // Quests Log + Messages.QuestLogHeader = gameData.messages.meta.quest_log.meta.header_meta; + Messages.QuestFormat = gameData.messages.meta.quest_log.meta.quest_format; + + Messages.QuestNotCompleted = gameData.messages.meta.quest_log.not_complete; + Messages.QuestNotAvalible = gameData.messages.meta.quest_log.not_avalible; + Messages.QuestCompleted = gameData.messages.meta.quest_log.completed; + + Messages.QuestFooterFormat = gameData.messages.meta.quest_log.footer_format; // Transport Messages.CantAffordTransport = gameData.messages.transport.not_enough_money;