mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-18 19:01:32 +12:00
Implement fountains.
This commit is contained in:
parent
6bea119831
commit
a0a328aa7d
7 changed files with 57 additions and 4 deletions
|
@ -12,6 +12,10 @@
|
||||||
"click_nothing_message":"Nothing interesting here...",
|
"click_nothing_message":"Nothing interesting here...",
|
||||||
"playtime_timeout":"You have run out of playtime for now. In one minute you will be disconnected. You gain one minute of playtime every 8 minutes. Please come back later!",
|
"playtime_timeout":"You have run out of playtime for now. In one minute you will be disconnected. You gain one minute of playtime every 8 minutes. Please come back later!",
|
||||||
"random_movement":"You are sooo <B>%STAT%</B>. You wander dizzily in a different direction.",
|
"random_movement":"You are sooo <B>%STAT%</B>. You wander dizzily in a different direction.",
|
||||||
|
"fountain":{
|
||||||
|
"drank_your_fill":"You drank your fill from the fountain.",
|
||||||
|
"dropped_money":"Oh no!!! While drinking you accidentally dropped $%MONEY% into the fountain!! There is no way to get it back!",
|
||||||
|
},
|
||||||
"consume":{
|
"consume":{
|
||||||
"consumed_item_format":"GULP! You consumed the %ITEM%.",
|
"consumed_item_format":"GULP! You consumed the %ITEM%.",
|
||||||
"consumed_but_max_reached":"You could not finish it all. Some was wasted."
|
"consumed_but_max_reached":"You could not finish it all. Some was wasted."
|
||||||
|
@ -101,6 +105,7 @@
|
||||||
"end_of_meta":"^Z",
|
"end_of_meta":"^Z",
|
||||||
"back_to_map":"^M",
|
"back_to_map":"^M",
|
||||||
"long_full_line":"^L",
|
"long_full_line":"^L",
|
||||||
|
"fountain":"Although it's not recommended, you could drink from this fountain if you are thirsty...^T6Drink from the public fountain. ^B1D^R1^X^Z",
|
||||||
"awards_page":{
|
"awards_page":{
|
||||||
"awards_header":"^ATYour Awards Earned^H",
|
"awards_header":"^ATYour Awards Earned^H",
|
||||||
"no_awards":"<BR>You have not earned any awards yet. You can view a list of earnable awards in a Horse Isle Library.",
|
"no_awards":"<BR>You have not earned any awards yet. You can view a list of earnable awards in a Horse Isle Library.",
|
||||||
|
|
|
@ -24,8 +24,8 @@ namespace HISP.Game
|
||||||
{
|
{
|
||||||
if (droppedItem.instance == null)
|
if (droppedItem.instance == null)
|
||||||
{
|
{
|
||||||
continue;
|
|
||||||
RemoveDroppedItem(droppedItem);
|
RemoveDroppedItem(droppedItem);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(droppedItem.instance.ItemId == item.Id)
|
if(droppedItem.instance.ItemId == item.Id)
|
||||||
|
|
|
@ -272,7 +272,7 @@ namespace HISP.Game
|
||||||
public static string East;
|
public static string East;
|
||||||
public static string South;
|
public static string South;
|
||||||
public static string West;
|
public static string West;
|
||||||
|
|
||||||
public static string TileFormat;
|
public static string TileFormat;
|
||||||
public static string Seperator;
|
public static string Seperator;
|
||||||
|
|
||||||
|
@ -281,6 +281,11 @@ namespace HISP.Game
|
||||||
public static string LongFullLine;
|
public static string LongFullLine;
|
||||||
public static string MetaTerminator;
|
public static string MetaTerminator;
|
||||||
|
|
||||||
|
// Fountain
|
||||||
|
public static string FountainMeta;
|
||||||
|
public static string FountainDrankYourFull;
|
||||||
|
public static string FountainDroppedMoneyFormat;
|
||||||
|
|
||||||
// Disconnect Messages
|
// Disconnect Messages
|
||||||
public static string KickReasonBanned;
|
public static string KickReasonBanned;
|
||||||
public static string KickReasonDuplicateLogin;
|
public static string KickReasonDuplicateLogin;
|
||||||
|
@ -295,7 +300,10 @@ namespace HISP.Game
|
||||||
// Click
|
// Click
|
||||||
public static string NothingInterestingHere;
|
public static string NothingInterestingHere;
|
||||||
|
|
||||||
|
public static string FormatDroppedMoneyMessage(int amount)
|
||||||
|
{
|
||||||
|
return FountainDroppedMoneyFormat.Replace("%MONEY%", amount.ToString("N0"));
|
||||||
|
}
|
||||||
public static string FormatAbuseReportPlayerNotFound(string username)
|
public static string FormatAbuseReportPlayerNotFound(string username)
|
||||||
{
|
{
|
||||||
return AbuseReportPlayerNotFoundFormat.Replace("%USERNAME%", username);
|
return AbuseReportPlayerNotFoundFormat.Replace("%USERNAME%", username);
|
||||||
|
|
|
@ -545,6 +545,10 @@ namespace HISP.Game
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string buildFountain()
|
||||||
|
{
|
||||||
|
return Messages.FountainMeta;
|
||||||
|
}
|
||||||
public static string BuildSpecialTileInfo(User user, World.SpecialTile specialTile)
|
public static string BuildSpecialTileInfo(User user, World.SpecialTile specialTile)
|
||||||
{
|
{
|
||||||
string message = "";
|
string message = "";
|
||||||
|
@ -602,6 +606,11 @@ namespace HISP.Game
|
||||||
message += buildShopInfo(shop,user.Inventory);
|
message += buildShopInfo(shop,user.Inventory);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if(TileCode == "FOUNTAIN")
|
||||||
|
{
|
||||||
|
message += buildFountain();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -495,6 +495,7 @@ namespace HISP.Server
|
||||||
Messages.AbuseReportPlayerNotFoundFormat = gameData.messages.abuse_report.player_not_found_format;
|
Messages.AbuseReportPlayerNotFoundFormat = gameData.messages.abuse_report.player_not_found_format;
|
||||||
Messages.AbuseReportFiled = gameData.messages.abuse_report.report_filed;
|
Messages.AbuseReportFiled = gameData.messages.abuse_report.report_filed;
|
||||||
Messages.AbuseReportProvideValidReason = gameData.messages.abuse_report.valid_reason;
|
Messages.AbuseReportProvideValidReason = gameData.messages.abuse_report.valid_reason;
|
||||||
|
|
||||||
// Chat
|
// Chat
|
||||||
|
|
||||||
Messages.ChatViolationMessageFormat = gameData.messages.chat.violation_format;
|
Messages.ChatViolationMessageFormat = gameData.messages.chat.violation_format;
|
||||||
|
@ -631,6 +632,11 @@ namespace HISP.Server
|
||||||
Messages.NoPitchforkMeta = gameData.messages.meta.hay_pile.no_pitchfork;
|
Messages.NoPitchforkMeta = gameData.messages.meta.hay_pile.no_pitchfork;
|
||||||
Messages.HasPitchforkMeta = gameData.messages.meta.hay_pile.pitchfork;
|
Messages.HasPitchforkMeta = gameData.messages.meta.hay_pile.pitchfork;
|
||||||
|
|
||||||
|
// Fountain
|
||||||
|
Messages.FountainMeta = gameData.messages.meta.fountain;
|
||||||
|
Messages.FountainDrankYourFull = gameData.messages.fountain.drank_your_fill;
|
||||||
|
Messages.FountainDroppedMoneyFormat = gameData.messages.fountain.dropped_money;
|
||||||
|
|
||||||
// Highscore
|
// Highscore
|
||||||
|
|
||||||
Messages.HighscoreHeaderMeta = gameData.messages.meta.highscores.header_meta;
|
Messages.HighscoreHeaderMeta = gameData.messages.meta.highscores.header_meta;
|
||||||
|
|
|
@ -1454,10 +1454,34 @@ namespace HISP.Server
|
||||||
Logger.HackerPrint(sender.LoggedinUser.Username + " Tried to wear an item they did not have.");
|
Logger.HackerPrint(sender.LoggedinUser.Username + " Tried to wear an item they did not have.");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case PacketBuilder.ITEM_DRINK:
|
||||||
|
packetStr = Encoding.UTF8.GetString(packet);
|
||||||
|
string idStr = packetStr.Substring(2, packet.Length - 4);
|
||||||
|
if(idStr == "NaN") // Fountain
|
||||||
|
{
|
||||||
|
string msg = Messages.FountainDrankYourFull;
|
||||||
|
bool looseMoney = RandomNumberGenerator.Next(0, 20) == 18;
|
||||||
|
if(looseMoney)
|
||||||
|
{
|
||||||
|
int looseAmount = RandomNumberGenerator.Next(0, 100);
|
||||||
|
if (looseAmount > sender.LoggedinUser.Money)
|
||||||
|
looseAmount = sender.LoggedinUser.Money;
|
||||||
|
sender.LoggedinUser.Money -= looseAmount;
|
||||||
|
msg = Messages.FormatDroppedMoneyMessage(looseAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
sender.LoggedinUser.Thirst = 1000;
|
||||||
|
byte[] drankFromFountainMessage = PacketBuilder.CreateChat(msg, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||||
|
sender.SendPacket(drankFromFountainMessage);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.ErrorPrint(sender.LoggedinUser.Username + "Sent unknown ITEM_DRINK command id: " + idStr);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case PacketBuilder.ITEM_CONSUME:
|
case PacketBuilder.ITEM_CONSUME:
|
||||||
packetStr = Encoding.UTF8.GetString(packet);
|
packetStr = Encoding.UTF8.GetString(packet);
|
||||||
randomIdStr = packetStr.Substring(2, packet.Length - 2);
|
randomIdStr = packetStr.Substring(2, packet.Length - 3);
|
||||||
randomId = 0;
|
randomId = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -91,6 +91,7 @@ namespace HISP.Server
|
||||||
public const byte ITEM_WEAR = 0x46;
|
public const byte ITEM_WEAR = 0x46;
|
||||||
public const byte ITEM_REMOVE = 0x47;
|
public const byte ITEM_REMOVE = 0x47;
|
||||||
public const byte ITEM_CONSUME = 0x51;
|
public const byte ITEM_CONSUME = 0x51;
|
||||||
|
public const byte ITEM_DRINK = 0x52;
|
||||||
public const byte ITEM_BINOCULARS = 0x5C;
|
public const byte ITEM_BINOCULARS = 0x5C;
|
||||||
public const byte ITEM_MAGNIFYING = 0x5D;
|
public const byte ITEM_MAGNIFYING = 0x5D;
|
||||||
public const byte ITEM_RAKE = 0x5B;
|
public const byte ITEM_RAKE = 0x5B;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue