| 
									
										
										
										
											2021-07-12 15:11:48 +02:00
										 |  |  | """Module extending BaseClasses.py for aLttP""" | 
					
						
							|  |  |  | from typing import Optional | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from BaseClasses import Location, Item | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ALttPLocation(Location): | 
					
						
							|  |  |  |     game: str = "A Link to the Past" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def __init__(self, player: int, name: str = '', address=None, crystal: bool = False, | 
					
						
							|  |  |  |                  hint_text: Optional[str] = None, parent=None, | 
					
						
							|  |  |  |                  player_address=None): | 
					
						
							|  |  |  |         super(ALttPLocation, self).__init__(player, name, address, parent) | 
					
						
							|  |  |  |         self.crystal = crystal | 
					
						
							|  |  |  |         self.player_address = player_address | 
					
						
							|  |  |  |         self._hint_text: str = hint_text | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ALttPItem(Item): | 
					
						
							|  |  |  |     game: str = "A Link to the Past" | 
					
						
							| 
									
										
										
										
											2021-08-30 16:31:56 +02:00
										 |  |  |     dungeon = None | 
					
						
							| 
									
										
										
										
											2021-07-12 15:11:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-29 05:21:33 +02:00
										 |  |  |     def __init__(self, name, player, advancement=False, type=None, item_code=None, pedestal_hint=None, | 
					
						
							|  |  |  |                  pedestal_credit=None, sick_kid_credit=None, zora_credit=None, witch_credit=None, | 
					
						
							|  |  |  |                  flute_boy_credit=None, hint_text=None, trap=False): | 
					
						
							| 
									
										
										
										
											2021-07-12 15:11:48 +02:00
										 |  |  |         super(ALttPItem, self).__init__(name, advancement, item_code, player) | 
					
						
							|  |  |  |         self.type = type | 
					
						
							|  |  |  |         self._pedestal_hint_text = pedestal_hint | 
					
						
							|  |  |  |         self.pedestal_credit_text = pedestal_credit | 
					
						
							|  |  |  |         self.sickkid_credit_text = sick_kid_credit | 
					
						
							|  |  |  |         self.zora_credit_text = zora_credit | 
					
						
							|  |  |  |         self.magicshop_credit_text = witch_credit | 
					
						
							|  |  |  |         self.fluteboy_credit_text = flute_boy_credit | 
					
						
							| 
									
										
										
										
											2021-08-28 12:56:52 +02:00
										 |  |  |         self._hint_text = hint_text | 
					
						
							| 
									
										
										
										
											2021-09-29 05:21:33 +02:00
										 |  |  |         if trap: | 
					
						
							|  |  |  |             self.trap = trap | 
					
						
							| 
									
										
										
										
											2021-08-28 12:56:52 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							|  |  |  |     def crystal(self) -> bool: | 
					
						
							|  |  |  |         return self.type == 'Crystal' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							|  |  |  |     def smallkey(self) -> bool: | 
					
						
							|  |  |  |         return self.type == 'SmallKey' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							|  |  |  |     def bigkey(self) -> bool: | 
					
						
							|  |  |  |         return self.type == 'BigKey' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							|  |  |  |     def map(self) -> bool: | 
					
						
							|  |  |  |         return self.type == 'Map' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							|  |  |  |     def compass(self) -> bool: | 
					
						
							|  |  |  |         return self.type == 'Compass' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							|  |  |  |     def dungeon_item(self) -> Optional[str]: | 
					
						
							| 
									
										
										
										
											2021-08-30 16:31:56 +02:00
										 |  |  |         if self.type in {"SmallKey", "BigKey", "Map", "Compass"}: | 
					
						
							| 
									
										
										
										
											2021-08-28 12:56:52 +02:00
										 |  |  |             return self.type | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							| 
									
										
										
										
											2021-08-30 16:31:56 +02:00
										 |  |  |     def locked_dungeon_item(self): | 
					
						
							|  |  |  |         return self.location.locked and self.dungeon_item |