| 
									
										
										
										
											2022-03-13 04:04:12 -04:00
										 |  |  | from BaseClasses import MultiWorld | 
					
						
							|  |  |  | from ..AutoWorld import LogicMixin | 
					
						
							|  |  |  | from ..generic.Rules import set_rule | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ArchipIDLELogic(LogicMixin): | 
					
						
							|  |  |  |     def _archipidle_location_is_accessible(self, player_id, items_required): | 
					
						
							|  |  |  |         items_received = 0 | 
					
						
							|  |  |  |         for item in self.prog_items: | 
					
						
							|  |  |  |             if item[1] == player_id: | 
					
						
							|  |  |  |                 items_received += 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return items_received >= items_required | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def set_rules(world: MultiWorld, player: int): | 
					
						
							| 
									
										
										
										
											2022-03-13 15:31:27 -04:00
										 |  |  |     for i in range(16, 31): | 
					
						
							| 
									
										
										
										
											2022-03-13 04:04:12 -04:00
										 |  |  |         set_rule( | 
					
						
							| 
									
										
										
										
											2023-03-29 21:27:35 -04:00
										 |  |  |             world.get_location(f"IDLE item number {i}", player), | 
					
						
							| 
									
										
										
										
											2022-03-13 04:04:12 -04:00
										 |  |  |             lambda state: state._archipidle_location_is_accessible(player, 4) | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     for i in range(31, 51): | 
					
						
							|  |  |  |         set_rule( | 
					
						
							| 
									
										
										
										
											2023-03-29 21:27:35 -04:00
										 |  |  |             world.get_location(f"IDLE item number {i}", player), | 
					
						
							| 
									
										
										
										
											2022-03-13 15:31:27 -04:00
										 |  |  |             lambda state: state._archipidle_location_is_accessible(player, 10) | 
					
						
							| 
									
										
										
										
											2022-03-13 04:04:12 -04:00
										 |  |  |         ) | 
					
						
							| 
									
										
										
										
											2022-03-13 14:37:56 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     for i in range(51, 101): | 
					
						
							|  |  |  |         set_rule( | 
					
						
							| 
									
										
										
										
											2023-03-29 21:27:35 -04:00
										 |  |  |             world.get_location(f"IDLE item number {i}", player), | 
					
						
							| 
									
										
										
										
											2022-03-13 15:31:27 -04:00
										 |  |  |             lambda state: state._archipidle_location_is_accessible(player, 20) | 
					
						
							| 
									
										
										
										
											2022-03-13 14:37:56 -04:00
										 |  |  |         ) | 
					
						
							| 
									
										
										
										
											2023-02-23 20:16:10 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-29 21:27:35 -04:00
										 |  |  |     for i in range(101, 201): | 
					
						
							|  |  |  |         set_rule( | 
					
						
							|  |  |  |             world.get_location(f"IDLE item number {i}", player), | 
					
						
							|  |  |  |             lambda state: state._archipidle_location_is_accessible(player, 40) | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-23 20:16:10 -06:00
										 |  |  |     world.completion_condition[player] =\ | 
					
						
							|  |  |  |         lambda state:\ | 
					
						
							| 
									
										
										
										
											2023-03-29 21:27:35 -04:00
										 |  |  |         state.can_reach(world.get_location("IDLE item number 200", player), "Location", player) |