diff --git a/game/db.py b/game/db.py index 5275e4f7..de3cc37b 100644 --- a/game/db.py +++ b/game/db.py @@ -371,7 +371,7 @@ PLANE_PAYLOAD_OVERRIDES = { M_2000C: { CAP: "Combat Air Patrol", - GroundAttack: "MK-82 Heavy Strike", + GroundAttack: "MK-82S Heavy Strike", }, MiG_21Bis: { diff --git a/game/operation/navalintercept.py b/game/operation/navalintercept.py index 94c479e1..e782c759 100644 --- a/game/operation/navalintercept.py +++ b/game/operation/navalintercept.py @@ -50,7 +50,7 @@ class NavalInterceptionOperation(Operation): self.briefinggen.title = "Naval Intercept" if self.game.player == self.attacker_name: self.briefinggen.description = "Destroy supply transport ships. Lowers target strength. Be advised that your flight will not attack anything until you explicitly tell them so by comms menu." - for unit_type, count in self.targets: + for unit_type, count in self.targets.items(): self.briefinggen.append_target("{} ({})".format(db.unit_type_name(unit_type), count)) else: self.briefinggen.description = "Protect supply transport ships." diff --git a/game/operation/strike.py b/game/operation/strike.py index ff605ccf..eaf5ee4b 100644 --- a/game/operation/strike.py +++ b/game/operation/strike.py @@ -46,7 +46,7 @@ class StrikeOperation(Operation): if global_cp == self.from_cp and not self.is_quick: self.attackers_starting_position = ship - targets = [] # type: typing.List[typing.Tuple[str, Point]] + targets = [] # type: typing.List[typing.Tuple[str, str, Point]] category_counters = {} # type: typing.Dict[str, int] processed_groups = [] for object in self.to_cp.ground_objects: @@ -56,16 +56,16 @@ class StrikeOperation(Operation): processed_groups.append(object.group_identifier) category_counters[object.category] = category_counters.get(object.category, 0) + 1 markpoint_name = "{}{}".format(object.name_abbrev, category_counters[object.category]) - targets.append((markpoint_name, object.position)) + targets.append((str(object), markpoint_name, object.position)) - targets.sort(key=lambda x: self.from_cp.position.distance_to_point(x[1])) + targets.sort(key=lambda x: self.from_cp.position.distance_to_point(x[2])) - for (name, markpoint_name) in targets: + for (name, markpoint_name, _) in targets: self.briefinggen.append_waypoint("TARGET {} (TP {})".format(str(name), markpoint_name)) planes_flights = {k: v for k, v in self.strikegroup.items() if k in plane_map.values()} self.airgen.generate_ground_attack_strikegroup(*assigned_units_split(planes_flights), - targets=targets, + targets=[(mp, pos) for (n, mp, pos) in targets], at=self.attackers_starting_position) heli_flights = {k: v for k, v in self.strikegroup.items() if k in helicopters.helicopter_map.values()} @@ -74,7 +74,7 @@ class StrikeOperation(Operation): for farp, dict in zip(self.groundobjectgen.generate_farps(sum([x[0] for x in heli_flights.values()])), db.assignedunits_split_to_count(heli_flights, self.groundobjectgen.FARP_CAPACITY)): self.airgen.generate_ground_attack_strikegroup(*assigned_units_split(dict), - targets=targets, + targets=[(mp, pos) for (n, mp, pos) in targets], at=farp, escort=len(planes_flights) == 0) diff --git a/gen/briefinggen.py b/gen/briefinggen.py index 8966f6ff..edff117f 100644 --- a/gen/briefinggen.py +++ b/gen/briefinggen.py @@ -58,6 +58,6 @@ class BriefingGenerator: if self.waypoints: description += "\n\nWAYPOINTS:" for i, descr in enumerate(self.waypoints): - description += "\n#{}: {}".format(i+1, descr) + description += "\n#{}: {}".format(i, descr) self.m.set_description_text(description) diff --git a/gen/conflictgen.py b/gen/conflictgen.py index 93744958..f1f4f70e 100644 --- a/gen/conflictgen.py +++ b/gen/conflictgen.py @@ -166,7 +166,7 @@ class Conflict: if ground_position: return ground_position, _opposite_heading(attack_heading) else: - print("Coudn't find frontline position between {} and {}!".format(from_cp, to_cp)) + logging.warning("Coudn't find frontline position between {} and {}!".format(from_cp, to_cp)) return position, _opposite_heading(attack_heading) diff --git a/gen/environmentgen.py b/gen/environmentgen.py index c007b107..9deadb8d 100644 --- a/gen/environmentgen.py +++ b/gen/environmentgen.py @@ -30,9 +30,9 @@ RANDOM_TIME = { RANDOM_WEATHER = { 1: 0, # heavy rain - 2: 10, # rain - 3: 20, # dynamic - 4: 30, # clear + 2: 5, # rain + 3: 15, # dynamic + 4: 40, # clear 5: 100, # random } @@ -49,7 +49,8 @@ class EnviromentGenerator: self.game = game def _gen_random_time(self): - start_time = datetime.fromtimestamp(1527206400) + start_time = datetime.strptime('May 25 2018 12:00AM', '%b %d %Y %I:%M%p') + time_range = None for k, v in RANDOM_TIME.items(): if self.game.settings.night_disabled and k == "night": @@ -60,6 +61,11 @@ class EnviromentGenerator: break start_time += timedelta(hours=random.randint(*time_range)) + logging.info("time - {}, slot - {}, night skipped - {}".format( + str(start_time), + str(time_range), + self.game.settings.night_disabled)) + self.mission.start_time = start_time def _gen_random_weather(self): diff --git a/resources/tools/nev_terrain.miz b/resources/tools/nev_terrain.miz new file mode 100644 index 00000000..ce6ad669 Binary files /dev/null and b/resources/tools/nev_terrain.miz differ diff --git a/ui/overviewcanvas.py b/ui/overviewcanvas.py index ae5d1495..23daec81 100644 --- a/ui/overviewcanvas.py +++ b/ui/overviewcanvas.py @@ -90,7 +90,6 @@ class OverviewCanvas: if cp.captured and not connected_cp.captured and Conflict.has_frontline_between(cp, connected_cp): frontline = Conflict.frontline_vector(cp, connected_cp, self.game.theater) if not frontline: - print(cp, connected_cp) continue frontline_pos, heading, distance = frontline diff --git a/userdata/debriefing.py b/userdata/debriefing.py index 71379164..895b8dac 100644 --- a/userdata/debriefing.py +++ b/userdata/debriefing.py @@ -163,7 +163,7 @@ class Debriefing: self.destroyed_objects.append(str(group.name)) self._dead_units.remove(identifier) - print("debriefing: unsatistied ids: {}".format(self._dead_units)) + logging.info("debriefing: unsatistied ids: {}".format(self._dead_units)) self.alive_units = { player.name: {k: v - self.destroyed_units[player.name].get(k, 0) for k, v in player_units.items()},