mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-22 08:37:42 +00:00
Use stored counter to count boss farming times to run
This commit is contained in:
parent
76c8f9eda6
commit
f5bc0d0ce1
@ -194,8 +194,7 @@
|
|||||||
"UseImmersifier": true,
|
"UseImmersifier": true,
|
||||||
"DoubleEvent": true,
|
"DoubleEvent": true,
|
||||||
"UseStamina": false,
|
"UseStamina": false,
|
||||||
"WeeklyFarming": false,
|
"WeeklyFarming": false
|
||||||
"WeeklyFarmingCount": 0
|
|
||||||
},
|
},
|
||||||
"RogueBlessing": {
|
"RogueBlessing": {
|
||||||
"PresetBlessingFilter": "preset",
|
"PresetBlessingFilter": "preset",
|
||||||
|
@ -1427,10 +1427,6 @@
|
|||||||
"WeeklyFarming": {
|
"WeeklyFarming": {
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"value": false
|
"value": false
|
||||||
},
|
|
||||||
"WeeklyFarmingCount": {
|
|
||||||
"type": "input",
|
|
||||||
"value": 0
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"RogueBlessing": {
|
"RogueBlessing": {
|
||||||
|
@ -238,7 +238,6 @@ RogueWorld:
|
|||||||
DoubleEvent: true
|
DoubleEvent: true
|
||||||
UseStamina: false
|
UseStamina: false
|
||||||
WeeklyFarming: false
|
WeeklyFarming: false
|
||||||
WeeklyFarmingCount: 0
|
|
||||||
|
|
||||||
RogueBlessing:
|
RogueBlessing:
|
||||||
PresetBlessingFilter:
|
PresetBlessingFilter:
|
||||||
|
@ -134,7 +134,6 @@ class GeneratedConfig:
|
|||||||
RogueWorld_DoubleEvent = True
|
RogueWorld_DoubleEvent = True
|
||||||
RogueWorld_UseStamina = False
|
RogueWorld_UseStamina = False
|
||||||
RogueWorld_WeeklyFarming = False
|
RogueWorld_WeeklyFarming = False
|
||||||
RogueWorld_WeeklyFarmingCount = 0
|
|
||||||
|
|
||||||
# Group `RogueBlessing`
|
# Group `RogueBlessing`
|
||||||
RogueBlessing_PresetBlessingFilter = 'preset' # preset, custom
|
RogueBlessing_PresetBlessingFilter = 'preset' # preset, custom
|
||||||
|
@ -943,11 +943,7 @@
|
|||||||
},
|
},
|
||||||
"WeeklyFarming": {
|
"WeeklyFarming": {
|
||||||
"name": "Boss Material Farming",
|
"name": "Boss Material Farming",
|
||||||
"help": "Not stop after point reward is full; farm the boss 33 times (i.e., 11 Simulated Universe) instead to obtain trace materials"
|
"help": "Do not stop after point reward is full; farm the boss 100 times instead to obtain trace materials"
|
||||||
},
|
|
||||||
"WeeklyFarmingCount": {
|
|
||||||
"name": "Material Attempts Remaining This Week: X",
|
|
||||||
"help": "Resets every Monday"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"RogueBlessing": {
|
"RogueBlessing": {
|
||||||
|
@ -943,11 +943,7 @@
|
|||||||
},
|
},
|
||||||
"WeeklyFarming": {
|
"WeeklyFarming": {
|
||||||
"name": "Recolección de Materiales de Jefes",
|
"name": "Recolección de Materiales de Jefes",
|
||||||
"help": "No detenerse después de que los puntos semanales estén llenos, farmear al jefe 33 veces (es decir, 11 simulaciones cósmicas) para obtener materiales de rastro"
|
"help": "No detenerse después de que los puntos semanales estén llenos, farmear al jefe 100 veces para obtener materiales de rastro"
|
||||||
},
|
|
||||||
"WeeklyFarmingCount": {
|
|
||||||
"name": "Intentos de Material Restantes Esta Semana: X",
|
|
||||||
"help": "Se reinicia cada lunes"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"RogueBlessing": {
|
"RogueBlessing": {
|
||||||
|
@ -943,11 +943,7 @@
|
|||||||
},
|
},
|
||||||
"WeeklyFarming": {
|
"WeeklyFarming": {
|
||||||
"name": "ボス素材を収集",
|
"name": "ボス素材を収集",
|
||||||
"help": "週間ポイントが満点に達しても停止せず、33回のボス(つまり11回の模擬宇宙)を収集して軌跡素材を入手"
|
"help": "週間ポイントが満点に達しても停止せず、100回のボスをファームして軌跡素材を入手"
|
||||||
},
|
|
||||||
"WeeklyFarmingCount": {
|
|
||||||
"name": "今週の素材が残りX回",
|
|
||||||
"help": "毎週月曜日にリセット"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"RogueBlessing": {
|
"RogueBlessing": {
|
||||||
|
@ -943,11 +943,7 @@
|
|||||||
},
|
},
|
||||||
"WeeklyFarming": {
|
"WeeklyFarming": {
|
||||||
"name": "刷取Boss材料",
|
"name": "刷取Boss材料",
|
||||||
"help": "每周积分满后不停止,刷取33次Boss(即11次模拟宇宙)以获取形迹材料"
|
"help": "每周积分满后不停止,刷取100次Boss以获取形迹材料"
|
||||||
},
|
|
||||||
"WeeklyFarmingCount": {
|
|
||||||
"name": "本周材料剩余X次",
|
|
||||||
"help": "每周一重置"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"RogueBlessing": {
|
"RogueBlessing": {
|
||||||
|
@ -943,11 +943,7 @@
|
|||||||
},
|
},
|
||||||
"WeeklyFarming": {
|
"WeeklyFarming": {
|
||||||
"name": "刷取Boss材料",
|
"name": "刷取Boss材料",
|
||||||
"help": "每週積分滿後不停止,刷取33次Boss(即11次模擬宇宙)以獲取形跡材料"
|
"help": "每週積分滿後不停止,刷取100次Boss以獲取形跡材料"
|
||||||
},
|
|
||||||
"WeeklyFarmingCount": {
|
|
||||||
"name": "本週材料剩餘X次",
|
|
||||||
"help": "每週一重置"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"RogueBlessing": {
|
"RogueBlessing": {
|
||||||
|
@ -205,7 +205,20 @@ class StoredImmersifier(StoredCounter):
|
|||||||
|
|
||||||
|
|
||||||
class StoredSimulatedUniverse(StoredCounter, StoredExpiredAtMonday0400):
|
class StoredSimulatedUniverse(StoredCounter, StoredExpiredAtMonday0400):
|
||||||
pass
|
FIXED_DEFAULT = 100
|
||||||
|
FarmingCounter = FIXED_DEFAULT
|
||||||
|
|
||||||
|
def farm_dec(self, value=1):
|
||||||
|
self.FarmingCounter -= value
|
||||||
|
|
||||||
|
def farm_reset(self,):
|
||||||
|
self.FarmingCounter = self.FIXED_DEFAULT
|
||||||
|
|
||||||
|
def farm_not_full(self) -> bool:
|
||||||
|
return self.FarmingCounter > 0
|
||||||
|
|
||||||
|
def farm_get_remain(self) -> int:
|
||||||
|
return self.FarmingCounter
|
||||||
|
|
||||||
|
|
||||||
class StoredAssignment(StoredCounter):
|
class StoredAssignment(StoredCounter):
|
||||||
|
@ -348,14 +348,16 @@ class RogueEntry(RouteBase, RogueRewardHandler, RoguePathHandler, DungeonUI):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if self.config.stored.SimulatedUniverse.is_expired():
|
if self.config.stored.SimulatedUniverse.is_expired():
|
||||||
# Expired, do rogue and reset weekly farming count
|
# Expired, do rogue and reset farming counter
|
||||||
self.config.RogueWorld_WeeklyFarmingCount = 11
|
self.config.stored.SimulatedUniverse.farm_reset()
|
||||||
|
|
||||||
elif self.config.stored.SimulatedUniverse.is_full():
|
elif self.config.stored.SimulatedUniverse.is_full():
|
||||||
if self.config.RogueWorld_UseImmersifier and self.config.stored.Immersifier.value > 0:
|
if self.config.RogueWorld_UseImmersifier and self.config.stored.Immersifier.value > 0:
|
||||||
logger.info(
|
logger.info(
|
||||||
'Reached weekly point limit but still have immersifiers left, continue to use them')
|
'Reached weekly point limit but still have immersifiers left, continue to use them')
|
||||||
elif self.config.RogueWorld_WeeklyFarming and self.config.RogueWorld_WeeklyFarmingCount > 0:
|
elif self.config.RogueWorld_WeeklyFarming and self.config.stored.SimulatedUniverse.farm_not_full():
|
||||||
|
logger.attr(
|
||||||
|
"Farming Counter", self.config.stored.SimulatedUniverse.farm_get_remain())
|
||||||
logger.info(
|
logger.info(
|
||||||
'Reached weekly point limit but still continue to farm materials')
|
'Reached weekly point limit but still continue to farm materials')
|
||||||
else:
|
else:
|
||||||
|
@ -28,11 +28,6 @@ class Rogue(RouteLoader, RogueEntry):
|
|||||||
|
|
||||||
self.rogue_run()
|
self.rogue_run()
|
||||||
self.rogue_reward_claim()
|
self.rogue_reward_claim()
|
||||||
# runs when one rogue run finishes (do not handle whether the last rogue run finished or failed due to one who use this feature has less chance of failure -- would be better if check boss battle result instead of rogue result, but this version also works), and decreases rogue farming count by 1
|
|
||||||
if self.config.RogueWorld_WeeklyFarming and self.config.RogueWorld_WeeklyFarmingCount > 0:
|
|
||||||
self.config.RogueWorld_WeeklyFarmingCount -= 1
|
|
||||||
logger.attr("WeeklyFarmingCount",
|
|
||||||
self.config.RogueWorld_WeeklyFarmingCount)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -170,6 +170,13 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
result = super().clear_enemy(*waypoints)
|
result = super().clear_enemy(*waypoints)
|
||||||
|
|
||||||
|
# runs when one elite battle finishes (do not handle whether battle succeeded or failed), and decreases rogue farming count by 1
|
||||||
|
if self.config.RogueWorld_WeeklyFarming and self.config.stored.SimulatedUniverse.farm_not_full():
|
||||||
|
self.config.stored.SimulatedUniverse.farm_dec()
|
||||||
|
logger.info(
|
||||||
|
f"Cleared elite boss, decrease farming count by 1, now {self.config.stored.SimulatedUniverse.FarmingCounter}")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _domain_event_expected_end(self):
|
def _domain_event_expected_end(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user