| 
									
										
										
										
											2022-05-18 17:27:38 -04:00
										 |  |  | from BaseClasses import MultiWorld | 
					
						
							| 
									
										
										
										
											2022-10-01 15:24:05 +02:00
										 |  |  | from worlds.AutoWorld import LogicMixin | 
					
						
							| 
									
										
										
										
											2022-05-18 17:27:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SC2WoLLogic(LogicMixin): | 
					
						
							|  |  |  |     def _sc2wol_has_common_unit(self, world: MultiWorld, player: int) -> bool: | 
					
						
							|  |  |  |         return self.has_any({'Marine', 'Marauder', 'Firebat', 'Hellion', 'Vulture'}, player) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def _sc2wol_has_bunker_unit(self, world: MultiWorld, player: int) -> bool: | 
					
						
							|  |  |  |         return self.has_any({'Marine', 'Marauder'}, player) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def _sc2wol_has_air(self, world: MultiWorld, player: int) -> bool: | 
					
						
							| 
									
										
										
										
											2022-08-19 13:50:44 -07:00
										 |  |  |         return self.has_any({'Viking', 'Wraith', 'Banshee'}, player) or \ | 
					
						
							|  |  |  |                self.has_any({'Hercules', 'Medivac'}, player) and self._sc2wol_has_common_unit(world, player) | 
					
						
							| 
									
										
										
										
											2022-05-18 17:27:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def _sc2wol_has_air_anti_air(self, world: MultiWorld, player: int) -> bool: | 
					
						
							|  |  |  |         return self.has_any({'Viking', 'Wraith'}, player) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-19 13:50:44 -07:00
										 |  |  |     def _sc2wol_has_competent_anti_air(self, world: MultiWorld, player: int) -> bool: | 
					
						
							| 
									
										
										
										
											2022-05-18 17:27:38 -04:00
										 |  |  |         return self.has_any({'Marine', 'Goliath'}, player) or self._sc2wol_has_air_anti_air(world, player) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def _sc2wol_has_anti_air(self, world: MultiWorld, player: int) -> bool: | 
					
						
							| 
									
										
										
										
											2022-08-19 13:50:44 -07:00
										 |  |  |         return self.has_any({'Missile Turret', 'Thor', 'War Pigs', 'Spartan Company', "Hel's Angel", 'Battlecruiser'}, player) or self._sc2wol_has_competent_anti_air(world, player) | 
					
						
							| 
									
										
										
										
											2022-05-18 17:27:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def _sc2wol_has_heavy_defense(self, world: MultiWorld, player: int) -> bool: | 
					
						
							|  |  |  |         return (self.has_any({'Siege Tank', 'Vulture'}, player) or | 
					
						
							|  |  |  |                 self.has('Bunker', player) and self._sc2wol_has_bunker_unit(world, player)) and \ | 
					
						
							|  |  |  |                self._sc2wol_has_anti_air(world, player) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-20 20:47:16 -04:00
										 |  |  |     def _sc2wol_has_competent_comp(self, world: MultiWorld, player: int) -> bool: | 
					
						
							|  |  |  |         return (self.has('Marine', player) or self.has('Marauder', player) and | 
					
						
							| 
									
										
										
										
											2022-08-19 13:50:44 -07:00
										 |  |  |                 self._sc2wol_has_competent_anti_air(world, player)) and self.has_any({'Medivac', 'Medic'}, player) or \ | 
					
						
							|  |  |  |                self.has('Thor', player) or self.has("Banshee", player) and self._sc2wol_has_competent_anti_air(world, player) or \ | 
					
						
							|  |  |  |                self.has('Battlecruiser', player) and self._sc2wol_has_common_unit(world, player) or \ | 
					
						
							|  |  |  |                self.has('Siege Tank', player) and self._sc2wol_has_competent_anti_air(world, player) | 
					
						
							| 
									
										
										
										
											2022-05-20 20:47:16 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-18 17:27:38 -04:00
										 |  |  |     def _sc2wol_has_train_killers(self, world: MultiWorld, player: int) -> bool: | 
					
						
							|  |  |  |         return (self.has_any({'Siege Tank', 'Diamondback'}, player) or | 
					
						
							| 
									
										
										
										
											2022-08-19 13:50:44 -07:00
										 |  |  |                 self.has_all({'Reaper', "G-4 Clusterbomb"}, player) or self.has_all({'Spectre', 'Psionic Lash'}, player) | 
					
						
							|  |  |  |                 or self.has('Marauders', player)) | 
					
						
							| 
									
										
										
										
											2022-05-18 17:27:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def _sc2wol_able_to_rescue(self, world: MultiWorld, player: int) -> bool: | 
					
						
							| 
									
										
										
										
											2022-08-08 23:20:18 +02:00
										 |  |  |         return self.has_any({'Medivac', 'Hercules', 'Raven', 'Viking'}, player) | 
					
						
							| 
									
										
										
										
											2022-05-18 17:27:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def _sc2wol_has_protoss_common_units(self, world: MultiWorld, player: int) -> bool: | 
					
						
							|  |  |  |         return self.has_any({'Zealot', 'Immortal', 'Stalker', 'Dark Templar'}, player) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def _sc2wol_has_protoss_medium_units(self, world: MultiWorld, player: int) -> bool: | 
					
						
							|  |  |  |         return self._sc2wol_has_protoss_common_units(world, player) and \ | 
					
						
							|  |  |  |                self.has_any({'Stalker', 'Void Ray', 'Phoenix', 'Carrier'}, player) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-19 13:50:44 -07:00
										 |  |  |     def _sc2wol_beats_protoss_deathball(self, world: MultiWorld, player: int) -> bool: | 
					
						
							|  |  |  |         return self.has_any({'Banshee', 'Battlecruiser'}, player) and self._sc2wol_has_competent_anti_air or \ | 
					
						
							|  |  |  |                self._sc2wol_has_competent_comp(world, player) and self._sc2wol_has_air_anti_air(world, player) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-18 17:27:38 -04:00
										 |  |  |     def _sc2wol_cleared_missions(self, world: MultiWorld, player: int, mission_count: int) -> bool: | 
					
						
							|  |  |  |         return self.has_group("Missions", player, mission_count) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 |