Skip to content

Commit

Permalink
feat!: add reclamation and improve fight, roguelike, copilot
Browse files Browse the repository at this point in the history
…commands (#313)

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.
  • Loading branch information
wangl-cc authored Sep 9, 2024
1 parent 6d9d755 commit d2b6253
Show file tree
Hide file tree
Showing 22 changed files with 2,052 additions and 827 deletions.
38 changes: 38 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions maa-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ tar = { version = "0.4.40", optional = true }

# Logging support
log = "0.4.20"
color-print = "0.3.6"

[dependencies.env_logger]
version = "0.11"
Expand Down
49 changes: 47 additions & 2 deletions maa-cli/completions/maa.fish
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ complete -c maa -n "__fish_seen_subcommand_from dir" -f -a "$maa_dirs"
# Maa run related options
set -l clients Official Bilibili Txwy YoStarEN YoStarJP YoStarKR
## Common options
set -l run_commands run startup closedown fight copilot roguelike
set -l run_commands run startup closedown fight copilot sscopilot roguelike reclamation
complete -c maa -n "__fish_seen_subcommand_from $run_commands" -s a -l addr -d 'ADB serial number of device or MaaTools address set in PlayCover' -r
complete -c maa -n "__fish_seen_subcommand_from $run_commands" -s p -l profile -d 'Profile to use' -r
complete -c maa -n "__fish_seen_subcommand_from $run_commands" -l user-resource -d 'Load resources from the config directory'
Expand All @@ -81,8 +81,53 @@ complete -c maa -n "__fish_seen_subcommand_from run" -f -a "$(maa list)"
complete -c maa -n "__fish_seen_subcommand_from startup" -f -a "$clients"
complete -c maa -n "__fish_seen_subcommand_from startup" -f -l account -d 'Account to login' -r
complete -c maa -n "__fish_seen_subcommand_from closedown" -f -a "$clients"

complete -c maa -n "__fish_seen_subcommand_from fight" -f -s m -l medicine -d 'Medicine to use' -r
complete -c maa -n "__fish_seen_subcommand_from roguelike" -a "phantom mizuki sami sarkaz"
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l expiring-medicine -d 'Expiring medicine to use' -r
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l stone -d 'Stone to use' -r
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l times -d 'Times to fight' -r
complete -c maa -n "__fish_seen_subcommand_from fight" -f -s D -l drops -d 'Exit after collecting given number of drops' -r
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l series -d 'Series of proxy combat' -r
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l report-to-penguin -d 'Report drops to the Penguin Statistics'
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l penguin-id -d 'Penguin Statistics ID to report drops' -r
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l report-to-yituliu -d 'Report drops to the yituliu'
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l yituliu-id -d 'Yituliu ID to report drops' -r
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l client-type -d 'Client type to restart' -r
complete -c maa -n "__fish_seen_subcommand_from fight" -f -l dr-grandet -d 'Use Dr. Grandet'

complete -c maa -n "__fish_seen_subcommand_from copilot" -f -s f -l formation -d 'Use formation'
complete -c maa -n "__fish_seen_subcommand_from copilot" -f -l use-sanity-potion -d 'Use sanity potion'
complete -c maa -n "__fish_seen_subcommand_from copilot" -f -l need-navigate -d 'Need navigate'
complete -c maa -n "__fish_seen_subcommand_from copilot" -f -l add-trust -d 'Add trust'
complete -c maa -n "__fish_seen_subcommand_from copilot" -f -l select-formation -d 'Select formation' -r
complete -c maa -n "__fish_seen_subcommand_from copilot" -f -l support-unit-name -d 'Support unit name' -r
complete -c maa -n "__fish_seen_subcommand_from sscopilot" -f -s l -l loop-times -d 'Loop times' -r

complete -c maa -n "__fish_seen_subcommand_from roguelike" -a "Phantom Mizuki Sami Sarkaz"
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l mode -d 'Mode of roguelike' -a "0 1 2 3 4"
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l squad -d 'Squad to use' -r
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l roles -d 'Roles to use' -r
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l core-char -d 'Core character to use' -r
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l start-count -d 'Count of start' -r
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l disable-investment -d 'Disable investment'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l investment-with-more-score -d 'Try to gain more score in investment mode'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l investments-count -d 'Count of investments' -r
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l no-stop-when-investment-full -d 'Do not stop when investment is full'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l use-support -d 'Use support'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l use-nonfriend-support -d 'Use non-friend support'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l start-with-elite-two -d 'Start with elite two'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l only-start-with-elite-two -d 'Only start with elite two'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l stop-at-final-boss -d 'Stop exploration before final boss'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l refresh-trader-with-dice -d 'Refresh trader with dice'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l use-foldartal -d 'Use foldartal'
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l start-foldartals -d 'Start foldartals' -r
complete -c maa -n "__fish_seen_subcommand_from roguelike" -l expected-collapsal-paradigms -d 'Expected collapsal paradigms' -r

complete -c maa -n "__fish_seen_subcommand_from reclamation" -a "Tales"
complete -c maa -n "__fish_seen_subcommand_from reclamation" -f -s m -l mode -d 'Mode of reclamation' -r -a "0 1"
complete -c maa -n "__fish_seen_subcommand_from reclamation" -f -s C -l tool-to-craft -d 'Tool to craft' -r
complete -c maa -n "__fish_seen_subcommand_from reclamation" -f -s m -l increase-mode -d 'Method to increase the number of tools' -r
complete -c maa -n "__fish_seen_subcommand_from reclamation" -f -s n -l num-craft-batches -d 'Number of batches in each game run' -r

# Misc commands
complete -c maa -n "__fish_seen_subcommand_from complete" -f -a "bash fish zsh powershell"
Expand Down
10 changes: 6 additions & 4 deletions maa-cli/docs/en-US/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ After installing and configuring MaaCore, you can run tasks. maa-cli supports tw

### Predefined tasks

- `maa startup [client]`: start the game client and enter the main screen, the `client` is the client type of game, leave it empty to don't start the game;
- `maa closedown [client]`: close the game client, the `client` is the client type of game, default is `Official`;
- `maa fight [stage]`: run a "fight" task, the `stage` is the stage to fight, like `1-7`, `CE-6`, etc.; if not given, the user will be prompted to input one;
- `maa copilot <maa_uri>`: run a "copilot" task, the `maa_uri` is the URI of a copilot task; it can be `maa://1234` or local file path;
- `maa startup [client]`: start the game client and enter the main screen, the `client` is the client type of game, leave it empty to don't start the game.
- `maa closedown [client]`: close the game client, the `client` is the client type of game, default is `Official`.
- `maa fight [stage]`: run a "fight" task, the `stage` is the stage to fight, like `1-7`, `CE-6`, etc.; if not given, the user will be prompted to input one.
- `maa copilot <maa_uri>...`: run a "copilot" task, the `maa_uri` is the URI of a copilot task, multiple URIs will be executed in sequence, `maa_uri` can be `maa://1234` or local file path `./1234.json`.
- `maa sscopilot <maa_uri>`: run a "sscopilot" task, the `maa_uri` is the URI of a sscopilot task.
- `maa roguelike [theme]`: run a "roguelike" task, the `theme` is the theme of roguelike, and available themes are `Phantom`, `Mizuki`, `Sami` and `Sarkaz`.
- `maa reclamation [theme]`: run a "reclamation" task, the `theme` is the theme of reclamation, and available themes are `Tales`.

The above tasks accept some parameters, you can view the specific parameters by `maa <task> --help`.

Expand Down
12 changes: 7 additions & 5 deletions maa-cli/docs/ja-JP/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ maa init

对于常见任务,maa-cli 提供了一些预定义的任务:

- `maa startup [client]`: 启动游戏并进入主界面,`[client]` 是客户端类型,如果留空则不会启动游戏客户端;
- `maa closedown [client]`: 关闭游戏客户端,`[client]` 是客户端类型,默认为 `Official`
- `maa fight [stage]`: 运行战斗任务,`[stage]` 是关卡名称,例如 `1-7`;留空选择上次或者当前关卡;
- `maa copilot <maa_uri>`: 运行自动战斗任务,其中 `<maa_uri>` 是作业的 URI,其可以是 `maa://1234` 或者本地文件路径 `./1234.json`
- `maa roguelike [theme]`: 自动集成战略,`[theme]` 是集成战略的主题,可选值为 `Phantom``Mizuki``Sami` 以及 `Sarkaz`
- `maa startup [client]`: 启动游戏并进入主界面,`[client]` 是客户端类型,如果留空则不会启动游戏客户端。
- `maa closedown [client]`: 关闭游戏客户端,`[client]` 是客户端类型,默认为 `Official`
- `maa fight [stage]`: 运行战斗任务,`[stage]` 是关卡名称,例如 `1-7`;留空选择上次或者当前关卡。
- `maa copilot <maa_uri>...`: 自动抄作业,其中 `<maa_uri>` 是作业的 URI,多个 URI 会依次执行,`maa_uri` 可以是 `maa://1234` 或者 本地文件路径 `./1234.json`
- `maa sscopilot <maa_uri>`: 自动保全派驻,其中 `<maa_uri>` 是保全派驻作业的 URI。
- `maa roguelike <theme>`: 自动集成战略,`<theme>` 是集成战略的主题,可选值为 `Phantom``Mizuki``Sami` 以及 `Sarkaz`
- `maa reclamation <theme>`: 自动生息演算,`<theme>` 是生息演算的主题,目前仅 `Tales` 主题可用。

上述任务接受一些参数,你可以通过 `maa <task> --help` 来查看具体的参数。

Expand Down
6 changes: 4 additions & 2 deletions maa-cli/docs/ko-KR/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ MaaCore의 설치 및 구성을 완료하면 작업을 실행할 준비가 된
- `maa startup [client]`: 게임을 시작하고 메인 화면으로 이동합니다. `[client]`는 클라이언트 유형이며, 생략하면 게임 클라이언트를 시작하지 않습니다.
- `maa closedown [client]`: 게임 클라이언트를 종료합니다. `[client]`는 클라이언트 유형이며, 기본값은 `Official`입니다.
- `maa fight [stage]`: 전투 작업을 실행합니다. `[stage]`는 스테이지 이름이며, 예를 들어 `1-7`입니다. 생략하면 이전 또는 현재 스테이지를 선택합니다.
- `maa copilot <maa_uri>`: 자동 전투 작업을 실행합니다. `<maa_uri>`는 작업의 URI로 `maa://1234` 또는 로컬 파일 경로 `./1234.json`일 수 있습니다.
- `maa roguelike [theme]`: 자동 통합 전략을 실행합니다. `[theme]`는 통합 전략의 주제이며, 선택 가능한 값은 `Phantom`, `Mizuki`, `Sami`, `Sarkaz`입니다.
- `maa copilot <maa_uri>...`: 자동 전투 작업을 실행합니다. `<maa_uri>`는 작업의 URI이며, 여러 URI는 순차적으로 실행됩니다. `maa_uri``maa://1234` 또는 로컬 파일 경로 `./1234.json`일 수 있습니다.
- `maa sscopilot <maa_uri>`: 자동 보안 파견을 실행합니다. `<maa_uri>`는 보안 파견 작업의 URI입니다.
- `maa roguelike <theme>`: 자동 통합 전략을 실행합니다. `<theme>`는 통합 전략의 주제이며, 선택 가능한 값은 `Phantom`, `Mizuki`, `Sami`, `Sarkaz`입니다.
- `maa reclamation <theme>`: 자동 생활 게임을 실행합니다. `<theme>`는 생활 게임의 주제이며, 현재 사용 가능한 값은 `Tales`입니다.

위 작업들은 몇 가지 매개변수를 받습니다. `maa <task> --help` 명령어를 통해 자세한 매개변수를 확인할 수 있습니다.

Expand Down
12 changes: 7 additions & 5 deletions maa-cli/docs/zh-CN/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ maa init

对于常见任务,maa-cli 提供了一些预定义的任务:

- `maa startup [client]`: 启动游戏并进入主界面,`[client]` 是客户端类型,如果留空则不会启动游戏客户端;
- `maa closedown [client]`: 关闭游戏客户端,`[client]` 是客户端类型,默认为 `Official`
- `maa fight [stage]`: 运行战斗任务,`[stage]` 是关卡名称,例如 `1-7`;留空选择上次或者当前关卡;
- `maa copilot <maa_uri>`: 运行自动战斗任务,其中 `<maa_uri>` 是作业的 URI,其可以是 `maa://1234` 或者本地文件路径 `./1234.json`
- `maa roguelike [theme]`: 自动集成战略,`[theme]` 是集成战略的主题,可选值为 `Phantom``Mizuki``Sami` 以及 `Sarkaz`
- `maa startup [client]`: 启动游戏并进入主界面,`[client]` 是客户端类型,如果留空则不会启动游戏客户端。
- `maa closedown [client]`: 关闭游戏客户端,`[client]` 是客户端类型,默认为 `Official`
- `maa fight [stage]`: 运行战斗任务,`[stage]` 是关卡名称,例如 `1-7`;留空选择上次或者当前关卡。
- `maa copilot <maa_uri>...`: 自动抄作业,其中 `<maa_uri>` 是作业的 URI,多个 URI 会依次执行,`maa_uri` 可以是 `maa://1234` 或者 本地文件路径 `./1234.json`
- `maa sscopilot <maa_uri>`: 自动保全派驻,其中 `<maa_uri>` 是保全派驻作业的 URI。
- `maa roguelike <theme>`: 自动集成战略,`<theme>` 是集成战略的主题,可选值为 `Phantom``Mizuki``Sami` 以及 `Sarkaz`
- `maa reclamation <theme>`: 自动生息演算,`<theme>` 是生息演算的主题,目前仅 `Tales` 主题可用。

上述任务接受一些参数,你可以通过 `maa <task> --help` 来查看具体的参数。

Expand Down
12 changes: 7 additions & 5 deletions maa-cli/docs/zh-TW/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ maa init

对于常见任务,maa-cli 提供了一些预定义的任务:

- `maa startup [client]`: 启动游戏并进入主界面,`[client]` 是客户端类型,如果留空则不会启动游戏客户端;
- `maa closedown [client]`: 关闭游戏客户端,`[client]` 是客户端类型,默认为 `Official`
- `maa fight [stage]`: 运行战斗任务,`[stage]` 是关卡名称,例如 `1-7`;留空选择上次或者当前关卡;
- `maa copilot <maa_uri>`: 运行自动战斗任务,其中 `<maa_uri>` 是作业的 URI,其可以是 `maa://1234` 或者本地文件路径 `./1234.json`
- `maa roguelike [theme]`: 自动集成战略,`[theme]` 是集成战略的主题,可选值为 `Phantom``Mizuki``Sami` 以及 `Sarkaz`
- `maa startup [client]`: 启动游戏并进入主界面,`[client]` 是客户端类型,如果留空则不会启动游戏客户端。
- `maa closedown [client]`: 关闭游戏客户端,`[client]` 是客户端类型,默认为 `Official`
- `maa fight [stage]`: 运行战斗任务,`[stage]` 是关卡名称,例如 `1-7`;留空选择上次或者当前关卡。
- `maa copilot <maa_uri>...`: 自动抄作业,其中 `<maa_uri>` 是作业的 URI,多个 URI 会依次执行,`maa_uri` 可以是 `maa://1234` 或者 本地文件路径 `./1234.json`
- `maa sscopilot <maa_uri>`: 自动保全派驻,其中 `<maa_uri>` 是保全派驻作业的 URI。
- `maa roguelike <theme>`: 自动集成战略,`<theme>` 是集成战略的主题,可选值为 `Phantom``Mizuki``Sami` 以及 `Sarkaz`
- `maa reclamation <theme>`: 自动生息演算,`<theme>` 是生息演算的主题,目前仅 `Tales` 主题可用。

上述任务接受一些参数,你可以通过 `maa <task> --help` 来查看具体的参数。

Expand Down
Loading

0 comments on commit d2b6253

Please sign in to comment.