Skip to content

Allow usage of technique points for Ruan Mei in simulated universe#345

Closed
JerryLingjieMei wants to merge 15 commits intoLmeSzinc:masterfrom
JerryLingjieMei:master
Closed

Allow usage of technique points for Ruan Mei in simulated universe#345
JerryLingjieMei wants to merge 15 commits intoLmeSzinc:masterfrom
JerryLingjieMei:master

Conversation

@JerryLingjieMei
Copy link
Contributor

The program can run well under python 3.10, addressing issues in #344 and #338 .

Ruan Mei is switched to the current character at the start of the rogue trial. Each time an enemy or elite enemy is cleared, the current character will try to use technique points once. The technique points are now detected using a horizontal search around its suggested location.

Copy link
Owner

@LmeSzinc LmeSzinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Make 2 PRs, one fixes the technique points detection, another adds new feature
  2. Add a GUI option to toggle using techniques

Comment on lines +108 to +111
TECHNIQUE_POINT_STRICT_1 = ButtonWrapper(
name='TECHNIQUE_POINT_STRICT_1',
share=Button(
file='./assets/share/map/control/TECHNIQUE_POINT_1.png',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assets files are auto generated, don't modify it manaully

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This button wrapper is to ensure a horizontal search area where technique_point_strict_1 can be found.

Comment on lines +200 to +210
TECHNIQUE_POINT_STRICT_1.match_template(self.device.image)
points = []
for button in [
TECHNIQUE_POINT_STRICT_1,
TECHNIQUE_POINT_STRICT_2,
TECHNIQUE_POINT_STRICT_3,
TECHNIQUE_POINT_STRICT_4,
TECHNIQUE_POINT_STRICT_5,
]:
button.load_offset(TECHNIQUE_POINT_STRICT_1)
points.append(self.image_color_count(button, color=(255, 255, 255), threshold=221, count=20, offset=True))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. TECHNIQUE_POINT_1 cannot detect empty technique points, add another template for that case
  2. image_color_count() accepts area tuple, use button.button instead of adding argument offset

Comment on lines +149 to +151
# Use techniques before enemy
logger.info('Trying to use technique')
UseTechniqueUI(self.config, self.device).use_technique_(1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if current character is in LIST_ROGUE_SPECIAL_TECHNIQUE_RANGES before using techniques

Comment on lines +170 to -171
# Use techniques before BOSS
logger.info('Trying to use technique')
UseTechniqueUI(self.config, self.device).use_technique_(1)

logger.hr('Clear elite', level=1)
waypoints = ensure_waypoints(waypoints)
end_point = waypoints[-1]
end_point.speed = 'run_2x'

# TODO: Use techniques before BOSS
pass

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use techinique from multiple characters to empty technique points before boss

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would refrain from using all technique pts for at least the first elite enemy since it might run out later.

Comment on lines +38 to +41
# Special character that has special effects in rogues
LIST_ROGUE_SPECIAL_TECHNIQUE_RANGES = [
RuanMei, TopazNumby, FuXuan, BlackSwan
] No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a full list of characters with useful techniques

@LmeSzinc LmeSzinc added good first issue / 首次贡献 Good for newcomers feature request / 功能请求 New feature or requests labels Feb 27, 2024
@JerryLingjieMei
Copy link
Contributor Author

Separated into two PRs #354 #355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants