Skip to content
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

feat!: add reclamation and improve fight, roguelike, copilot commands #313

Merged
merged 6 commits into from
Sep 9, 2024

Conversation

wangl-cc
Copy link
Member

@wangl-cc wangl-cc commented Aug 31, 2024

Features:

  • Added a new reclamation sub-command.
  • Improved functionality for the fight and roguelike sub-commands with additional parameters.
  • ssscopilot is now an individual sub-command for SSS, separate from copilot.
  • copilot can now handle multiple files, sets, and accepts extra parameters.
  • Support overlay to override default value of predefined tasks.

Others:

  • Unified the entry point for all predefined tasks.

Breaking Changes:

  • The SSS copilot file is incompatible with the copilot sub-command; use the ssscopilot sub-command instead.
  • Some runtime-entered parameters should be passed as command-line arguments now.

TODO:

  • Document about commands for predefined tasks.
  • Update fish complete script.

@wangl-cc wangl-cc force-pushed the feat/task branch 2 times, most recently from 1b0332a to 62f2fc1 Compare September 1, 2024 14:59
@wangl-cc wangl-cc changed the title refactor!: improve commands for predefined tasks feat!: add reclamation and improve fight, roguelike, copilot commands Sep 4, 2024
@wangl-cc wangl-cc force-pushed the feat/task branch 2 times, most recently from 2ad6ad3 to 457ea81 Compare September 4, 2024 15:37
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 94.15205% with 20 lines in your changes missing coverage. Please review.

Project coverage is 65.58%. Comparing base (3875660) to head (652972d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
maa-cli/src/run/preset/copilot.rs 92.61% 11 Missing ⚠️
maa-cli/src/main.rs 0.00% 7 Missing ⚠️
maa-cli/src/run/mod.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #313      +/-   ##
==========================================
+ Coverage   63.14%   65.58%   +2.44%     
==========================================
  Files          42       44       +2     
  Lines        3392     3560     +168     
==========================================
+ Hits         2142     2335     +193     
+ Misses       1250     1225      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wangl-cc wangl-cc force-pushed the feat/task branch 4 times, most recently from 5f452f3 to 15351bb Compare September 5, 2024 20:42
Comment on lines 29 to 62
pub struct ReclamationParams {
/// Theme of the reclamation algorithm
theme: Theme,
/// Mode of the reclamation algorithm
///
/// 0: build and restart again and again. **This mode will discard all the progress**.
/// 1: craft some products and fall back to the previous checkpoint.
#[arg(short = 'm', long, default_value = "1", verbatim_doc_comment)]
mode: i32,
/// Tool to craft in mode 1
#[arg(short = 'C', long)]
tool_to_craft: Option<String>,
/// Mode to increase the number of tools to craft
///
/// 0: increase the number by clicking the button.
/// 1: increase the number by holding the button.
#[arg(long, default_value = "0", verbatim_doc_comment)]
increase_mode: i32,
/// Number of craft each batch
#[arg(long, default_value = "16")]
num_craft_batches: i32,
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@Alan-Charred 老师,麻烦看看生息演算的参数和 help 有没有问题。

Copy link
Contributor

Choose a reason for hiding this comment

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

内容完全没有问题!感谢!
这个注释是可以直接作为help的文字吗?我脑海中是以下文字,您看着改改。(我对rust不太熟悉,也不懂输出结构好不好看。

话说,是不是increase_modenum_craft_batches应该像tool_to_craft一样有个option?哦它们有默认值。
如果可以,还请后续加一个检查,如果tool_to_craft为空的话,报个错。
我们其实是希望能给它一个“荧光棒”作为默认值,但是我不确定 cli 是否要支持多语言。您看看怎么办比较好?

    /// Reclamation Algorithm theme
    ///
    /// Tales: Tales Within the Sand
    #[arg(short = 't', long, default_value = "Tales", verbatim_doc_comment)]
    theme: String,
    /// Reclamation Algorithm task mode
    ///
    /// 0: farm prosperity points by repeatedly entering and exiting stages.
    ///     **This task mode should only be used when no save exists**.
    ///     **Using it with an active save may result in losing your progress**.
    /// 1: farm prosperity points by crafting tools.
    ///     **This task mode should only be used when you already have a save and can craft certain tools**.
    ///     **Using it may result in losing your progress after last calculation day**.
    ///     **It is recommend to start task from a new calculation day**.
    #[arg(short = 'm', long, default_value = "1", verbatim_doc_comment)]
    mode: i32,
    /// Name of tool to craft in mode 1
    #[arg(short = 'C', long)]
    tool_to_craft: Option<String>,
    /// Method to interactive with the add button when increasing the crafting quantity
    ///
    /// 0: increase the number by clicking the button.
    /// 1: increase the number by holding the button.
    #[arg(long, default_value = "0", verbatim_doc_comment)]
    increase_mode: i32,
    /// Number of batches in each game run, with each batch containing 99 items
    #[arg(long, default_value = "16")]
    num_craft_batches: i32,

草好像对theme的描写有点问题,我得去改改文档。

Copy link
Member Author

Choose a reason for hiding this comment

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

感谢,不过这个 help 好像暂时不支持用 ** 来加粗,我来研究一下怎么给 help 加上格式。另外 theme 不用 String 而是 ValueEnum, 这样可以生成补全和可选项。

double_check_collapsal_paradigms: bool,
/// A list of expected collapsal paradigms
#[arg(short = 'P', long)]
expected_collapsal_paradigms: Vec<String>,
Copy link
Member Author

Choose a reason for hiding this comment

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

@Alan-Charred 如果你对肉鸽也比较熟悉的话,可以看一下肉鸽的。

Copy link
Contributor

Choose a reason for hiding this comment

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

啊,我不知道默认值这边您是怎么处理的,

    /// Collapsal paradigm related parameters
    /// Whether to check collapsal paradigms
    #[arg(long)]
    check_collapsal_paradigms: bool,
    /// Whether to double check collapsal paradigms
    #[arg(long)]
    double_check_collapsal_paradigms: bool,
    /// A list of expected collapsal paradigms
    #[arg(short = 'P', long)]
    expected_collapsal_paradigms: Vec<String>,

这段里,check_collapsal_paradigms 和 double_check_collapsal_paradigms,在 mode=5时是默认开启的,在其他模式下也可以打开。🤔️感觉要描述得太多了。不知道有没有可能,对于一些高级选项,就留下个文档地址供大家自行学习。

Copy link
Contributor

Choose a reason for hiding this comment

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

新增的关于坍缩范式的参数我看了没问题。
其他一些参数。。。这个stop_at_final_boss怎么好像也没进文档?@status102 老师您也来看一眼。

Copy link
Member Author

Choose a reason for hiding this comment

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

啊,我不知道默认值这边您是怎么处理的,

    /// Collapsal paradigm related parameters
    /// Whether to check collapsal paradigms
    #[arg(long)]
    check_collapsal_paradigms: bool,
    /// Whether to double check collapsal paradigms
    #[arg(long)]
    double_check_collapsal_paradigms: bool,
    /// A list of expected collapsal paradigms
    #[arg(short = 'P', long)]
    expected_collapsal_paradigms: Vec<String>,

这段里,check_collapsal_paradigms 和 double_check_collapsal_paradigms,在 mode=5时是默认开启的,在其他模式下也可以打开。🤔️感觉要描述得太多了。不知道有没有可能,对于一些高级选项,就留下个文档地址供大家自行学习。

那就 mode 5 默认开启,去掉这两个选项,然后在这种情况下让 expected_collapsal_paradigms 需要提供至少一个选项。

Copy link
Contributor

Choose a reason for hiding this comment

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

好好,这样好。虽然 expected_collapsal_paradigms 在中文下有默认值(4个稀有坍缩范式),但是外服我没弄。所以还是让用户必须填写吧。

Copy link
Member

Choose a reason for hiding this comment

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

新增的关于坍缩范式的参数我看了没问题。
其他一些参数。。。这个stop_at_final_boss怎么好像也没进文档?@status102 老师您也来看一眼。

没看到有啥问题,也可能漏了没看到

@wangl-cc wangl-cc marked this pull request as ready for review September 9, 2024 22:58
@wangl-cc wangl-cc merged commit d2b6253 into main Sep 9, 2024
23 checks passed
@wangl-cc wangl-cc deleted the feat/task branch September 9, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants