Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
18636ac8
Commit
18636ac8
authored
Apr 30, 2025
by
Nemo Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FEAT: Add club22
parent
7cc8abdd
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
3286 additions
and
46 deletions
+3286
-46
command.php
command.php
+70
-28
doc/etc/20240719_185500_fireseed_deploy_fix.txt
doc/etc/20240719_185500_fireseed_deploy_fix.txt
+31
-0
doc/etc/20240719_190500_fireseed_clbpara_fix.txt
doc/etc/20240719_190500_fireseed_clbpara_fix.txt
+53
-0
doc/etc/20240719_191500_fireseed_clbpara_fix2.txt
doc/etc/20240719_191500_fireseed_clbpara_fix2.txt
+100
-0
doc/etc/20240719_192500_fireseed_logic_move.txt
doc/etc/20240719_192500_fireseed_logic_move.txt
+57
-0
doc/etc/20240719_193500_fireseed_panel_update.txt
doc/etc/20240719_193500_fireseed_panel_update.txt
+45
-0
doc/etc/20240719_194500_fireseed_deploy_fix.txt
doc/etc/20240719_194500_fireseed_deploy_fix.txt
+55
-0
doc/etc/20240719_195500_fireseed_clbpara_save.txt
doc/etc/20240719_195500_fireseed_clbpara_save.txt
+44
-0
doc/etc/20240719_201500_npc_purity_implementation.txt
doc/etc/20240719_201500_npc_purity_implementation.txt
+53
-0
doc/etc/20240719_202500_fireseed_deploy_position_fix.txt
doc/etc/20240719_202500_fireseed_deploy_position_fix.txt
+45
-0
doc/etc/20240719_204500_fireseed_deploy_position_fix2.txt
doc/etc/20240719_204500_fireseed_deploy_position_fix2.txt
+63
-0
doc/etc/20240719_210000_fireseed_deploy_position_fix3.txt
doc/etc/20240719_210000_fireseed_deploy_position_fix3.txt
+102
-0
doc/etc/20240719_212000_slidingpanel_improvements.txt
doc/etc/20240719_212000_slidingpanel_improvements.txt
+104
-0
doc/etc/20240719_214500_slidingpanel_undefined_fix.txt
doc/etc/20240719_214500_slidingpanel_undefined_fix.txt
+103
-0
doc/etc/20240719_221500_slidingpanel_item_display_fix.txt
doc/etc/20240719_221500_slidingpanel_item_display_fix.txt
+78
-0
doc/etc/20240719_224500_club22_fireseed_fix.txt
doc/etc/20240719_224500_club22_fireseed_fix.txt
+114
-0
doc/etc/20240719_230000_fireseed_follow_implementation.txt
doc/etc/20240719_230000_fireseed_follow_implementation.txt
+105
-0
doc/etc/20240719_232000_fireseed_button_fix.txt
doc/etc/20240719_232000_fireseed_button_fix.txt
+55
-0
doc/etc/20240719_club22_implementation.txt
doc/etc/20240719_club22_implementation.txt
+51
-0
doc/etc/20240719_slidingpanel_fix.txt
doc/etc/20240719_slidingpanel_fix.txt
+23
-0
doc/etc/20240719_slidingpanel_fix2.txt
doc/etc/20240719_slidingpanel_fix2.txt
+40
-0
doc/etc/20240719_slidingpanel_fix3.txt
doc/etc/20240719_slidingpanel_fix3.txt
+44
-0
game.php
game.php
+3
-0
gamedata/cache/addnpc_1.php
gamedata/cache/addnpc_1.php
+1
-0
gamedata/cache/club22cfg.php
gamedata/cache/club22cfg.php
+36
-0
gamedata/cache/clubskills_1.php
gamedata/cache/clubskills_1.php
+13
-1
gamedata/cache/npc_1.php
gamedata/cache/npc_1.php
+1
-0
include/game/club22.func.php
include/game/club22.func.php
+566
-0
include/game/item.test.php
include/game/item.test.php
+13
-0
include/game/revattr.func.php
include/game/revattr.func.php
+22
-2
include/game/search.func.php
include/game/search.func.php
+17
-0
include/news.func.php
include/news.func.php
+3
-1
include/state.func.php
include/state.func.php
+8
-0
templates/default/command.htm
templates/default/command.htm
+12
-6
templates/default/corpse.htm
templates/default/corpse.htm
+2
-0
templates/default/fireseedpage.htm
templates/default/fireseedpage.htm
+311
-0
templates/default/slidingpanel.htm
templates/default/slidingpanel.htm
+843
-8
No files found.
command.php
View file @
18636ac8
...
@@ -392,6 +392,62 @@ if($hp > 0){
...
@@ -392,6 +392,62 @@ if($hp > 0){
skill_tl_pickpocket_act
(
$choice
);
skill_tl_pickpocket_act
(
$choice
);
}
}
$mode
=
'command'
;
$mode
=
'command'
;
}
elseif
(
$sp_cmd
==
'sp_fireseed_deploy'
&&
$club
==
22
){
include_once
GAME_ROOT
.
'./include/game/club22.func.php'
;
if
(
isset
(
$fireseed_id
)
&&
isset
(
$deploy_mode
)){
$deploy_pls
=
isset
(
$deploy_pls
)
?
intval
(
$deploy_pls
)
:
$pls
;
$log
.=
"<span class='yellow'>DEBUG: 部署位置
$deploy_pls
</span><br>"
;
FireseedDeploy
(
$fireseed_id
,
$deploy_mode
,
$deploy_pls
);
}
else
{
$log
.=
'<span class="red">请选择要部署的种火和部署模式!</span><br>'
;
}
$mode
=
'command'
;
}
elseif
(
$sp_cmd
==
'sp_fireseed_getitem'
&&
$club
==
22
){
include_once
GAME_ROOT
.
'./include/game/club22.func.php'
;
if
(
isset
(
$fireseed_item_id
)
&&
isset
(
$item_id
)){
// 从种火物品池中获取物品
if
(
isset
(
$clbpara
[
'fireseed'
][
$fireseed_item_id
][
'items'
][
$item_id
])){
$item
=
$clbpara
[
'fireseed'
][
$fireseed_item_id
][
'items'
][
$item_id
];
// 查找空物品栏
$empty_slot
=
0
;
for
(
$i
=
1
;
$i
<=
6
;
$i
++
){
if
(
empty
(
$
{
'itm'
.
$i
})){
$empty_slot
=
$i
;
break
;
}
}
if
(
$empty_slot
){
// 将物品添加到玩家物品栏
$
{
'itm'
.
$empty_slot
}
=
$item
[
'itm'
];
$
{
'itmk'
.
$empty_slot
}
=
$item
[
'itmk'
];
$
{
'itme'
.
$empty_slot
}
=
$item
[
'itme'
];
$
{
'itms'
.
$empty_slot
}
=
$item
[
'itms'
];
$
{
'itmsk'
.
$empty_slot
}
=
$item
[
'itmsk'
];
// 从种火物品池中移除物品
unset
(
$clbpara
[
'fireseed'
][
$fireseed_item_id
][
'items'
][
$item_id
]);
$log
.=
'<span class="lime">你从种火「'
.
$clbpara
[
'fireseed'
][
$fireseed_item_id
][
'name'
]
.
'」处获得了物品「'
.
$item
[
'itm'
]
.
'」!</span><br>'
;
}
else
{
$log
.=
'<span class="red">你的物品栏已满,无法获取物品!</span><br>'
;
}
}
else
{
$log
.=
'<span class="red">指定的物品不存在!</span><br>'
;
}
}
else
{
$log
.=
'<span class="red">请选择要获取物品的种火和物品!</span><br>'
;
}
$mode
=
'command'
;
}
elseif
(
$sp_cmd
==
'sp_fireseed_enhance'
&&
$club
==
22
){
include_once
GAME_ROOT
.
'./include/game/club22.func.php'
;
if
(
isset
(
$enhance_fireseed_id
)
&&
isset
(
$enhance_item
)){
FireseedEnhance
(
$enhance_fireseed_id
,
$enhance_item
);
}
else
{
$log
.=
'<span class="red">请选择要强化的种火和焰火物品!</span><br>'
;
}
$mode
=
'command'
;
}
else
{
}
else
{
$mode
=
$sp_cmd
;
$mode
=
$sp_cmd
;
}
}
...
@@ -478,8 +534,8 @@ if($hp > 0){
...
@@ -478,8 +534,8 @@ if($hp > 0){
$opendialog
=
null
;
$opendialog
=
null
;
// 保存玩家数据,确保选择被记录
// 保存玩家数据,确保选择被记录
$serialized_clbpara
=
serialize
(
$clbpara
);
//
$serialized_clbpara = serialize($clbpara);
$encoded_clbpara
=
base64_encode
(
$serialized_clbpara
);
$encoded_clbpara
=
json_encode
(
$clbpara
,
JSON_UNESCAPED_UNICODE
);
//$log .= "<!-- DEBUG: 序列化后的 clbpara 长度: " . strlen($serialized_clbpara) . " -->";
//$log .= "<!-- DEBUG: 序列化后的 clbpara 长度: " . strlen($serialized_clbpara) . " -->";
//$log .= "<!-- DEBUG: 编码后的 clbpara 长度: " . strlen($encoded_clbpara) . " -->";
//$log .= "<!-- DEBUG: 编码后的 clbpara 长度: " . strlen($encoded_clbpara) . " -->";
...
@@ -489,30 +545,6 @@ if($hp > 0){
...
@@ -489,30 +545,6 @@ if($hp > 0){
if
(
$update_result
)
{
if
(
$update_result
)
{
$log
.=
"<!-- DEBUG: 数据库更新成功 -->"
;
$log
.=
"<!-- DEBUG: 数据库更新成功 -->"
;
// 验证数据库中的值是否正确
$verify_query
=
"SELECT clbpara FROM
{
$tablepre
}
players WHERE pid='
$pid
'"
;
$verify_result
=
$db
->
query
(
$verify_query
);
if
(
$verify_result
&&
$db
->
num_rows
(
$verify_result
)
>
0
)
{
$verify_data
=
$db
->
fetch_array
(
$verify_result
);
$db_clbpara
=
$verify_data
[
'clbpara'
];
$log
.=
"<!-- DEBUG: 数据库中的 clbpara 长度: "
.
strlen
(
$db_clbpara
)
.
" -->"
;
// 尝试解码和反序列化
try
{
$decoded_clbpara
=
base64_decode
(
$db_clbpara
);
$unserialized_clbpara
=
unserialize
(
$decoded_clbpara
);
if
(
is_array
(
$unserialized_clbpara
)
&&
isset
(
$unserialized_clbpara
[
'dialogue_choice'
]))
{
$log
.=
"<!-- DEBUG: 数据库中的 dialogue_choice 存在 -->"
;
}
else
{
$log
.=
"<!-- DEBUG: 数据库中的 dialogue_choice 不存在 -->"
;
}
}
catch
(
Exception
$e
)
{
$log
.=
"<!-- DEBUG: 反序列化失败: "
.
$e
->
getMessage
()
.
" -->"
;
}
}
else
{
$log
.=
"<!-- DEBUG: 无法验证数据库中的值 -->"
;
}
}
else
{
}
else
{
$log
.=
"<!-- DEBUG: 数据库更新失败: "
.
$db
->
error
()
.
" -->"
;
$log
.=
"<!-- DEBUG: 数据库更新失败: "
.
$db
->
error
()
.
" -->"
;
}
}
...
@@ -736,8 +768,18 @@ if($hp > 0){
...
@@ -736,8 +768,18 @@ if($hp > 0){
// include_once GAME_ROOT.'./include/game/special.func.php';
// include_once GAME_ROOT.'./include/game/special.func.php';
// chgword($newmotto,$newlastword,$newkillmsg);
// chgword($newmotto,$newlastword,$newkillmsg);
}
elseif
(
$mode
==
'corpse'
)
{
}
elseif
(
$mode
==
'corpse'
)
{
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
if
(
$command
==
'fireseed_recruit'
&&
$club
==
22
)
{
getcorpse
(
$command
);
include_once
GAME_ROOT
.
'./include/game/club22.func.php'
;
$result
=
$db
->
query
(
"SELECT * FROM
{
$tablepre
}
players WHERE pid='
$bid
' AND hp=0"
);
if
(
$db
->
num_rows
(
$result
)
>
0
)
{
$npc
=
$db
->
fetch_array
(
$result
);
FireseedRecruit
(
$npc
);
}
$mode
=
'command'
;
}
else
{
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
getcorpse
(
$command
);
}
}
elseif
(
$mode
==
'team'
)
{
}
elseif
(
$mode
==
'team'
)
{
include_once
GAME_ROOT
.
'./include/game/team.func.php'
;
include_once
GAME_ROOT
.
'./include/game/team.func.php'
;
if
(
$command
==
"teammake"
)
teammake
(
$nteamID
,
$nteamPass
,(
int
)
$ticon
);
if
(
$command
==
"teammake"
)
teammake
(
$nteamID
,
$nteamPass
,(
int
)
$ticon
);
...
...
doc/etc/20240719_185500_fireseed_deploy_fix.txt
0 → 100644
View file @
18636ac8
# 种火部署功能修复记录
## 问题描述
在侧边面板中使用种火部署功能时,点击"部署种火"按钮后,command.php 在新窗口中打开,显示原始 HTML 代码而不是正确执行命令。这个问题也影响了种火物品获取和种火强化功能。
## 问题原因
问题出在表单提交方式上。原来的代码使用了创建隐藏表单并直接提交的方式,这导致了浏览器打开新窗口并显示原始 HTML 内容,而不是正确处理命令。
## 修复方法
将表单提交方式从直接提交改为使用 AJAX 方式提交,这样可以在后台处理命令而不会导致页面跳转或打开新窗口。
修改了以下三个 JavaScript 函数:
1. `deployFireseed()` - 处理种火部署
2. `getFireseedItem()` - 处理种火物品获取
3. `enhanceFireseed()` - 处理种火强化
每个函数都做了以下改动:
- 移除了创建隐藏表单的代码
- 使用 FormData 对象收集表单数据
- 使用 XMLHttpRequest 对象通过 AJAX 方式提交数据
- 添加了成功和错误处理逻辑
- 在命令执行后更新 clbpara 数据
- 显示操作状态消息
## 修复文件
- templates/default/slidingpanel.htm
## 注意事项
- 这种修复方法保持了原有的命令处理逻辑不变,只是改变了命令的提交方式
- 使用 AJAX 提交后,命令的执行结果会显示在游戏主界面的命令窗口中,而不是打开新窗口
- 添加了错误处理和状态反馈,提高了用户体验
doc/etc/20240719_190500_fireseed_clbpara_fix.txt
0 → 100644
View file @
18636ac8
# 种火 clbpara 数据格式修复记录
## 问题描述
在收纳种火后,其 clbpara 数据没有正确处理,数据库中的 clbpara 键值成为了类似于 `czoyMzoiNCJza2lsbCI6WyJmaXJlc2VlZDMiXX0iOw==` 这样的 base64 编码的序列化数据,导致大部分逻辑无法生效。
## 问题原因
问题出在 FireseedRecruit 函数中处理 NPC 的 clbpara 数据的方式。当前代码使用了 serialize 和 base64_encode 来处理 clbpara 数据,但是系统中处理 clbpara 的标准方式是使用 JSON 格式。
## 修复方法
1. 修改 FireseedRecruit 函数中更新 NPC clbpara 的代码,将 base64_encode(serialize()) 改为 json_encode()
2. 创建一个修复函数 fix_fireseed_data(),用于修复已经存在的错误数据
3. 在 command.php 中添加一个特殊命令 sp_fireseed_fix,用于执行修复函数
4. 在侧边面板中添加一个修复按钮,方便用户执行修复操作
## 修复文件
1. include/game/club22.func.php - 修改 FireseedRecruit 函数
2. include/game/club22_fix.func.php - 新增修复函数
3. command.php - 添加特殊命令
4. templates/default/slidingpanel.htm - 添加修复按钮和 JavaScript 函数
## 修复详情
1. 在 FireseedRecruit 函数中,将:
```php
$encoded_clbpara = base64_encode(serialize($npc_clbpara));
```
修改为:
```php
$encoded_clbpara = json_encode($npc_clbpara, JSON_UNESCAPED_UNICODE);
```
2. 创建 club22_fix.func.php 文件,实现 fix_fireseed_data 函数,该函数会:
- 查找所有种火 NPC(type=92)
- 检查 clbpara 是否为 base64 编码的序列化数据
- 如果是,则解码、反序列化,然后重新以 JSON 格式编码
- 更新数据库中的记录
- 同时检查所有拥有种火的玩家,确保种火的 owner 字段正确
3. 在 command.php 中添加特殊命令:
```php
elseif($sp_cmd == 'sp_fireseed_fix' && $club == 22){
include_once GAME_ROOT.'./include/game/club22_fix.func.php';
fix_fireseed_data();
$mode = 'command';
}
```
4. 在侧边面板中添加"种火维护"部分,包含修复按钮和 fixFireseedData JavaScript 函数
## 注意事项
- 修复操作只能由枫火歌者(club=22)执行
- 修复操作会尝试修复所有种火的数据格式问题
- 修复操作会显示修复的记录数量
- 修复按钮有确认提示,防止误操作
doc/etc/20240719_191500_fireseed_clbpara_fix2.txt
0 → 100644
View file @
18636ac8
# 种火 clbpara 数据格式修复记录 (第二次)
## 问题描述
在收纳种火后,其 clbpara 中的 skill 数据仍然没有正确处理,数据库中的 clbpara 键值成为了类似于 `"4"skill":[fireseed3]}"` 这样的格式,而不是正确的 JSON 格式 `{"skill":["fireseed3"]}`。
## 问题原因
问题出在 FireseedRecruit 函数中处理 NPC 的 clbpara 数据的方式。虽然我们已经将 base64_encode(serialize()) 改为 json_encode(),但是在读取 NPC 的 clbpara 数据时没有正确处理 skill 字段。
## 修复方法
1. 修改 FireseedRecruit 函数,确保正确处理 NPC 的 clbpara 数据:
- 添加对 NPC clbpara 的检查,确保它是数组格式
- 添加对 skill 字段的检查,确保它是数组格式
2. 修改 club22_fix.func.php 文件,增强修复功能:
- 添加对 skill 字段的特殊处理,将字符串格式的 skill 字段转换为数组格式
- 添加对非 base64 编码的 clbpara 数据的处理
- 添加对玩家 clbpara 中 fireseed 数据的修复
## 修复文件
1. include/game/club22.func.php - 修改 FireseedRecruit 函数
2. include/game/club22_fix.func.php - 增强修复功能
## 修复详情
1. 在 FireseedRecruit 函数中,添加对 NPC clbpara 的检查:
```php
// 确保 NPC 的 clbpara 是数组格式
if(!is_array($npc['clbpara'])) {
$npc['clbpara'] = get_clbpara($npc['clbpara']);
}
```
2. 在 FireseedRecruit 函数中,修改对 skill 字段的处理:
```php
'skills' => isset($npc['clbpara']['skill']) && is_array($npc['clbpara']['skill']) ? $npc['clbpara']['skill'] : array(),
```
3. 在 club22_fix.func.php 文件中,添加对 skill 字段的特殊处理:
```php
// 确保 skill 字段是数组
if(isset($unserialized['skill']) && !is_array($unserialized['skill'])) {
// 如果 skill 字段不是数组,尝试修复
$skill_str = $unserialized['skill'];
// 尝试从字符串中提取技能数组
if(preg_match('/\[(.*?)\]/', $skill_str, $matches)) {
$skills = explode(',', str_replace('"', '', $matches[1]));
$unserialized['skill'] = array_map('trim', $skills);
} else {
$unserialized['skill'] = array();
}
}
```
4. 在 club22_fix.func.php 文件中,添加对非 base64 编码的 clbpara 数据的处理:
```php
// 如果不是 base64 编码,尝试直接解析
$clbpara_data = json_decode($npc['clbpara'], true);
if(is_array($clbpara_data)) {
// 确保 skill 字段是数组
if(isset($clbpara_data['skill']) && !is_array($clbpara_data['skill'])) {
// 如果 skill 字段不是数组,尝试修复
$skill_str = $clbpara_data['skill'];
// 尝试从字符串中提取技能数组
if(preg_match('/\[(.*?)\]/', $skill_str, $matches)) {
$skills = explode(',', str_replace('"', '', $matches[1]));
$clbpara_data['skill'] = array_map('trim', $skills);
} else {
$clbpara_data['skill'] = array();
}
}
// 重新编码为JSON格式
$json_clbpara = json_encode($clbpara_data, JSON_UNESCAPED_UNICODE);
// 更新数据库
$db->query("UPDATE {$tablepre}players SET clbpara='$json_clbpara' WHERE pid='{$npc['pid']}'");
$fixed_count++;
}
```
5. 在 club22_fix.func.php 文件中,添加对玩家 clbpara 中 fireseed 数据的修复:
```php
// 检查种火的skills字段是否为数组
if(isset($fs_data['skills']) && !is_array($fs_data['skills'])) {
// 如果 skills 字段不是数组,尝试修复
$skills_str = $fs_data['skills'];
// 尝试从字符串中提取技能数组
if(preg_match('/\[(.*?)\]/', $skills_str, $matches)) {
$skills = explode(',', str_replace('"', '', $matches[1]));
$clbpara['fireseed'][$fs_id]['skills'] = array_map('trim', $skills);
} else {
$clbpara['fireseed'][$fs_id]['skills'] = array();
}
$updated = true;
}
```
## 注意事项
- 修复操作只能由枫火歌者(club=22)执行
- 修复操作会尝试修复所有种火的数据格式问题,包括 skill 字段的格式问题
- 修复操作会显示修复的记录数量
- 修复按钮有确认提示,防止误操作
doc/etc/20240719_192500_fireseed_logic_move.txt
0 → 100644
View file @
18636ac8
# 种火探物和索敌逻辑移动记录
## 问题描述
在将种火设定在探物或索敌模式时,没有返回任何反馈,效果也没有生效。这是因为这些功能的触发逻辑在 game.php 中,但只有在玩家执行 command=move 时才会触发,而不会在其他移动或探索操作中触发。
## 问题原因
原来的代码在 game.php 中判断 `$mode == 'command' && $command == 'move'` 时才会触发种火的探物和索敌逻辑,但这种判断方式不够全面,无法覆盖所有的移动和探索场景。
## 修复方法
将种火的探物和索敌逻辑从 game.php 移动到 search.func.php 中的 move() 和 search() 函数中,这样无论玩家通过什么方式移动或探索,都能触发种火的相关功能。
## 修改文件
1. include/game/search.func.php - 在 move() 和 search() 函数中添加种火逻辑
2. game.php - 移除原有的种火逻辑判断
## 修改详情
1. 在 search.func.php 的 move() 函数中添加:
```php
# 如果是种火歌者,处理种火相关逻辑
if($club == 22) {
include_once GAME_ROOT.'./include/game/club22.func.php';
FireseedSearch($pls);
FireseedDrainNPC($pls);
}
```
2. 在 search.func.php 的 search() 函数中添加:
```php
# 如果是种火歌者,处理种火相关逻辑
if($club == 22) {
include_once GAME_ROOT.'./include/game/club22.func.php';
FireseedSearch($pls);
FireseedDrainNPC($pls);
}
```
3. 从 game.php 中移除:
```php
// 如果是种火歌者,处理种火相关逻辑
if($club == 22) {
include_once GAME_ROOT.'./include/game/club22.func.php';
// 如果玩家在移动时,触发种火探物和索敌逻辑
if($mode == 'command' && $command == 'move') {
FireseedSearch($pls);
FireseedDrainNPC($pls);
}
}
```
## 优势
1. 无论玩家通过什么方式移动或探索,都能触发种火的探物和索敌逻辑
2. 代码逻辑更加清晰,将相关功能放在更合适的位置
3. 修复了种火探物和索敌功能不生效的问题
## 注意事项
- 这个修改不会影响其他功能,只是将种火的逻辑移动到更合适的位置
- 种火的探物和索敌功能现在会在每次移动和探索时都触发,而不仅仅是在执行 command=move 时
doc/etc/20240719_193500_fireseed_panel_update.txt
0 → 100644
View file @
18636ac8
# 种火管理面板更新功能修复记录
## 问题描述
通过侧面板对种火进行操作后,面板上的数据不会自动更新,必须重新加载整个页面才能看到变化。这与之前 charge 进度条的问题类似。点击面板上的更新信息按钮也不会更新种火标签页的内容。
## 问题原因
虽然已经有 `fetchLatestClbpara()` 函数来获取最新的 clbpara 数据,但是种火标签页的内容没有在数据更新后刷新。需要添加一个函数来更新种火标签页的内容,并在获取最新数据后调用它。
## 修复方法
1. 添加 `updateFireseedTab()` 函数,用于更新种火标签页的内容
2. 在 `fetchLatestClbpara()` 函数中调用 `updateFireseedTab()`
3. 在 `openPanel()` 函数中调用 `updateFireseedTab()`
4. 在 `manualUpdate()` 函数中调用 `updateFireseedTab()`
5. 在 `deployFireseed()`、`getFireseedItem()` 和 `enhanceFireseed()` 函数中添加延迟调用 `updateFireseedTab()`
## 修改文件
1. templates/default/slidingpanel.htm - 添加 `updateFireseedTab()` 函数及相关辅助函数
## 修改详情
1. 添加 `updateFireseedTab()` 函数,用于更新种火标签页的内容:
- 更新种火状态表格
- 更新种火选择下拉框
- 更新种火物品列表
2. 添加辅助函数:
- `updateFireseedStatusTable()` - 更新种火状态表格
- `getPlsName()` - 获取位置名称
- `updateFireseedSelects()` - 更新种火选择下拉框
- `updateFireseedItemsList()` - 更新种火物品列表
3. 在以下位置调用 `updateFireseedTab()` 函数:
- `fetchLatestClbpara()` 函数中
- `openPanel()` 函数中
- `manualUpdate()` 函数中
- `deployFireseed()`、`getFireseedItem()` 和 `enhanceFireseed()` 函数中(延迟调用)
## 优势
1. 种火标签页的内容会在数据更新后自动刷新
2. 用户可以通过点击更新信息按钮手动刷新种火标签页
3. 用户可以在操作种火后立即看到变化,无需刷新整个页面
4. 提高了用户体验,使种火管理更加方便
## 注意事项
- 由于 AJAX 请求的异步性质,在某些情况下可能需要等待一段时间才能看到更新后的数据
- 为了确保数据更新后能够正确显示,在某些操作后添加了延迟调用 `updateFireseedTab()` 函数
doc/etc/20240719_194500_fireseed_deploy_fix.txt
0 → 100644
View file @
18636ac8
# 种火部署位置修复记录
## 问题描述
1. 种火部署位置选择下拉框显示了所有位置,包括禁区和隐藏位置,而不是只显示玩家可以移动到的位置
2. 种火部署后没有正确移动到选择的位置
## 问题原因
1. 位置选择下拉框没有过滤掉禁区和隐藏位置
2. FireseedDeploy 函数只更新了 clbpara 中的种火位置,但没有更新数据库中对应 NPC 的位置
## 修复方法
1. 修改 slidingpanel.htm 中的位置选择下拉框,使其只显示玩家可以移动到的位置
2. 修改 club22.func.php 中的 FireseedDeploy 函数,确保种火正确移动到选择的位置
## 修改文件
1. templates/default/slidingpanel.htm - 修改位置选择下拉框
2. include/game/club22.func.php - 修改 FireseedDeploy 函数
## 修改详情
1. 在 slidingpanel.htm 中修改位置选择下拉框:
```html
<select id="deploy_pls_panel">
<!--{loop $plsinfo $pls_id $pls_name}-->
<!--{if $pls_id > 0 && !in_array($pls_id, $deepzones) && $pls_id < 100}-->
<option value="$pls_id" <!--{if $pls_id == $pls}-->selected<!--{/if}-->>$pls_name</option>
<!--{/if}-->
<!--{/loop}-->
</select>
```
2. 在 club22.func.php 中修改 FireseedDeploy 函数:
- 添加对位置有效性的检查
- 添加更新数据库中 NPC 位置的代码
```php
// 检查位置是否有效(不是禁区或隐藏地图)
if(in_array($pls, $deepzones) || $pls < 0 || $pls >= 100) {
$log .= "<span class='red'>无法部署到指定位置!</span><br>";
return false;
}
// 如果种火有对应的NPC,更新NPC的位置
$result = $db->query("SELECT * FROM {$tablepre}players WHERE pid='$fireseed_id'");
if($db->num_rows($result) > 0) {
$db->query("UPDATE {$tablepre}players SET pls='$pls' WHERE pid='$fireseed_id'");
}
```
## 优势
1. 位置选择下拉框只显示玩家可以移动到的位置,避免玩家选择无效位置
2. 种火部署后会正确移动到选择的位置,使得探物和索敌功能能够正常工作
3. 添加了位置有效性检查,避免玩家部署到无效位置
## 注意事项
- 这个修复不会影响其他功能,只是修复了种火部署的问题
- 种火部署后,如果有对应的 NPC,会更新 NPC 的位置,使得探物和索敌功能能够正常工作
doc/etc/20240719_195500_fireseed_clbpara_save.txt
0 → 100644
View file @
18636ac8
# 种火 clbpara 保存修复记录
## 问题描述
在部署种火后,种火的位置信息没有正确更新。虽然 FireseedDeploy 函数更新了 clbpara 中的种火位置信息,但没有将更新后的 clbpara 保存到数据库中,导致种火的位置信息在页面刷新后丢失。
## 问题原因
FireseedDeploy、FireseedSearch 和 FireseedEnhance 函数更新了 clbpara 数组,但没有将更新后的 clbpara 保存到数据库中。
## 修复方法
修改 FireseedDeploy、FireseedSearch 和 FireseedEnhance 函数,在更新 clbpara 数组后,将其使用 JSON 格式编码并保存到数据库中。
## 修改文件
1. include/game/club22.func.php - 修改 FireseedDeploy、FireseedSearch 和 FireseedEnhance 函数
## 修改详情
1. 在 FireseedDeploy 函数中添加:
```php
// 将更新后的 clbpara 保存到数据库
$encoded_clbpara = json_encode($clbpara, JSON_UNESCAPED_UNICODE);
$db->query("UPDATE {$tablepre}players SET clbpara='$encoded_clbpara' WHERE pid='$pid'");
```
2. 在 FireseedSearch 函数中添加:
```php
// 将更新后的 clbpara 保存到数据库
$encoded_clbpara = json_encode($clbpara, JSON_UNESCAPED_UNICODE);
$db->query("UPDATE {$tablepre}players SET clbpara='$encoded_clbpara' WHERE pid='$pid'");
```
3. 在 FireseedEnhance 函数中添加:
```php
// 将更新后的 clbpara 保存到数据库
$encoded_clbpara = json_encode($clbpara, JSON_UNESCAPED_UNICODE);
$db->query("UPDATE {$tablepre}players SET clbpara='$encoded_clbpara' WHERE pid='$pid'");
```
## 优势
1. 种火的位置信息会正确保存到数据库中,不会在页面刷新后丢失
2. 种火的探物和索敌功能能够正常工作,因为种火的位置信息已经正确保存
3. 种火的强化信息也会正确保存到数据库中
## 注意事项
- 这个修复不会影响其他功能,只是修复了种火相关功能的数据保存问题
- 使用 json_encode($clbpara, JSON_UNESCAPED_UNICODE) 的方式保存 clbpara 数据,与系统其他部分的处理方式保持一致
doc/etc/20240719_201500_npc_purity_implementation.txt
0 → 100644
View file @
18636ac8
# NPC技能实装:洁净(npc_purity)
## 功能概述
实现了一个专为NPC设计的技能:
- **洁净(npc_purity)**:被动技,战斗时无法获得经验值。
## 实装内容
1. 在 `gamedata/cache/clubskills_1.php` 文件中添加了 `npc_purity` 技能的定义
2. 在 `include/state.func.php` 文件中修改了 `expup_rev` 函数,使其检查是否有 `npc_purity` 技能
## 实装细节
### 1. 技能定义
在 `clubskills_1.php` 文件中添加了以下技能定义:
```php
'npc_purity' => Array
(
'name' => '洁净',
'tags' => Array('passive'),
'desc' => '战斗时无法获得经验值。',
),
```
### 2. 经验值获取逻辑修改
在 `state.func.php` 文件的 `expup_rev` 函数中添加了对 `npc_purity` 技能的检查:
```php
# 「洁净」技能判定:战斗时无法获得经验值
if(!empty($pa['clbpara']['skill']) && in_array('npc_purity', $pa['clbpara']['skill']))
{
$log.='<span class="yellow">「洁净」使'.$pa['nm'].'无法获得经验值!</span><br>';
return;
}
```
## 使用方法
### 为NPC添加洁净技能
```php
$npc['clbpara']['skill'][] = 'npc_purity';
```
## 注意事项
1. 这个技能专为NPC设计,玩家不应该获得这个技能
2. 技能会在战斗中完全阻止经验值获取,包括通过「反思」技能或「解构」技能获得的经验值
3. 技能效果会在战斗日志中显示提示信息
doc/etc/20240719_202500_fireseed_deploy_position_fix.txt
0 → 100644
View file @
18636ac8
# 种火部署位置修复记录
## 问题描述
在选择部署位置时,无论选择了什么位置,什么操作,实际上都只会将种火部署到玩家的目前位置而非选择的位置。
## 问题原因
1. 在 slidingpanel.htm 中的 deployFireseed 函数中,只有当部署模式不是跟随模式(mode != 0)时,才会将位置参数添加到表单数据中。
2. 在 club22.func.php 中的 FireseedDeploy 函数中,当模式不是跟随模式时,没有正确使用传入的 pls 参数。
## 修复方法
1. 修改 slidingpanel.htm 中的 deployFireseed 函数,无论什么模式都添加位置字段。
2. 修改 club22.func.php 中的 FireseedDeploy 函数,确保在非跟随模式下正确使用传入的位置参数。
3. 在 command.php 中添加调试信息,显示部署位置参数。
## 修改文件
1. templates/default/slidingpanel.htm - 修改 deployFireseed 函数
2. include/game/club22.func.php - 修改 FireseedDeploy 函数
3. command.php - 添加调试信息
## 修改详情
1. 在 slidingpanel.htm 中修改 deployFireseed 函数:
```javascript
// 无论什么模式,都添加位置字段
formData.append('deploy_pls', deployPls);
```
2. 在 club22.func.php 中修改 FireseedDeploy 函数:
```php
// 确保使用传入的位置参数,而不是玩家当前位置
$pls = intval($pls);
```
3. 在 command.php 中添加调试信息:
```php
$log .= "<span class='yellow'>DEBUG: 部署位置 $deploy_pls</span><br>";
```
## 优势
1. 种火部署后会正确移动到选择的位置,使得探物和索敌功能能够正常工作
2. 修复了种火部署位置不正确的问题
3. 添加了调试信息,方便排查问题
## 注意事项
- 这个修复不会影响其他功能,只是修复了种火部署位置不正确的问题
- 调试信息可以在确认问题解决后移除
doc/etc/20240719_204500_fireseed_deploy_position_fix2.txt
0 → 100644
View file @
18636ac8
# 种火部署位置修复记录(第二次)
## 问题描述
在选择部署位置时,无论选择了什么位置,什么操作,实际上都只会将种火部署到玩家的目前位置而非选择的位置。第一次修复没有解决问题。
## 问题原因
在 club22.func.php 中的 FireseedDeploy 函数中,如果部署模式是跟随模式(mode == 0),位置会被强制设置为玩家当前位置:
```php
// 如果是跟随模式,位置设为玩家当前位置
if($mode == 0) {
$pls = $data['pls'];
} else {
// 检查位置是否有效(不是禁区或隐藏地图)
if(in_array($pls, $deepzones) || $pls < 0 || $pls >= 100) {
$log .= "<span class='red'>无法部署到指定位置!</span><br>";
return false;
}
// 确保使用传入的位置参数,而不是玩家当前位置
$pls = intval($pls);
}
```
## 修复方法
修改 club22.func.php 中的 FireseedDeploy 函数,使其在跟随模式下也使用传入的位置参数:
```php
// 确保使用传入的位置参数,而不是玩家当前位置
$pls = intval($pls);
// 检查位置是否有效(不是禁区或隐藏地图)
if(in_array($pls, $deepzones) || $pls < 0 || $pls >= 100) {
$log .= "<span class='red'>无法部署到指定位置!</span><br>";
return false;
}
// 如果是跟随模式,记录一下但仍然使用传入的位置
if($mode == 0) {
$log .= "<span class='yellow'>DEBUG: 跟随模式,部署位置 $pls</span><br>";
}
```
同时,修复了 FireseedBuffBonus 函数中的一个未使用变量警告:
```php
// 计算跟随模式的种火加成
foreach($clbpara['fireseed'] as $fs_id => $fs_data) {
```
改为:
```php
// 计算跟随模式的种火加成
foreach($clbpara['fireseed'] as $fs_data) {
```
## 修改文件
1. include/game/club22.func.php - 修改 FireseedDeploy 函数和 FireseedBuffBonus 函数
## 优势
1. 种火部署后会正确移动到选择的位置,使得探物和索敌功能能够正常工作
2. 修复了种火部署位置不正确的问题
3. 修复了未使用变量警告
## 注意事项
- 这个修复不会影响其他功能,只是修复了种火部署位置不正确的问题
- 调试信息可以在确认问题解决后移除
doc/etc/20240719_210000_fireseed_deploy_position_fix3.txt
0 → 100644
View file @
18636ac8
# 种火部署位置修复记录(第三次)
## 问题描述
在选择部署位置时,无论选择了什么位置,什么操作,实际上都只会将种火部署到玩家的目前位置而非选择的位置。前两次修复没有解决问题。
## 问题原因
1. 部署种火的逻辑顺序不正确,应该先更新NPC的位置,再更新玩家的clbpara中种火的位置。
2. 种火的动作使用的是mode,但实际上为了防止和其他NPC相关功能冲突,应该使用pose。
## 修复方法
1. 修改部署种火的逻辑顺序,先更新NPC的位置和姿态,再更新玩家的clbpara中种火的位置。
2. 将种火的动作从mode改为pose,对应数值如下:
- 跟随:1(作战姿态)
- 探物:3(探物姿态)
- 索敌:2(强袭姿态)
- 隐藏:4(偷袭姿态)
3. 修改FireseedSearch、FireseedDrainNPC和FireseedBuffBonus函数,使其使用pose而不是mode来判断种火的动作。
## 修改文件
1. include/game/club22.func.php - 修改FireseedDeploy、FireseedSearch、FireseedDrainNPC和FireseedBuffBonus函数
## 修改详情
1. 在FireseedDeploy函数中:
```php
// 将模式转换为姿态值
$pose_map = array(
0 => 1, // 跟随 -> 作战姿态
1 => 3, // 探物 -> 探物姿态
2 => 2, // 索敌 -> 强袭姿态
3 => 4 // 隐藏 -> 偷袭姿态
);
$pose = isset($pose_map[$mode]) ? $pose_map[$mode] : 1;
// 先更新NPC的位置和姿态
$result = $db->query("SELECT * FROM {$tablepre}players WHERE pid='$fireseed_id'");
if($db->num_rows($result) > 0) {
$db->query("UPDATE {$tablepre}players SET pls='$pls', pose='$pose' WHERE pid='$fireseed_id'");
$log .= "<span class='yellow'>DEBUG: 更新NPC位置 $pls 和姿态 {$poseinfo[$pose]}</span><br>";
} else {
$log .= "<span class='red'>警告:找不到对应的种火NPC!</span><br>";
}
// 再更新种火部署状态
$clbpara['fireseed'][$fireseed_id]['mode'] = $mode;
$clbpara['fireseed'][$fireseed_id]['pls'] = $pls;
$clbpara['fireseed'][$fireseed_id]['pose'] = $pose;
```
2. 在FireseedSearch函数中:
```php
// 查找在当前地图处于探物模式的种火
$search_fireseeds = array();
foreach($clbpara['fireseed'] as $fs_id => $fs_data) {
// 使用 pose 值 3 表示探物姿态
if(isset($fs_data['pose']) && $fs_data['pose'] == 3 && $fs_data['pls'] == $pls) {
$search_fireseeds[$fs_id] = $fs_data;
} else if($fs_data['mode'] == 1 && $fs_data['pls'] == $pls) {
// 兼容旧数据,如果没有 pose 字段,则使用 mode
$search_fireseeds[$fs_id] = $fs_data;
}
}
```
3. 在FireseedDrainNPC函数中:
```php
// 查找在当前地图处于索敌模式的种火
$drain_fireseeds = array();
foreach($clbpara['fireseed'] as $fs_id => $fs_data) {
// 使用 pose 值 2 表示强袭姿态(索敌)
if(isset($fs_data['pose']) && $fs_data['pose'] == 2 && $fs_data['pls'] == $pls) {
$drain_fireseeds[$fs_id] = $fs_data;
} else if($fs_data['mode'] == 2 && $fs_data['pls'] == $pls) {
// 兼容旧数据,如果没有 pose 字段,则使用 mode
$drain_fireseeds[$fs_id] = $fs_data;
}
}
```
4. 在FireseedBuffBonus函数中:
```php
// 计算跟随模式的种火加成
foreach($clbpara['fireseed'] as $fs_data) {
// 使用 pose 值 1 表示作战姿态(跟随)
if((isset($fs_data['pose']) && $fs_data['pose'] == 1 && $fs_data['pls'] == $pls) ||
($fs_data['mode'] == 0 && $fs_data['pls'] == $pls)) {
// 加成 = 数量(1) × 强化层数 × 1%
$bonus_percent = 1 * $fs_data['level'] * $fireseed_follow_bonus_rate;
$att_bonus += ceil($att * $bonus_percent / 100);
$def_bonus += ceil($def * $bonus_percent / 100);
}
}
```
## 优势
1. 种火部署后会正确移动到选择的位置,使得探物和索敌功能能够正常工作
2. 修复了种火部署位置不正确的问题
3. 使用pose而不是mode来判断种火的动作,避免和其他NPC相关功能冲突
4. 兼容旧数据,如果没有pose字段,则使用mode
## 注意事项
- 这个修复不会影响其他功能,只是修复了种火部署位置不正确的问题
- 调试信息可以在确认问题解决后移除
doc/etc/20240719_212000_slidingpanel_improvements.txt
0 → 100644
View file @
18636ac8
# 侧边栏(Sliding Panel)功能改进记录
## 修改内容
1. **优化数据更新逻辑**
- 移除了定时更新 clbpara 数据的功能,改为只在打开侧边栏或点击更新按钮时更新
- 这样可以减少不必要的网络请求和资源消耗
2. **种火信息显示改进**
- 在种火信息表格中添加了 ID 列,显示种火的 NPC ID
- 在所有种火选择下拉框中添加了 ID 信息,方便玩家识别不同的种火
- 修复了种火信息表格中的 colspan 值,确保空行显示正确
3. **修复种火物品列表中的空行问题**
- 增加了对 item.itm 是否为 undefined 的检查,防止显示空行
- 这解决了截图中显示的 undefined/undefined 问题
## 修改文件
- templates/default/slidingpanel.htm
## 具体修改
1. 在种火状态表格中添加 ID 列:
```html
<tr>
<th>名称</th>
<th>等级</th>
<th>状态</th>
<th>位置</th>
<th>生命</th>
<th>体力</th>
<th>攻击</th>
<th>防御</th>
<th>ID</th>
</tr>
```
2. 在种火信息行中添加 ID 列:
```html
<td><span class="lime">$fs_id</span></td>
```
3. 修改空行的 colspan 值:
```html
<td colspan="9">你还没有收纳任何种火。</td>
```
4. 在种火选择下拉框中添加 ID 信息:
```html
<option value="$fs_id">$fs_data['name'] (等级: $fs_data['level'], ID: $fs_id)</option>
```
5. 移除定时更新,只在打开面板和点击更新按钮时更新:
```javascript
// 初始化面板
initPanel();
// 初始更新进度条(仅一次)
updateChargeProgressBars();
```
6. 修改 updateFireseedStatusTable 函数,修复空行问题并添加 ID 列:
```javascript
// 如果没有种火数据,显示提示行
if (!clbpara.fireseed || Object.keys(clbpara.fireseed).length === 0) {
const row = statusTable.insertRow();
const cell = row.insertCell();
cell.colSpan = 9; // 更新为9列
cell.textContent = '你还没有收纳任何种火。';
return;
}
```
7. 在动态生成的种火信息行中添加 ID 列:
```javascript
// ID
const idCell = row.insertCell();
const idSpan = document.createElement('span');
idSpan.className = 'lime';
idSpan.textContent = fsId;
idCell.appendChild(idSpan);
```
8. 在动态生成的种火选择下拉框中添加 ID 信息:
```javascript
option.textContent = fsData.name + ' (等级: ' + fsData.level + ', ID: ' + fsId + ')';
```
9. 修复种火物品列表中的空行问题:
```javascript
// 添加物品行
for (let itemId = 0; itemId < fsData.items.length; itemId++) {
const item = fsData.items[itemId];
if (!item || item.itm === undefined) continue;
// ...
}
```
## 优势
1. 减少了不必要的网络请求和资源消耗
2. 提供了更多的种火信息,方便玩家识别不同的种火
3. 修复了种火物品列表中的空行问题
4. 保持了与原有功能的兼容性
doc/etc/20240719_214500_slidingpanel_undefined_fix.txt
0 → 100644
View file @
18636ac8
# 侧边栏(Sliding Panel)undefined 行问题修复记录
## 问题描述
在种火状态表格中,出现了显示为 "undefined/undefined" 的行,同时 ID 列显示为 "toJSONString"。这表明 clbpara.fireseed 对象中包含了无效的条目,导致显示了错误的数据。
## 修复内容
1. **修复种火状态表格中的 undefined 行问题**
- 在遍历 clbpara.fireseed 对象时,添加了对无效数据的检查和过滤
- 跳过非对象类型的条目或缺少必要属性(name、level)的数据
- 在控制台输出调试信息,帮助识别问题数据
2. **修复种火选择下拉框中的无效选项**
- 在生成种火选择下拉框选项时,添加了对无效数据的检查和过滤
- 确保只有有效的种火数据才会被添加到选择框中
3. **修复种火物品列表中的无效条目**
- 在生成种火物品列表时,添加了对无效数据的检查和过滤
- 确保只有有效的种火数据才会被处理
4. **修复首个种火物品列表的显示逻辑**
- 修改了首个种火物品列表的获取方式,确保只使用有效的种火 ID
- 创建了一个有效种火 ID 的数组,从中选择第一个进行显示
## 修改文件
- templates/default/slidingpanel.htm
## 具体修改
1. 在 updateFireseedStatusTable 函数中添加对无效数据的检查:
```javascript
// 添加种火数据行
for (const fsId in clbpara.fireseed) {
// 跳过非对象类型的条目或无效数据
if (!clbpara.fireseed[fsId] || typeof clbpara.fireseed[fsId] !== 'object' ||
!clbpara.fireseed[fsId].name || !clbpara.fireseed[fsId].level) {
console.log('跳过无效种火数据:', fsId, clbpara.fireseed[fsId]);
continue;
}
const fsData = clbpara.fireseed[fsId];
// ... 后续代码 ...
}
```
2. 在 updateFireseedSelects 函数中添加对无效数据的检查:
```javascript
// 添加种火选项
for (const fsId in clbpara.fireseed) {
// 跳过非对象类型的条目或无效数据
if (!clbpara.fireseed[fsId] || typeof clbpara.fireseed[fsId] !== 'object' ||
!clbpara.fireseed[fsId].name || !clbpara.fireseed[fsId].level) {
console.log('跳过无效种火数据(选择框):', fsId, clbpara.fireseed[fsId]);
continue;
}
const fsData = clbpara.fireseed[fsId];
// ... 后续代码 ...
}
```
3. 在 updateFireseedItemsList 函数中添加对无效数据的检查:
```javascript
// 为每个种火创建物品列表
for (const fsId in clbpara.fireseed) {
// 跳过非对象类型的条目或无效数据
if (!clbpara.fireseed[fsId] || typeof clbpara.fireseed[fsId] !== 'object' ||
!clbpara.fireseed[fsId].name || !clbpara.fireseed[fsId].level) {
console.log('跳过无效种火数据(物品列表):', fsId, clbpara.fireseed[fsId]);
continue;
}
const fsData = clbpara.fireseed[fsId];
// ... 后续代码 ...
}
```
4. 修改首个种火物品列表的显示逻辑:
```javascript
// 显示第一个有效种火的物品列表
let validFireseeds = [];
for (const fsId in clbpara.fireseed) {
if (clbpara.fireseed[fsId] && typeof clbpara.fireseed[fsId] === 'object' &&
clbpara.fireseed[fsId].name && clbpara.fireseed[fsId].level) {
validFireseeds.push(fsId);
}
}
if (validFireseeds.length > 0) {
const firstFsId = validFireseeds[0];
const firstItemsList = document.getElementById('fireseed-items-' + firstFsId);
if (firstItemsList) {
firstItemsList.style.display = 'block';
}
}
```
## 优势
1. 解决了种火状态表格中显示 undefined 行的问题
2. 提高了代码的健壮性,能够处理无效的数据
3. 添加了调试信息,方便开发者识别和解决问题
4. 保持了与原有功能的兼容性
doc/etc/20240719_221500_slidingpanel_item_display_fix.txt
0 → 100644
View file @
18636ac8
# 侧边栏(Sliding Panel)种火物品显示优化记录
## 问题描述
在种火物品列表中,物品类型和特殊属性栏位显示的是原始数据(如 "HH"、"f"),而不是对应的可读文本(如 "生命恢复"、"灼焰")。这使得玩家难以理解物品的实际功能。
## 修复内容
1. **优化物品类型显示**
- 修改了物品类型的显示逻辑,使其显示 resources_1.php 中 $iteminfo 数组对应的可读文本
- 例如,将 "HH" 显示为 "生命恢复","DA" 显示为 "手臂装备"
2. **优化物品特殊属性显示**
- 修改了物品特殊属性的显示逻辑,使其显示 resources_1.php 中 $itemspkinfo 数组对应的可读文本
- 对于多个特殊属性,会将它们以逗号分隔显示
- 例如,将 "f" 显示为 "灼焰","fu" 显示为 "灼焰, 火焰"
3. **添加数据传递**
- 在页面加载时,将 PHP 中的 $iteminfo 和 $itemspkinfo 数组传递给 JavaScript
- 这样 JavaScript 可以使用这些数据来显示可读的物品信息
## 修改文件
- templates/default/slidingpanel.htm
## 具体修改
1. 在页面顶部添加 iteminfo 和 itemspkinfo 数据:
```html
<!--{eval echo "<script>var clbpara_data = ".json_encode($clbpara).";</script>";}-->
<!--{eval echo "<script>var iteminfo = ".json_encode($iteminfo).";</script>";}-->
<!--{eval echo "<script>var itemspkinfo = ".json_encode($itemspkinfo).";</script>";}-->
```
2. 修改物品类型的显示逻辑:
```javascript
// 类型
const typeCell = row.insertCell();
// 使用iteminfo显示物品类型
if (typeof window.iteminfo !== 'undefined' && window.iteminfo[item.itmk]) {
typeCell.textContent = window.iteminfo[item.itmk];
} else {
typeCell.textContent = item.itmk;
}
```
3. 修改物品特殊属性的显示逻辑:
```javascript
// 特殊
const specialCell = row.insertCell();
// 使用itemspkinfo显示物品特殊属性
if (item.itmsk && item.itmsk !== '--') {
if (typeof window.itemspkinfo !== 'undefined') {
let spkText = '';
// 遍历每个特殊属性字符
for (let i = 0; i < item.itmsk.length; i++) {
const spk = item.itmsk[i];
if (window.itemspkinfo[spk]) {
if (spkText) spkText += ', ';
spkText += window.itemspkinfo[spk];
} else {
if (spkText) spkText += ', ';
spkText += spk;
}
}
specialCell.innerHTML = spkText;
} else {
specialCell.textContent = item.itmsk;
}
} else {
specialCell.textContent = '--';
}
```
## 优势
1. 提高了种火物品列表的可读性,使玩家能够更容易理解物品的功能
2. 保持了与游戏其他部分的一致性,使用相同的物品类型和特殊属性描述
3. 代码具有健壮性,能够处理未定义的物品类型和特殊属性
4. 保持了与原有功能的兼容性
doc/etc/20240719_224500_club22_fireseed_fix.txt
0 → 100644
View file @
18636ac8
# 种火部署位置问题修复记录
## 问题描述
在对 club22.func.php 进行修改解决种火无法部署到选择的位置的问题后,引入了一个新的问题:只有玩家处于和正在部署的种火相同的位置时,该位置的索敌与探物动作才会处理。根据设计,不管玩家本人在哪个位置,全部位置的种火的索敌与探物动作都应该处理。
## 修复内容
1. **修改 FireseedSearch 函数**
- 移除了对玩家当前位置的限制,使其能够处理所有位置的种火探物动作
- 按位置分组处理种火,对每个位置分别执行探物逻辑
- 在日志中显示种火探物的位置信息,方便玩家了解种火在哪个位置发现了物品
2. **修改 FireseedDrainNPC 函数**
- 移除了对玩家当前位置的限制,使其能够处理所有位置的种火索敌动作
- 按位置分组处理种火,对每个位置分别执行索敌逻辑
- 在日志中显示种火索敌的位置信息,方便玩家了解种火在哪个位置削弱了NPC
3. **保留 FireseedBuffBonus 函数的位置限制**
- 对于战斗加成,仍然只考虑与玩家在同一位置的种火,因为这是战斗相关的功能
- 添加了注释说明这一设计决策
4. **移除调试输出**
- 删除了 FireseedDeploy 函数中的 `echo $fspls;` 调试输出
## 修改文件
- include/game/club22.func.php
## 具体修改
1. 修改 FireseedSearch 函数,使其处理所有位置的种火:
```php
// 查找所有处于探物模式的种火,不限制地图位置
$search_fireseeds = array();
foreach($clbpara['fireseed'] as $fs_id => $fs_data) {
// 使用 pose 值 3 表示探物姿态
if(isset($fs_data['pose']) && $fs_data['pose'] == 3) {
$search_fireseeds[$fs_id] = $fs_data;
} else if($fs_data['mode'] == 1) {
// 兼容旧数据,如果没有 pose 字段,则使用 mode
$search_fireseeds[$fs_id] = $fs_data;
}
}
// 按位置分组处理种火
$fireseeds_by_location = array();
foreach($search_fireseeds as $fs_id => $fs_data) {
$location = $fs_data['pls'];
if(!isset($fireseeds_by_location[$location])) {
$fireseeds_by_location[$location] = array();
}
$fireseeds_by_location[$location][$fs_id] = $fs_data;
}
// 对每个位置分别处理
foreach($fireseeds_by_location as $location => $location_fireseeds) {
// 获取该位置的物品
$result = $db->query("SELECT * FROM {$tablepre}mapitem WHERE pls='$location' LIMIT 1");
if(!$db->num_rows($result)) {
continue; // 该位置没有物品,继续检查下一个位置
}
// ... 处理该位置的种火探物逻辑 ...
}
```
2. 修改 FireseedDrainNPC 函数,使其处理所有位置的种火:
```php
// 查找所有处于索敌模式的种火,不限制地图位置
$drain_fireseeds = array();
foreach($clbpara['fireseed'] as $fs_id => $fs_data) {
// 使用 pose 值 2 表示强袭姿态(索敌)
if(isset($fs_data['pose']) && $fs_data['pose'] == 2) {
$drain_fireseeds[$fs_id] = $fs_data;
} else if($fs_data['mode'] == 2) {
// 兼容旧数据,如果没有 pose 字段,则使用 mode
$drain_fireseeds[$fs_id] = $fs_data;
}
}
// 按位置分组处理种火
$fireseeds_by_location = array();
foreach($drain_fireseeds as $fs_id => $fs_data) {
$location = $fs_data['pls'];
if(!isset($fireseeds_by_location[$location])) {
$fireseeds_by_location[$location] = array();
}
$fireseeds_by_location[$location][$fs_id] = $fs_data;
}
// 对每个位置分别处理
foreach($fireseeds_by_location as $location => $location_fireseeds) {
// 获取该位置的NPC
$result = $db->query("SELECT * FROM {$tablepre}players WHERE type>0 AND hp>1 AND pls='$location'");
if(!$db->num_rows($result)) {
continue; // 该位置没有NPC,继续检查下一个位置
}
// ... 处理该位置的种火索敌逻辑 ...
}
```
3. 在日志中添加位置信息:
```php
$log .= "<span class='lime'>你的种火「{$clbpara['fireseed'][$finder_id]['name']}」在「{$plsinfo[$location]}」发现了物品「{$item_data['itm']}」!</span><br>";
$log .= "<span class='lime'>你的种火「{$clbpara['fireseed'][$drainer_id]['name']}」在「{$plsinfo[$location]}」削弱了「{$npc['name']}」,造成了{$drain_amount}点伤害!</span><br>";
```
## 优势
1. 修复了种火无法在玩家不在场的位置执行索敌和探物动作的问题
2. 保持了设计的一致性,使种火能够在不同位置独立工作
3. 通过在日志中添加位置信息,提高了用户体验,使玩家能够更好地了解种火的活动
4. 代码结构更加清晰,按位置分组处理种火,提高了代码的可维护性
doc/etc/20240719_230000_fireseed_follow_implementation.txt
0 → 100644
View file @
18636ac8
# 种火跟随功能实现记录
## 功能描述
实现种火跟随功能,使玩家每次移动时,所有处于跟随状态的种火也会一并移动到目标位置,并输出提示。
## 实现内容
1. **新增 FireseedFollow 函数**
- 在 include/game/club22.func.php 中添加了 FireseedFollow 函数
- 该函数接收目标位置 ID 作为参数
- 查找所有处于跟随模式的种火(pose=1 或 mode=0)
- 将这些种火的位置更新为玩家的目标位置
- 同时更新数据库中的种火位置和玩家 clbpara 中的种火位置
- 显示移动提示,告知玩家有多少个种火随行
2. **修改 move 函数**
- 在 include/game/search.func.php 的 move 函数中调用 FireseedFollow 函数
- 确保在玩家移动后,所有跟随状态的种火也会移动到相同位置
## 具体实现
1. FireseedFollow 函数实现:
```php
/**
* 玩家移动时,将所有处于跟随状态的种火一并移动到目标位置
*
* @param int $target_pls 目标位置ID
* @return void
*/
function FireseedFollow($target_pls) {
global $log, $db, $tablepre, $plsinfo;
if(!isset($data)) {
global $pdata;
$data = &$pdata;
}
extract($data, EXTR_REFS);
// 检查是否有种火
if(empty($clbpara['fireseed'])) {
return;
}
// 查找所有处于跟随模式的种火
$follow_fireseeds = array();
foreach($clbpara['fireseed'] as $fs_id => $fs_data) {
// 使用 pose 值 1 表示作战姿态(跟随)
if((isset($fs_data['pose']) && $fs_data['pose'] == 1) ||
($fs_data['mode'] == 0)) {
$follow_fireseeds[$fs_id] = $fs_data;
}
}
if(empty($follow_fireseeds)) {
return;
}
// 移动所有跟随种火到目标位置
$moved_count = 0;
foreach($follow_fireseeds as $fs_id => $fs_data) {
// 如果种火已经在目标位置,则跳过
if($fs_data['pls'] == $target_pls) {
continue;
}
// 更新数据库中的种火位置
$db->query("UPDATE {$tablepre}players SET pls='$target_pls' WHERE pid='$fs_id'");
// 更新clbpara中的种火位置
$clbpara['fireseed'][$fs_id]['pls'] = $target_pls;
$moved_count++;
}
// 如果有种火被移动,则更新clbpara并显示提示
if($moved_count > 0) {
// 将更新后的 clbpara 保存到数据库
$encoded_clbpara = json_encode($clbpara, JSON_UNESCAPED_UNICODE);
$db->query("UPDATE {$tablepre}players SET clbpara='$encoded_clbpara' WHERE pid='$pid'");
// 显示提示
$log .= "<span class='lime'>{$moved_count}个跟随状态的种火随你一起移动到了「{$plsinfo[$target_pls]}」。</span><br>";
}
}
```
2. 在 move 函数中调用 FireseedFollow:
```php
# 如果是种火歌者,处理种火相关逻辑
if($club == 22) {
include_once GAME_ROOT.'./include/game/club22.func.php';
// 移动跟随状态的种火
FireseedFollow($pls);
// 处理探物和索敌逻辑
FireseedSearch($pls);
FireseedDrainNPC($pls);
}
```
## 优势
1. 实现了种火跟随功能,使玩家移动时,跟随状态的种火也会一并移动
2. 保持了与原有功能的兼容性,不影响其他种火功能
3. 提供了清晰的提示,让玩家知道有多少种火随行
4. 代码结构清晰,易于维护和扩展
doc/etc/20240719_232000_fireseed_button_fix.txt
0 → 100644
View file @
18636ac8
# 枫火歌者"种火管理"按钮修复记录
## 问题描述
点击界面上的"种火管理"按钮时没有作用,控制台输出以下错误:
```
Uncaught TypeError: Cannot read properties of null (reading 'showModal')
at showModalDialog (common.js:12:5)
at HTMLInputElement.onclick (game.php:1:1)
```
这是因为按钮点击事件使用了 `showModalDialog($('fireseedpage'))` 来显示模态对话框,但是 `$('fireseedpage')` 返回 null,因为找不到 ID 为 "fireseedpage" 的元素。
## 修复内容
1. **修改"种火管理"按钮的点击事件**
- 将原来的 `onclick="showModalDialog($('fireseedpage'));"` 修改为 `onclick="openSidePanelToFireseedTab();"`
- 这样点击按钮时会调用新增的 `openSidePanelToFireseedTab` 函数
2. **添加 openSidePanelToFireseedTab 函数**
- 在 slidingpanel.htm 文件末尾添加了 `openSidePanelToFireseedTab` 函数
- 该函数会打开侧边栏,切换到种火管理标签页,并更新种火数据
## 修改文件
- templates/default/command.htm
- templates/default/slidingpanel.htm
## 具体修改
1. 修改 command.htm 中的"种火管理"按钮:
```html
<input type="button" class="cmdbutton" id="fireseed_manage" name="fireseed_manage" value="种火管理" onclick="openSidePanelToFireseedTab();">
```
2. 在 slidingpanel.htm 中添加 openSidePanelToFireseedTab 函数:
```javascript
// 打开侧边栏并切换到种火管理标签页
function openSidePanelToFireseedTab() {
// 打开侧边栏
document.getElementById('sliding-panel').classList.add('open');
document.getElementById('side-panel-button').style.display = 'none';
// 切换到种火管理标签页
showTab('fireseed-tab', { target: document.querySelector('.tab-button[onclick*="fireseed-tab"]') });
// 更新种火数据
updateFireseedTab();
}
```
## 优势
1. 修复了点击"种火管理"按钮时的错误
2. 提供了更好的用户体验,点击按钮后自动打开侧边栏并切换到种火管理标签页
3. 保持了与原有功能的一致性,使用现有的侧边栏而不是创建新的模态对话框
4. 代码简洁明了,易于维护
doc/etc/20240719_club22_implementation.txt
0 → 100644
View file @
18636ac8
# 枫火歌者(Club 22)实装记录
实装时间:2024年7月19日
## 实装内容
1. 配置文件:
- 在 gamedata/cache/club22cfg.php 中创建了枫火歌者社团的配置文件
- 包含收为随从的成功率、跟随时强化玩家倍率、探物检定成功率、削减NPC HP检定成功率、强化倍率等配置
2. 后端逻辑:
- 在 include/game/club22.func.php 中实现了以下功能:
- FireseedRecruit($npc):将目标种火复活,并进行收纳种火
- FireseedDeploy($npc, $mode, $pls):设置部署状态并标记姿态(探物、索敌、隐藏、跟随)
- FireseedSearch($pls):玩家行动时触发探物逻辑,将对应道具加入该种火clbpara中的道具池
- FireseedDrainNPC($pls):玩家行动时触发索敌逻辑,对NPC造成伤害(最低留1血)
- FireseedEnhance($npc, $item):消耗焰火物品,更新该种火的强化倍率
- FireseedBuffBonus():根据所有跟随种火的数量与强化层数,为玩家加成攻击防御
3. 前端逻辑:
- 修改 command.htm 中隐藏 Club 22 玩家使用的"组队"按钮并添加禁止组队判断逻辑
- 修改 corpse.htm 中加入判断,若目标尸体为"种火"(type==92)且 club == 22,便显示"收纳种火"按钮
- 在 slidingpanel.htm 中添加种火状态管理标签页
- 创建 fireseedpage.htm 提供种火管理界面
4. 战斗系统整合:
- 修改 revattr.func.php 中的 get_base_att_modifier 和 get_base_def_modifier 函数,添加种火加成逻辑
- 在 game.php 中添加种火探物和索敌的触发逻辑
5. 社团技能:
- 在 clubskills_1.php 中添加了 c22_fireseed 技能,描述枫火歌者的核心机制
## 核心机制
Club 22玩家不能进行组队,可以通过在遭遇特定NPC"种火"(type = 92)的尸体进行操作,消耗体力值将其收为"随从",纳入队伍。
种火具备四种部署状态:
- 跟随:在战斗时增加玩家攻击/防御,按"数量 × 强化层数 × 1%"叠加
- 探物:部署在地图上,为玩家收集该地的掉落物品(叠加将影响发现速率)
- 索敌:部署后稳定按照比率削减该地图NPC生命至最低1点(叠加将影响削血速率)
- 隐藏:没有额外效果(玩法上因为其他玩家会遭遇它们,有探索干扰作用)
种火可被升级,升级后将显著提升数值,通过消耗指定焰火类物品(共5种:◆焰火,✦烈焰火,★华焰火★,☾真焰火☽,☼焰火☼)来升级特定种火,倍率为:1x、8x、32x、64x、128x。
## 注意事项
1. 种火收纳后,会在种火的 clbpara 中记录所有者信息,防止被其他玩家重复收纳
2. 种火部署在地图上时,会根据部署模式执行不同的功能
3. 种火收集的物品会存储在种火的 clbpara 中,玩家可以通过界面获取这些物品
4. 种火强化后,其属性会根据强化倍率提升
5. 跟随模式的种火会在战斗中为玩家提供攻击和防御加成
doc/etc/20240719_slidingpanel_fix.txt
0 → 100644
View file @
18636ac8
# 滑动面板修复记录
修复时间:2024年7月19日
## 问题描述
在 slidingpanel.htm 文件中,种火状态表格的表头和数据行的列数不匹配,导致生成的 tpl.php 文件出现语法错误:
```
Parse error: syntax error, unexpected ')' in /volume1/web/gamedata/templates/1_slidingpanel.tpl.php on line 376
```
## 修复内容
1. 在种火状态表格中,表头只有7列(名称、等级、状态、位置、生命、攻击、防御),但数据行有8列(多了一个"体力"列)。
2. 修复方法:
- 在表头中添加了"体力"列,使表头和数据行的列数一致(都是8列)
- 将"没有收纳任何种火"提示行的 colspan 从 7 改为 8,以匹配新的列数
## 修复结果
修复后,slidingpanel.htm 文件可以正确生成 tpl.php 文件,不再出现语法错误。种火状态表格现在可以正确显示所有数据,包括种火的体力值。
doc/etc/20240719_slidingpanel_fix2.txt
0 → 100644
View file @
18636ac8
# 滑动面板修复记录 2
修复时间:2024年7月19日
## 问题描述
在 slidingpanel.htm 文件中,种火强化部分的 for 循环和条件判断语法有问题,导致生成的 tpl.php 文件出现语法错误:
```
Parse error: syntax error, unexpected ')' in /volume1/web/gamedata/templates/1_slidingpanel.tpl.php on line 378
```
## 问题分析
问题出在种火强化部分的物品选择下拉框中,当检查物品是否为焰火类物品时,没有先检查变量是否存在就直接进行比较,导致在 PHP 解析时出现语法错误。
原代码:
```html
<!--{for $i=1; $i<=6; $i++}-->
<!--{if ${'itm'.$i} == '◆焰火' || ${'itm'.$i} == '✦烈焰火' || ${'itm'.$i} == '★华焰火★' || ${'itm'.$i} == '☾真焰火☽' || ${'itm'.$i} == '☼焰火☼'}-->
<option value="$i">${'itm'.$i} (效果: ${'itme'.$i}, 数量: ${'itms'.$i})</option>
<!--{/if}-->
<!--{/for}-->
```
## 修复内容
修复方法是在比较前先使用 isset() 函数检查变量是否存在:
```html
<!--{for $i=1; $i<=6; $i++}-->
<!--{if isset(${'itm'.$i}) && (${'itm'.$i} == '◆焰火' || ${'itm'.$i} == '✦烈焰火' || ${'itm'.$i} == '★华焰火★' || ${'itm'.$i} == '☾真焰火☽' || ${'itm'.$i} == '☼焰火☼')}-->
<option value="$i">${'itm'.$i} (效果: ${'itme'.$i}, 数量: ${'itms'.$i})</option>
<!--{/if}-->
<!--{/for}-->
```
## 修复结果
修复后,slidingpanel.htm 文件可以正确生成 tpl.php 文件,不再出现语法错误。种火强化部分的物品选择下拉框现在可以正确显示所有符合条件的焰火类物品。
doc/etc/20240719_slidingpanel_fix3.txt
0 → 100644
View file @
18636ac8
# 滑动面板修复记录 3
修复时间:2024年7月19日
## 问题描述
在 slidingpanel.htm 文件中,种火强化部分的物品选择下拉框代码仍然存在问题,导致生成的 tpl.php 文件出现语法错误:
```
Parse error: syntax error, unexpected ')' in /volume1/web/gamedata/templates/1_slidingpanel.tpl.php on line 378
```
生成的 tpl.php 文件中的问题代码如下:
```php
{for <?php echo $i?>=1; <?php echo $i?><=6; <?php echo $i?>++}
<?php if(isset(${'itm'.$i) { ?>
) && (${'itm'.<?php echo $i?>} == '◆焰火' || ${'itm'.<?php echo $i?>} == '✦烈焰火' || ${'itm'.<?php echo $i?>} == '★华焰火★' || ${'itm'.<?php echo $i?>} == '☾真焰火☽' || ${'itm'.<?php echo $i?>} == '☼焰火☼')}
```
## 问题分析
问题出在模板引擎处理循环和变量拼接时的混淆。模板引擎在处理 for 循环和动态变量名(如 `${'itm'.$i}`)时,无法正确解析这种复杂的嵌套结构,导致生成的 PHP 代码出现语法错误。
## 修复内容
修复方法是避免使用循环和动态变量名,而是直接展开所有可能的条件判断:
```html
<!--{if isset($itm1) && ($itm1 == '◆焰火' || $itm1 == '✦烈焰火' || $itm1 == '★华焰火★' || $itm1 == '☾真焰火☽' || $itm1 == '☼焰火☼')}-->
<option value="1">$itm1 (效果: $itme1, 数量: $itms1)</option>
<!--{/if}-->
<!--{if isset($itm2) && ($itm2 == '◆焰火' || $itm2 == '✦烈焰火' || $itm2 == '★华焰火★' || $itm2 == '☾真焰火☽' || $itm2 == '☼焰火☼')}-->
<option value="2">$itm2 (效果: $itme2, 数量: $itms2)</option>
<!--{/if}-->
<!-- ... 以此类推到 itm6 -->
```
这种方式虽然代码量增加,但避免了模板引擎在处理复杂结构时的问题。
## 修复结果
修复后,slidingpanel.htm 文件可以正确生成 tpl.php 文件,不再出现语法错误。种火强化部分的物品选择下拉框现在可以正确显示所有符合条件的焰火类物品。
game.php
View file @
18636ac8
...
@@ -70,6 +70,9 @@ $log = '';
...
@@ -70,6 +70,9 @@ $log = '';
$chatdata
=
getchat
(
0
,
$teamID
);
$chatdata
=
getchat
(
0
,
$teamID
);
//读取表情信息
//读取表情信息
$emdata
=
get_emdata
();
$emdata
=
get_emdata
();
//读取玩家互动信息
//读取玩家互动信息
$result
=
$db
->
query
(
"SELECT lid,time,log FROM
{
$tablepre
}
log WHERE toid = '
$pid
' AND prcsd = 0 ORDER BY time,lid"
);
$result
=
$db
->
query
(
"SELECT lid,time,log FROM
{
$tablepre
}
log WHERE toid = '
$pid
' AND prcsd = 0 ORDER BY time,lid"
);
$llist
=
''
;
$llist
=
''
;
...
...
gamedata/cache/addnpc_1.php
View file @
18636ac8
...
@@ -2575,6 +2575,7 @@ $anpcinfo = array(
...
@@ -2575,6 +2575,7 @@ $anpcinfo = array(
'msp'
=>
200
,
'msp'
=>
200
,
'clubskill'
=>
Array
(
'clubskill'
=>
Array
(
'fireseed3'
,
'fireseed3'
,
'npc_purity'
,
),
),
'att'
=>
27
,
'att'
=>
27
,
'def'
=>
99
,
'def'
=>
99
,
...
...
gamedata/cache/club22cfg.php
0 → 100644
View file @
18636ac8
<?php
if
(
!
defined
(
'IN_GAME'
))
exit
(
'Access Denied'
);
// 枫火歌者社团配置文件
// 收为随从的成功率(默认100%)
$fireseed_recruit_rate
=
100
;
// 跟随时强化玩家倍率(默认每个1%)
$fireseed_follow_bonus_rate
=
1
;
// 每一次探物检定成功率(默认60%)
$fireseed_search_rate
=
60
;
// 每一次削减NPC HP检定成功率(默认50%)
$fireseed_drain_rate
=
50
;
// 强化倍率(默认1x、8x、32x、64x、128x)
$fireseed_enhance_multipliers
=
array
(
'◆焰火'
=>
1
,
'✦烈焰火'
=>
8
,
'★华焰火★'
=>
32
,
'☾真焰火☽'
=>
64
,
'☼焰火☼'
=>
128
);
// 种火部署状态
$fireseed_deploy_modes
=
array
(
0
=>
'跟随'
,
// 在战斗时增加玩家攻击/防御
1
=>
'探物'
,
// 部署在地图上,为玩家收集该地的掉落物品
2
=>
'索敌'
,
// 部署后稳定按照比率削减该地图NPC生命至最低1点
3
=>
'隐藏'
// 没有额外效果
);
?>
gamedata/cache/clubskills_1.php
View file @
18636ac8
...
@@ -28,7 +28,7 @@ $club_skillslist = Array
...
@@ -28,7 +28,7 @@ $club_skillslist = Array
19
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
,
'c19_nirvana'
,
'c19_reincarn'
,
'c19_purity'
,
'c19_crystal'
,
'c19_redeem'
,
'c19_dispel'
,
'c19_woesea'
),
#'晶莹剔透', //晶莹剔透、决死结界合并为晶莹剔透
19
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
,
'c19_nirvana'
,
'c19_reincarn'
,
'c19_purity'
,
'c19_crystal'
,
'c19_redeem'
,
'c19_dispel'
,
'c19_woesea'
),
#'晶莹剔透', //晶莹剔透、决死结界合并为晶莹剔透
20
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
,
'c20_fertile'
,
'c20_windfall'
,
'c20_lighting'
,
'c20_zombie'
,
'c20_sparkle'
,
'c20_lotus'
),
#'元素大师', #商店购买社团卡
20
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
,
'c20_fertile'
,
'c20_windfall'
,
'c20_lighting'
,
'c20_zombie'
,
'c20_sparkle'
,
'c20_lotus'
),
#'元素大师', #商店购买社团卡
21
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
,
'c21_stormedge'
,
'c21_creation'
,
'c21_discovery'
,
'c21_sacrifice'
,
'c21_blaster'
),
#'码语行人', #商店购买社团卡
21
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
,
'c21_stormedge'
,
'c21_creation'
,
'c21_discovery'
,
'c21_sacrifice'
,
'c21_blaster'
),
#'码语行人', #商店购买社团卡
22
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
),
#'偶像大师
', #暂定名,「除错大师」头衔奖励
22
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
,
'c22_fireseed'
),
#'枫火歌者
', #暂定名,「除错大师」头衔奖励
98
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
),
#'换装迷宫',
98
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
),
#'换装迷宫',
99
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
),
#'第一形态'
99
=>
Array
(
's_hp'
,
's_ad'
,
'f_heal'
),
#'第一形态'
);
);
...
@@ -162,6 +162,18 @@ $cskills = Array
...
@@ -162,6 +162,18 @@ $cskills = Array
'targets'
=>
Array
(),
// 初始无目标
'targets'
=>
Array
(),
// 初始无目标
),
),
),
),
'npc_purity'
=>
Array
(
'name'
=>
'洁净'
,
'tags'
=>
Array
(
'passive'
),
'desc'
=>
'战斗时无法获得经验值。'
,
),
'c22_fireseed'
=>
Array
(
'name'
=>
'枫火'
,
'tags'
=>
Array
(
'passive'
),
'desc'
=>
'你可以通过在发现种火的尸体页面收纳种火,并通过侧边栏进行部署。<br>'
,
),
// 可以通过在此文件中填写配置项来创建一个新技能,系统会自动生成模板。如果配置文件不能满足需求,可以自己创建一个模板文件
// 可以通过在此文件中填写配置项来创建一个新技能,系统会自动生成模板。如果配置文件不能满足需求,可以自己创建一个模板文件
/*'技能编号' => Array
/*'技能编号' => Array
(
(
...
...
gamedata/cache/npc_1.php
View file @
18636ac8
...
@@ -2088,6 +2088,7 @@
...
@@ -2088,6 +2088,7 @@
'gd'
=>
'f'
,
'gd'
=>
'f'
,
'clubskill'
=>
Array
(
'clubskill'
=>
Array
(
'fireseed3'
,
'fireseed3'
,
'npc_purity'
,
),
),
//'pls' => 99,
//'pls' => 99,
'mhp'
=>
11
,
'mhp'
=>
11
,
...
...
include/game/club22.func.php
0 → 100644
View file @
18636ac8
<?php
if
(
!
defined
(
'IN_GAME'
))
exit
(
'Access Denied'
);
include_once
GAME_ROOT
.
'./gamedata/cache/club22cfg.php'
;
/**
* 将目标种火复活,并进行收纳种火
*
* @param array $npc 目标种火NPC数据
* @return bool 是否成功收纳
*/
function
FireseedRecruit
(
$npc
)
{
global
$log
,
$now
,
$fireseed_recruit_rate
,
$db
,
$tablepre
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
// 检查是否为种火NPC
if
(
$npc
[
'type'
]
!=
92
)
{
$log
.=
"<span class='red'>这不是一个种火!</span><br>"
;
return
false
;
}
// 确保 NPC 的 clbpara 是数组格式
if
(
!
is_array
(
$npc
[
'clbpara'
]))
{
$npc
[
'clbpara'
]
=
get_clbpara
(
$npc
[
'clbpara'
]);
}
// 检查是否已被其他玩家收纳
if
(
!
empty
(
$npc
[
'clbpara'
][
'owner'
]))
{
$log
.=
"<span class='yellow'>这个种火已经被其他枫火歌者收纳了!</span><br>"
;
return
false
;
}
// 计算收纳成功率
$recruit_dice
=
rand
(
1
,
100
);
if
(
$recruit_dice
>
$fireseed_recruit_rate
)
{
$log
.=
"<span class='yellow'>你试图收纳这个种火,但失败了!</span><br>"
;
return
false
;
}
// 初始化种火数据
if
(
!
isset
(
$clbpara
[
'fireseed'
]))
{
$clbpara
[
'fireseed'
]
=
array
();
}
// 生成种火ID
$fireseed_id
=
$npc
[
'pid'
];
// 记录种火数据
$clbpara
[
'fireseed'
][
$fireseed_id
]
=
array
(
'name'
=>
$npc
[
'name'
],
'icon'
=>
$npc
[
'icon'
],
'level'
=>
1
,
// 初始等级
'mode'
=>
0
,
// 初始模式:跟随
'pls'
=>
$pls
,
// 初始位置
'horizon'
=>
0
,
// 初始位于通常视界而非灵子视界
'hp'
=>
$npc
[
'mhp'
],
'mhp'
=>
$npc
[
'mhp'
],
'sp'
=>
$npc
[
'msp'
],
'msp'
=>
$npc
[
'msp'
],
'att'
=>
$npc
[
'att'
],
'def'
=>
$npc
[
'def'
],
'skills'
=>
isset
(
$npc
[
'clbpara'
][
'skill'
])
&&
is_array
(
$npc
[
'clbpara'
][
'skill'
])
?
$npc
[
'clbpara'
][
'skill'
]
:
array
(),
'items'
=>
array
(),
// 探物模式下收集的物品
'wep'
=>
$npc
[
'wep'
],
'wepk'
=>
$npc
[
'wepk'
],
'wepe'
=>
$npc
[
'wepe'
],
'weps'
=>
$npc
[
'weps'
],
'wepsk'
=>
$npc
[
'wepsk'
],
'arb'
=>
$npc
[
'arb'
],
'arbk'
=>
$npc
[
'arbk'
],
'arbe'
=>
$npc
[
'arbe'
],
'arbs'
=>
$npc
[
'arbs'
],
'arbsk'
=>
$npc
[
'arbsk'
],
'recruited_time'
=>
$now
);
// 标记NPC已被收纳
$npc
[
'clbpara'
][
'owner'
]
=
$pid
;
$db
->
query
(
"UPDATE
{
$tablepre
}
players SET hp='
{
$npc
[
'mhp'
]
}
', sp='
{
$npc
[
'msp'
]
}
' WHERE pid='
{
$npc
[
'pid'
]
}
'"
);
// 更新NPC的clbpara - 使用JSON格式存储
$npc_clbpara
=
$npc
[
'clbpara'
];
$encoded_clbpara
=
json_encode
(
$npc_clbpara
,
JSON_UNESCAPED_UNICODE
);
$db
->
query
(
"UPDATE
{
$tablepre
}
players SET clbpara='
$encoded_clbpara
' WHERE pid='
{
$npc
[
'pid'
]
}
'"
);
$log
.=
"<span class='lime'>你成功收纳了种火「
{
$npc
[
'name'
]
}
」!</span><br>"
;
addnews
(
$now
,
'fireseed_recruit'
,
$name
,
$npc
[
'name'
]);
return
true
;
}
/**
* 设置种火部署状态
*
* @param string $fireseed_id 种火ID
* @param int $mode 部署模式(0:跟随, 1:探物, 2:索敌, 3:隐藏)
* @param int $pls 部署位置(如果不是跟随模式)
* @return bool 是否成功部署
*/
function
FireseedDeploy
(
$fireseed_id
,
$mode
,
$deploypls
=
0
)
{
global
$log
,
$fireseed_deploy_modes
,
$plsinfo
,
$deepzones
,
$db
,
$tablepre
,
$poseinfo
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
// 检查种火是否存在
if
(
!
isset
(
$clbpara
[
'fireseed'
][
$fireseed_id
]))
{
$log
.=
"<span class='red'>指定的种火不存在!</span><br>"
;
return
false
;
}
// 检查模式是否有效
if
(
!
isset
(
$fireseed_deploy_modes
[
$mode
]))
{
$log
.=
"<span class='red'>无效的部署模式!</span><br>"
;
return
false
;
}
// 确保使用传入的位置参数,而不是玩家当前位置
$fspls
=
intval
(
$deploypls
);
// 检查位置是否有效(不是禁区或隐藏地图)
if
(
in_array
(
$fspls
,
$deepzones
)
||
$fspls
<
0
||
$fspls
>=
100
)
{
$log
.=
"<span class='red'>无法部署到指定位置!</span><br>"
;
return
false
;
}
// 将模式转换为姿态值
$pose_map
=
array
(
0
=>
1
,
// 跟随 -> 作战姿态
1
=>
3
,
// 探物 -> 探物姿态
2
=>
2
,
// 索敌 -> 强袭姿态
3
=>
4
// 隐藏 -> 偷袭姿态
);
$pose
=
isset
(
$pose_map
[
$mode
])
?
$pose_map
[
$mode
]
:
1
;
// 如果是跟随模式,记录一下但仍然使用传入的位置
if
(
$mode
==
0
)
{
$log
.=
"<span class='yellow'>DEBUG: 跟随模式,部署位置
$fspls
</span><br>"
;
}
// 先更新NPC的位置和姿态
$result
=
$db
->
query
(
"SELECT * FROM
{
$tablepre
}
players WHERE pid='
$fireseed_id
'"
);
if
(
$db
->
num_rows
(
$result
)
>
0
)
{
$db
->
query
(
"UPDATE
{
$tablepre
}
players SET pls='
$fspls
', pose='
$pose
' WHERE pid='
$fireseed_id
'"
);
$log
.=
"<span class='yellow'>DEBUG: 更新NPC位置
$fspls
和姿态
{
$poseinfo
[
$pose
]
}
</span><br>"
;
}
else
{
$log
.=
"<span class='red'>警告:找不到对应的种火NPC!</span><br>"
;
}
// 再更新种火部署状态
$clbpara
[
'fireseed'
][
$fireseed_id
][
'mode'
]
=
$mode
;
$clbpara
[
'fireseed'
][
$fireseed_id
][
'pls'
]
=
$fspls
;
$clbpara
[
'fireseed'
][
$fireseed_id
][
'pose'
]
=
$pose
;
// 将更新后的 clbpara 保存到数据库
$encoded_clbpara
=
json_encode
(
$clbpara
,
JSON_UNESCAPED_UNICODE
);
$db
->
query
(
"UPDATE
{
$tablepre
}
players SET clbpara='
$encoded_clbpara
' WHERE pid='
$pid
'"
);
$mode_name
=
$fireseed_deploy_modes
[
$mode
];
$location
=
$plsinfo
[
$fspls
];
$pose_name
=
$poseinfo
[
$pose
];
$log
.=
"<span class='lime'>你将种火「
{
$clbpara
[
'fireseed'
][
$fireseed_id
][
'name'
]
}
」的状态设置为「
{
$mode_name
}
」(
{
$pose_name
}
)"
;
$log
.=
",并部署在了「
{
$location
}
」"
;
$log
.=
"。</span><br>"
;
return
true
;
}
/**
* 玩家行动时触发探物逻辑
*
* @param int $pls 玩家当前地图ID(不再使用此参数限制种火位置)
* @return void
*/
function
FireseedSearch
(
$pls
)
{
global
$log
,
$fireseed_search_rate
,
$db
,
$tablepre
,
$plsinfo
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
// 检查是否有种火
if
(
empty
(
$clbpara
[
'fireseed'
]))
{
return
;
}
// 查找所有处于探物模式的种火,不限制地图位置
$search_fireseeds
=
array
();
foreach
(
$clbpara
[
'fireseed'
]
as
$fs_id
=>
$fs_data
)
{
// 使用 pose 值 3 表示探物姿态
if
(
isset
(
$fs_data
[
'pose'
])
&&
$fs_data
[
'pose'
]
==
3
)
{
$search_fireseeds
[
$fs_id
]
=
$fs_data
;
}
else
if
(
$fs_data
[
'mode'
]
==
1
)
{
// 兼容旧数据,如果没有 pose 字段,则使用 mode
$search_fireseeds
[
$fs_id
]
=
$fs_data
;
}
}
if
(
empty
(
$search_fireseeds
))
{
return
;
}
// 按位置分组处理种火
$fireseeds_by_location
=
array
();
foreach
(
$search_fireseeds
as
$fs_id
=>
$fs_data
)
{
$location
=
$fs_data
[
'pls'
];
if
(
!
isset
(
$fireseeds_by_location
[
$location
]))
{
$fireseeds_by_location
[
$location
]
=
array
();
}
$fireseeds_by_location
[
$location
][
$fs_id
]
=
$fs_data
;
}
// 对每个位置分别处理
foreach
(
$fireseeds_by_location
as
$location
=>
$location_fireseeds
)
{
// 获取该位置的物品
$result
=
$db
->
query
(
"SELECT * FROM
{
$tablepre
}
mapitem WHERE pls='
$location
' LIMIT 1"
);
if
(
!
$db
->
num_rows
(
$result
))
{
continue
;
// 该位置没有物品,继续检查下一个位置
}
// 计算探物成功率(每个种火增加一次成功机会)
$success
=
false
;
foreach
(
$location_fireseeds
as
$fs_id
=>
$fs_data
)
{
$search_dice
=
rand
(
1
,
100
);
// 种火等级会提高探物成功率
$adjusted_rate
=
$fireseed_search_rate
+
(
$fs_data
[
'level'
]
*
2
);
if
(
$search_dice
<=
$adjusted_rate
)
{
$success
=
true
;
$finder_id
=
$fs_id
;
break
;
}
}
if
(
!
$success
)
{
continue
;
// 该位置的种火探物失败,继续检查下一个位置
}
// 获取物品数据
$item_data
=
$db
->
fetch_array
(
$result
);
// 将物品添加到种火的物品池中
$clbpara
[
'fireseed'
][
$finder_id
][
'items'
][]
=
array
(
'itm'
=>
$item_data
[
'itm'
],
'itmk'
=>
$item_data
[
'itmk'
],
'itme'
=>
$item_data
[
'itme'
],
'itms'
=>
$item_data
[
'itms'
],
'itmsk'
=>
$item_data
[
'itmsk'
]
);
// 从地图上移除物品
$db
->
query
(
"DELETE FROM
{
$tablepre
}
mapitem WHERE iid='
{
$item_data
[
'iid'
]
}
'"
);
$log
.=
"<span class='lime'>你的种火「
{
$clbpara
[
'fireseed'
][
$finder_id
][
'name'
]
}
」在「
{
$plsinfo
[
$location
]
}
」发现了物品「
{
$item_data
[
'itm'
]
}
」!</span><br>"
;
}
// 如果有任何种火成功探物,更新玩家的 clbpara
if
(
isset
(
$finder_id
))
{
// 将更新后的 clbpara 保存到数据库
$encoded_clbpara
=
json_encode
(
$clbpara
,
JSON_UNESCAPED_UNICODE
);
$db
->
query
(
"UPDATE
{
$tablepre
}
players SET clbpara='
$encoded_clbpara
' WHERE pid='
$pid
'"
);
}
}
/**
* 玩家行动时触发索敌逻辑
*
* @param int $pls 玩家当前地图ID(不再使用此参数限制种火位置)
* @return void
*/
function
FireseedDrainNPC
(
$pls
)
{
global
$log
,
$fireseed_drain_rate
,
$db
,
$tablepre
,
$plsinfo
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
// 检查是否有种火
if
(
empty
(
$clbpara
[
'fireseed'
]))
{
return
;
}
// 查找所有处于索敌模式的种火,不限制地图位置
$drain_fireseeds
=
array
();
foreach
(
$clbpara
[
'fireseed'
]
as
$fs_id
=>
$fs_data
)
{
// 使用 pose 值 2 表示强袭姿态(索敌)
if
(
isset
(
$fs_data
[
'pose'
])
&&
$fs_data
[
'pose'
]
==
2
)
{
$drain_fireseeds
[
$fs_id
]
=
$fs_data
;
}
else
if
(
$fs_data
[
'mode'
]
==
2
)
{
// 兼容旧数据,如果没有 pose 字段,则使用 mode
$drain_fireseeds
[
$fs_id
]
=
$fs_data
;
}
}
if
(
empty
(
$drain_fireseeds
))
{
return
;
}
// 按位置分组处理种火
$fireseeds_by_location
=
array
();
foreach
(
$drain_fireseeds
as
$fs_id
=>
$fs_data
)
{
$location
=
$fs_data
[
'pls'
];
if
(
!
isset
(
$fireseeds_by_location
[
$location
]))
{
$fireseeds_by_location
[
$location
]
=
array
();
}
$fireseeds_by_location
[
$location
][
$fs_id
]
=
$fs_data
;
}
// 对每个位置分别处理
foreach
(
$fireseeds_by_location
as
$location
=>
$location_fireseeds
)
{
// 获取该位置的NPC
$result
=
$db
->
query
(
"SELECT * FROM
{
$tablepre
}
players WHERE type>0 AND hp>1 AND pls='
$location
'"
);
if
(
!
$db
->
num_rows
(
$result
))
{
continue
;
// 该位置没有NPC,继续检查下一个位置
}
while
(
$npc
=
$db
->
fetch_array
(
$result
))
{
// 跳过防御力超过10000,或持有fireseed3和fireseed4技能的NPC
if
(
$npc
[
'def'
]
>
10000
||
(
isset
(
$npc
[
'clbpara'
][
'skill'
])
&&
(
in_array
(
'fireseed3'
,
$npc
[
'clbpara'
][
'skill'
])
||
in_array
(
'fireseed4'
,
$npc
[
'clbpara'
][
'skill'
]))))
{
continue
;
}
// 计算削减成功率(每个种火增加一次成功机会)
$success
=
false
;
foreach
(
$location_fireseeds
as
$fs_id
=>
$fs_data
)
{
$drain_dice
=
rand
(
1
,
100
);
// 种火等级会提高削减成功率
$adjusted_rate
=
$fireseed_drain_rate
+
(
$fs_data
[
'level'
]
*
2
);
if
(
$drain_dice
<=
$adjusted_rate
)
{
$success
=
true
;
$drainer_id
=
$fs_id
;
break
;
}
}
if
(
!
$success
)
{
continue
;
}
// 计算削减量(基于种火等级和攻击力)
$drain_amount
=
ceil
(
$location_fireseeds
[
$drainer_id
][
'att'
]
*
(
$location_fireseeds
[
$drainer_id
][
'level'
]
*
0.5
));
$new_hp
=
max
(
1
,
$npc
[
'hp'
]
-
$drain_amount
);
// 更新NPC生命值
$db
->
query
(
"UPDATE
{
$tablepre
}
players SET hp='
$new_hp
' WHERE pid='
{
$npc
[
'pid'
]
}
'"
);
$log
.=
"<span class='lime'>你的种火「
{
$clbpara
[
'fireseed'
][
$drainer_id
][
'name'
]
}
」在「
{
$plsinfo
[
$location
]
}
」削弱了「
{
$npc
[
'name'
]
}
」,造成了
{
$drain_amount
}
点伤害!</span><br>"
;
}
}
}
/**
* 消耗焰火物品,更新种火的强化倍率
*
* @param string $fireseed_id 种火ID
* @param int $item_index 物品在物品栏中的位置
* @return bool 是否成功强化
*/
function
FireseedEnhance
(
$fireseed_id
,
$item_index
)
{
global
$log
,
$fireseed_enhance_multipliers
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
// 检查种火是否存在
if
(
!
isset
(
$clbpara
[
'fireseed'
][
$fireseed_id
]))
{
$log
.=
"<span class='red'>指定的种火不存在!</span><br>"
;
return
false
;
}
// 检查物品是否存在
$item_var
=
'itm'
.
$item_index
;
$itemk_var
=
'itmk'
.
$item_index
;
$iteme_var
=
'itme'
.
$item_index
;
$items_var
=
'itms'
.
$item_index
;
$itemsk_var
=
'itmsk'
.
$item_index
;
if
(
empty
(
$$item_var
))
{
$log
.=
"<span class='red'>指定的物品不存在!</span><br>"
;
return
false
;
}
// 检查物品是否为焰火类物品
$item_name
=
$$item_var
;
if
(
!
isset
(
$fireseed_enhance_multipliers
[
$item_name
]))
{
$log
.=
"<span class='red'>这不是可用于强化的焰火物品!</span><br>"
;
return
false
;
}
// 获取强化倍率
$multiplier
=
$fireseed_enhance_multipliers
[
$item_name
];
// 更新种火属性
$old_level
=
$clbpara
[
'fireseed'
][
$fireseed_id
][
'level'
];
$clbpara
[
'fireseed'
][
$fireseed_id
][
'level'
]
=
$multiplier
;
$clbpara
[
'fireseed'
][
$fireseed_id
][
'hp'
]
*=
$multiplier
/
$old_level
;
$clbpara
[
'fireseed'
][
$fireseed_id
][
'mhp'
]
*=
$multiplier
/
$old_level
;
$clbpara
[
'fireseed'
][
$fireseed_id
][
'sp'
]
*=
$multiplier
/
$old_level
;
$clbpara
[
'fireseed'
][
$fireseed_id
][
'msp'
]
*=
$multiplier
/
$old_level
;
$clbpara
[
'fireseed'
][
$fireseed_id
][
'att'
]
*=
$multiplier
/
$old_level
;
$clbpara
[
'fireseed'
][
$fireseed_id
][
'def'
]
*=
$multiplier
/
$old_level
;
// 更新武器和防具效果
if
(
!
empty
(
$clbpara
[
'fireseed'
][
$fireseed_id
][
'wepe'
]))
{
$clbpara
[
'fireseed'
][
$fireseed_id
][
'wepe'
]
*=
$multiplier
/
$old_level
;
}
if
(
!
empty
(
$clbpara
[
'fireseed'
][
$fireseed_id
][
'arbe'
]))
{
$clbpara
[
'fireseed'
][
$fireseed_id
][
'arbe'
]
*=
$multiplier
/
$old_level
;
}
// 将更新后的 clbpara 保存到数据库
$encoded_clbpara
=
json_encode
(
$clbpara
,
JSON_UNESCAPED_UNICODE
);
$db
->
query
(
"UPDATE
{
$tablepre
}
players SET clbpara='
$encoded_clbpara
' WHERE pid='
$pid
'"
);
// 消耗物品
$$items_var
--
;
if
(
$$items_var
<=
0
)
{
$$item_var
=
$$itemk_var
=
$$itemsk_var
=
''
;
$$iteme_var
=
$$items_var
=
0
;
}
$log
.=
"<span class='lime'>你使用「
{
$item_name
}
」强化了种火「
{
$clbpara
[
'fireseed'
][
$fireseed_id
][
'name'
]
}
」!</span><br>"
;
$log
.=
"<span class='yellow'>种火的强化倍率提升到了
{
$multiplier
}
倍!</span><br>"
;
return
true
;
}
/**
* 玩家移动时,将所有处于跟随状态的种火一并移动到目标位置
*
* @param int $target_pls 目标位置ID
* @return void
*/
function
FireseedFollow
(
$target_pls
)
{
global
$log
,
$db
,
$tablepre
,
$plsinfo
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
// 检查是否有种火
if
(
empty
(
$clbpara
[
'fireseed'
]))
{
return
;
}
// 查找所有处于跟随模式的种火
$follow_fireseeds
=
array
();
foreach
(
$clbpara
[
'fireseed'
]
as
$fs_id
=>
$fs_data
)
{
// 使用 pose 值 1 表示作战姿态(跟随)
if
((
isset
(
$fs_data
[
'pose'
])
&&
$fs_data
[
'pose'
]
==
1
)
||
(
$fs_data
[
'mode'
]
==
0
))
{
$follow_fireseeds
[
$fs_id
]
=
$fs_data
;
}
}
if
(
empty
(
$follow_fireseeds
))
{
return
;
}
// 移动所有跟随种火到目标位置
$moved_count
=
0
;
foreach
(
$follow_fireseeds
as
$fs_id
=>
$fs_data
)
{
// 如果种火已经在目标位置,则跳过
if
(
$fs_data
[
'pls'
]
==
$target_pls
)
{
continue
;
}
// 更新数据库中的种火位置
$db
->
query
(
"UPDATE
{
$tablepre
}
players SET pls='
$target_pls
' WHERE pid='
$fs_id
'"
);
// 更新clbpara中的种火位置
$clbpara
[
'fireseed'
][
$fs_id
][
'pls'
]
=
$target_pls
;
$moved_count
++
;
}
// 如果有种火被移动,则更新clbpara并显示提示
if
(
$moved_count
>
0
)
{
// 将更新后的 clbpara 保存到数据库
$encoded_clbpara
=
json_encode
(
$clbpara
,
JSON_UNESCAPED_UNICODE
);
$db
->
query
(
"UPDATE
{
$tablepre
}
players SET clbpara='
$encoded_clbpara
' WHERE pid='
$pid
'"
);
// 显示提示
$log
.=
"<span class='lime'>
{
$moved_count
}
个跟随状态的种火随你一起移动到了「
{
$plsinfo
[
$target_pls
]
}
」。</span><br>"
;
}
}
/**
* 根据所有跟随种火的数量与强化层数,为玩家加成攻击防御
* 注意:只有与玩家在同一位置的跟随种火才会提供加成
*
* @return array 返回加成的攻击和防御值
*/
function
FireseedBuffBonus
()
{
global
$fireseed_follow_bonus_rate
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
$att_bonus
=
0
;
$def_bonus
=
0
;
// 检查是否有种火
if
(
empty
(
$clbpara
[
'fireseed'
]))
{
return
array
(
'att'
=>
$att_bonus
,
'def'
=>
$def_bonus
);
}
// 计算跟随模式的种火加成
// 注意:这里仍然只考虑与玩家在同一位置的种火,因为这是战斗加成
foreach
(
$clbpara
[
'fireseed'
]
as
$fs_data
)
{
// 使用 pose 值 1 表示作战姿态(跟随)
if
((
isset
(
$fs_data
[
'pose'
])
&&
$fs_data
[
'pose'
]
==
1
&&
$fs_data
[
'pls'
]
==
$pls
)
||
(
$fs_data
[
'mode'
]
==
0
&&
$fs_data
[
'pls'
]
==
$pls
))
{
// 加成 = 数量(1) × 强化层数 × 1%
$bonus_percent
=
1
*
$fs_data
[
'level'
]
*
$fireseed_follow_bonus_rate
;
$att_bonus
+=
ceil
(
$att
*
$bonus_percent
/
100
);
$def_bonus
+=
ceil
(
$def
*
$bonus_percent
/
100
);
}
}
return
array
(
'att'
=>
$att_bonus
,
'def'
=>
$def_bonus
);
}
/**
* 检查玩家是否有利于种火的物品
*
* @return bool
*/
function
hasFireseedEquipment
()
{
# 备用
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
//return (strpos($wep, '钓竿') !== false || strpos($wep, '钓鱼竿') !== false);
return
false
;
}
?>
include/game/item.test.php
View file @
18636ac8
...
@@ -115,6 +115,19 @@ function item_test($itmn, &$data) {
...
@@ -115,6 +115,19 @@ function item_test($itmn, &$data) {
$itm
=
$itmk
=
$itmsk
=
''
;
$itm
=
$itmk
=
$itmsk
=
''
;
$itme
=
$itms
=
0
;
$itme
=
$itms
=
0
;
}
}
}
elseif
(
$itm
==
'测试用枫火歌者社团卡'
)
{
//-----------------------//
//未选择社团情况下才可以用社团卡
if
(
$club
)
{
$log
.=
"你已经是有身份的人了!不能再使用社团卡。<br>"
;
}
else
{
$log
.=
"<br>加入了了<span class='sparkle'>
{
$sparkle
}
枫火歌者
{
$sparkle
}
</span>!<br>"
;
//社团变更
changeclub
(
22
,
$data
);
//销毁道具
$itm
=
$itmk
=
$itmsk
=
''
;
$itme
=
$itms
=
0
;
}
//-----------------------//
//-----------------------//
}
elseif
(
$itm
==
'提示纸条A'
)
{
}
elseif
(
$itm
==
'提示纸条A'
)
{
$log
.=
'你读着纸条上的内容:<br>"执行官其实都是幻影,那个红暮的身上应该有召唤幻影的玩意。"<br>"用那个东西然后打倒幻影的话能用游戏解除钥匙出去吧。"<br>'
;
$log
.=
'你读着纸条上的内容:<br>"执行官其实都是幻影,那个红暮的身上应该有召唤幻影的玩意。"<br>"用那个东西然后打倒幻影的话能用游戏解除钥匙出去吧。"<br>'
;
...
...
include/game/revattr.func.php
View file @
18636ac8
...
@@ -861,8 +861,18 @@ namespace revattr
...
@@ -861,8 +861,18 @@ namespace revattr
$club_atk_per *= $attfac;
$club_atk_per *= $attfac;
}*/
}*/
# 「枝火歌者」效果判定:基础攻击力增加
$fireseed_bonus
=
0
;
if
(
$pa
[
'club'
]
==
22
&&
!
empty
(
$pa
[
'clbpara'
][
'fireseed'
]))
{
include_once
GAME_ROOT
.
'./include/game/club22.func.php'
;
$fireseed_buff
=
FireseedBuffBonus
();
$fireseed_bonus
=
$fireseed_buff
[
'att'
];
if
(
!
$tooltip
&&
$fireseed_bonus
>
0
)
$log
.=
"<span class='yellow'>
{
$pa
[
'nm'
]
}
的种火增幅了
{
$fireseed_bonus
}
点攻击力!</span><br>"
;
}
# 汇总
# 汇总
$base_att
=
round
(
$base_att
*
(
$base_atk_per
/
100
)
*
(
$inf_atk_per
/
100
));
$base_att
=
round
(
$base_att
*
(
$base_atk_per
/
100
)
*
(
$inf_atk_per
/
100
))
+
$fireseed_bonus
;
$base_att
=
max
(
1
,
$base_att
);
$base_att
=
max
(
1
,
$base_att
);
if
(
$tooltip
)
if
(
$tooltip
)
...
@@ -983,10 +993,20 @@ namespace revattr
...
@@ -983,10 +993,20 @@ namespace revattr
$sk_lvl
=
get_skilllvl
(
'c12_garrison'
,
$pd
);
$sk_lvl
=
get_skilllvl
(
'c12_garrison'
,
$pd
);
$sk_var
=
100
+
round
(
get_skillvars
(
'c12_garrison'
,
'defgain'
,
$sk_lvl
)
*
calc_garrison_losshpr
(
$pa
,
$pd
));
$sk_var
=
100
+
round
(
get_skillvars
(
'c12_garrison'
,
'defgain'
,
$sk_lvl
)
*
calc_garrison_losshpr
(
$pa
,
$pd
));
}
}
# 「枝火歌者」效果判定:基础防御力增加
$fireseed_bonus
=
0
;
if
(
$pd
[
'club'
]
==
22
&&
!
empty
(
$pd
[
'clbpara'
][
'fireseed'
]))
{
include_once
GAME_ROOT
.
'./include/game/club22.func.php'
;
$fireseed_buff
=
FireseedBuffBonus
();
$fireseed_bonus
=
$fireseed_buff
[
'def'
];
if
(
!
$tooltip
&&
$fireseed_bonus
>
0
)
$log
.=
"<span class='yellow'>
{
$pd
[
'nm'
]
}
的种火增幅了
{
$fireseed_bonus
}
点防御力!</span><br>"
;
}
# 汇总
# 汇总
$total_def
=
round
(
$total_def
*
(
$base_def_per
/
100
)
*
(
$inf_def_per
/
100
));
$total_def
=
round
(
$total_def
*
(
$base_def_per
/
100
)
*
(
$inf_def_per
/
100
));
if
(
isset
(
$sk_var
))
$total_def
=
round
(
$total_def
*
(
$sk_var
/
100
));
if
(
isset
(
$sk_var
))
$total_def
=
round
(
$total_def
*
(
$sk_var
/
100
));
$total_def
=
max
(
0.01
,
$total_def
);
$total_def
=
max
(
0.01
,
$total_def
)
+
$fireseed_bonus
;
if
(
$tooltip
)
if
(
$tooltip
)
{
{
...
...
include/game/search.func.php
View file @
18636ac8
...
@@ -119,6 +119,16 @@ function move($moveto = 99,&$data=NULL)
...
@@ -119,6 +119,16 @@ function move($moveto = 99,&$data=NULL)
# 更新charge值
# 更新charge值
process_charge_events
(
$data
);
process_charge_events
(
$data
);
# 如果是种火歌者,处理种火相关逻辑
if
(
$club
==
22
)
{
include_once
GAME_ROOT
.
'./include/game/club22.func.php'
;
// 移动跟随状态的种火
FireseedFollow
(
$pls
);
// 处理探物和索敌逻辑
FireseedSearch
(
$pls
);
FireseedDrainNPC
(
$pls
);
}
$enemyrate
=
\revbattle\calc_meetman_rate
(
$data
);
$enemyrate
=
\revbattle\calc_meetman_rate
(
$data
);
discover
(
$enemyrate
,
$data
);
discover
(
$enemyrate
,
$data
);
return
;
return
;
...
@@ -167,6 +177,13 @@ function search(&$data=NULL)
...
@@ -167,6 +177,13 @@ function search(&$data=NULL)
# 更新charge值
# 更新charge值
process_charge_events
(
$data
);
process_charge_events
(
$data
);
# 如果是种火歌者,处理种火相关逻辑
if
(
$club
==
22
)
{
include_once
GAME_ROOT
.
'./include/game/club22.func.php'
;
FireseedSearch
(
$pls
);
FireseedDrainNPC
(
$pls
);
}
$enemyrate
=
\revbattle\calc_meetman_rate
(
$data
);
$enemyrate
=
\revbattle\calc_meetman_rate
(
$data
);
discover
(
$enemyrate
,
$data
);
discover
(
$enemyrate
,
$data
);
return
;
return
;
...
...
include/news.func.php
View file @
18636ac8
...
@@ -173,7 +173,7 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
...
@@ -173,7 +173,7 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
yellow
\"
>
$a
</span>被<span class=
\"
yellow
\"
>
$c
</span>使用<span class=
\"
red
\"
>
{
$d
}
</span>殴打致死"
;
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
yellow
\"
>
$a
</span>被<span class=
\"
yellow
\"
>
$c
</span>使用<span class=
\"
red
\"
>
{
$d
}
</span>殴打致死"
;
}
elseif
(
$news
==
'death22'
)
{
}
elseif
(
$news
==
'death22'
)
{
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
yellow
\"
>
$a
</span>被<span class=
\"
yellow
\"
>
$c
</span>使用<span class=
\"
red
\"
>
{
$d
}
</span>斩杀"
;
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
yellow
\"
>
$a
</span>被<span class=
\"
yellow
\"
>
$c
</span>使用<span class=
\"
red
\"
>
{
$d
}
</span>斩杀"
;
}
elseif
(
$news
==
'death23'
)
{
}
elseif
(
$news
==
'death23'
||
$news
==
'death60'
)
{
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
yellow
\"
>
$a
</span>被<span class=
\"
yellow
\"
>
$c
</span>使用<span class=
\"
red
\"
>
{
$d
}
</span>射杀"
;
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
yellow
\"
>
$a
</span>被<span class=
\"
yellow
\"
>
$c
</span>使用<span class=
\"
red
\"
>
{
$d
}
</span>射杀"
;
}
elseif
(
$news
==
'death24'
)
{
}
elseif
(
$news
==
'death24'
)
{
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
yellow
\"
>
$a
</span>被<span class=
\"
yellow
\"
>
$c
</span>投掷<span class=
\"
red
\"
>
{
$d
}
</span>致死"
;
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
yellow
\"
>
$a
</span>被<span class=
\"
yellow
\"
>
$c
</span>投掷<span class=
\"
red
\"
>
{
$d
}
</span>致死"
;
...
@@ -318,6 +318,8 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
...
@@ -318,6 +318,8 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
red
\"
>
{
$a
}
的尸体被时空特使别动队销毁了</span><br>
\n
"
;
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
red
\"
>
{
$a
}
的尸体被时空特使别动队销毁了</span><br>
\n
"
;
}
elseif
(
$news
==
'cstick'
)
{
}
elseif
(
$news
==
'cstick'
)
{
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
red
\"
>
{
$a
}
把
{
$b
}
作为武器抡了起来!哇……这可真是……</span><br>
\n
"
;
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
red
\"
>
{
$a
}
把
{
$b
}
作为武器抡了起来!哇……这可真是……</span><br>
\n
"
;
}
elseif
(
$news
==
'fireseed_recruit'
)
{
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
lime
\"
>
{
$a
}
将
{
$b
}
收纳到了自己名下!</span><br>
\n
"
;
}
elseif
(
$news
==
'editpc'
)
{
}
elseif
(
$news
==
'editpc'
)
{
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
red
\"
>
{
$a
}
遭到了黑幕的生化改造!</span><br>
\n
"
;
$newsinfo
.=
"<li>
{
$hour
}
时
{
$min
}
分
{
$sec
}
秒,<span class=
\"
red
\"
>
{
$a
}
遭到了黑幕的生化改造!</span><br>
\n
"
;
}
elseif
(
$news
==
'suisidefail'
)
{
}
elseif
(
$news
==
'suisidefail'
)
{
...
...
include/state.func.php
View file @
18636ac8
...
@@ -529,6 +529,14 @@
...
@@ -529,6 +529,14 @@
function
expup_rev
(
&
$pa
,
&
$pd
,
$active
)
function
expup_rev
(
&
$pa
,
&
$pd
,
$active
)
{
{
global
$log
,
$baseexp
;
global
$log
,
$baseexp
;
# 「洁净」技能判定:战斗时无法获得经验值
if
(
!
empty
(
$pa
[
'clbpara'
][
'skill'
])
&&
in_array
(
'npc_purity'
,
$pa
[
'clbpara'
][
'skill'
]))
{
$log
.=
'<span class="yellow">「洁净」使'
.
$pa
[
'nm'
]
.
'无法获得经验值!</span><br>'
;
return
;
}
# 攻击命中的情况下,计算获得经验
# 攻击命中的情况下,计算获得经验
if
(
$pa
[
'hitrate_times'
]
>
0
)
if
(
$pa
[
'hitrate_times'
]
>
0
)
{
{
...
...
templates/default/command.htm
View file @
18636ac8
...
@@ -50,13 +50,13 @@
...
@@ -50,13 +50,13 @@
<br>
<br>
<!-- 第 -1 行:社团提示相关-->
<!-- 第 -1 行:社团提示相关-->
<!--{if $club==19}-->
<!--{if $club==19}-->
【
<span
class=
"lime"
>
报应点数:
<span
id=
"anum"
>
$rp
</span></span>
】
<br>
【
<span
class=
"lime"
>
报应点数:
<span
id=
"anum"
>
$rp
</span></span>
】
<br>
<!--{/if}-->
<!--{/if}-->
<!--{if $nick==69}-->
<!--{if $nick==69}-->
【
<span
class=
"lime"
>
梦之数值:
<span
id=
"anum"
>
$clbpara['randver1']
</span>
,
<span
id=
"anum"
>
$clbpara['randver2']
</span>
,
<span
id=
"anum"
>
$clbpara['randver3']
</span></span>
】
<br>
【
<span
class=
"lime"
>
梦之数值:
<span
id=
"anum"
>
$clbpara['randver1']
</span>
,
<span
id=
"anum"
>
$clbpara['randver2']
</span>
,
<span
id=
"anum"
>
$clbpara['randver3']
</span></span>
】
<br>
<!--{/if}-->
<!--{/if}-->
<!--{if $clbpara['BGMBrand']=='rixolamal'}-->
<!--{if $clbpara['BGMBrand']=='rixolamal'}-->
【
<span
class=
"lime"
>
你投出的骰子数量:
<span
id=
"anum"
>
$clbpara['diceRolled']
</span></span>
】
<br>
【
<span
class=
"lime"
>
你投出的骰子数量:
<span
id=
"anum"
>
$clbpara['diceRolled']
</span></span>
】
<br>
<br>
<br>
【🍀
<span
class=
"minirainbow"
>
你正在反叛随机数大神!
</span>
🍀】
<br>
【🍀
<span
class=
"minirainbow"
>
你正在反叛随机数大神!
</span>
🍀】
<br>
...
@@ -69,8 +69,8 @@
...
@@ -69,8 +69,8 @@
<!--{/if}-->
<!--{/if}-->
<!-- 第 1 行 : 包裹相关-->
<!-- 第 1 行 : 包裹相关-->
<!--{if $club==20}-->
<!--{if $club==20}-->
<!--{if $clbstatusa}-->
<!--{if $clbstatusa}-->
<input
type=
"button"
class=
"cmdbutton"
id=
"elementmix"
name=
"elementmix"
value=
"■■■■"
onclick=
"$('command').value='itemmain';$('subcmd').name='itemcmd';$('subcmd').value='elementmix';postCmd('gamecmd','command.php');this.disabled=true;"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"elementmix"
name=
"elementmix"
value=
"■■■■"
onclick=
"$('command').value='itemmain';$('subcmd').name='itemcmd';$('subcmd').value='elementmix';postCmd('gamecmd','command.php');this.disabled=true;"
>
<!--{else}-->
<!--{else}-->
<input
type=
"button"
class=
"cmdbutton"
id=
"elementmix"
name=
"elementmix"
value=
"元素口袋"
onclick=
"$('command').value='itemmain';$('subcmd').name='itemcmd';$('subcmd').value='elementmix';postCmd('gamecmd','command.php');this.disabled=true;"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"elementmix"
name=
"elementmix"
value=
"元素口袋"
onclick=
"$('command').value='itemmain';$('subcmd').name='itemcmd';$('subcmd').value='elementmix';postCmd('gamecmd','command.php');this.disabled=true;"
>
...
@@ -127,7 +127,7 @@
...
@@ -127,7 +127,7 @@
<br>
<br>
<!-- 第 3.5 行:队伍指令-->
<!-- 第 3.5 行:队伍指令-->
<!--{if $gamestate < 40}-->
<!--{if $gamestate < 40
&& $club != 22
}-->
<!--{if !$teamID}-->
<!--{if !$teamID}-->
<span
tooltip=
"消耗{$team_sp}点体力,创建一支队伍"
>
<span
tooltip=
"消耗{$team_sp}点体力,创建一支队伍"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"teammake"
name=
"teammake"
value=
"组建队伍"
onclick=
"$('command').value='team';$('subcmd').name='teamcmd';$('subcmd').value='teammake';postCmd('gamecmd','command.php');this.disabled=true;"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"teammake"
name=
"teammake"
value=
"组建队伍"
onclick=
"$('command').value='team';$('subcmd').name='teamcmd';$('subcmd').value='teammake';postCmd('gamecmd','command.php');this.disabled=true;"
>
...
@@ -140,6 +140,12 @@
...
@@ -140,6 +140,12 @@
<!--{/if}-->
<!--{/if}-->
<br
/>
<br
/>
<!--{/if}-->
<!--{/if}-->
<!--{if $club == 22}-->
<span
tooltip=
"枫火歌者无法组队,但可以收纳种火作为随从"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"fireseed_manage"
name=
"fireseed_manage"
value=
"种火管理"
onclick=
"openSidePanelToFireseedTab();"
>
</span>
<br
/>
<!--{/if}-->
<!-- 第 4 行:地区功能-->
<!-- 第 4 行:地区功能-->
<!--{if in_array($pls,$shops) || !check_skill_unlock('c11_ebuy',$pdata)}-->
<!--{if in_array($pls,$shops) || !check_skill_unlock('c11_ebuy',$pdata)}-->
...
...
templates/default/corpse.htm
View file @
18636ac8
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
<input
type=
"radio"
name=
"command"
id=
"c20_zombie"
value=
"c20_zombie"
style=
"margin-left:5px;"
><a
onclick=
sl('c20_zombie');
href=
"javascript:void(0);"
><span
class=
"mtgblack"
>
转化灵俑
</span></a>
<input
type=
"radio"
name=
"command"
id=
"c20_zombie"
value=
"c20_zombie"
style=
"margin-left:5px;"
><a
onclick=
sl('c20_zombie');
href=
"javascript:void(0);"
><span
class=
"mtgblack"
>
转化灵俑
</span></a>
<!--{/if}-->
<!--{/if}-->
<br>
<br>
<!--{elseif $club==22 && $w_type==92 && empty($w_clbpara['owner'])}-->
<input
type=
"radio"
name=
"command"
id=
"fireseed_recruit"
value=
"fireseed_recruit"
<!
--
{
if
!$
w_money
}
--
>
checked
<!--{/if}-->
>
<a
onclick=
sl('fireseed_recruit');
href=
"javascript:void(0);"
><span
class=
"lime"
>
收纳种火
</span></a><br>
<!--{elseif $allow_destory_corpse && !in_array($w_type,$no_destory_corpse_type)}-->
<!--{elseif $allow_destory_corpse && !in_array($w_type,$no_destory_corpse_type)}-->
<input
type=
"radio"
name=
"command"
id=
"destory"
value=
"destory"
<!
--
{
if
!$
w_money
}
--
>
checked
<!--{/if}-->
>
<a
onclick=
sl('destory');
href=
"javascript:void(0);"
>
销毁尸体
</a><br>
<input
type=
"radio"
name=
"command"
id=
"destory"
value=
"destory"
<!
--
{
if
!$
w_money
}
--
>
checked
<!--{/if}-->
>
<a
onclick=
sl('destory');
href=
"javascript:void(0);"
>
销毁尸体
</a><br>
<!--{/if}-->
<!--{/if}-->
...
...
templates/default/fireseedpage.htm
0 → 100644
View file @
18636ac8
<div
id=
"fireseedpage"
class=
"userdialog"
style=
"display:none;width:800px;height:600px;"
>
<div
class=
"dialog-title"
>
种火管理
</div>
<div
class=
"dialog-content"
style=
"overflow-y: auto; height: 520px;"
>
<div
class=
"dialog-tab"
>
<div
class=
"tab-header"
>
<div
class=
"tab-button active"
onclick=
"switchTab(this, 'fireseed-status')"
>
种火状态
</div>
<div
class=
"tab-button"
onclick=
"switchTab(this, 'fireseed-deploy')"
>
种火部署
</div>
<div
class=
"tab-button"
onclick=
"switchTab(this, 'fireseed-items')"
>
种火物品
</div>
<div
class=
"tab-button"
onclick=
"switchTab(this, 'fireseed-enhance')"
>
种火强化
</div>
</div>
<div
class=
"tab-content"
>
<div
id=
"fireseed-status"
class=
"tab-pane active"
>
<h3>
种火状态
</h3>
<table
class=
"fireseed-table"
>
<tr>
<th>
名称
</th>
<th>
等级
</th>
<th>
状态
</th>
<th>
位置
</th>
<th>
生命
</th>
<th>
体力
</th>
<th>
攻击
</th>
<th>
防御
</th>
</tr>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<tr>
<td><span
class=
"yellow"
>
$fs_data['name']
</span></td>
<td>
$fs_data['level']
</td>
<td>
$fireseed_deploy_modes[$fs_data['mode']]
</td>
<td>
$plsinfo[$fs_data['pls']]
</td>
<td>
$fs_data['hp']/$fs_data['mhp']
</td>
<td>
$fs_data['sp']/$fs_data['msp']
</td>
<td>
$fs_data['att']
</td>
<td>
$fs_data['def']
</td>
</tr>
<!--{/loop}-->
<!--{else}-->
<tr>
<td
colspan=
"8"
>
你还没有收纳任何种火。
</td>
</tr>
<!--{/if}-->
</table>
</div>
<div
id=
"fireseed-deploy"
class=
"tab-pane"
>
<h3>
种火部署
</h3>
<form
id=
"fireseed-deploy-form"
method=
"post"
action=
"command.php"
target=
"cmd_window"
>
<input
type=
"hidden"
name=
"mode"
value=
"command"
>
<input
type=
"hidden"
name=
"command"
value=
"special"
>
<input
type=
"hidden"
name=
"sp_cmd"
value=
"sp_fireseed_deploy"
>
<div
class=
"form-group"
>
<label
for=
"fireseed_id"
>
选择种火:
</label>
<select
name=
"fireseed_id"
id=
"fireseed_id"
>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<option
value=
"$fs_id"
>
$fs_data['name'] (等级: $fs_data['level'])
</option>
<!--{/loop}-->
<!--{else}-->
<option
value=
""
>
你还没有收纳任何种火
</option>
<!--{/if}-->
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"deploy_mode"
>
部署模式:
</label>
<select
name=
"deploy_mode"
id=
"deploy_mode"
>
<!--{loop $fireseed_deploy_modes $mode_id $mode_name}-->
<option
value=
"$mode_id"
>
$mode_name
</option>
<!--{/loop}-->
</select>
</div>
<div
class=
"form-group"
id=
"deploy-location-group"
>
<label
for=
"deploy_pls"
>
部署位置:
</label>
<select
name=
"deploy_pls"
id=
"deploy_pls"
>
<!--{loop $plsinfo $pls_id $pls_name}-->
<!--{if $pls_id > 0}-->
<option
value=
"$pls_id"
<!
--
{
if
$
pls_id =
=
$
pls
}
--
>
selected
<!--{/if}-->
>$pls_name
</option>
<!--{/if}-->
<!--{/loop}-->
</select>
</div>
<div
class=
"form-group"
>
<input
type=
"submit"
class=
"cmdbutton"
value=
"部署种火"
onclick=
"postCmd('gamecmd','command.php');"
>
</div>
</form>
<script>
// 当部署模式改变时,显示或隐藏位置选择
document
.
getElementById
(
'
deploy_mode
'
).
addEventListener
(
'
change
'
,
function
()
{
var
mode
=
this
.
value
;
var
locationGroup
=
document
.
getElementById
(
'
deploy-location-group
'
);
if
(
mode
==
'
0
'
)
{
// 跟随模式
locationGroup
.
style
.
display
=
'
none
'
;
}
else
{
locationGroup
.
style
.
display
=
'
block
'
;
}
});
</script>
</div>
<div
id=
"fireseed-items"
class=
"tab-pane"
>
<h3>
种火物品
</h3>
<form
id=
"fireseed-items-form"
method=
"post"
action=
"command.php"
target=
"cmd_window"
>
<input
type=
"hidden"
name=
"mode"
value=
"command"
>
<input
type=
"hidden"
name=
"command"
value=
"special"
>
<input
type=
"hidden"
name=
"sp_cmd"
value=
"sp_fireseed_getitem"
>
<div
class=
"form-group"
>
<label
for=
"fireseed_item_id"
>
选择种火:
</label>
<select
name=
"fireseed_item_id"
id=
"fireseed_item_id"
onchange=
"updateFireseedItems(this.value)"
>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<option
value=
"$fs_id"
>
$fs_data['name'] (等级: $fs_data['level'])
</option>
<!--{/loop}-->
<!--{else}-->
<option
value=
""
>
你还没有收纳任何种火
</option>
<!--{/if}-->
</select>
</div>
<div
id=
"fireseed-items-list"
>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<div
class=
"fireseed-items"
id=
"fireseed-items-$fs_id"
style=
"display: none;"
>
<!--{if !empty($fs_data['items'])}-->
<table
class=
"fireseed-table"
>
<tr>
<th>
物品名称
</th>
<th>
类型
</th>
<th>
效果
</th>
<th>
数量
</th>
<th>
特殊
</th>
<th>
操作
</th>
</tr>
<!--{loop $fs_data['items'] $item_id $item}-->
<tr>
<td>
$item['itm']
</td>
<td>
$item['itmk']
</td>
<td>
$item['itme']
</td>
<td>
$item['itms']
</td>
<td>
$item['itmsk']
</td>
<td>
<input
type=
"radio"
name=
"item_id"
value=
"$item_id"
>
</td>
</tr>
<!--{/loop}-->
</table>
<input
type=
"submit"
class=
"cmdbutton"
value=
"获取物品"
onclick=
"postCmd('gamecmd','command.php');"
>
<!--{else}-->
<p>
该种火没有收集到任何物品。
</p>
<!--{/if}-->
</div>
<!--{/loop}-->
<!--{/if}-->
</div>
</form>
<script>
function
updateFireseedItems
(
fsId
)
{
// 隐藏所有种火物品列表
var
itemLists
=
document
.
querySelectorAll
(
'
.fireseed-items
'
);
for
(
var
i
=
0
;
i
<
itemLists
.
length
;
i
++
)
{
itemLists
[
i
].
style
.
display
=
'
none
'
;
}
// 显示选中的种火物品列表
var
selectedList
=
document
.
getElementById
(
'
fireseed-items-
'
+
fsId
);
if
(
selectedList
)
{
selectedList
.
style
.
display
=
'
block
'
;
}
}
// 初始化显示第一个种火的物品
var
firstFireseed
=
document
.
getElementById
(
'
fireseed_item_id
'
);
if
(
firstFireseed
&&
firstFireseed
.
value
)
{
updateFireseedItems
(
firstFireseed
.
value
);
}
</script>
</div>
<div
id=
"fireseed-enhance"
class=
"tab-pane"
>
<h3>
种火强化
</h3>
<form
id=
"fireseed-enhance-form"
method=
"post"
action=
"command.php"
target=
"cmd_window"
>
<input
type=
"hidden"
name=
"mode"
value=
"command"
>
<input
type=
"hidden"
name=
"command"
value=
"special"
>
<input
type=
"hidden"
name=
"sp_cmd"
value=
"sp_fireseed_enhance"
>
<div
class=
"form-group"
>
<label
for=
"enhance_fireseed_id"
>
选择种火:
</label>
<select
name=
"enhance_fireseed_id"
id=
"enhance_fireseed_id"
>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<option
value=
"$fs_id"
>
$fs_data['name'] (等级: $fs_data['level'])
</option>
<!--{/loop}-->
<!--{else}-->
<option
value=
""
>
你还没有收纳任何种火
</option>
<!--{/if}-->
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"enhance_item"
>
选择焰火物品:
</label>
<select
name=
"enhance_item"
id=
"enhance_item"
>
<!--{for $i=1; $i<=6; $i++}-->
<!--{if ${'itm'.$i} == '◆焰火' || ${'itm'.$i} == '✦烈焰火' || ${'itm'.$i} == '★华焰火★' || ${'itm'.$i} == '☾真焰火☽' || ${'itm'.$i} == '☼焰火☼'}-->
<option
value=
"$i"
>
${'itm'.$i} (效果: ${'itme'.$i}, 数量: ${'itms'.$i})
</option>
<!--{/if}-->
<!--{/for}-->
</select>
</div>
<div
class=
"form-group"
>
<input
type=
"submit"
class=
"cmdbutton"
value=
"强化种火"
onclick=
"postCmd('gamecmd','command.php');"
>
</div>
</form>
</div>
</div>
</div>
</div>
<div
class=
"dialog-footer"
>
<button
class=
"cmdbutton"
onclick=
"hideModalDialog($('fireseedpage'));"
>
关闭
</button>
</div>
</div>
<style>
.fireseed-table
{
width
:
100%
;
border-collapse
:
collapse
;
margin-bottom
:
20px
;
}
.fireseed-table
th
,
.fireseed-table
td
{
border
:
1px
solid
#ddd
;
padding
:
8px
;
text-align
:
left
;
}
.fireseed-table
th
{
background-color
:
#f2f2f2
;
}
.dialog-tab
.tab-header
{
display
:
flex
;
border-bottom
:
1px
solid
#ddd
;
margin-bottom
:
15px
;
}
.dialog-tab
.tab-button
{
padding
:
10px
15px
;
cursor
:
pointer
;
background-color
:
#f2f2f2
;
border
:
1px
solid
#ddd
;
border-bottom
:
none
;
margin-right
:
5px
;
}
.dialog-tab
.tab-button.active
{
background-color
:
#fff
;
border-bottom
:
1px
solid
#fff
;
margin-bottom
:
-1px
;
}
.dialog-tab
.tab-content
{
padding
:
15px
;
border
:
1px
solid
#ddd
;
border-top
:
none
;
}
.dialog-tab
.tab-pane
{
display
:
none
;
}
.dialog-tab
.tab-pane.active
{
display
:
block
;
}
.form-group
{
margin-bottom
:
15px
;
}
.form-group
label
{
display
:
block
;
margin-bottom
:
5px
;
}
.form-group
select
,
.form-group
input
[
type
=
"text"
]
{
width
:
100%
;
padding
:
8px
;
border
:
1px
solid
#ddd
;
}
</style>
<script>
function
switchTab
(
button
,
tabId
)
{
// 移除所有标签页的活动状态
var
tabButtons
=
document
.
querySelectorAll
(
'
.tab-button
'
);
for
(
var
i
=
0
;
i
<
tabButtons
.
length
;
i
++
)
{
tabButtons
[
i
].
classList
.
remove
(
'
active
'
);
}
var
tabPanes
=
document
.
querySelectorAll
(
'
.tab-pane
'
);
for
(
var
i
=
0
;
i
<
tabPanes
.
length
;
i
++
)
{
tabPanes
[
i
].
classList
.
remove
(
'
active
'
);
}
// 设置当前标签页为活动状态
button
.
classList
.
add
(
'
active
'
);
document
.
getElementById
(
tabId
).
classList
.
add
(
'
active
'
);
}
</script>
templates/default/slidingpanel.htm
View file @
18636ac8
<!--{eval echo "<script>var clbpara_data = ".json_encode($clbpara).";</script>";}-->
<!--{eval echo "<script>var clbpara_data = ".json_encode($clbpara).";</script>";}-->
<!--{eval echo "<script>var iteminfo = ".json_encode($iteminfo).";</script>";}-->
<!--{eval echo "<script>var itemspkinfo = ".json_encode($itemspkinfo).";</script>";}-->
<!-- 副面板按钮 -->
<!-- 副面板按钮 -->
<button
id=
"side-panel-button"
class=
"side-panel-button"
onclick=
"togglePanel()"
>
<button
id=
"side-panel-button"
class=
"side-panel-button"
onclick=
"togglePanel()"
>
...
@@ -11,6 +13,9 @@
...
@@ -11,6 +13,9 @@
<div
class=
"tab-container"
>
<div
class=
"tab-container"
>
<button
class=
"tab-button active"
onclick=
"showTab('misc-tab', event)"
>
任务窗体
</button>
<button
class=
"tab-button active"
onclick=
"showTab('misc-tab', event)"
>
任务窗体
</button>
<button
class=
"tab-button"
onclick=
"showTab('misc-tab2', event)"
>
其他信息
</button>
<button
class=
"tab-button"
onclick=
"showTab('misc-tab2', event)"
>
其他信息
</button>
<!--{if $club==22}-->
<button
class=
"tab-button"
onclick=
"showTab('fireseed-tab', event)"
>
种火管理
</button>
<!--{/if}-->
<!-- 预留更多标签的空间 -->
<!-- 预留更多标签的空间 -->
<div
class=
"tab-spacer"
></div>
<div
class=
"tab-spacer"
></div>
</div>
</div>
...
@@ -149,6 +154,192 @@
...
@@ -149,6 +154,192 @@
</div>
</div>
</div>
</div>
<!-- 种火管理标签页 -->
<!--{if $club==22}-->
<div
id=
"fireseed-tab"
class=
"tab-pane"
>
<div
class=
"section-container"
>
<h4
class=
"section-title"
>
种火状态
</h4>
<div
class=
"section-content"
>
<table
class=
"fireseed-table"
>
<tr>
<th>
名称
</th>
<th>
等级
</th>
<th>
状态
</th>
<th>
位置
</th>
<th>
生命
</th>
<th>
体力
</th>
<th>
攻击
</th>
<th>
防御
</th>
<th>
ID
</th>
</tr>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<tr>
<td><span
class=
"yellow"
>
$fs_data['name']
</span></td>
<td>
$fs_data['level']
</td>
<td>
<!--{if $fs_data['mode'] == 0}-->
跟随
<!--{elseif $fs_data['mode'] == 1}-->
探物
<!--{elseif $fs_data['mode'] == 2}-->
索敌
<!--{else}-->
隐藏
<!--{/if}-->
</td>
<td>
$plsinfo[$fs_data['pls']]
</td>
<td>
$fs_data['hp']/$fs_data['mhp']
</td>
<td>
$fs_data['sp']/$fs_data['msp']
</td>
<td>
$fs_data['att']
</td>
<td>
$fs_data['def']
</td>
<td><span
class=
"lime"
>
$fs_id
</span></td>
</tr>
<!--{/loop}-->
<!--{else}-->
<tr>
<td
colspan=
"9"
>
你还没有收纳任何种火。
</td>
</tr>
<!--{/if}-->
</table>
</div>
</div>
<div
class=
"section-container"
>
<h4
class=
"section-title"
>
种火部署
</h4>
<div
class=
"section-content"
>
<div
class=
"form-group"
>
<label
for=
"fireseed_id_panel"
>
选择种火:
</label>
<select
id=
"fireseed_id_panel"
>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<option
value=
"$fs_id"
>
$fs_data['name'] (等级: $fs_data['level'], ID: $fs_id)
</option>
<!--{/loop}-->
<!--{else}-->
<option
value=
""
>
你还没有收纳任何种火
</option>
<!--{/if}-->
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"deploy_mode_panel"
>
部署模式:
</label>
<select
id=
"deploy_mode_panel"
>
<option
value=
"0"
>
跟随
</option>
<option
value=
"1"
>
探物
</option>
<option
value=
"2"
>
索敌
</option>
<option
value=
"3"
>
隐藏
</option>
</select>
</div>
<div
class=
"form-group"
id=
"deploy-location-group"
>
<label
for=
"deploy_pls_panel"
>
部署位置:
</label>
<select
id=
"deploy_pls_panel"
>
<!--{loop $plsinfo $pls_id $pls_name}-->
<!--{if $pls_id > 0 && !in_array($pls_id, $deepzones) && $pls_id < 100}-->
<option
value=
"$pls_id"
<!
--
{
if
$
pls_id =
=
$
pls
}
--
>
selected
<!--{/if}-->
>$pls_name
</option>
<!--{/if}-->
<!--{/loop}-->
</select>
</div>
<div
class=
"form-group"
>
<button
type=
"button"
class=
"cmdbutton"
onclick=
"deployFireseed()"
>
部署种火
</button>
</div>
</div>
</div>
<div
class=
"section-container"
>
<h4
class=
"section-title"
>
种火物品
</h4>
<div
class=
"section-content"
>
<div
class=
"form-group"
>
<label
for=
"fireseed_item_id_panel"
>
选择种火:
</label>
<select
id=
"fireseed_item_id_panel"
onchange=
"updateFireseedItems(this.value)"
>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<option
value=
"$fs_id"
>
$fs_data['name'] (等级: $fs_data['level'], ID: $fs_id)
</option>
<!--{/loop}-->
<!--{else}-->
<option
value=
""
>
你还没有收纳任何种火
</option>
<!--{/if}-->
</select>
</div>
<div
id=
"fireseed-items-list"
>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<div
class=
"fireseed-items"
id=
"fireseed-items-$fs_id"
style=
"display: none;"
>
<!--{if !empty($fs_data['items'])}-->
<table
class=
"fireseed-table"
>
<tr>
<th>
物品名称
</th>
<th>
类型
</th>
<th>
效果
</th>
<th>
数量
</th>
<th>
特殊
</th>
<th>
操作
</th>
</tr>
<!--{loop $fs_data['items'] $item_id $item}-->
<tr>
<td>
$item['itm']
</td>
<td>
$item['itmk']
</td>
<td>
$item['itme']
</td>
<td>
$item['itms']
</td>
<td>
$item['itmsk']
</td>
<td>
<input
type=
"radio"
name=
"item_id_panel"
value=
"$item_id"
data-fs-id=
"$fs_id"
>
</td>
</tr>
<!--{/loop}-->
</table>
<button
type=
"button"
class=
"cmdbutton"
onclick=
"getFireseedItem('$fs_id')"
>
获取物品
</button>
<!--{else}-->
<p>
该种火没有收集到任何物品。
</p>
<!--{/if}-->
</div>
<!--{/loop}-->
<!--{/if}-->
</div>
</div>
</div>
<div
class=
"section-container"
>
<h4
class=
"section-title"
>
种火强化
</h4>
<div
class=
"section-content"
>
<div
class=
"form-group"
>
<label
for=
"enhance_fireseed_id_panel"
>
选择种火:
</label>
<select
id=
"enhance_fireseed_id_panel"
>
<!--{if !empty($clbpara['fireseed'])}-->
<!--{loop $clbpara['fireseed'] $fs_id $fs_data}-->
<option
value=
"$fs_id"
>
$fs_data['name'] (等级: $fs_data['level'], ID: $fs_id)
</option>
<!--{/loop}-->
<!--{else}-->
<option
value=
""
>
你还没有收纳任何种火
</option>
<!--{/if}-->
</select>
</div>
<div
class=
"form-group"
>
<label
for=
"enhance_item_panel"
>
选择焰火物品:
</label>
<select
id=
"enhance_item_panel"
>
<!--{if isset($itm1) && ($itm1 == '◆焰火' || $itm1 == '✦烈焰火' || $itm1 == '★华焰火★' || $itm1 == '☾真焰火☽' || $itm1 == '☼焰火☼')}-->
<option
value=
"1"
>
$itm1 (效果: $itme1, 数量: $itms1)
</option>
<!--{/if}-->
<!--{if isset($itm2) && ($itm2 == '◆焰火' || $itm2 == '✦烈焰火' || $itm2 == '★华焰火★' || $itm2 == '☾真焰火☽' || $itm2 == '☼焰火☼')}-->
<option
value=
"2"
>
$itm2 (效果: $itme2, 数量: $itms2)
</option>
<!--{/if}-->
<!--{if isset($itm3) && ($itm3 == '◆焰火' || $itm3 == '✦烈焰火' || $itm3 == '★华焰火★' || $itm3 == '☾真焰火☽' || $itm3 == '☼焰火☼')}-->
<option
value=
"3"
>
$itm3 (效果: $itme3, 数量: $itms3)
</option>
<!--{/if}-->
<!--{if isset($itm4) && ($itm4 == '◆焰火' || $itm4 == '✦烈焰火' || $itm4 == '★华焰火★' || $itm4 == '☾真焰火☽' || $itm4 == '☼焰火☼')}-->
<option
value=
"4"
>
$itm4 (效果: $itme4, 数量: $itms4)
</option>
<!--{/if}-->
<!--{if isset($itm5) && ($itm5 == '◆焰火' || $itm5 == '✦烈焰火' || $itm5 == '★华焰火★' || $itm5 == '☾真焰火☽' || $itm5 == '☼焰火☼')}-->
<option
value=
"5"
>
$itm5 (效果: $itme5, 数量: $itms5)
</option>
<!--{/if}-->
<!--{if isset($itm6) && ($itm6 == '◆焰火' || $itm6 == '✦烈焰火' || $itm6 == '★华焰火★' || $itm6 == '☾真焰火☽' || $itm6 == '☼焰火☼')}-->
<option
value=
"6"
>
$itm6 (效果: $itme6, 数量: $itms6)
</option>
<!--{/if}-->
</select>
</div>
<div
class=
"form-group"
>
<button
type=
"button"
class=
"cmdbutton"
onclick=
"enhanceFireseed()"
>
强化种火
</button>
</div>
</div>
</div>
</div>
<!--{/if}-->
<!-- 更新按钮 -->
<!-- 更新按钮 -->
<div
class=
"update-button-container"
>
<div
class=
"update-button-container"
>
<button
id=
"update-button"
class=
"update-button"
onclick=
"manualUpdate()"
>
更新信息
</button>
<button
id=
"update-button"
class=
"update-button"
onclick=
"manualUpdate()"
>
更新信息
</button>
...
@@ -475,6 +666,61 @@
...
@@ -475,6 +666,61 @@
transform
:
translateY
(
1px
);
transform
:
translateY
(
1px
);
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.3
);
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
0.3
);
}
}
/* 种火管理样式 */
.fireseed-table
{
width
:
100%
;
border-collapse
:
collapse
;
margin-bottom
:
15px
;
}
.fireseed-table
th
,
.fireseed-table
td
{
border
:
1px
solid
rgba
(
225
,
124
,
226
,
0.3
);
padding
:
5px
;
text-align
:
center
;
font-size
:
9pt
;
}
.fireseed-table
th
{
background-color
:
rgba
(
30
,
30
,
30
,
0.7
);
color
:
#cceafa
;
}
.fireseed-table
td
{
color
:
#98fb98
;
}
.form-group
{
margin-bottom
:
15px
;
}
.form-group
label
{
display
:
block
;
margin-bottom
:
5px
;
color
:
#ddd
;
font
:
10pt
"FusionPixel10px"
;
}
.form-group
select
,
.form-group
input
[
type
=
"text"
]
{
width
:
100%
;
padding
:
8px
;
background-color
:
rgba
(
50
,
50
,
50
,
0.7
);
border
:
1px
solid
rgba
(
225
,
124
,
226
,
0.3
);
border-radius
:
4px
;
color
:
#98fb98
;
font
:
10pt
"FusionPixel10px"
;
}
.form-group
select
:focus
,
.form-group
input
[
type
=
"text"
]
:focus
{
border-color
:
rgba
(
225
,
124
,
226
,
0.7
);
outline
:
none
;
}
.fireseed-items
p
{
color
:
#98fb98
;
font
:
10pt
"FusionPixel10px"
;
margin
:
10px
0
;
}
</style>
</style>
<script>
<script>
...
@@ -492,15 +738,8 @@
...
@@ -492,15 +738,8 @@
// 初始化面板
// 初始化面板
initPanel
();
initPanel
();
//
更新进度条
//
初始更新进度条(仅一次)
updateChargeProgressBars
();
updateChargeProgressBars
();
// 定期更新进度条
setInterval
(
function
()
{
if
(
isPanelOpen
())
{
updateChargeProgressBars
();
}
},
2000
);
});
});
// 初始化面板
// 初始化面板
...
@@ -523,9 +762,228 @@
...
@@ -523,9 +762,228 @@
}
}
});
});
// 初始化种火管理功能
initFireseedManagement
();
console
.
log
(
'
Panel initialized
'
);
console
.
log
(
'
Panel initialized
'
);
}
}
// 初始化种火管理功能
function
initFireseedManagement
()
{
// 添加部署模式变化事件
const
deployMode
=
document
.
getElementById
(
'
deploy_mode
'
);
if
(
deployMode
)
{
deployMode
.
addEventListener
(
'
change
'
,
function
()
{
const
locationGroup
=
document
.
getElementById
(
'
deploy-location-group
'
);
if
(
this
.
value
===
'
0
'
)
{
// 跟随模式
if
(
locationGroup
)
locationGroup
.
style
.
display
=
'
none
'
;
}
else
{
if
(
locationGroup
)
locationGroup
.
style
.
display
=
'
block
'
;
}
});
// 初始触发一次事件
const
event
=
new
Event
(
'
change
'
);
deployMode
.
dispatchEvent
(
event
);
}
// 初始化种火物品显示
const
fireseedItemId
=
document
.
getElementById
(
'
fireseed_item_id
'
);
if
(
fireseedItemId
&&
fireseedItemId
.
value
)
{
updateFireseedItems
(
fireseedItemId
.
value
);
}
}
// 更新种火物品显示
function
updateFireseedItems
(
fsId
)
{
// 隐藏所有种火物品列表
const
itemLists
=
document
.
querySelectorAll
(
'
.fireseed-items
'
);
for
(
let
i
=
0
;
i
<
itemLists
.
length
;
i
++
)
{
itemLists
[
i
].
style
.
display
=
'
none
'
;
}
// 显示选中的种火物品列表
const
selectedList
=
document
.
getElementById
(
'
fireseed-items-
'
+
fsId
);
if
(
selectedList
)
{
selectedList
.
style
.
display
=
'
block
'
;
}
}
// 部署种火
function
deployFireseed
()
{
const
fireseedId
=
document
.
getElementById
(
'
fireseed_id_panel
'
).
value
;
const
deployMode
=
document
.
getElementById
(
'
deploy_mode_panel
'
).
value
;
const
deployPls
=
document
.
getElementById
(
'
deploy_pls_panel
'
).
value
;
if
(
!
fireseedId
)
{
alert
(
'
请选择要部署的种火!
'
);
return
;
}
console
.
log
(
'
部署种火 - ID:
'
,
fireseedId
,
'
模式:
'
,
deployMode
,
'
位置:
'
,
deployPls
);
// 准备数据
const
formData
=
new
FormData
();
formData
.
append
(
'
mode
'
,
'
command
'
);
formData
.
append
(
'
command
'
,
'
special
'
);
formData
.
append
(
'
sp_cmd
'
,
'
sp_fireseed_deploy
'
);
formData
.
append
(
'
fireseed_id
'
,
fireseedId
);
formData
.
append
(
'
deploy_mode
'
,
deployMode
);
// 无论什么模式,都添加位置字段
formData
.
append
(
'
deploy_pls
'
,
deployPls
);
// 使用AJAX提交
const
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'
POST
'
,
'
command.php
'
,
true
);
xhr
.
onload
=
function
()
{
if
(
xhr
.
status
===
200
)
{
// 将响应内容写入命令窗口
if
(
window
.
parent
&&
window
.
parent
.
document
.
getElementById
(
'
cmd_window
'
))
{
window
.
parent
.
document
.
getElementById
(
'
cmd_window
'
).
contentWindow
.
document
.
body
.
innerHTML
=
xhr
.
responseText
;
}
else
{
console
.
log
(
'
命令已执行,但无法更新命令窗口
'
);
}
// 更新clbpara数据
fetchLatestClbpara
();
// 显示成功消息
showUpdateMessage
(
'
种火部署命令已执行
'
);
// 延迟一段时间后再次更新种火标签页,确保数据已更新
setTimeout
(
function
()
{
updateFireseedTab
();
},
500
);
}
else
{
console
.
error
(
'
命令执行失败:
'
,
xhr
.
statusText
);
showUpdateMessage
(
'
种火部署命令执行失败
'
,
'
error
'
);
}
};
xhr
.
onerror
=
function
()
{
console
.
error
(
'
网络错误,无法执行命令
'
);
showUpdateMessage
(
'
网络错误,无法执行命令
'
,
'
error
'
);
};
xhr
.
send
(
formData
);
}
// 获取种火物品
function
getFireseedItem
(
fsId
)
{
// 获取选中的物品
const
selectedItem
=
document
.
querySelector
(
'
input[name="item_id_panel"]:checked
'
);
if
(
!
selectedItem
)
{
alert
(
'
请选择要获取的物品!
'
);
return
;
}
const
itemId
=
selectedItem
.
value
;
// 准备数据
const
formData
=
new
FormData
();
formData
.
append
(
'
mode
'
,
'
command
'
);
formData
.
append
(
'
command
'
,
'
special
'
);
formData
.
append
(
'
sp_cmd
'
,
'
sp_fireseed_getitem
'
);
formData
.
append
(
'
fireseed_item_id
'
,
fsId
);
formData
.
append
(
'
item_id
'
,
itemId
);
// 使用AJAX提交
const
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'
POST
'
,
'
command.php
'
,
true
);
xhr
.
onload
=
function
()
{
if
(
xhr
.
status
===
200
)
{
// 将响应内容写入命令窗口
if
(
window
.
parent
&&
window
.
parent
.
document
.
getElementById
(
'
cmd_window
'
))
{
window
.
parent
.
document
.
getElementById
(
'
cmd_window
'
).
contentWindow
.
document
.
body
.
innerHTML
=
xhr
.
responseText
;
}
else
{
console
.
log
(
'
命令已执行,但无法更新命令窗口
'
);
}
// 更新clbpara数据
fetchLatestClbpara
();
// 显示成功消息
showUpdateMessage
(
'
物品获取命令已执行
'
);
// 延迟一段时间后再次更新种火标签页,确保数据已更新
setTimeout
(
function
()
{
updateFireseedTab
();
},
500
);
}
else
{
console
.
error
(
'
命令执行失败:
'
,
xhr
.
statusText
);
showUpdateMessage
(
'
物品获取命令执行失败
'
,
'
error
'
);
}
};
xhr
.
onerror
=
function
()
{
console
.
error
(
'
网络错误,无法执行命令
'
);
showUpdateMessage
(
'
网络错误,无法执行命令
'
,
'
error
'
);
};
xhr
.
send
(
formData
);
}
// 强化种火
function
enhanceFireseed
()
{
const
fireseedId
=
document
.
getElementById
(
'
enhance_fireseed_id_panel
'
).
value
;
const
enhanceItem
=
document
.
getElementById
(
'
enhance_item_panel
'
).
value
;
if
(
!
fireseedId
)
{
alert
(
'
请选择要强化的种火!
'
);
return
;
}
if
(
!
enhanceItem
)
{
alert
(
'
请选择用于强化的焰火物品!
'
);
return
;
}
// 准备数据
const
formData
=
new
FormData
();
formData
.
append
(
'
mode
'
,
'
command
'
);
formData
.
append
(
'
command
'
,
'
special
'
);
formData
.
append
(
'
sp_cmd
'
,
'
sp_fireseed_enhance
'
);
formData
.
append
(
'
enhance_fireseed_id
'
,
fireseedId
);
formData
.
append
(
'
enhance_item
'
,
enhanceItem
);
// 使用AJAX提交
const
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'
POST
'
,
'
command.php
'
,
true
);
xhr
.
onload
=
function
()
{
if
(
xhr
.
status
===
200
)
{
// 将响应内容写入命令窗口
if
(
window
.
parent
&&
window
.
parent
.
document
.
getElementById
(
'
cmd_window
'
))
{
window
.
parent
.
document
.
getElementById
(
'
cmd_window
'
).
contentWindow
.
document
.
body
.
innerHTML
=
xhr
.
responseText
;
}
else
{
console
.
log
(
'
命令已执行,但无法更新命令窗口
'
);
}
// 更新clbpara数据
fetchLatestClbpara
();
// 显示成功消息
showUpdateMessage
(
'
种火强化命令已执行
'
);
// 延迟一段时间后再次更新种火标签页,确保数据已更新
setTimeout
(
function
()
{
updateFireseedTab
();
},
500
);
}
else
{
console
.
error
(
'
命令执行失败:
'
,
xhr
.
statusText
);
showUpdateMessage
(
'
种火强化命令执行失败
'
,
'
error
'
);
}
};
xhr
.
onerror
=
function
()
{
console
.
error
(
'
网络错误,无法执行命令
'
);
showUpdateMessage
(
'
网络错误,无法执行命令
'
,
'
error
'
);
};
xhr
.
send
(
formData
);
}
// 切换标签页
// 切换标签页
function
showTab
(
tabId
,
event
)
{
function
showTab
(
tabId
,
event
)
{
// 隐藏所有标签页
// 隐藏所有标签页
...
@@ -665,6 +1123,8 @@
...
@@ -665,6 +1123,8 @@
fetchLatestClbpara
();
fetchLatestClbpara
();
// 然后更新显示
// 然后更新显示
updateChargeProgressBars
();
updateChargeProgressBars
();
// 更新种火标签页
updateFireseedTab
();
console
.
log
(
'
Panel opened
'
);
console
.
log
(
'
Panel opened
'
);
...
@@ -733,6 +1193,9 @@
...
@@ -733,6 +1193,9 @@
const
newClbpara
=
JSON
.
parse
(
match
[
1
]);
const
newClbpara
=
JSON
.
parse
(
match
[
1
]);
clbpara
=
newClbpara
;
clbpara
=
newClbpara
;
console
.
log
(
'
clbpara updated from page:
'
,
clbpara
);
console
.
log
(
'
clbpara updated from page:
'
,
clbpara
);
// 更新种火标签页
updateFireseedTab
();
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
'
Failed to parse clbpara data:
'
,
e
);
console
.
error
(
'
Failed to parse clbpara data:
'
,
e
);
}
}
...
@@ -794,6 +1257,9 @@
...
@@ -794,6 +1257,9 @@
// 更新显示
// 更新显示
updateChargeProgressBars
();
updateChargeProgressBars
();
// 更新种火标签页
updateFireseedTab
();
// 恢复按钮状态
// 恢复按钮状态
if
(
updateButton
)
{
if
(
updateButton
)
{
updateButton
.
textContent
=
'
更新信息
'
;
updateButton
.
textContent
=
'
更新信息
'
;
...
@@ -891,4 +1357,373 @@
...
@@ -891,4 +1357,373 @@
},
2000
);
},
2000
);
}
}
}
}
// 更新种火标签页
function
updateFireseedTab
()
{
// 检查是否有种火标签页
const
fireseedTab
=
document
.
getElementById
(
'
fireseed-tab
'
);
if
(
!
fireseedTab
)
return
;
// 检查是否有种火数据
if
(
!
clbpara
||
!
clbpara
.
fireseed
)
{
console
.
log
(
'
No fireseed data available
'
);
return
;
}
// 更新种火状态表格
updateFireseedStatusTable
();
// 更新种火选择下拉框
updateFireseedSelects
();
// 更新种火物品列表
updateFireseedItemsList
();
console
.
log
(
'
Fireseed tab updated
'
);
}
// 更新种火状态表格
function
updateFireseedStatusTable
()
{
const
statusTable
=
document
.
querySelector
(
'
#fireseed-tab .fireseed-table
'
);
if
(
!
statusTable
)
return
;
// 清除现有行,保留表头
const
headerRow
=
statusTable
.
rows
[
0
];
while
(
statusTable
.
rows
.
length
>
1
)
{
statusTable
.
deleteRow
(
1
);
}
// 如果没有种火数据,显示提示行
if
(
!
clbpara
.
fireseed
||
Object
.
keys
(
clbpara
.
fireseed
).
length
===
0
)
{
const
row
=
statusTable
.
insertRow
();
const
cell
=
row
.
insertCell
();
cell
.
colSpan
=
9
;
// 更新为9列
cell
.
textContent
=
'
你还没有收纳任何种火。
'
;
return
;
}
// 添加种火数据行
for
(
const
fsId
in
clbpara
.
fireseed
)
{
// 跳过非对象类型的条目或无效数据
if
(
!
clbpara
.
fireseed
[
fsId
]
||
typeof
clbpara
.
fireseed
[
fsId
]
!==
'
object
'
||
!
clbpara
.
fireseed
[
fsId
].
name
||
!
clbpara
.
fireseed
[
fsId
].
level
)
{
console
.
log
(
'
跳过无效种火数据:
'
,
fsId
,
clbpara
.
fireseed
[
fsId
]);
continue
;
}
const
fsData
=
clbpara
.
fireseed
[
fsId
];
const
row
=
statusTable
.
insertRow
();
// 名称
const
nameCell
=
row
.
insertCell
();
const
nameSpan
=
document
.
createElement
(
'
span
'
);
nameSpan
.
className
=
'
yellow
'
;
nameSpan
.
textContent
=
fsData
.
name
;
nameCell
.
appendChild
(
nameSpan
);
// 等级
const
levelCell
=
row
.
insertCell
();
levelCell
.
textContent
=
fsData
.
level
;
// 状态
const
modeCell
=
row
.
insertCell
();
const
modes
=
[
'
跟随
'
,
'
探物
'
,
'
索敌
'
,
'
隐藏
'
];
modeCell
.
textContent
=
modes
[
fsData
.
mode
]
||
'
未知
'
;
// 位置
const
plsCell
=
row
.
insertCell
();
// 获取位置名称
const
plsName
=
getPlsName
(
fsData
.
pls
);
plsCell
.
textContent
=
plsName
;
// 生命
const
hpCell
=
row
.
insertCell
();
hpCell
.
textContent
=
fsData
.
hp
+
'
/
'
+
fsData
.
mhp
;
// 体力
const
spCell
=
row
.
insertCell
();
spCell
.
textContent
=
fsData
.
sp
+
'
/
'
+
fsData
.
msp
;
// 攻击
const
attCell
=
row
.
insertCell
();
attCell
.
textContent
=
fsData
.
att
;
// 防御
const
defCell
=
row
.
insertCell
();
defCell
.
textContent
=
fsData
.
def
;
// ID
const
idCell
=
row
.
insertCell
();
const
idSpan
=
document
.
createElement
(
'
span
'
);
idSpan
.
className
=
'
lime
'
;
idSpan
.
textContent
=
fsId
;
idCell
.
appendChild
(
idSpan
);
}
}
// 获取位置名称
function
getPlsName
(
plsId
)
{
// 尝试从页面中获取位置信息
const
plsSelects
=
document
.
querySelectorAll
(
'
select[id$="pls_panel"]
'
);
for
(
const
select
of
plsSelects
)
{
for
(
const
option
of
select
.
options
)
{
if
(
option
.
value
==
plsId
)
{
return
option
.
textContent
;
}
}
}
return
'
未知位置
'
;
}
// 更新种火选择下拉框
function
updateFireseedSelects
()
{
const
selects
=
[
document
.
getElementById
(
'
fireseed_id_panel
'
),
document
.
getElementById
(
'
fireseed_item_id_panel
'
),
document
.
getElementById
(
'
enhance_fireseed_id_panel
'
)
];
for
(
const
select
of
selects
)
{
if
(
!
select
)
continue
;
// 保存当前选中值
const
currentValue
=
select
.
value
;
// 清除现有选项
select
.
innerHTML
=
''
;
// 如果没有种火数据,添加提示选项
if
(
!
clbpara
.
fireseed
||
Object
.
keys
(
clbpara
.
fireseed
).
length
===
0
)
{
const
option
=
document
.
createElement
(
'
option
'
);
option
.
value
=
''
;
option
.
textContent
=
'
你还没有收纳任何种火
'
;
select
.
appendChild
(
option
);
continue
;
}
// 添加种火选项
for
(
const
fsId
in
clbpara
.
fireseed
)
{
// 跳过非对象类型的条目或无效数据
if
(
!
clbpara
.
fireseed
[
fsId
]
||
typeof
clbpara
.
fireseed
[
fsId
]
!==
'
object
'
||
!
clbpara
.
fireseed
[
fsId
].
name
||
!
clbpara
.
fireseed
[
fsId
].
level
)
{
console
.
log
(
'
跳过无效种火数据(选择框):
'
,
fsId
,
clbpara
.
fireseed
[
fsId
]);
continue
;
}
const
fsData
=
clbpara
.
fireseed
[
fsId
];
const
option
=
document
.
createElement
(
'
option
'
);
option
.
value
=
fsId
;
option
.
textContent
=
fsData
.
name
+
'
(等级:
'
+
fsData
.
level
+
'
, ID:
'
+
fsId
+
'
)
'
;
select
.
appendChild
(
option
);
}
// 尝试恢复之前的选中值
if
(
currentValue
&&
select
.
querySelector
(
`option[value="
${
currentValue
}
"]`
))
{
select
.
value
=
currentValue
;
}
}
}
// 更新种火物品列表
function
updateFireseedItemsList
()
{
const
itemsList
=
document
.
getElementById
(
'
fireseed-items-list
'
);
if
(
!
itemsList
)
return
;
// 清除现有内容
itemsList
.
innerHTML
=
''
;
// 如果没有种火数据,返回
if
(
!
clbpara
.
fireseed
||
Object
.
keys
(
clbpara
.
fireseed
).
length
===
0
)
{
return
;
}
// 为每个种火创建物品列表
for
(
const
fsId
in
clbpara
.
fireseed
)
{
// 跳过非对象类型的条目或无效数据
if
(
!
clbpara
.
fireseed
[
fsId
]
||
typeof
clbpara
.
fireseed
[
fsId
]
!==
'
object
'
||
!
clbpara
.
fireseed
[
fsId
].
name
||
!
clbpara
.
fireseed
[
fsId
].
level
)
{
console
.
log
(
'
跳过无效种火数据(物品列表):
'
,
fsId
,
clbpara
.
fireseed
[
fsId
]);
continue
;
}
const
fsData
=
clbpara
.
fireseed
[
fsId
];
const
itemsDiv
=
document
.
createElement
(
'
div
'
);
itemsDiv
.
className
=
'
fireseed-items
'
;
itemsDiv
.
id
=
'
fireseed-items-
'
+
fsId
;
itemsDiv
.
style
.
display
=
'
none
'
;
// 如果种火有物品
if
(
fsData
.
items
&&
fsData
.
items
.
length
>
0
)
{
const
table
=
document
.
createElement
(
'
table
'
);
table
.
className
=
'
fireseed-table
'
;
// 添加表头
const
headerRow
=
table
.
insertRow
();
const
headers
=
[
'
物品名称
'
,
'
类型
'
,
'
效果
'
,
'
数量
'
,
'
特殊
'
,
'
操作
'
];
for
(
const
header
of
headers
)
{
const
th
=
document
.
createElement
(
'
th
'
);
th
.
textContent
=
header
;
headerRow
.
appendChild
(
th
);
}
// 添加物品行
for
(
let
itemId
=
0
;
itemId
<
fsData
.
items
.
length
;
itemId
++
)
{
const
item
=
fsData
.
items
[
itemId
];
if
(
!
item
||
item
.
itm
===
undefined
)
continue
;
const
row
=
table
.
insertRow
();
// 物品名称
const
nameCell
=
row
.
insertCell
();
nameCell
.
textContent
=
item
.
itm
;
// 类型
const
typeCell
=
row
.
insertCell
();
// 使用iteminfo显示物品类型
if
(
typeof
window
.
iteminfo
!==
'
undefined
'
&&
window
.
iteminfo
[
item
.
itmk
])
{
typeCell
.
textContent
=
window
.
iteminfo
[
item
.
itmk
];
}
else
{
typeCell
.
textContent
=
item
.
itmk
;
}
// 效果
const
effectCell
=
row
.
insertCell
();
effectCell
.
textContent
=
item
.
itme
;
// 数量
const
amountCell
=
row
.
insertCell
();
amountCell
.
textContent
=
item
.
itms
;
// 特殊
const
specialCell
=
row
.
insertCell
();
// 使用itemspkinfo显示物品特殊属性
if
(
item
.
itmsk
&&
item
.
itmsk
!==
'
--
'
)
{
if
(
typeof
window
.
itemspkinfo
!==
'
undefined
'
)
{
let
spkText
=
''
;
// 遍历每个特殊属性字符
for
(
let
i
=
0
;
i
<
item
.
itmsk
.
length
;
i
++
)
{
const
spk
=
item
.
itmsk
[
i
];
if
(
window
.
itemspkinfo
[
spk
])
{
if
(
spkText
)
spkText
+=
'
,
'
;
spkText
+=
window
.
itemspkinfo
[
spk
];
}
else
{
if
(
spkText
)
spkText
+=
'
,
'
;
spkText
+=
spk
;
}
}
specialCell
.
innerHTML
=
spkText
;
}
else
{
specialCell
.
textContent
=
item
.
itmsk
;
}
}
else
{
specialCell
.
textContent
=
'
--
'
;
}
// 操作
const
actionCell
=
row
.
insertCell
();
const
radio
=
document
.
createElement
(
'
input
'
);
radio
.
type
=
'
radio
'
;
radio
.
name
=
'
item_id_panel
'
;
radio
.
value
=
itemId
;
radio
.
setAttribute
(
'
data-fs-id
'
,
fsId
);
actionCell
.
appendChild
(
radio
);
}
itemsDiv
.
appendChild
(
table
);
// 添加获取按钮
const
button
=
document
.
createElement
(
'
button
'
);
button
.
type
=
'
button
'
;
button
.
className
=
'
cmdbutton
'
;
button
.
textContent
=
'
获取物品
'
;
button
.
onclick
=
function
()
{
getFireseedItem
(
fsId
);
};
itemsDiv
.
appendChild
(
button
);
}
else
{
// 如果种火没有物品
const
p
=
document
.
createElement
(
'
p
'
);
p
.
textContent
=
'
该种火没有收集到任何物品。
'
;
itemsDiv
.
appendChild
(
p
);
}
itemsList
.
appendChild
(
itemsDiv
);
}
// 显示第一个有效种火的物品列表
let
validFireseeds
=
[];
for
(
const
fsId
in
clbpara
.
fireseed
)
{
if
(
clbpara
.
fireseed
[
fsId
]
&&
typeof
clbpara
.
fireseed
[
fsId
]
===
'
object
'
&&
clbpara
.
fireseed
[
fsId
].
name
&&
clbpara
.
fireseed
[
fsId
].
level
)
{
validFireseeds
.
push
(
fsId
);
}
}
if
(
validFireseeds
.
length
>
0
)
{
const
firstFsId
=
validFireseeds
[
0
];
const
firstItemsList
=
document
.
getElementById
(
'
fireseed-items-
'
+
firstFsId
);
if
(
firstItemsList
)
{
firstItemsList
.
style
.
display
=
'
block
'
;
}
}
}
// 修复种火数据
function
fixFireseedData
()
{
if
(
!
confirm
(
'
确定要修复种火数据吗?这将尝试修复所有种火的数据格式问题。
'
))
{
return
;
}
// 准备数据
const
formData
=
new
FormData
();
formData
.
append
(
'
mode
'
,
'
command
'
);
formData
.
append
(
'
command
'
,
'
special
'
);
formData
.
append
(
'
sp_cmd
'
,
'
sp_fireseed_fix
'
);
// 使用AJAX提交
const
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'
POST
'
,
'
command.php
'
,
true
);
xhr
.
onload
=
function
()
{
if
(
xhr
.
status
===
200
)
{
// 将响应内容写入命令窗口
if
(
window
.
parent
&&
window
.
parent
.
document
.
getElementById
(
'
cmd_window
'
))
{
window
.
parent
.
document
.
getElementById
(
'
cmd_window
'
).
contentWindow
.
document
.
body
.
innerHTML
=
xhr
.
responseText
;
}
else
{
console
.
log
(
'
命令已执行,但无法更新命令窗口
'
);
}
// 更新clbpara数据
fetchLatestClbpara
();
// 显示成功消息
showUpdateMessage
(
'
种火数据修复命令已执行
'
);
// 延迟一段时间后再次更新种火标签页,确保数据已更新
setTimeout
(
function
()
{
updateFireseedTab
();
},
500
);
}
else
{
console
.
error
(
'
命令执行失败:
'
,
xhr
.
statusText
);
showUpdateMessage
(
'
种火数据修复命令执行失败
'
,
'
error
'
);
}
};
xhr
.
onerror
=
function
()
{
console
.
error
(
'
网络错误,无法执行命令
'
);
showUpdateMessage
(
'
网络错误,无法执行命令
'
,
'
error
'
);
};
xhr
.
send
(
formData
);
}
// 打开侧边栏并切换到种火管理标签页
function
openSidePanelToFireseedTab
()
{
// 打开侧边栏
document
.
getElementById
(
'
sliding-panel
'
).
classList
.
add
(
'
open
'
);
document
.
getElementById
(
'
side-panel-button
'
).
style
.
display
=
'
none
'
;
// 切换到种火管理标签页
showTab
(
'
fireseed-tab
'
,
{
target
:
document
.
querySelector
(
'
.tab-button[onclick*="fireseed-tab"]
'
)
});
// 更新种火数据
updateFireseedTab
();
}
</script>
</script>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment