From d1b1b0ac7d4d20961edf85bf6f02307cf69e0fd8 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sat, 15 Apr 2023 22:16:40 +0800 Subject: [PATCH] Opt: No map clear percentage waiting in SOS maps --- campaign/campaign_sos/campaign_10_5.py | 6 +++--- campaign/campaign_sos/campaign_3_5.py | 6 +++--- campaign/campaign_sos/campaign_4_5.py | 6 +++--- campaign/campaign_sos/campaign_5_5.py | 6 +++--- campaign/campaign_sos/campaign_6_5.py | 6 +++--- campaign/campaign_sos/campaign_7_5.py | 6 +++--- campaign/campaign_sos/campaign_8_5.py | 6 +++--- campaign/campaign_sos/campaign_9_5.py | 6 +++--- campaign/campaign_sos/campaign_base.py | 4 ++++ module/config/config_manual.py | 3 ++- module/map/map_operation.py | 3 +++ 11 files changed, 33 insertions(+), 25 deletions(-) diff --git a/campaign/campaign_sos/campaign_10_5.py b/campaign/campaign_sos/campaign_10_5.py index fff50a3bb..9795fc11a 100644 --- a/campaign/campaign_sos/campaign_10_5.py +++ b/campaign/campaign_sos/campaign_10_5.py @@ -2,7 +2,7 @@ from module.logger import logger from module.map.map_base import CampaignMap from module.map.map_grids import RoadGrids, SelectedGrids -from .campaign_base import CampaignBase +from .campaign_base import CampaignBase, ConfigBase MAP = CampaignMap('SOS') MAP.shape = 'I6' @@ -42,7 +42,7 @@ A6, B6, C6, D6, E6, F6, G6, H6, I6, \ = MAP.flatten() -class Config: +class Config(ConfigBase): # ===== Start of generated config ===== MAP_HAS_MAP_STORY = False MAP_HAS_FLEET_STEP = False @@ -80,4 +80,4 @@ class Campaign(CampaignBase): return self.battle_default() def battle_6(self): - self.fleet_boss.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_sos/campaign_3_5.py b/campaign/campaign_sos/campaign_3_5.py index ec22e32ee..9c9d9c1c0 100644 --- a/campaign/campaign_sos/campaign_3_5.py +++ b/campaign/campaign_sos/campaign_3_5.py @@ -2,7 +2,7 @@ from module.logger import logger from module.map.map_base import CampaignMap from module.map.map_grids import RoadGrids, SelectedGrids -from .campaign_base import CampaignBase +from .campaign_base import CampaignBase, ConfigBase MAP = CampaignMap('SOS') MAP.shape = 'H5' @@ -36,7 +36,7 @@ A5, B5, C5, D5, E5, F5, G5, H5, \ = MAP.flatten() -class Config: +class Config(ConfigBase): # ===== Start of generated config ===== MAP_HAS_MAP_STORY = False MAP_HAS_FLEET_STEP = False @@ -81,4 +81,4 @@ class Campaign(CampaignBase): return self.battle_default() def battle_3(self): - self.fleet_boss.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_sos/campaign_4_5.py b/campaign/campaign_sos/campaign_4_5.py index 9b58d4dcd..1fe698e7e 100644 --- a/campaign/campaign_sos/campaign_4_5.py +++ b/campaign/campaign_sos/campaign_4_5.py @@ -2,7 +2,7 @@ from module.logger import logger from module.map.map_base import CampaignMap from module.map.map_grids import RoadGrids, SelectedGrids -from .campaign_base import CampaignBase +from .campaign_base import CampaignBase, ConfigBase MAP = CampaignMap('SOS') MAP.shape = 'H7' @@ -43,7 +43,7 @@ A7, B7, C7, D7, E7, F7, G7, H7, \ = MAP.flatten() -class Config: +class Config(ConfigBase): # ===== Start of generated config ===== MAP_HAS_MAP_STORY = False MAP_HAS_FLEET_STEP = False @@ -91,4 +91,4 @@ class Campaign(CampaignBase): return self.battle_default() def battle_4(self): - self.fleet_boss.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_sos/campaign_5_5.py b/campaign/campaign_sos/campaign_5_5.py index 9aa77bcca..4f74b686c 100644 --- a/campaign/campaign_sos/campaign_5_5.py +++ b/campaign/campaign_sos/campaign_5_5.py @@ -2,7 +2,7 @@ from module.logger import logger from module.map.map_base import CampaignMap from module.map.map_grids import RoadGrids, SelectedGrids -from .campaign_base import CampaignBase +from .campaign_base import CampaignBase, ConfigBase MAP = CampaignMap('SOS') MAP.shape = 'H6' @@ -40,7 +40,7 @@ A6, B6, C6, D6, E6, F6, G6, H6, \ = MAP.flatten() -class Config: +class Config(ConfigBase): # ===== Start of generated config ===== MAP_HAS_MAP_STORY = False MAP_HAS_FLEET_STEP = False @@ -85,4 +85,4 @@ class Campaign(CampaignBase): return self.battle_default() def battle_4(self): - self.fleet_boss.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_sos/campaign_6_5.py b/campaign/campaign_sos/campaign_6_5.py index 7a927d0e5..e1ef6eb04 100644 --- a/campaign/campaign_sos/campaign_6_5.py +++ b/campaign/campaign_sos/campaign_6_5.py @@ -2,7 +2,7 @@ from module.logger import logger from module.map.map_base import CampaignMap from module.map.map_grids import RoadGrids, SelectedGrids -from .campaign_base import CampaignBase +from .campaign_base import CampaignBase, ConfigBase MAP = CampaignMap('SOS') MAP.shape = 'H6' @@ -41,7 +41,7 @@ A6, B6, C6, D6, E6, F6, G6, H6, \ = MAP.flatten() -class Config: +class Config(ConfigBase): # ===== Start of generated config ===== MAP_HAS_MAP_STORY = False MAP_HAS_FLEET_STEP = False @@ -73,4 +73,4 @@ class Campaign(CampaignBase): return self.battle_default() def battle_5(self): - self.fleet_boss.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_sos/campaign_7_5.py b/campaign/campaign_sos/campaign_7_5.py index 983457329..b4984f089 100644 --- a/campaign/campaign_sos/campaign_7_5.py +++ b/campaign/campaign_sos/campaign_7_5.py @@ -2,7 +2,7 @@ from module.logger import logger from module.map.map_base import CampaignMap from module.map.map_grids import RoadGrids, SelectedGrids -from .campaign_base import CampaignBase +from .campaign_base import CampaignBase, ConfigBase MAP = CampaignMap('SOS') MAP.shape = 'H6' @@ -41,7 +41,7 @@ A6, B6, C6, D6, E6, F6, G6, H6, \ = MAP.flatten() -class Config: +class Config(ConfigBase): # ===== Start of generated config ===== MAP_HAS_MAP_STORY = False MAP_HAS_FLEET_STEP = False @@ -76,4 +76,4 @@ class Campaign(CampaignBase): return self.battle_default() def battle_5(self): - self.fleet_boss.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_sos/campaign_8_5.py b/campaign/campaign_sos/campaign_8_5.py index 4cbdfb8eb..300b24f03 100644 --- a/campaign/campaign_sos/campaign_8_5.py +++ b/campaign/campaign_sos/campaign_8_5.py @@ -2,7 +2,7 @@ from module.logger import logger from module.map.map_base import CampaignMap from module.map.map_grids import RoadGrids, SelectedGrids -from .campaign_base import CampaignBase +from .campaign_base import CampaignBase, ConfigBase MAP = CampaignMap('SOS') MAP.shape = 'H7' @@ -43,7 +43,7 @@ A7, B7, C7, D7, E7, F7, G7, H7, \ = MAP.flatten() -class Config: +class Config(ConfigBase): # ===== Start of generated config ===== MAP_HAS_MAP_STORY = False MAP_HAS_FLEET_STEP = False @@ -87,4 +87,4 @@ class Campaign(CampaignBase): return self.battle_default() def battle_4(self): - self.fleet_boss.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_sos/campaign_9_5.py b/campaign/campaign_sos/campaign_9_5.py index e5c7e7fb4..d0dd0e6f1 100644 --- a/campaign/campaign_sos/campaign_9_5.py +++ b/campaign/campaign_sos/campaign_9_5.py @@ -2,7 +2,7 @@ from module.logger import logger from module.map.map_base import CampaignMap from module.map.map_grids import RoadGrids, SelectedGrids -from .campaign_base import CampaignBase +from .campaign_base import CampaignBase, ConfigBase MAP = CampaignMap('SOS') MAP.shape = 'I6' @@ -41,7 +41,7 @@ A6, B6, C6, D6, E6, F6, G6, H6, I6, \ = MAP.flatten() -class Config: +class Config(ConfigBase): # ===== Start of generated config ===== MAP_HAS_MAP_STORY = False MAP_HAS_FLEET_STEP = False @@ -72,4 +72,4 @@ class Campaign(CampaignBase): return self.battle_default() def battle_5(self): - self.fleet_boss.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_sos/campaign_base.py b/campaign/campaign_sos/campaign_base.py index 9d2d9122a..3e9e66a4b 100644 --- a/campaign/campaign_sos/campaign_base.py +++ b/campaign/campaign_sos/campaign_base.py @@ -5,6 +5,10 @@ from module.exception import CampaignNameError from module.template.assets import TEMPLATE_STAGE_SOS +class ConfigBase: + MAP_HAS_CLEAR_PERCENTAGE = False + + class CampaignBase(CampaignBase_): ENEMY_FILTER = '1T > 1L > 1E > 1M > 2T > 2L > 2E > 2M > 3T > 3L > 3E > 3M' diff --git a/module/config/config_manual.py b/module/config/config_manual.py index fa9c9aaa7..9cdb8d004 100644 --- a/module/config/config_manual.py +++ b/module/config/config_manual.py @@ -107,6 +107,7 @@ class ManualConfig: """ module.map.fleet """ + MAP_HAS_CLEAR_PERCENTAGE = True MAP_HAS_AMBUSH = True MAP_HAS_FLEET_STEP = False MAP_HAS_MOVABLE_ENEMY = False @@ -339,7 +340,7 @@ class ManualConfig: module.shop """ # For dev purpose, auto extract new item templates - SHOP_EXTRACT_TEMPLATE = False + SHOP_EXTRACT_TEMPLATE = True """ module.war_archives diff --git a/module/map/map_operation.py b/module/map/map_operation.py index dc5305ffb..1f1fa28df 100644 --- a/module/map/map_operation.py +++ b/module/map/map_operation.py @@ -251,6 +251,9 @@ class MapOperation(MysteryHandler, FleetPreparation, Retirement, FastForwardHand self.map_clear_percentage_prev = -1 self.map_clear_percentage_timer.reset() return False + if not self.config.MAP_HAS_CLEAR_PERCENTAGE: + logger.attr('MAP_HAS_CLEAR_PERCENTAGE', self.config.MAP_HAS_CLEAR_PERCENTAGE) + return True percent = self.get_map_clear_percentage() logger.attr('Map_clear_percentage', percent)