-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultiServer: !status shows Ready status #3598
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the goal_text
variable name is the best with this change. But it's not bad and I don't have a really confident idea for something better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good and variable name better reflects its use,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love code like this that tries to figure out how to "build sentences" using code.
Y'all should have a look at
Archipelago/worlds/witness/hints.py
Lines 484 to 582 in 7adb673
def word_area_hint(world: "WitnessWorld", hinted_area: str, area_items: List[Item]) -> Tuple[str, int, Optional[int]]: | |
""" | |
Word the hint for an area using natural sounding language. | |
This takes into account how much progression there is, how much of it is local/non-local, and whether there are | |
any local lasers to be found in this area. | |
""" | |
local_progression = sum(item.player == world.player and item.advancement for item in area_items) | |
non_local_progression = sum(item.player != world.player and item.advancement for item in area_items) | |
laser_names = {"Symmetry Laser", "Desert Laser", "Quarry Laser", "Shadows Laser", "Town Laser", "Monastery Laser", | |
"Jungle Laser", "Bunker Laser", "Swamp Laser", "Treehouse Laser", "Keep Laser", } | |
local_lasers = sum( | |
item.player == world.player and item.name in laser_names | |
for item in area_items | |
) | |
total_progression = non_local_progression + local_progression | |
player_count = world.multiworld.players | |
area_progression_word = "Both" if total_progression == 2 else "All" | |
hint_string = f"In the {hinted_area} area, you will find " | |
hunt_panels = None | |
if world.options.victory_condition == "panel_hunt": | |
hunt_panels = sum( | |
static_witness_logic.ENTITIES_BY_HEX[hunt_entity]["area"]["name"] == hinted_area | |
for hunt_entity in world.player_logic.HUNT_ENTITIES | |
) | |
if not hunt_panels: | |
hint_string += "no Hunt Panels and " | |
elif hunt_panels == 1: | |
hint_string += "1 Hunt Panel and " | |
else: | |
hint_string += f"{hunt_panels} Hunt Panels and " | |
if not total_progression: | |
hint_string += "no progression items." | |
elif total_progression == 1: | |
hint_string += "1 progression item." | |
if player_count > 1: | |
if local_lasers: | |
hint_string += "\nThis item is a laser for this world." | |
elif non_local_progression: | |
other_player_str = "the other player" if player_count == 2 else "another player" | |
hint_string += f"\nThis item is for {other_player_str}." | |
else: | |
hint_string += "\nThis item is for this world." | |
else: | |
if local_lasers: | |
hint_string += "\nThis item is a laser." | |
else: | |
hint_string += f"{total_progression} progression items." | |
if local_lasers == total_progression: | |
sentence_end = (" for this world." if player_count > 1 else ".") | |
hint_string += "\nAll of them are lasers" + sentence_end | |
elif player_count > 1: | |
if local_progression and non_local_progression: | |
if non_local_progression == 1: | |
other_player_str = "the other player" if player_count == 2 else "another player" | |
hint_string += f"\nOne of them is for {other_player_str}." | |
else: | |
other_player_str = "the other player" if player_count == 2 else "other players" | |
hint_string += f"\n{non_local_progression} of them are for {other_player_str}." | |
elif non_local_progression: | |
other_players_str = "the other player" if player_count == 2 else "other players" | |
hint_string += f"\n{area_progression_word} of them are for {other_players_str}." | |
elif local_progression: | |
hint_string += f"\n{area_progression_word} of them are for this world." | |
if local_lasers == 1: | |
if not non_local_progression: | |
hint_string += "\nAlso, one of them is a laser." | |
else: | |
hint_string += "\nAlso, one of them is a laser for this world." | |
elif local_lasers: | |
if not non_local_progression: | |
hint_string += f"\nAlso, {local_lasers} of them are lasers." | |
else: | |
hint_string += f"\nAlso, {local_lasers} of them are lasers for this world." | |
else: | |
if local_lasers == 1: | |
hint_string += "\nOne of them is a laser." | |
elif local_lasers: | |
hint_string += f"\n{local_lasers} of them are lasers." | |
return hint_string, total_progression, hunt_panels |
What is this fixing or adding?
Makes !status show a note if the slot is in Status Ready
How was this tested?
lightly,
running a server, connecting with text client, running !status, /ready, !status and seeing the output text change before/after setting ready
If this makes graphical changes, please attach screenshots.