Skip to content

Commit a1571f1

Browse files
committed
feat: 📚短期速成班
1 parent 85dba7c commit a1571f1

9 files changed

Lines changed: 623 additions & 7 deletions

File tree

.qoder/rules/global.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ https://github.com/kqcoxn/MaaDuDuL
2424

2525
- 不要帮我`yarn dev`,一般我是一直开着的
2626
- 不要自动帮我构建测试相关内容
27+
- 不要主动写 Pipeline JSON,如果需要扩充功能,在最后给我流水线汇总
28+
- 本地的 `/MFAAvalonia` 是测试环境,不应该改动,修改各资源应该在 `/assets`

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,31 @@
3232
- [x] 每日签到(打卡/月卡)
3333
- **日常补给**
3434
- [x] 领取邮件
35-
- [x] 每日糖果
3635
- [x] 叶子互换
3736
- **每日采购**
38-
- [x] 免费礼包
39-
- [x] 新礼包查阅奖励
40-
- [x] 商店物资购买
37+
- [x] 免费礼包(日/周/月)
38+
- [x] 新礼包查阅
39+
- [x] 普通商店
40+
- [x] 水晶叶糖果
4141
- **清体力**
4242
- [x] 清紫糖(副本)
4343
- [x] 清红糖(装备)
44+
- [ ] 清红糖(心形)(Coming Soon)
4445
- **圣团巡礼**
4546
- [x] 领取世界树贡品
4647
- [x] 大扫除(手动/女仆)
4748
- [ ] 每日冒险
4849
- [ ] 每日宴席
4950
- [x] 领取宠物礼物
50-
- **农场视察**
51-
- [x] 领取每日萝卜
52-
- [x] 每日派遣
5351
- **巅峰对决**
5452
- [x] 领取战斗宝石
5553
- [x] PVP
54+
- **其他战斗**
55+
- [ ] 短期速成班(Coming Soon)
56+
- [x] 游乐场
57+
- **农场视察**
58+
- [x] 领取每日萝卜
59+
- [x] 每日派遣
5660
- **领取奖励**
5761
- [x] 每日/周奖励
5862
- [x] 通行证奖励
@@ -62,6 +66,8 @@
6266
- **开荒相关**
6367
- [x] 副本连续作战
6468
- [x] 领取章节奖励
69+
- [x] 快速剧情
70+
- [ ] 好友清理
6571

6672
\* **若有其他功能需求请提交 [issue](https://github.com/kqcoxn/MaaDuDuL/issues?q=is%3Aissue)**
6773

agent/customs/special_treat/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
from .receive_reward import *
77
from .land_reclamation import *
88
from .pinch_face import *
9+
from .exam_cram import *
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
"""速成班关卡选择模块
2+
3+
本模块实现速成班关卡的自动选择功能,根据当前游戏日期自动确定并点击对应关卡。
4+
"""
5+
6+
from maa.agent.agent_server import AgentServer
7+
from maa.custom_action import CustomAction
8+
from maa.context import Context
9+
10+
from datetime import datetime, timedelta
11+
12+
from agent.customs.utils import Prompter, MatrixOperator, LocalStorage
13+
from agent.customs.maahelper import ParamAnalyzer, Tasker, RecoHelper
14+
15+
16+
@AgentServer.custom_action("select_cram_level")
17+
class SelectCramLevel(CustomAction):
18+
"""速成班关卡选择自定义动作
19+
20+
根据当前游戏日期自动选择速成班关卡:
21+
- 周一至周五:根据日期直接选择对应关卡(1-5)
22+
- 周六:根据参数选择,可选关卡 1/2/3
23+
- 周日:根据参数选择,可选关卡 4/5
24+
"""
25+
26+
def run(self, context: Context, argv: CustomAction.RunArg) -> bool:
27+
"""执行关卡选择逻辑
28+
29+
Args:
30+
context: MaaFramework 上下文对象
31+
argv: 自定义动作运行参数
32+
33+
Returns:
34+
bool: 执行成功返回 True,失败返回 False
35+
36+
Note:
37+
游戏日期计算逻辑:凌晨 4 点前视为前一天
38+
"""
39+
try:
40+
# 解析自定义动作参数
41+
args = ParamAnalyzer(argv)
42+
43+
# 计算游戏日期
44+
now = datetime.now()
45+
if now.hour < 4:
46+
game_date = now - timedelta(days=1)
47+
else:
48+
game_date = now
49+
weekday = game_date.weekday()
50+
51+
# 根据游戏日期选择关卡
52+
weekday_names = ["一", "二", "三", "四", "五", "六", "日"]
53+
level = 1
54+
if weekday < 5:
55+
# 周一至周五:关卡与星期对应(1-5)
56+
level = weekday + 1
57+
Prompter.log(f"游戏日期为周{weekday_names[weekday]},选择关卡 {level}")
58+
elif weekday == 5:
59+
# 周六:从参数读取关卡(可选 1/2/3)
60+
level = args.get(["week_6", "w6"], 2)
61+
if level not in [1, 2, 3]:
62+
Prompter.log(f"周六关卡 {level} 无效,使用默认关卡 2")
63+
level = 2
64+
Prompter.log(f"游戏日期为周六,选择关卡 {level}")
65+
else:
66+
# 周日:从参数读取关卡(可选 4/5)
67+
level = args.get(["week_7", "w7"], 5)
68+
if level not in [4, 5]:
69+
Prompter.log(f"周日关卡 {level} 无效,使用默认关卡 5")
70+
level = 5
71+
Prompter.log(f"游戏日期为周日,选择关卡 {level}")
72+
73+
# 执行点击操作
74+
Tasker(context).click(130 + (level - 1) * 256, 354)
75+
76+
return True
77+
except Exception as e:
78+
return Prompter.error("选择速成班关卡", e)

assets/interface.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"resource/tasks/daily/clear_red_candy.json",
7171
"resource/tasks/daily/peak_battle.json",
7272
"resource/tasks/daily/farm.json",
73+
"resource/tasks/daily/exam_cram.json",
7374
"resource/tasks/daily/claim_reward.json",
7475
"resource/tasks/daily/claim_new_goods.json",
7576
"resource/tasks/daily/playground.json",

assets/resource/Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
## 主要内容
66

7+
- **新增任务**
8+
- 📚短期速成班
79
- **更新适配**
810
- 适配金币大作战 21-24 关
911
- **问题修复**
@@ -21,6 +23,7 @@
2123

2224
在跨以下版本更新后,您需要手动在列表新增任务区域将任务调整至合适位置使用:
2325

26+
- `v0.2.4`版本后,新增任务“短期速成班”
2427
- `v0.2.3`版本后,新增任务“游乐场”
2528
- `v0.2.0`版本后,新增任务“清红糖”
2629
- 更早版本请查阅更新历史!

0 commit comments

Comments
 (0)