2023-11-24 05:27:03 +00:00
from typing import Tuple , List , TYPE_CHECKING
from BaseClasses import Item
if TYPE_CHECKING :
from . import WitnessWorld
2022-10-09 02:13:52 +00:00
joke_hints = [
2023-03-02 23:08:24 +00:00
" Quaternions break my brain " ,
" Eclipse has nothing, but you should do it anyway. " ,
" Beep " ,
" Putting in custom subtitles shouldn ' t have been as hard as it was... " ,
" BK mode is right around the corner. " ,
" You can do it! " ,
" I believe in you! " ,
" The person playing is cute. <3 " ,
Witness: Fix one of the hints not being a Haiku (seriously) (#2123)
I hope this gets a prize for "Most irrelevant PR in AP history"
Explanation:
When changing the hint system on the client side to be able to auto-wrap, decisions were made about which line breaks were still explicitly important, with most of them being removed.
This hint was somewhat devalued in the process.
-. --- - .... .. -. --. translates to "Nothing", which I thought was the entirety of the joke.
However, the line breaks were actually also important, because:
dash dot, dash dash dash,
dash, dot dot dot dot, dot dot,
dash dot, dash dash dot
is a Haiku! And the hint's creator (oddGarrett I believe) said this was specifically part of the creative vision for this joke hint. They said it's fine, I don't need to change it, but I couldn't let that stand.
So, the explicit line breaks for this joke hint are back.
2023-08-29 18:56:40 +00:00
" dash dot, dash dash dash, \n dash, dot dot dot dot, dot dot, \n dash dot, dash dash dot " ,
2023-03-02 23:08:24 +00:00
" When you think about it, there are actually a lot of bubbles in a stream. " ,
" Never gonna give you up \n Never gonna let you down \n Never gonna run around and desert you " ,
" Thanks to the Archipelago developers for making this possible. " ,
" Have you tried ChecksFinder? \n If you like puzzles, you might enjoy it! " ,
" Have you tried Dark Souls III? \n A tough game like this feels better when friends are helping you! " ,
" Have you tried Donkey Kong Country 3? \n A legendary game from a golden age of platformers! " ,
" Have you tried Factorio? \n Alone in an unknown multiworld. Sound familiar? " ,
" Have you tried Final Fantasy? \n Experience a classic game improved to fit modern standards! " ,
" Have you tried Hollow Knight? \n Another independent hit revolutionising a genre! " ,
" Have you tried A Link to the Past? \n The Archipelago game that started it all! " ,
" Have you tried Meritous? \n You should know that obscure games are often groundbreaking! " ,
" Have you tried Ocarina of Time? \n One of the biggest randomizers, big inspiration for this one ' s features! " ,
" Have you tried Raft? \n Haven ' t you always wanted to explore the ocean surrounding this island? " ,
" Have you tried Risk of Rain 2? \n I haven ' t either. But I hear it ' s incredible! " ,
2023-07-19 02:19:58 +00:00
" Have you tried Rogue Legacy? \n After solving so many puzzles it ' s the perfect way to rest your \" thinking \" brain. " ,
" Have you tried Secret of Evermore? \n I haven ' t either. But I hear it ' s great! " ,
2023-03-02 23:08:24 +00:00
" Have you tried Slay the Spire? \n Experience the thrill of combat without needing fast fingers! " ,
" Have you tried SMZ3? \n Why play one incredible game when you can play 2 at once? " ,
" Have you tried Starcraft 2? \n Use strategy and management to crush your enemies! " ,
" Have you tried Super Mario 64? \n 3-dimensional games like this owe everything to that game. " ,
" Have you tried Super Metroid? \n A classic game, yet still one of the best in the genre. " ,
" Have you tried Timespinner? \n Everyone who plays it ends up loving it! " ,
" Have you tried VVVVVV? \n Experience the essence of gaming distilled into its purest form! " ,
" Have you tried The Witness? \n Oh. I guess you already have. Thanks for playing! " ,
" Have you tried Super Mario World? \n I don ' t think I need to tell you that it is beloved by many. " ,
" Have you tried Overcooked 2? \n When you ' re done relaxing with puzzles, use your energy to yell at your friends. " ,
" Have you tried Zillion? \n Me neither. But it looks fun. So, let ' s try something new together? " ,
" Have you tried Hylics 2? \n Stop motion might just be the epitome of unique art styles. " ,
" Have you tried Pokemon Red&Blue? \n A cute pet collecting game that fascinated an entire generation. " ,
" Have you tried Lufia II? \n Roguelites are not just a 2010s phenomenon, turns out. " ,
" Have you tried Minecraft? \n I have recently learned this is a question that needs to be asked. " ,
" Have you tried Subnautica? \n If you like this game ' s lonely atmosphere, I would suggest you try it. " ,
" Have you tried Sonic Adventure 2? \n If the silence on this island is getting to you, "
" there aren ' t many games more energetic. " ,
" Waiting to get your items? \n Try BK Sudoku! Make progress even while stuck. " ,
2023-07-19 02:19:58 +00:00
" Have you tried Adventure? \n ...Holy crud, that game is 17 years older than me. " ,
" Have you tried Muse Dash? \n Rhythm game with cute girls! \n (Maybe skip if you don ' t like the Jungle panels) " ,
" Have you tried Clique? \n It ' s certainly a lot less complicated than this game! " ,
" Have you tried Bumper Stickers? \n Decades after its inception, people are still inventing unique twists on the match-3 genre. " ,
" Have you tried DLC Quest? \n I know you all like parody games. \n I got way too many requests to make a randomizer for \" The Looker \" . " ,
" Have you tried Doom? \n I wonder if a smart fridge can connect to Archipelago. " ,
" Have you tried Kingdom Hearts II? \n I ' ll wait for you to name a more epic crossover. " ,
" Have you tried Link ' s Awakening DX? \n Hopefully, Link won ' t be obsessed with circles when he wakes up. " ,
" Have you tried The Messenger? \n Old ideas made new again. It ' s how all art is made. " ,
" Have you tried Mega Man Battle Network 3? \n It ' s a Mega Man RPG. How could you not want to try that? " ,
" Have you tried Noita? \n If you like punishing yourself, you will like it. " ,
" Have you tried Stardew Valley? \n The Farming game that gave a damn. It ' s so easy to lose hours and days to it... " ,
" Have you tried The Legend of Zelda? \n In some sense, it was the starting point of \" adventure \" in video games. " ,
" Have you tried Undertale? \n I hope I ' m not the 10th person to ask you that. But it ' s, like, really good. " ,
" Have you tried Wargroove? \n I ' m glad that for every abandoned series, enough people are yearning for its return that one of them will know how to code. " ,
" Have you tried Blasphemous? \n You haven ' t? Blasphemy! \n ...Sorry. You should try it, though! " ,
2023-11-24 19:38:46 +00:00
" Have you tried Doom II? \n Got a good game on your hands? Just make it bigger and better. " ,
" Have you tried Lingo? \n It ' s an open world puzzle game. It features panels with non-verbally explained mechanics. \n If you like this game, you ' ll like Lingo too. " ,
" (Middle Yellow) \n YOU AILED OVERNIGHT \n H--- --- ----- -----? " ,
" Have you tried Bumper Stickers? \n Maybe after spending so much time on this island, you are longing for a simpler puzzle game. " ,
" Have you tried Pokemon Emerald? \n I ' m going to say it: 10/10, just the right amount of water. " ,
" Have you tried Terraria? \n A prime example of a survival sandbox game that beats the \" Wide as an ocean, deep as a puddle \" allegations. " ,
2023-07-19 02:19:58 +00:00
2023-03-02 23:08:24 +00:00
" One day I was fascinated by the subject of generation of waves by wind. " ,
" I don ' t like sandwiches. Why would you think I like sandwiches? Have you ever seen me with a sandwich? " ,
" Where are you right now? \n I ' m at soup! \n What do you mean you ' re at soup? " ,
" Remember to ask in the Archipelago Discord what the Functioning Brain does. " ,
" Don ' t use your puzzle skips, you might need them later. " ,
" For an extra challenge, try playing blindfolded. " ,
" Go to the top of the mountain and see if you can see your house. " ,
" Yellow = Red + Green \n Cyan = Green + Blue \n Magenta = Red + Blue " ,
" Maybe that panel really is unsolvable. " ,
" Did you make sure it was plugged in? " ,
" Do not look into laser with remaining eye. " ,
" Try pressing Space to jump. " ,
" The Witness is a Doom clone. \n Just replace the demons with puzzles " ,
" Test Hint please ignore " ,
" Shapers can never be placed outside the panel boundaries, even if subtracted. " ,
" The Keep laser panels use the same trick on both sides! " ,
" Can ' t get past a door? Try going around. Can ' t go around? Try building a nether portal. " ,
" We ' ve been trying to reach you about your car ' s extended warranty. " ,
" I hate this game. I hate this game. I hate this game. \n - Chess player Bobby Fischer " ,
" Dear Mario, \n Please come to the castle. I ' ve baked a cake for you! " ,
" Have you tried waking up? \n Yeah, me neither. " ,
" Why do they call it The Witness, when wit game the player view play of with the game. " ,
" THE WIND FISH IN NAME ONLY, FOR IT IS NEITHER " ,
" Like this game? \n Try The Wit.nes, Understand, INSIGHT, Taiji What the Witness?, and Tametsi. " ,
" In a race, It ' s survival of the Witnesst. " ,
" This hint has been removed. We apologize for your inconvenience. " ,
" O----------- " ,
" Circle is draw \n Square is separate \n Line is win " ,
" Circle is draw \n Star is pair \n Line is win " ,
" Circle is draw \n Circle is copy \n Line is win " ,
" Circle is draw \n Dot is eat \n Line is win " ,
" Circle is start \n Walk is draw \n Line is win " ,
" Circle is start \n Line is win \n Witness is you " ,
" Can ' t find any items? \n Consider a relaxing boat trip around the island! " ,
" Don ' t forget to like, comment, and subscribe. " ,
" Ah crap, gimme a second. \n [papers rustling] \n Sorry, nothing. " ,
" Trying to get a hint? Too bad. " ,
" Here ' s a hint: Get good at the game. " ,
" I ' m still not entirely sure what we ' re witnessing here. " ,
" Have you found a red page yet? No? Then have you found a blue page? " ,
" And here we see the Witness player, seeking answers where there are none- \n Did someone turn on the loudspeaker? " ,
2023-11-24 19:38:46 +00:00
" Be quiet. I can ' t hear the elevator. " ,
" Witness me. \n - The famous last words of John Witness. " ,
" It ' s okay, I always have to skip the Rotated Shaper puzzles too. " ,
" Alan please add hint. " ,
" Rumor has it there ' s an audio log with a hint nearby. " ,
" In the future, war will break out between obelisk_sides and individual EP players. \n Which side are you on? " ,
" Droplets: Low, High, Mid. \n Ambience: Mid, Low, Mid, High. " ,
" Name a better game involving lines. I ' ll wait. " ,
" \" You have to draw a line in the sand. \" \n - Arin \" Egoraptor \" Hanson " ,
" Have you tried? \n The puzzles tend to get easier if you do. " ,
" Sorry, I accidentally left my phone in the Jungle. \n And also all my fragile dishes. " ,
" Winner of the \" Most Irrelevant PR in AP History \" award! " ,
" I bet you wish this was a real hint :) " ,
" \" This hint is an impostor. \" - Junk hint submitted by T1mshady. \n ...wait, I ' m not supposed to say that part? " ,
" Wouldn ' t you like to know, weather buoy? " ,
" Give me a few minutes, I should have better material by then. " ,
" Just pet the doggy! You know you want to!!! " ,
" ceci n ' est pas une metroidvania " ,
" HINT is MELT \n YOU is HOT " ,
" Who ' s that behind you? " ,
" :3 " ,
" ^v ^^v> >>^>v \n ^^v>v ^v>> v>^> v>v^ " ,
" Statement #0162601, regarding a strange island that-- \n Oh, wait, sorry. I ' m not supposed to be here. " ,
" Hollow Bastion has 6 progression items. \n Or maybe it doesn ' t. \n I wouldn ' t know. " ,
" Set your hint count lower so I can tell you more jokes next time. " ,
" A non-edge start point is similar to a cat. \n It must be either inside or outside, it can ' t be both. " ,
" What if we kissed on the Bunker Laser Platform? \n Jk... unless? " ,
" You don ' t have Boat? Invisible boat time! \n You do have boat? Boat clipping time! " ,
" Cet indice est en français. Nous nous excusons de tout inconvénients engendrés par cela. " ,
" How many of you have personally witnessed a total solar eclipse? " ,
" In the Treehouse area, you will find \n [Error: Data not found] progression items. " ,
" Lingo \n Lingoing \n Lingone " ,
" The name of the captain was Albert Einstein. " ,
" Panel impossible Sigma plz fix " ,
" Welcome Back! (: " ,
" R R R U L L U L U R U R D R D R U U " ,
" Have you tried checking your tracker? " ,
" Hints suggested by: \n IHNN, Beaker, MrPokemon11, Ember, TheM8, NewSoupVi, Jasper Bird, T1mshady, "
" KF, Yoshi348, Berserker, BowlinJim, oddGarrett, Pink Switch, Rever, Ishigh, snolid. " ,
2022-10-09 02:13:52 +00:00
]
2023-12-10 19:36:55 +00:00
def get_always_hint_items ( world : " WitnessWorld " ) - > List [ str ] :
2023-06-20 22:45:26 +00:00
always = [
2022-10-09 02:13:52 +00:00
" Boat " ,
2023-11-24 05:27:03 +00:00
" Caves Shortcuts " ,
2023-02-01 20:18:07 +00:00
" Progressive Dots " ,
2022-10-09 02:13:52 +00:00
]
2023-11-24 05:27:03 +00:00
difficulty = world . options . puzzle_randomization
discards = world . options . shuffle_discarded_panels
wincon = world . options . victory_condition
2022-10-09 02:13:52 +00:00
if discards :
if difficulty == 1 :
2023-06-20 22:45:26 +00:00
always . append ( " Arrows " )
2022-10-09 02:13:52 +00:00
else :
2023-06-20 22:45:26 +00:00
always . append ( " Triangles " )
2022-10-09 02:13:52 +00:00
2023-06-20 22:45:26 +00:00
if wincon == 0 :
2023-11-24 05:27:03 +00:00
always + = [ " Mountain Bottom Floor Final Room Entry (Door) " , " Mountain Bottom Floor Doors " ]
if wincon == 1 :
always + = [ " Challenge Entry (Panel) " , " Caves Panels " ]
2023-06-20 22:45:26 +00:00
return always
2022-10-09 02:13:52 +00:00
2024-01-16 12:14:38 +00:00
def get_always_hint_locations ( world : " WitnessWorld " ) - > List [ str ] :
always = [
2022-10-09 02:13:52 +00:00
" Challenge Vault Box " ,
" Mountain Bottom Floor Discard " ,
2023-02-01 20:18:07 +00:00
" Theater Eclipse EP " ,
" Shipwreck Couch EP " ,
" Mountainside Cloud Cycle EP " ,
2023-12-10 19:36:55 +00:00
]
2022-10-09 02:13:52 +00:00
2024-01-16 12:14:38 +00:00
# Add Obelisk Sides that contain EPs that are meant to be hinted, if they are necessary to complete the Obelisk Side
if world . options . EP_difficulty == " eclipse " :
always . append ( " Town Obelisk Side 6 " ) # Eclipse EP
if world . options . EP_difficulty != " normal " :
always . append ( " Treehouse Obelisk Side 4 " ) # Couch EP
always . append ( " River Obelisk Side 1 " ) # Cloud Cycle EP. Needs to be changed to "Mountainside Obelisk" soon
return always
2022-10-09 02:13:52 +00:00
2023-12-10 19:36:55 +00:00
def get_priority_hint_items ( world : " WitnessWorld " ) - > List [ str ] :
2022-10-09 02:13:52 +00:00
priority = {
2023-06-20 22:45:26 +00:00
" Caves Mountain Shortcut (Door) " ,
" Caves Swamp Shortcut (Door) " ,
2022-10-09 02:13:52 +00:00
" Swamp Entry (Panel) " ,
" Swamp Laser Shortcut (Door) " ,
}
2023-11-24 05:27:03 +00:00
if world . options . shuffle_symbols :
symbols = [
" Progressive Dots " ,
" Progressive Stars " ,
" Shapers " ,
" Rotated Shapers " ,
" Negative Shapers " ,
" Arrows " ,
" Triangles " ,
" Eraser " ,
" Black/White Squares " ,
" Colored Squares " ,
" Colored Dots " ,
" Sound Dots " ,
" Symmetry "
]
priority . update ( world . random . sample ( symbols , 5 ) )
if world . options . shuffle_lasers :
2023-07-18 08:18:42 +00:00
lasers = [
2022-10-09 02:13:52 +00:00
" Symmetry Laser " ,
" Town Laser " ,
" Keep Laser " ,
" Swamp Laser " ,
" Treehouse Laser " ,
" Monastery Laser " ,
" Jungle Laser " ,
" Quarry Laser " ,
" Bunker Laser " ,
" Shadows Laser " ,
2023-07-18 08:18:42 +00:00
]
2022-10-09 02:13:52 +00:00
2023-11-24 05:27:03 +00:00
if world . options . shuffle_doors > = 2 :
2022-10-09 02:13:52 +00:00
priority . add ( " Desert Laser " )
2023-11-24 05:27:03 +00:00
priority . update ( world . random . sample ( lasers , 5 ) )
2022-10-09 02:13:52 +00:00
else :
2023-07-18 08:18:42 +00:00
lasers . append ( " Desert Laser " )
2023-11-24 05:27:03 +00:00
priority . update ( world . random . sample ( lasers , 6 ) )
2022-10-09 02:13:52 +00:00
2023-12-10 19:36:55 +00:00
return sorted ( priority )
2022-10-09 02:13:52 +00:00
2024-01-16 12:14:38 +00:00
def get_priority_hint_locations ( world : " WitnessWorld " ) - > List [ str ] :
priority = [
2023-06-20 22:45:26 +00:00
" Swamp Purple Underwater " ,
" Shipwreck Vault Box " ,
2022-10-09 02:13:52 +00:00
" Town RGB Room Left " ,
" Town RGB Room Right " ,
" Treehouse Green Bridge 7 " ,
" Treehouse Green Bridge Discard " ,
" Shipwreck Discard " ,
" Desert Vault Box " ,
" Mountainside Vault Box " ,
" Mountainside Discard " ,
2023-02-01 20:18:07 +00:00
" Tunnels Theater Flowers EP " ,
" Boat Shipwreck Green EP " ,
2023-07-09 12:21:05 +00:00
" Quarry Stoneworks Control Room Left " ,
2023-12-10 19:36:55 +00:00
]
2024-01-16 12:14:38 +00:00
# Add Obelisk Sides that contain EPs that are meant to be hinted, if they are necessary to complete the Obelisk Side
if world . options . EP_difficulty != " normal " :
priority . append ( " Town Obelisk Side 6 " ) # Theater Flowers EP
priority . append ( " Treehouse Obelisk Side 4 " ) # Shipwreck Green EP
return priority
2022-10-09 02:13:52 +00:00
2023-11-24 05:27:03 +00:00
def make_hint_from_item ( world : " WitnessWorld " , item_name : str , own_itempool : List [ Item ] ) :
locations = [ item . location for item in own_itempool if item . name == item_name and item . location ]
if not locations :
return None
location_obj = world . random . choice ( locations )
2022-10-09 02:13:52 +00:00
location_name = location_obj . name
2023-11-24 05:27:03 +00:00
if location_obj . player != world . player :
location_name + = " ( " + world . multiworld . get_player_name ( location_obj . player ) + " ) "
return location_name , item_name , location_obj . address if ( location_obj . player == world . player ) else - 1
2022-10-09 02:13:52 +00:00
2023-11-24 05:27:03 +00:00
def make_hint_from_location ( world : " WitnessWorld " , location : str ) :
location_obj = world . multiworld . get_location ( location , world . player )
item_obj = world . multiworld . get_location ( location , world . player ) . item
2022-10-09 02:13:52 +00:00
item_name = item_obj . name
2023-11-24 05:27:03 +00:00
if item_obj . player != world . player :
item_name + = " ( " + world . multiworld . get_player_name ( item_obj . player ) + " ) "
2022-10-09 02:13:52 +00:00
2023-11-24 05:27:03 +00:00
return location , item_name , location_obj . address if ( location_obj . player == world . player ) else - 1
2022-10-09 02:13:52 +00:00
2023-11-24 05:27:03 +00:00
def make_hints ( world : " WitnessWorld " , hint_amount : int , own_itempool : List [ Item ] ) :
2022-10-09 02:13:52 +00:00
hints = list ( )
prog_items_in_this_world = {
2023-11-24 05:27:03 +00:00
item . name for item in own_itempool if item . advancement and item . code and item . location
2022-10-09 02:13:52 +00:00
}
loc_in_this_world = {
2023-11-24 05:27:03 +00:00
location . name for location in world . multiworld . get_locations ( world . player ) if location . address
2022-10-09 02:13:52 +00:00
}
always_locations = [
2023-11-24 05:27:03 +00:00
location for location in get_always_hint_locations ( world )
2022-10-09 02:13:52 +00:00
if location in loc_in_this_world
]
always_items = [
2023-11-24 05:27:03 +00:00
item for item in get_always_hint_items ( world )
2022-10-09 02:13:52 +00:00
if item in prog_items_in_this_world
]
priority_locations = [
2023-11-24 05:27:03 +00:00
location for location in get_priority_hint_locations ( world )
2022-10-09 02:13:52 +00:00
if location in loc_in_this_world
]
priority_items = [
2023-11-24 05:27:03 +00:00
item for item in get_priority_hint_items ( world )
2022-10-09 02:13:52 +00:00
if item in prog_items_in_this_world
]
always_hint_pairs = dict ( )
for item in always_items :
2023-11-24 05:27:03 +00:00
hint_pair = make_hint_from_item ( world , item , own_itempool )
2023-02-01 20:18:07 +00:00
2023-11-24 05:27:03 +00:00
if not hint_pair or hint_pair [ 2 ] == 158007 : # Tutorial Gate Open
2023-02-01 20:18:07 +00:00
continue
2022-10-09 02:13:52 +00:00
always_hint_pairs [ hint_pair [ 0 ] ] = ( hint_pair [ 1 ] , True , hint_pair [ 2 ] )
for location in always_locations :
2023-11-24 05:27:03 +00:00
hint_pair = make_hint_from_location ( world , location )
2022-10-09 02:13:52 +00:00
always_hint_pairs [ hint_pair [ 0 ] ] = ( hint_pair [ 1 ] , False , hint_pair [ 2 ] )
priority_hint_pairs = dict ( )
for item in priority_items :
2023-11-24 05:27:03 +00:00
hint_pair = make_hint_from_item ( world , item , own_itempool )
2023-02-01 20:18:07 +00:00
2023-11-24 05:27:03 +00:00
if not hint_pair or hint_pair [ 2 ] == 158007 : # Tutorial Gate Open
2023-02-01 20:18:07 +00:00
continue
2022-10-09 02:13:52 +00:00
priority_hint_pairs [ hint_pair [ 0 ] ] = ( hint_pair [ 1 ] , True , hint_pair [ 2 ] )
for location in priority_locations :
2023-11-24 05:27:03 +00:00
hint_pair = make_hint_from_location ( world , location )
2022-10-09 02:13:52 +00:00
priority_hint_pairs [ hint_pair [ 0 ] ] = ( hint_pair [ 1 ] , False , hint_pair [ 2 ] )
2023-11-24 05:27:03 +00:00
already_hinted_locations = set ( )
2022-10-09 02:13:52 +00:00
for loc , item in always_hint_pairs . items ( ) :
2023-11-24 05:27:03 +00:00
if loc in already_hinted_locations :
continue
2022-10-09 02:13:52 +00:00
if item [ 1 ] :
2023-03-02 23:08:24 +00:00
hints . append ( ( f " { item [ 0 ] } can be found at { loc } . " , item [ 2 ] ) )
2022-10-09 02:13:52 +00:00
else :
2023-03-02 23:08:24 +00:00
hints . append ( ( f " { loc } contains { item [ 0 ] } . " , item [ 2 ] ) )
2022-10-09 02:13:52 +00:00
2023-11-24 05:27:03 +00:00
already_hinted_locations . add ( loc )
world . random . shuffle ( hints ) # shuffle always hint order in case of low hint amount
2023-02-01 20:18:07 +00:00
2023-06-20 22:45:26 +00:00
remaining_hints = hint_amount - len ( hints )
priority_hint_amount = int ( max ( 0.0 , min ( len ( priority_hint_pairs ) / 2 , remaining_hints / 2 ) ) )
2022-10-09 02:13:52 +00:00
2023-12-10 19:36:55 +00:00
prog_items_in_this_world = sorted ( prog_items_in_this_world )
locations_in_this_world = sorted ( loc_in_this_world )
2022-10-09 02:13:52 +00:00
2023-11-24 05:27:03 +00:00
world . random . shuffle ( prog_items_in_this_world )
world . random . shuffle ( locations_in_this_world )
2022-10-09 02:13:52 +00:00
2023-06-20 22:45:26 +00:00
priority_hint_list = list ( priority_hint_pairs . items ( ) )
2023-11-24 05:27:03 +00:00
world . random . shuffle ( priority_hint_list )
2023-06-20 22:45:26 +00:00
for _ in range ( 0 , priority_hint_amount ) :
next_priority_hint = priority_hint_list . pop ( )
loc = next_priority_hint [ 0 ]
item = next_priority_hint [ 1 ]
2023-11-24 05:27:03 +00:00
if loc in already_hinted_locations :
continue
2023-06-20 22:45:26 +00:00
if item [ 1 ] :
hints . append ( ( f " { item [ 0 ] } can be found at { loc } . " , item [ 2 ] ) )
else :
hints . append ( ( f " { loc } contains { item [ 0 ] } . " , item [ 2 ] ) )
2022-10-09 02:13:52 +00:00
2023-11-24 05:27:03 +00:00
already_hinted_locations . add ( loc )
next_random_hint_is_item = world . random . randrange ( 0 , 2 )
2023-06-20 22:45:26 +00:00
while len ( hints ) < hint_amount :
2022-10-09 02:13:52 +00:00
if next_random_hint_is_item :
if not prog_items_in_this_world :
next_random_hint_is_item = not next_random_hint_is_item
continue
2023-11-24 05:27:03 +00:00
hint = make_hint_from_item ( world , prog_items_in_this_world . pop ( ) , own_itempool )
if not hint or hint [ 0 ] in already_hinted_locations :
continue
2023-03-02 23:08:24 +00:00
hints . append ( ( f " { hint [ 1 ] } can be found at { hint [ 0 ] } . " , hint [ 2 ] ) )
2023-11-24 05:27:03 +00:00
already_hinted_locations . add ( hint [ 0 ] )
2022-10-09 02:13:52 +00:00
else :
2023-11-24 05:27:03 +00:00
hint = make_hint_from_location ( world , locations_in_this_world . pop ( ) )
if hint [ 0 ] in already_hinted_locations :
continue
2023-03-02 23:08:24 +00:00
hints . append ( ( f " { hint [ 0 ] } contains { hint [ 1 ] } . " , hint [ 2 ] ) )
2022-10-09 02:13:52 +00:00
2023-11-24 05:27:03 +00:00
already_hinted_locations . add ( hint [ 0 ] )
2022-10-09 02:13:52 +00:00
next_random_hint_is_item = not next_random_hint_is_item
return hints
2023-11-24 05:27:03 +00:00
def generate_joke_hints ( world : " WitnessWorld " , amount : int ) - > List [ Tuple [ str , int ] ] :
return [ ( x , - 1 ) for x in world . random . sample ( joke_hints , amount ) ]