Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
RedpointGames
A Momentary Meeting
Commits
d3fb759c
Commit
d3fb759c
authored
Jan 31, 2021
by
Katelyn Gigante
Browse files
AnyDir Autoexits
parent
7f51e2f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
MomentaryMeeting/Game/CommandParser.cs
View file @
d3fb759c
...
...
@@ -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}"
));
}
}
}
}
...
...
MomentaryMeeting/Models/Location.cs
View file @
d3fb759c
...
...
@@ -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
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment