Add horse games

This commit is contained in:
SilicaAndPina 2021-02-17 01:02:40 +13:00
parent 35afd32d6c
commit 83445971e0
4 changed files with 32 additions and 0 deletions

View file

@ -194,6 +194,10 @@
"venus_flytrap_format":"The Giant Venus Flytrap chomped at you!<BR><B>OUCH!!</B><BR>It chomped your pocket, taking $%MONEY% with it!!", "venus_flytrap_format":"The Giant Venus Flytrap chomped at you!<BR><B>OUCH!!</B><BR>It chomped your pocket, taking $%MONEY% with it!!",
"password_input":"<BR>^PLReply:|^PS14|ANSWER^R1", "password_input":"<BR>^PLReply:|^PS14|ANSWER^R1",
"last_poet":"^R1^LLast Player Poet:%USERNAME% ^R1", "last_poet":"^R1^LLast Player Poet:%USERNAME% ^R1",
"horse_games":{
"select_a_horse":"<BR>^LSelect a horse to compete with:^R1",
"horse_entry":"^I252^T7#%PLACING%:%HORSENAME%^BM%SWF%^R1"
},
"mail":{ "mail":{
"mail_received":"A message has been sent to you from another player. It is in your inventory now.", "mail_received":"A message has been sent to you from another player. It is in your inventory now.",
"mail_ripped":"You permanently ripped up the message.", "mail_ripped":"You permanently ripped up the message.",

View file

@ -16,6 +16,10 @@ namespace HISP.Game
// Click // Click
public static string PlayerHereFormat; public static string PlayerHereFormat;
// Horse Games
public static string HorseGamesSelectHorse;
public static string HorseGamesHorseEntryFormat;
// City Hall // City Hall
public static string CityHallMenu; public static string CityHallMenu;
public static string CityHallMailSendMeta; public static string CityHallMailSendMeta;
@ -792,6 +796,10 @@ namespace HISP.Game
// Click // Click
public static string NothingInterestingHere; public static string NothingInterestingHere;
public static string FormatHorseGamesEntry(int placing, string horseName, string Swf)
{
return HorseGamesHorseEntryFormat.Replace("%PLACING%", placing.ToString()).Replace("%HORSENAME%", horseName).Replace("%SWF%", Swf);
}
public static string FormatCityHallCantFindPlayerMessage(string playerName) public static string FormatCityHallCantFindPlayerMessage(string playerName)
{ {
return CityHallCantFindPlayerMessageFormat.Replace("%PLAYERNAME%", playerName); return CityHallCantFindPlayerMessageFormat.Replace("%PLAYERNAME%", playerName);

View file

@ -1222,6 +1222,18 @@ namespace HISP.Game
message += Messages.MetaTerminator; message += Messages.MetaTerminator;
return message; return message;
} }
private static string buildHorseGame(User user, string swf)
{
string message = Messages.HorseGamesSelectHorse;
int placing = 1;
foreach(HorseInstance horse in user.HorseInventory.HorseList.OrderBy(o => o.Name).ToArray())
{
message += Messages.FormatHorseGamesEntry(placing, horse.Name, swf + ".swf?ID=" + horse.RandomId + "&SP=" + horse.AdvancedStats.Speed + "&ST=" + horse.AdvancedStats.Strength + "&CO=" + horse.AdvancedStats.Conformation + "&AG=" + horse.AdvancedStats.Agility + "&EN=" + horse.AdvancedStats.Endurance + "&IN=" + horse.AdvancedStats.Inteligence + "&PE=" + horse.AdvancedStats.Personality + "&");
}
message += Messages.ExitThisPlace;
message += Messages.MetaTerminator;
return message;
}
public static string BuildMostValuedRanches() public static string BuildMostValuedRanches()
{ {
string message = Messages.CityHallTop25Ranches; string message = Messages.CityHallTop25Ranches;
@ -2328,6 +2340,10 @@ namespace HISP.Game
{ {
message += buildPond(user); message += buildPond(user);
} }
if(TileCode == "HORSES")
{
message += buildHorseGame(user, TileArg);
}
if (TileCode == "WORKSHOP") if (TileCode == "WORKSHOP")
{ {
message += buildWorkshop(user); message += buildWorkshop(user);

View file

@ -746,6 +746,10 @@ namespace HISP.Server
Map.ModIsleX = gameData.messages.commands.mod_isle.x; Map.ModIsleX = gameData.messages.commands.mod_isle.x;
Map.ModIsleY = gameData.messages.commands.mod_isle.y; Map.ModIsleY = gameData.messages.commands.mod_isle.y;
// Horse Games
Messages.HorseGamesSelectHorse = gameData.messages.meta.horse_games.select_a_horse;
Messages.HorseGamesHorseEntryFormat = gameData.messages.meta.horse_games.horse_entry;
// City Hall // City Hall
Messages.CityHallMenu = gameData.messages.meta.city_hall.menu; Messages.CityHallMenu = gameData.messages.meta.city_hall.menu;
Messages.CityHallMailSendMeta = gameData.messages.meta.city_hall.mail_send_meta; Messages.CityHallMailSendMeta = gameData.messages.meta.city_hall.mail_send_meta;