Skip to content
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

Merged
merged 2 commits into from
Nov 30, 2024

Conversation

qwint
Copy link
Contributor

@qwint qwint commented Jun 29, 2024

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.

image

@github-actions github-actions bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Jun 29, 2024
@Exempt-Medic Exempt-Medic added the is: enhancement Issues requesting new features or pull requests implementing new features. label Jun 30, 2024
Copy link
Collaborator

@beauxq beauxq left a 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.

Copy link
Contributor

@nicholassaylor nicholassaylor left a 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,

@Exempt-Medic Exempt-Medic added waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer. and removed waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Aug 31, 2024
Copy link
Member

@NewSoupVi NewSoupVi left a 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

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
some time lol

@NewSoupVi NewSoupVi merged commit 845a604 into ArchipelagoMW:main Nov 30, 2024
17 checks passed
@qwint qwint deleted the cmd_status_ready branch November 30, 2024 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants