From aef67541c59f693799088ead98e8961dfe41e564 Mon Sep 17 00:00:00 2001 From: Zuosizhu <2839299264@qq.com> Date: Fri, 2 Aug 2024 17:23:36 +0800 Subject: [PATCH] Add: Option to disable Opsi repair --- config/template.json | 1 + module/config/argument/args.json | 4 ++++ module/config/argument/argument.yaml | 1 + module/config/config_generated.py | 1 + module/config/i18n/en-US.json | 4 ++++ module/config/i18n/ja-JP.json | 4 ++++ module/config/i18n/zh-CN.json | 4 ++++ module/config/i18n/zh-TW.json | 4 ++++ module/os/map.py | 3 +++ 9 files changed, 26 insertions(+) diff --git a/config/template.json b/config/template.json index a41b9c2ba..d2c5f017f 100644 --- a/config/template.json +++ b/config/template.json @@ -2198,6 +2198,7 @@ "BuyActionPointLimit": 0, "OilLimit": 1000, "RepairThreshold": 0.4, + "DontRepair": false, "DoRandomMapEvent": true, "AkashiShopFilter": "ActionPoint > PurpleCoins" }, diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 91fb2d6d5..d220edefe 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -11663,6 +11663,10 @@ "type": "input", "value": 0.4 }, + "DontRepair": { + "type": "checkbox", + "value": false + }, "DoRandomMapEvent": { "type": "checkbox", "value": true diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 2f88485aa..6fc17a257 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -824,6 +824,7 @@ OpsiGeneral: option: [ 0, 1, 2, 3, 4, 5 ] OilLimit: 1000 RepairThreshold: 0.4 + DontRepair: false DoRandomMapEvent: true AkashiShopFilter: |- ActionPoint > PurpleCoins diff --git a/module/config/config_generated.py b/module/config/config_generated.py index ad7ab7658..4b845df66 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -460,6 +460,7 @@ class GeneratedConfig: OpsiGeneral_BuyActionPointLimit = 0 # 0, 1, 2, 3, 4, 5 OpsiGeneral_OilLimit = 1000 OpsiGeneral_RepairThreshold = 0.4 + OpsiGeneral_DontRepair = False OpsiGeneral_DoRandomMapEvent = True OpsiGeneral_AkashiShopFilter = 'ActionPoint > PurpleCoins' diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 4ed05b991..9650d07b4 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -2871,6 +2871,10 @@ "name": "Repair Threshold", "help": "After completion of an OpSi map; if any one ship's HP is below threshold, retreat back to nearest port for repairs\n0.0 ~ 1.0" }, + "DontRepair": { + "name": "OpsiGeneral.DontRepair.name", + "help": "OpsiGeneral.DontRepair.help" + }, "DoRandomMapEvent": { "name": "Do Random Map Events", "help": "Rescan the whole map after auto search, purchase akashi's shop, use siren logging tower, use siren scanning device, unlock mechanism that require 2 fleets," diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 04cdf48af..a60b19493 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -2871,6 +2871,10 @@ "name": "OpsiGeneral.RepairThreshold.name", "help": "OpsiGeneral.RepairThreshold.help" }, + "DontRepair": { + "name": "OpsiGeneral.DontRepair.name", + "help": "OpsiGeneral.DontRepair.help" + }, "DoRandomMapEvent": { "name": "OpsiGeneral.DoRandomMapEvent.name", "help": "OpsiGeneral.DoRandomMapEvent.help" diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 368c59f8c..0f2dc2cf2 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -2871,6 +2871,10 @@ "name": "任意舰船血量低于 X 后,回港修理", "help": "0.0 ~ 1.0" }, + "DontRepair": { + "name": "禁用回港维修", + "help": "" + }, "DoRandomMapEvent": { "name": "完成地图随机事件", "help": "在自律寻敌完成后重新扫描一遍地图,购买明石商店,使用塞壬信息收集装置、使用塞壬探测装置、解锁两舰队机关" diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 77f2f3c08..04fb79d38 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -2871,6 +2871,10 @@ "name": "任意艦船血量低於 X 後,回港修理", "help": "0.0 ~ 1.0" }, + "DontRepair": { + "name": "OpsiGeneral.DontRepair.name", + "help": "OpsiGeneral.DontRepair.help" + }, "DoRandomMapEvent": { "name": "完成地圖隨機事件", "help": "在自律尋敵完成後重新掃描一遍地圖,購買明石商店、使用塞壬信息收集裝置、使用塞壬探測裝置、解鎖兩艦隊機關" diff --git a/module/os/map.py b/module/os/map.py index abb75ad52..b220b0409 100644 --- a/module/os/map.py +++ b/module/os/map.py @@ -206,6 +206,9 @@ class OSMap(OSFleet, Map, GlobeCamera, StrategicSearchHandler): revert (bool): If go back to previous zone. """ logger.hr('OS fleet repair') + if self.config.OpsiGeneral_DontRepair: + logger.info('Repair disabled, Alas will not repair any ship.') + return False prev = self.zone if self.zone.is_azur_port: logger.info('Already in azur port')