| 
									
										
										
										
											2022-01-23 21:34:30 +01:00
										 |  |  | import string | 
					
						
							|  |  |  | from .Items import item_table, SM64Item | 
					
						
							|  |  |  | from .Locations import location_table, SM64Location | 
					
						
							|  |  |  | from .Options import sm64_options | 
					
						
							|  |  |  | from .Rules import set_rules | 
					
						
							|  |  |  | from .Regions import create_regions | 
					
						
							|  |  |  | from BaseClasses import Region, RegionType, Entrance, Item, MultiWorld | 
					
						
							|  |  |  | from ..AutoWorld import World | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | client_version = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SM64World(World): | 
					
						
							|  |  |  |     """ 
 | 
					
						
							| 
									
										
										
										
											2022-01-23 21:45:43 +01:00
										 |  |  |     The first Super Mario game to feature 3D gameplay, it features freedom of movement within a large open world based on polygons, | 
					
						
							|  |  |  |     combined with traditional Mario gameplay, visual style, and characters. | 
					
						
							| 
									
										
										
										
											2022-01-23 21:34:30 +01:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     game: str = "Super Mario 64" | 
					
						
							|  |  |  |     topology_present = False | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     item_name_to_id = item_table | 
					
						
							|  |  |  |     location_name_to_id = location_table | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-30 19:12:52 +01:00
										 |  |  |     data_version = 4 | 
					
						
							| 
									
										
										
										
											2022-01-23 21:34:30 +01:00
										 |  |  |     forced_auto_forfeit = False | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     options = sm64_options | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def create_regions(self): | 
					
						
							|  |  |  |         create_regions(self.world,self.player) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def set_rules(self): | 
					
						
							|  |  |  |         set_rules(self.world,self.player) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def create_item(self, name: str) -> Item: | 
					
						
							|  |  |  |         item_id = item_table[name] | 
					
						
							| 
									
										
										
										
											2022-01-30 19:12:52 +01:00
										 |  |  |         item = SM64Item(name, name != "1Up Mushroom", item_id, self.player) | 
					
						
							| 
									
										
										
										
											2022-01-23 21:34:30 +01:00
										 |  |  |         return item | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def generate_basic(self): | 
					
						
							| 
									
										
										
										
											2022-01-27 11:14:17 +01:00
										 |  |  |         staritem = self.create_item("Power Star") | 
					
						
							| 
									
										
										
										
											2022-01-30 19:12:52 +01:00
										 |  |  |         starcount = self.world.StarsToFinish[self.player].value + self.world.ExtraStars[self.player].value | 
					
						
							|  |  |  |         if (self.world.EnableCoinStars[self.player].value and (starcount-15) >= self.world.StarsToFinish[self.player].value): | 
					
						
							|  |  |  |             starcount -= 15 | 
					
						
							|  |  |  |         self.world.itempool += [staritem for i in range(0,starcount)] | 
					
						
							|  |  |  |         mushroomitem = self.create_item("1Up Mushroom")  | 
					
						
							|  |  |  |         self.world.itempool += [mushroomitem for i in range(starcount,120)] | 
					
						
							| 
									
										
										
										
											2022-01-23 21:34:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-27 11:14:17 +01:00
										 |  |  |         key1 = self.create_item("Basement Key") | 
					
						
							| 
									
										
										
										
											2022-01-23 21:34:30 +01:00
										 |  |  |         key2 = self.create_item("Second Floor Key") | 
					
						
							|  |  |  |         self.world.itempool += [key1,key2] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         wingcap = self.create_item("Wing Cap") | 
					
						
							|  |  |  |         metalcap = self.create_item("Metal Cap") | 
					
						
							|  |  |  |         vanishcap = self.create_item("Vanish Cap") | 
					
						
							|  |  |  |         self.world.itempool += [wingcap,metalcap,vanishcap] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def fill_slot_data(self): | 
					
						
							|  |  |  |         return { | 
					
						
							|  |  |  |             "StarsToFinish": self.world.StarsToFinish[self.player].value | 
					
						
							|  |  |  |         } |