New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature of material farming in task RogueWorld #361
Conversation
…nabled to acquire materials from boss
Im not quite sure about the usage of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I discard the modification of .gitignore or seperate it into a new PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im not quite sure about the usage of self.config.stored.SimulatedUniverse.is_expired() function.
Check out the echo of war countdown
StarRailCopilot/module/config/stored/classes.py
Lines 284 to 285 in 58e054a
class StoredEchoOfWar(StoredCounter, StoredExpiredAtMonday0400): | |
FIXED_TOTAL = 3 |
https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/6.1.-GUI-Option
Should I discard the modification of .gitignore or seperate it into a new PR?
yes, and comment that these are electron files
tasks/rogue/entry/entry.py
Outdated
if self.config.stored.SimulatedUniverse.is_expired(): | ||
# Expired, do rogue | ||
pass | ||
# Expired, do rogue and reset weekly farming count | ||
self.config.RogueWorld_WeeklyFarmingCount = 11 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't share records, it should have its own counter, counter starts from 100 and reduces after cleared an elite or boss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. Thank your correction and I ll fix that later today.
why adding an extra local variable for this while we can just detect the material result after the elite fight? Extra local variable means redundant logic and conflicts as you may wanna do some dlc runs in-game by yourself |
you are right but is there any material result that is easy and reliable to detect?
|
Not necessarily relying on any specific material, simply employing template matching for the multiplication sign and counting the quantity should be reliable enough. any thoughts? |
I have taken @LmeSzinc 's suggestion and set a farming counter in I have noted the idea of detecting boss drop list by @foodtooth 's suggestion.
I cannot conclude which way is better than the other, so I adopted the former one. Furthermore, consider of maintainability, every variable name in this commit contains |
🥲It seems that StoredSimulatedUniverse class will not save the counter to disk, causing the counter to reset when src restarts. I dont know how to save this counter, should I use this way or adding the counter value directly to GUI? Another known issue: if SRC is terminated after clearing elite boss but before exiting elite boss's dungeon(which means just a little walk and one click, will not take much time), farming counter will decrease again at the next time the |
module/config/stored/classes.py
Outdated
class StoredSimulatedUniverse(StoredCounter, StoredExpiredAtMonday0400): | ||
pass | ||
# These variables are used in Rogue Farming feature. | ||
|
||
# Times of boss drop chance per week. In current version of StarRail, this value is 100. | ||
FIXED_DEFAULT = 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add standalone storage
class StoredSimulatedUniverseElite(StoredCounter, StoredExpiredAtMonday0400):
pass
tasks/rogue/route/base.py
Outdated
result = super().clear_enemy(*waypoints) | ||
|
||
# runs when one elite battle finishes (do not handle whether the battle succeeded or failed), and decreases rogue farming count by 1 | ||
if self.config.RogueWorld_WeeklyFarming and self.config.stored.SimulatedUniverse.farm_not_complete(): | ||
self.config.stored.SimulatedUniverse.farm_dec() | ||
logger.info( | ||
f"Cleared elite boss, decrease farming count by 1, now {self.config.stored.SimulatedUniverse.FarmingCounter}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the result
above, reduce counter if "enemy" in result
Thanks to @LmeSzinc 's suggestion, I have fixed the problem. |
When
RogueWorld_WeeklyFarming
is enabled, taskRogueWorld
will not stop when weekly points are full, instead farming the boss 33 times (i.e., 11 simulated universe) to obtain trace materials.RogueWorld_WeeklyFarmingCount
denotes how many turns of rogue remain to complete this week and will be reset to 11 each Monday 04:00.Does not handle whether the last rogue run failed due to one who use this feature may have less chance of failure.
#231 #247 #264 #288 #294
Correction: Sorry I was misled by #288. Rogue boss has 100 drop times per week, not 33 times. See this.