JS脚本:「牌圣」 (#1693)

This commit is contained in:
提瓦特钓鱼玳师
2025-08-24 22:51:30 +08:00
committed by GitHub
parent 6d9159bc29
commit 020cef14b9
45 changed files with 14691 additions and 0 deletions

28
repo/js/DSTCG/README.md Normal file
View File

@@ -0,0 +1,28 @@
脚本名称:「牌圣」(Duel Saint of TCG)
功能描述:智能版自动七圣召唤
## 核心功能
1. 衡量双方出战角色牌的血量、可能发生的元素反应,通过切人来规避伤害或打出元素反应
2. 自动重投元素骰
## 注意事项
1. 使用前最好确保位于“手牌选择”界面或**牌局开始后任何一个阶段的界面**
2. 由于手牌部分的逻辑还未完善人话没来得及做已经在JS内关闭了双方召唤、支援牌区的识别和手牌详情的识别
3. 本JS脚本目前为测试版出现bug请在v7群或者测试群内@作者反馈
## 测试阶段尚未解决的问题
```JS脚本配置未完全关联```
1. OCR识别血量不准确
2. 考量全面的通用策略(现有版本不考虑手牌和副牌区)尚待完善,目前进度:第三版策略,绘制流程图重制阶段
3. 手牌和副牌的结合使用(需要完善卡牌描述字符串信息的解析相关方法,该部分代码已经注释)
## 其它
作者:提瓦特钓鱼玳师
脚本反馈邮箱hijiwos@hotmail.com

View File

@@ -0,0 +1,46 @@
### action单个卡牌效果以下仅影响出牌决策具体效果不进行推算数据实时获取
1. dealDamage(boolean)是否造成伤害
2. instantDamage(boolean)是否是即时伤害
3. clickTwiceboolean是否需要二次点击
例如指定敌方的召唤牌
4. damageint伤害
正数为攻击、负数为治疗
5. residueDegreeint剩余次数
6. consumption(int) 生效后减少的可用次数
7. effectTypeString生效类型
- 我方出战角色为...角色被动user_main_card\[card_name\]
- 我方...卡牌入场名称、类型user_card_income\[card_name\]
- 敌方...卡牌入场名称、类型enemy_card_income\[card_name\]
- 我方切换角色 user_switch
- 敌方切换角色 enemy_switch
- 我方造成元素攻击 user_element_dmg
- 敌方造成元素攻击 enemy_element_dmg
- 我方造成穿透伤害 user_real_dmg
- 敌方造成穿透伤害 enemy_real_dmg
- 回合结束 round_over
8. elementTypeString元素类型(元素附着)
- 无 None
- 火 Pyro
- 水 Hydro
- 风 Anemo
- 雷 Electro
- 草 Dendro
- 冰 Cryo
- 岩 Geo
9. targetTypeString目标
- 敌方出战卡牌 enemy_main_card
- 我方出战卡牌 user_main_card
- 敌方下一个角色卡牌 enemy_next_card
- 我方下一个角色卡牌 user_next_card
- 敌方所有后台卡牌 enemy_other_card
- 我方所有后台卡牌 user_other_card
- 敌方支援牌 enemy_location
- 敌方召唤牌 enemy_summon
- 我方支援牌 user_location
- 我方召唤牌 user_summon
10. specialEffectString特殊效果
例如本回合禁止对方使用行动牌(秘传卡牌等)

View File

@@ -0,0 +1,40 @@
缺少实时监测技能骰子消耗的方法
元素爆发释放检测是否有对应手牌
元素反应检测只能判断增幅,计算伤害要额外根据技能
每轮次优先无条件打出0消耗的手牌
// 1
if 我方骰子数小于等于1
结束回合
// 2
else if 我方出战角色充能已满且元素爆发满足释放条件(此if语句内仅供参考实际执行直接释放元素爆发)
if 敌方出战角色附着有元素
if 我方出战角色元素可以与敌方出战角色的附着元素发生反应
释放元素爆发
else if 我方出战角色血量小于等于3
切换我方受对方元素影响后血量最高的后台角色(逻辑需要完善,可能存在只剩一张牌的情况)
// 3
else if 我方出战角色充能已满且元素爆发不满足释放条件
切换我方受对方元素影响最低的角色(如果切换的是当前角色,检测释放条件释放元素技能或普攻)
// 4
else if 我方出战角色经元素反应检测后剩余血量大于0
if 敌方出战角色附着有元素
if 我方出战角色元素可以与敌方出战角色的附着元素发生反应
释放元素技能
else
if 我方出战角色为法器角色
释放元素技能
else
释放普攻
else
我方出战角色使用附带元素附着的攻击(优先技能,避免使用元素爆发)
// 5
else if 我方出战角色经元素反应检测后剩余血量小于等于0
if 敌方出战角色经元素反应检测后血量小于等于0
我方释放元素技能(骰子数识别)
else
切换我方元素检测后血量最高的角色(保证角色未倒地)

View File

@@ -0,0 +1,28 @@
// 元素爆发满足释放条件应当优先释放元素爆发
if 我方剩余骰子数 == 0
结束回合
if 敌方剩余骰子数 <= 2 or 敌方已经结束回合
if 我方剩余骰子数 <= 2
模拟所有我方角色经过敌方出战角色攻击后的剩余血量
计算我方角色经计算后血量最高的那个,切换该角色,如果要求换的角色为出战角色,结束回合
else // 我方剩余骰子数 >= 3
if 敌方出战角色附着有元素
计算我方出战角色的元素是否能与之发生反应
if 能反应
计算元素战技的消耗并计算可用性
if 能释放
元素调和后释放(如果需要元素调和)
else // 无法释放
模拟所有我方角色经过敌方出战角色攻击后的剩余血量
else // 无法反应
if 我方出战角色为法器角色
计算并释放元素战技
else // 不是法器角色
计算并释放普通攻击
计算我方角色经计算后血量最高的那个,切换该角色,如果要求换的角色为出战角色,结束回合
else // 敌方出战角色未附着元素
else
if 我方剩余骰子数 == 1
else // 我方剩余骰子数 >= 2

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

2504
repo/js/DSTCG/main.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
{
"manifest_version": 1,
"name": "「牌圣」",
"version": "1.0",
"bgi_version": "0.45.0",
"description": "智能版自动七圣召唤",
"authors": [
{
"name": "提瓦特钓鱼玳师",
"links": "https://github.com/Hijiwos"
}
],
"settings_ui": "settings.json",
"main": "main.js"
}

View File

@@ -0,0 +1,3 @@
[
]

View File

@@ -0,0 +1,14 @@
\[默认满级\]
# 自动寻找并进入对局类
1. 猫尾酒馆(角色挑战)
- 传送到猫尾酒馆
- 交互画框
- 根据角色选择对应挑战
- 判断剩余邀请函并自动购买(检测兑换币是否充足)
- 进入角色对战(普通和认真)
2. 猫尾酒馆(酒馆挑战)
3. 猫尾酒馆(每周对战)
4. 大世界(角色对战)