mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-21 12:19:15 +12:00
Make waypoints or "show locations" work in the libary.
This commit is contained in:
parent
abe8a8a353
commit
e3dae116dd
6 changed files with 117 additions and 7 deletions
|
@ -185,6 +185,13 @@ namespace HISP.Game
|
|||
public static string MaxJewelryMessage;
|
||||
public static string RemoveJewelry;
|
||||
|
||||
// Locations (Libary)
|
||||
public static string LocationKnownIslands;
|
||||
public static string LocationKnownTowns;
|
||||
public static string LocationIslandFormat;
|
||||
public static string LocationTownFormat;
|
||||
public static string LocationDescriptionFormat;
|
||||
|
||||
// Minigames (Libary)
|
||||
public static string MinigameSingleplayer;
|
||||
public static string MinigameTwoplayer;
|
||||
|
@ -526,8 +533,18 @@ namespace HISP.Game
|
|||
|
||||
// Click
|
||||
public static string NothingInterestingHere;
|
||||
|
||||
|
||||
public static string FormatLocationDescription(string description)
|
||||
{
|
||||
return LocationDescriptionFormat.Replace("%AREADESC%", description);
|
||||
}
|
||||
public static string FormatIslandLocation(string isleName, string mapXy)
|
||||
{
|
||||
return LocationIslandFormat.Replace("%ISLENAME%", isleName).Replace("%MAPXY%",mapXy);
|
||||
}
|
||||
public static string FormatTownLocation(string townName, string mapXy)
|
||||
{
|
||||
return LocationTownFormat.Replace("%TOWNNAME%", townName).Replace("%MAPXY%",mapXy);
|
||||
}
|
||||
public static string FormatMinigameEntry(string gameName, string mapXy)
|
||||
{
|
||||
return MinigameEntryFormat.Replace("%GAMENAME%",gameName).Replace("%MAPXY%",mapXy);
|
||||
|
|
|
@ -419,7 +419,33 @@ namespace HISP.Game
|
|||
message += Messages.MetaTerminator;
|
||||
return message;
|
||||
}
|
||||
|
||||
public static string BuildLocationsLibary()
|
||||
{
|
||||
string message = "";
|
||||
message += Messages.LocationKnownIslands;
|
||||
foreach(World.Waypoint waypoint in World.Waypoints.OrderBy(o => o.Name).ToArray())
|
||||
{
|
||||
if(waypoint.Type == "ISLE")
|
||||
{
|
||||
string mapxy = Messages.FormatMapLocation(waypoint.PosX, waypoint.PosY);
|
||||
message += Messages.FormatIslandLocation(waypoint.Name, mapxy);
|
||||
message += Messages.FormatLocationDescription(waypoint.Description);
|
||||
}
|
||||
}
|
||||
message += Messages.LocationKnownTowns;
|
||||
foreach(World.Waypoint waypoint in World.Waypoints.OrderBy(o => o.Name).ToArray())
|
||||
{
|
||||
if(waypoint.Type == "TOWN")
|
||||
{
|
||||
string mapxy = Messages.FormatMapLocation(waypoint.PosX, waypoint.PosY);
|
||||
message += Messages.FormatTownLocation(waypoint.Name, mapxy);
|
||||
message += Messages.FormatLocationDescription(waypoint.Description);
|
||||
}
|
||||
}
|
||||
message += Messages.BackToMap;
|
||||
message += Messages.MetaTerminator;
|
||||
return message;
|
||||
}
|
||||
public static string BuildHorseReleased()
|
||||
{
|
||||
string message = "";
|
||||
|
|
|
@ -6,7 +6,28 @@ namespace HISP.Game
|
|||
|
||||
public class World
|
||||
{
|
||||
public struct Isle
|
||||
private static Waypoint getWaypoint(string find)
|
||||
{
|
||||
foreach(Waypoint waypoint in Waypoints)
|
||||
{
|
||||
if(waypoint.Name == find)
|
||||
return waypoint;
|
||||
}
|
||||
|
||||
throw new KeyNotFoundException("Waypoint with name "+find+" not found.");
|
||||
|
||||
}
|
||||
|
||||
public struct Waypoint
|
||||
{
|
||||
public string Name;
|
||||
public int PosX;
|
||||
public int PosY;
|
||||
public string Type;
|
||||
public string Description;
|
||||
public string[] WeatherTypesAvalible;
|
||||
}
|
||||
public class Isle
|
||||
{
|
||||
public int StartX;
|
||||
public int EndX;
|
||||
|
@ -14,14 +35,25 @@ namespace HISP.Game
|
|||
public int EndY;
|
||||
public int Tileset;
|
||||
public string Name;
|
||||
|
||||
public Waypoint GetWaypoint()
|
||||
{
|
||||
return getWaypoint(this.Name);
|
||||
}
|
||||
|
||||
}
|
||||
public struct Town
|
||||
public class Town
|
||||
{
|
||||
public int StartX;
|
||||
public int EndX;
|
||||
public int StartY;
|
||||
public int EndY;
|
||||
public string Name;
|
||||
|
||||
public Waypoint GetWaypoint()
|
||||
{
|
||||
return getWaypoint(this.Name);
|
||||
}
|
||||
}
|
||||
public struct Area
|
||||
{
|
||||
|
@ -66,12 +98,14 @@ namespace HISP.Game
|
|||
}
|
||||
public static Time ServerTime = new Time();
|
||||
|
||||
public static List<Waypoint> Waypoints = new List<Waypoint>();
|
||||
public static List<Isle> Isles = new List<Isle>();
|
||||
public static List<Town> Towns = new List<Town>();
|
||||
public static List<Area> Areas = new List<Area>();
|
||||
public static List<Zone> Zones = new List<Zone>();
|
||||
|
||||
public static List<SpecialTile> SpecialTiles = new List<SpecialTile>();
|
||||
|
||||
public static void TickWorldClock()
|
||||
{
|
||||
ServerTime.Minutes += 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue