Commit d3fb759c authored by Katelyn Gigante's avatar Katelyn Gigante
Browse files

AnyDir Autoexits

parent 7f51e2f1
......@@ -632,7 +632,7 @@ namespace MomentaryMeeting.Game
void AutoExitForDirection(RelativeDirection forward)
{
var dir = (CardinalDirection)((int)player.RelativeCardinalDirection(forward));
var dir = (CardinalDirection)(int)player.RelativeCardinalDirection(forward);
if (_database.Locations.ContainsKey(neighbours.GetNeighbour(dir)))
{
var target = _database.Locations[neighbours.GetNeighbour(dir)];
......@@ -645,6 +645,17 @@ namespace MomentaryMeeting.Game
}
sb.AppendLine().Append(EvaluatePrompt(target.ViewFrom[dir]));
}
else if (!string.IsNullOrWhiteSpace(target.ViewFromAny))
{
if (dir == CardinalDirection.North)
sb.AppendLine().Append(target.ViewFromAny.Replace("{dir}", "{north}").Replace("{Dir}", "{North}"));
else if (dir == CardinalDirection.East)
sb.AppendLine().Append(target.ViewFromAny.Replace("{dir}", "{east}").Replace("{Dir}", "{East}"));
else if (dir == CardinalDirection.South)
sb.AppendLine().Append(target.ViewFromAny.Replace("{dir}", "{south}").Replace("{Dir}", "{South}"));
else if (dir == CardinalDirection.West)
sb.AppendLine().Append(target.ViewFromAny.Replace("{dir}", "{west}").Replace("{Dir}", "{West}"));
}
}
}
}
......
......@@ -17,6 +17,8 @@ namespace MomentaryMeeting.Models
public Dictionary<UserModel.CardinalDirection, List<Prompt>> ViewFrom { get; set; }
public string ViewFromAny { get; set; }
public bool NoSpawn { get; set; }
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment