Added places of interest to #location. Resolves #69

This commit is contained in:
raeleus 2024-10-14 06:44:15 -07:00
parent ac71bbad3e
commit 264ced0e08
2 changed files with 16 additions and 1 deletions

View file

@ -1972,7 +1972,7 @@ function doGoToLocation(command) {
}
function doGetLocation(command) {
state.show = "none"
state.show = "location"
return `\n[You are at ${state.location == null ? "" : "the location " + toTitleCase(state.location) + " "}(${state.x},${state.y})]`
}

View file

@ -221,6 +221,21 @@ const modifier = (text) => {
}
text += "******************\n\n"
break
case "location":
var localLocations = []
for (location of state.locations) {
if (location.x == state.x && location.y == state.y) localLocations.push(location)
}
if (localLocations.length > 0) {
text += "Places of interest here:\n"
for (location of localLocations) {
text += `* ${location.name}\n`
}
} else {
text += " "
}
break
case "locations":
text += `Player location: ${state.location == null ? "" : state.location + " "}(${state.x},${state.y})\n`
text += `*** LOCATIONS ***\n`