forked from mirror/Archipelago
The Witness: Fix CreateHints spoiling vague hints (#5359)
* Encode non-local vague hints as negative player number * comments * also bump req client version
This commit is contained in:
@@ -81,7 +81,7 @@ class WitnessWorld(World):
|
||||
item_name_groups = static_witness_items.ITEM_GROUPS
|
||||
location_name_groups = static_witness_locations.AREA_LOCATION_GROUPS
|
||||
|
||||
required_client_version = (0, 6, 0)
|
||||
required_client_version = (0, 6, 4)
|
||||
|
||||
player_logic: WitnessPlayerLogic
|
||||
player_locations: WitnessPlayerLocations
|
||||
|
||||
@@ -705,6 +705,8 @@ def get_compact_hint_args(hint: WitnessWordedHint, local_player_number: int) ->
|
||||
|
||||
Area Hint: 1st Arg is the amount of area progression and hunt panels. 2nd Arg is the name of the area.
|
||||
Location Hint: 1st Arg is the location's address, second arg is the player number the location belongs to.
|
||||
In case of a local vague hint, the second arg is a string with the containing location group.
|
||||
In case of a nonlocal vague hint, the second arg is the *negative* player number.
|
||||
Junk Hint: 1st Arg is -1, second arg is this slot's player number.
|
||||
"""
|
||||
|
||||
@@ -724,10 +726,13 @@ def get_compact_hint_args(hint: WitnessWordedHint, local_player_number: int) ->
|
||||
|
||||
# Is location hint
|
||||
if location and location.address is not None:
|
||||
if hint.vague_location_hint and location.player == local_player_number:
|
||||
assert hint.area is not None # A local vague location hint should have an area argument
|
||||
return location.address, "containing_area:" + hint.area
|
||||
return location.address, location.player # Scouting does not matter for other players (currently)
|
||||
if hint.vague_location_hint:
|
||||
if location.player == local_player_number:
|
||||
assert hint.area is not None # A local vague location hint should have an area argument
|
||||
return location.address, "containing_area:" + hint.area
|
||||
return location.address, - location.player # Encode non-local vague hint as negative player number
|
||||
|
||||
return location.address, location.player
|
||||
|
||||
# Is junk / undefined hint
|
||||
return -1, local_player_number
|
||||
|
||||
Reference in New Issue
Block a user