Commit 39bc9b8a authored by June's avatar June
Browse files

Merge branch 'main' of gitlab.com:redpointgames/a-momentary-meeting into main

parents 0a444cee dfc41f92
Subproject commit 10d9e43dffc687a1b93feda3a3e9558c785869cf
Subproject commit e9db99bab1d65068d867fb86e71160844d79bfe5
......@@ -236,7 +236,7 @@ namespace MomentaryMeeting.Game
// await _databaseApi.Refresh();
if (!player.InMeeting)
{
response = "There is no one around to hear what you have to say.";
response = _database.GlobalText.SelectFromList("lonely");
}
else if (words.Length < 2)
{
......@@ -512,7 +512,7 @@ namespace MomentaryMeeting.Game
else
{
string content = command.Substring(verb.Length + 1);
string message = $"<The Stranger says: {content}";
string message = "<" + _database.GlobalText.SelectFromList("other_says").Replace("__CONTENT__", content);
Meeting meeting = _interactionManager.FindMeeting(player);
foreach (UserModel other in meeting._users)
{
......@@ -522,7 +522,7 @@ namespace MomentaryMeeting.Game
await gameInstance.SendPromptToPlayer(conn, message);
}
}
response += $">You say: {content}";
response += ">" + _database.GlobalText.SelectFromList("you_say").Replace("__CONTENT__", content);
}
}
break;
......@@ -613,7 +613,6 @@ namespace MomentaryMeeting.Game
List<Prompt> prompts = _database.Locations[player.LocationName].Prompt;
sb.Append(EvaluatePrompt(prompts));
var neighbours = _arrangementGenerator.GetNeighbours(player.LocationName);
var needsNewlineBeforeAutoExit = true;
AutoExitForDirection(RelativeDirection.Forward);
AutoExitForDirection(RelativeDirection.Right);
AutoExitForDirection(RelativeDirection.Back);
......@@ -632,19 +631,25 @@ 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)];
if (target.ViewFrom != null && target.ViewFrom.ContainsKey(dir))
{
if (needsNewlineBeforeAutoExit)
{
sb.AppendLine();
needsNewlineBeforeAutoExit = false;
}
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}"));
}
}
}
}
......
......@@ -16,7 +16,6 @@ namespace MomentaryMeeting.Game
public class InteractionManager : IEndMeetings
{
private const string _entryText = "A stranger appears in front of you.{1} You feel as though you could {b}say{/b} something to them.";
// Two players cannot meet more than once within this interval
private const int _reMeetingLockoutInterval = 180;
......@@ -99,12 +98,12 @@ namespace MomentaryMeeting.Game
RecordMeetingOccurred(otherUser, player);
_meetings.Add(meeting);
// let them know someone has entered their room
await _gameInstance.SendPromptToPlayer(otherUser, "<" + _entryText);
await _gameInstance.SendPromptToPlayer(otherUser, "<" + _database.GlobalText.SelectFromList("begin_meeting"));
await _gameInstance.SyncPlayerMusic(_gameInstance.GetConnection(otherUser.DiscordId));
_logger.LogInformation("User(" + player.DiscordId + ":" + player.Username +
") has entered a room occupied by " + "User(" + otherUser.DiscordId + ":" + otherUser.Username + "). Beginning meeting!");
return _entryText;
return _database.GlobalText.SelectFromList("begin_meeting");
}
}
return null;
......
......@@ -9,7 +9,7 @@ namespace MomentaryMeeting.Game.Interactions
{
// Meetings can never be any longer than this; players will be torn
// apart after this
private const int _maxMeetingLengthSeconds = 90;
private const int _maxMeetingLengthSeconds = 60;
// If players spend more than this amount of time not in the same
// location, their meeting will end
private const int _driftApartTimeout = 30;
......
......@@ -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