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

@ -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`