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
0d3dae35
Commit
0d3dae35
authored
Apr 15, 2025
by
Nemo Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FEAT:Add itmpara parsing in tooltip
parent
2fce5e88
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
2345 additions
and
155 deletions
+2345
-155
doc/etc/20240719_itmpara_tooltip_final.txt
doc/etc/20240719_itmpara_tooltip_final.txt
+80
-0
doc/etc/20240719_itmpara_tooltip_fix.txt
doc/etc/20240719_itmpara_tooltip_fix.txt
+63
-0
doc/etc/20240719_itmpara_tooltip_fix10.txt
doc/etc/20240719_itmpara_tooltip_fix10.txt
+57
-0
doc/etc/20240719_itmpara_tooltip_fix14.txt
doc/etc/20240719_itmpara_tooltip_fix14.txt
+105
-0
doc/etc/20240719_itmpara_tooltip_fix2.txt
doc/etc/20240719_itmpara_tooltip_fix2.txt
+50
-0
doc/etc/20240719_itmpara_tooltip_fix3.txt
doc/etc/20240719_itmpara_tooltip_fix3.txt
+41
-0
doc/etc/20240719_itmpara_tooltip_fix4.txt
doc/etc/20240719_itmpara_tooltip_fix4.txt
+99
-0
doc/etc/20240719_itmpara_tooltip_fix5.txt
doc/etc/20240719_itmpara_tooltip_fix5.txt
+102
-0
doc/etc/20240719_itmpara_tooltip_fix6.txt
doc/etc/20240719_itmpara_tooltip_fix6.txt
+303
-0
doc/etc/20240719_itmpara_tooltip_fix7.txt
doc/etc/20240719_itmpara_tooltip_fix7.txt
+80
-0
doc/etc/20240719_itmpara_tooltip_fix8.txt
doc/etc/20240719_itmpara_tooltip_fix8.txt
+64
-0
doc/etc/20240719_itmpara_tooltip_fix9.txt
doc/etc/20240719_itmpara_tooltip_fix9.txt
+156
-0
doc/etc/20240719_itmpara_tooltip_implementation.txt
doc/etc/20240719_itmpara_tooltip_implementation.txt
+42
-0
doc/etc/20240719_itmpara_tooltip_summary.txt
doc/etc/20240719_itmpara_tooltip_summary.txt
+64
-0
gamedata/cache/itmpara_tooltip.php
gamedata/cache/itmpara_tooltip.php
+365
-0
include/game.func.php
include/game.func.php
+47
-39
include/game/battle.func.php
include/game/battle.func.php
+19
-11
include/game/item.test.php
include/game/item.test.php
+9
-0
include/game/itemplace.func.php
include/game/itemplace.func.php
+22
-19
include/game/itmpara_tooltip.func.php
include/game/itmpara_tooltip.func.php
+345
-0
include/global.func.php
include/global.func.php
+224
-78
include/vnworld/vnmix.func.php
include/vnworld/vnmix.func.php
+8
-8
No files found.
doc/etc/20240719_itmpara_tooltip_final.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 功能最终实现记录
## 功能概述
实现了 $itmpara 字段在 tooltip 中的显示功能,使玩家能够看到物品的特殊属性,如伤害增加、防御增加等。同时,添加了调试功能,方便开发者查看 itmpara 字段的解析过程和结果。
## 实现细节
1. 创建了 `itmpara_tooltip.func.php` 文件,包含以下函数:
- `parse_itmpara_tooltip($itmpara, $item_type = '')` - 解析 itmpara 字段并生成 tooltip 内容
- `add_itmpara_tooltip_to_item($item_name, $itmpara, $item_type = '', $existing_tooltip = '')` - 为物品名称添加 tooltip
- `get_itmpara($para)` - 将 itmpara 字符串转换为数组
2. 修改了 `global.func.php` 文件,在 `parse_nameinfo_desc` 函数中添加了对 itmpara tooltip 的支持:
```php
// 解析 itmpara tooltip
$tooltip_content = parse_itmpara_tooltip($itmpara, $itmk);
// 如果有 itmpara tooltip,添加到现有 tooltip
if(!empty($tooltip_content))
{
if(!empty($info_tp)) $info_tp .= "\r";
$info_tp .= $tooltip_content;
}
```
3. 添加了调试功能:
- 详细的调试信息,显示 itmpara 的解析过程和结果
- 调试信息仅在玩家的 $clbpara['SetItmparaDebug'] 为 true 时显示
- 添加了 "itmpara调试开关" 物品,用于切换调试模式
4. 添加了默认的 itmpara 配置:
```php
$itmpara_tooltip = array(
'AddDamageRaw' => array(
'title' => '最终伤害增加',
'format' => '{value}',
'suffix' => '',
'color' => 'red',
'condition' => function($item_type, $value) { return true; }
),
'AddDamagePercentage' => array(
'title' => '最终伤害增加',
'format' => '{value}',
'suffix' => '%',
'color' => 'red',
'condition' => function($item_type, $value) { return true; }
),
'lore' => array(
'title' => '',
'format' => '{value}',
'suffix' => '',
'color' => 'lore',
'condition' => function($item_type, $value) { return true; }
)
);
```
## 使用方法
1. 为物品添加 itmpara 字段:
```php
$itmpara = '{"AddDamageRaw":100,"AddDamagePercentage":10,"lore":"这是一件测试用的物品"}';
```
2. 在物品名称中显示 tooltip:
```php
$item_name = add_itmpara_tooltip_to_item($item_name, $itmpara, $item_type);
```
3. 开启/关闭调试模式:
- 使用 "itmpara调试开关" 物品切换调试模式
- 调试模式下,tooltip 中会显示详细的调试信息
## 注意事项
1. itmpara 字段应该是一个有效的 JSON 字符串或数组
2. 键名大小写不敏感,但建议使用首字母大写的驼峰式命名(如 AddDamageRaw)
3. 调试信息仅在开启调试模式时显示,不会影响正常玩家的游戏体验
4. 如果需要添加新的 itmpara 键,需要在配置文件中添加相应的配置
doc/etc/20240719_itmpara_tooltip_fix.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 显示问题修复记录
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了两个问题:
1. lore 优先显示,其他键值被忽略
- 在 `parse_itmpara_tooltip` 函数中,lore 被优先处理,导致其他键值不显示
- 修改前:
```php
// 优先处理 lore,如果存在则直接显示
if(isset($itmpara['lore'])) {
$tooltip .= $itmpara['lore'] . "\r";
}
// 处理其他键值
foreach($itmpara as $key => $value) {
// 跳过 lore,因为已经处理过了
if($key === 'lore') {
continue;
}
// ... 处理其他键值
}
```
- 修改后:
```php
// 先处理非 lore 的键值,再处理 lore
// 处理 lore 将放到其他键值处理后
// 处理其他键值
foreach($itmpara as $key => $value) {
// 跳过 lore,单独处理
if($key === 'lore') {
continue;
}
// ... 处理其他键值
}
// 最后处理 lore,如果存在则显示
if(isset($itmpara['lore'])) {
$tooltip .= $itmpara['lore'] . "\r";
}
```
2. 条件函数导致某些键值不显示
- 在 `itmpara_tooltip.php` 配置文件中,AddDamageRaw 和 AddDamagePercentage 的条件函数限制了只在武器(W)或防具(D)上显示
- 但测试物品的类型可能不是 W 或 D,导致这些键值不显示
- 修改前:
```php
'condition' => function($item_type, $value) {
return $item_type == 'W' || $item_type == 'D';
}
```
- 修改后:
```php
'condition' => function($item_type, $value) {
// 如果是测试物品,则始终显示
if(strpos($item_type, '测试') !== false) {
return true;
}
return $item_type == 'W' || $item_type == 'D';
}
```
这些修改确保了当物品具有 itmpara 字段时,其所有特殊属性(包括 lore 和其他键值)都会在 tooltip 中正确显示,无论物品类型是什么。
doc/etc/20240719_itmpara_tooltip_fix10.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 配置问题修复记录(第十次)
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了一个新问题:
1. 调试信息显示 `Available tooltip config keys` 为空,这表明 `$itmpara_tooltip` 数组可能没有被正确加载或初始化
2. 所有的键名匹配都返回 false,导致无法找到对应的配置信息
修复内容:
1. 修复 `$itmpara_tooltip` 数组的加载问题
- 在 `global.func.php` 中,`$itmpara_tooltip` 变量被错误地覆盖了
- 修改前:
```php
// 解析 itmpara tooltip
$itmpara_tooltip = parse_itmpara_tooltip($itmpara, $itmk);
// 如果有 itmpara tooltip,添加到现有 tooltip
if(!empty($itmpara_tooltip))
{
if(!empty($info_tp)) $info_tp .= "\r";
$info_tp .= $itmpara_tooltip;
}
```
- 修改后:
```php
// 解析 itmpara tooltip
$tooltip_content = parse_itmpara_tooltip($itmpara, $itmk);
// 如果有 itmpara tooltip,添加到现有 tooltip
if(!empty($tooltip_content))
{
if(!empty($info_tp)) $info_tp .= "\r";
$info_tp .= $tooltip_content;
}
```
2. 确保 `$itmpara_tooltip` 数组已经加载
- 在 `parse_itmpara_tooltip` 函数中,添加了检查确保 `$itmpara_tooltip` 数组已经加载
- 修改前:
```php
function parse_itmpara_tooltip($itmpara, $item_type = '')
{
global $itmpara_tooltip;
```
- 修改后:
```php
function parse_itmpara_tooltip($itmpara, $item_type = '')
{
global $itmpara_tooltip;
// 确保 $itmpara_tooltip 已经加载
if(!isset($itmpara_tooltip) || empty($itmpara_tooltip)) {
include_once GAME_ROOT.'./gamedata/cache/itmpara_tooltip.php';
}
```
这些修改确保了 `$itmpara_tooltip` 数组能够正确加载和使用,从而使系统能够找到对应的配置信息。问题的根源是在 `global.func.php` 中,`$itmpara_tooltip` 变量被错误地覆盖为函数的返回值,而函数本身需要使用这个数组。
doc/etc/20240719_itmpara_tooltip_fix14.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 配置问题修复记录(第十四次)
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了一个新问题:
1. 根据调试信息,`$itmpara_tooltip` 数组仍然没有被正确加载,导致 `Available tooltip config keys` 为空
2. 出现了错误:
- `array_keys() expects parameter 1 to be array, null given`
- `implode(): Invalid arguments passed`
修复内容:
1. 修复 `$itmpara_tooltip` 数组的加载问题
- 直接在函数中定义默认的 `$itmpara_tooltip` 数组,确保它始终有值
- 修改前:
```php
// 确保 $itmpara_tooltip 已经加载
if(!isset($itmpara_tooltip) || empty($itmpara_tooltip)) {
include_once GAME_ROOT.'./gamedata/cache/itmpara_tooltip.php';
}
```
- 修改后:
```php
// 确保 $itmpara_tooltip 已经加载
if(!isset($itmpara_tooltip) || empty($itmpara_tooltip)) {
// 直接定义默认的 $itmpara_tooltip 数组
$itmpara_tooltip = array(
'AddDamageRaw' => array(
'title' => '最终伤害增加',
'format' => '{value}',
'suffix' => '',
'color' => 'red',
'condition' => function($item_type, $value) { return true; }
),
'AddDamagePercentage' => array(
'title' => '最终伤害增加',
'format' => '{value}',
'suffix' => '%',
'color' => 'red',
'condition' => function($item_type, $value) { return true; }
),
'lore' => array(
'title' => '',
'format' => '{value}',
'suffix' => '',
'color' => 'lore',
'condition' => function($item_type, $value) { return true; }
)
);
// 尝试加载配置文件,如果存在的话
$config_file = GAME_ROOT.'./gamedata/cache/itmpara_tooltip.php';
if(file_exists($config_file)) {
include $config_file;
}
}
```
2. 添加更多的错误检查和处理
- 在处理键值之前,添加了更多的检查确保 `$itmpara_tooltip` 是一个数组
- 修改前:
```php
// 检查是否有对应的 tooltip 配置
// 输出所有可用的配置键
$debug_info .= "\r\n - Available tooltip config keys: " . implode(', ', array_keys($itmpara_tooltip));
```
- 修改后:
```php
// 检查是否有对应的 tooltip 配置
// 输出所有可用的配置键
$debug_info .= "\r\n - itmpara_tooltip is " . (isset($itmpara_tooltip) ? 'set' : 'not set');
$debug_info .= "\r\n - itmpara_tooltip is " . (empty($itmpara_tooltip) ? 'empty' : 'not empty');
$debug_info .= "\r\n - itmpara_tooltip type: " . gettype($itmpara_tooltip);
// 确保 $itmpara_tooltip 是数组
if(!is_array($itmpara_tooltip)) {
$itmpara_tooltip = array(
'AddDamageRaw' => array(
'title' => '最终伤害增加',
'format' => '{value}',
'suffix' => '',
'color' => 'red',
'condition' => function($item_type, $value) { return true; }
),
'AddDamagePercentage' => array(
'title' => '最终伤害增加',
'format' => '{value}',
'suffix' => '%',
'color' => 'red',
'condition' => function($item_type, $value) { return true; }
),
'lore' => array(
'title' => '',
'format' => '{value}',
'suffix' => '',
'color' => 'lore',
'condition' => function($item_type, $value) { return true; }
)
);
$debug_info .= "\r\n - Created default itmpara_tooltip array";
}
$debug_info .= "\r\n - Available tooltip config keys: " . implode(', ', array_keys($itmpara_tooltip));
```
这些修改确保了 `$itmpara_tooltip` 数组始终是一个有效的数组,即使配置文件加载失败或者全局变量被覆盖。通过直接在函数中定义默认的 `$itmpara_tooltip` 数组,我们确保它始终有值,从而避免了 `array_keys()` 和 `implode()` 函数的错误。
doc/etc/20240719_itmpara_tooltip_fix2.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 显示问题修复记录(第二次)
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了两个问题:
1. 背包栏物品的 itmpara 参数名称不匹配
- 在 `game.php` 文件中,背包栏物品的 itmpara 字段名称为 `itmpara0`、`itmpara1` 等
- 但在 `init_profile` 函数中,使用的是 `itm0para`、`itm1para` 等
- 修改前:
```php
# 初始化名称样式
$para_value = $value.'para';
${$value.'_words'} = parse_nameinfo_desc($$value, $horizon, '', '', isset($$para_value) ? $$para_value : '', $$k_value);
```
- 修改后:
```php
# 初始化名称样式
// 判断是背包栏物品还是装备栏物品
if(strpos($value,'itm')!==false) {
// 背包栏物品的 itmpara 字段名称为 itmpara0、itmpara1 等
$para_value = 'itmpara'.substr($value, 3);
} else {
// 装备栏物品的 itmpara 字段名称为 weppara、arbpara 等
$para_value = $value.'para';
}
${$value.'_words'} = parse_nameinfo_desc($$value, $horizon, '', '', isset($$para_value) ? $$para_value : '', $$k_value);
```
2. 尸体物品的 itmpara 参数名称不匹配
- 在 `battle.func.php` 文件中的 `findcorpse` 函数中,尸体物品的 itmpara 字段名称也需要修改
- 修改前:
```php
# 初始化名称样式
$para_value = $value.'para';
${$value.'_words'} = parse_nameinfo_desc($$value, $w_horizon, '', '', isset($$para_value) ? $$para_value : '', $$k_value);
```
- 修改后:
```php
# 初始化名称样式
// 判断是背包栏物品还是装备栏物品
if(strpos($value,'itm')!==false) {
// 背包栏物品的 itmpara 字段名称为 itmpara0、itmpara1 等
$para_value = 'w_itmpara'.substr($value, 5);
} else {
// 装备栏物品的 itmpara 字段名称为 weppara、arbpara 等
$para_value = $value.'para';
}
${$value.'_words'} = parse_nameinfo_desc($$value, $w_horizon, '', '', isset($$para_value) ? $$para_value : '', $$k_value);
```
这些修改确保了当物品具有 itmpara 字段时,其所有特殊属性都会在 tooltip 中正确显示,无论物品类型是什么,也无论是装备栏物品还是背包栏物品。
doc/etc/20240719_itmpara_tooltip_fix3.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 显示问题修复记录(第三次)
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了问题:
1. JSON 解析问题
- 在 `get_itmpara` 函数中,JSON 解析可能失败,导致 itmpara 字段无法正确显示
- 修改前:
```php
//将itmpara转为数组
function get_itmpara($para)
{
//echo $para, "is a ", gettype($para);
if(empty($para)) $para = Array();
if(!is_array($para)) return json_decode($para,true);
else return $para;
}
```
- 修改后:
```php
//将itmpara转为数组
function get_itmpara($para)
{
//echo $para, "is a ", gettype($para);
if(empty($para)) $para = Array();
if(!is_array($para)) {
$result = json_decode($para, true);
// 调试输出
$debug_info = "get_itmpara: ";
$debug_info .= "input: {$para}\r";
$debug_info .= "output: ".(is_array($result) ? json_encode($result) : $result)."\r";
//error_log($debug_info);
return $result;
} else return $para;
}
```
2. 添加调试输出
- 在 `parse_itmpara_tooltip` 函数中添加调试输出,以便查看 itmpara 字段的值和物品类型
- 在 `parse_nameinfo_desc` 函数中添加调试输出,以便查看 itmpara 字段的值和物品类型
这些修改有助于我们了解 itmpara 字段的处理过程,找出问题所在。通过调试输出,我们可以看到 itmpara 字段的值和物品类型,以及 JSON 解析的结果,从而确定问题的原因。
doc/etc/20240719_itmpara_tooltip_fix4.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 显示问题修复记录(第四次)
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了一个问题:
1. 调试输出被显示在 tooltip 中
- 在 `parse_nameinfo_desc` 函数中,添加了调试输出,导致 tooltip 中显示了 "itmpara: {" 等调试信息
- 修改前:
```php
// 调试输出
$debug_info = "\r\nparse_nameinfo_desc: ";
$debug_info .= "itmpara: ".(is_array($itmpara) ? json_encode($itmpara) : $itmpara)."\r";
$debug_info .= "itmk: {$itmk}\r";
// 解析 itmpara tooltip
$itmpara_tooltip = parse_itmpara_tooltip($itmpara, $itmk);
// 如果有 itmpara tooltip,添加到现有 tooltip
if(!empty($itmpara_tooltip))
{
if(!empty($info_tp)) $info_tp .= "\r";
$info_tp .= $itmpara_tooltip;
}
// 添加调试输出
if(!empty($info_tp)) $info_tp .= "\r";
$info_tp .= $debug_info;
```
- 修改后:
```php
// 解析 itmpara tooltip
$itmpara_tooltip = parse_itmpara_tooltip($itmpara, $itmk);
// 如果有 itmpara tooltip,添加到现有 tooltip
if(!empty($itmpara_tooltip))
{
if(!empty($info_tp)) $info_tp .= "\r";
$info_tp .= $itmpara_tooltip;
}
```
2. 同样在 `parse_itmpara_tooltip` 函数中也有调试输出
- 修改前:
```php
function parse_itmpara_tooltip($itmpara, $item_type = '')
{
global $itmpara_tooltip;
// 调试输出
$debug_output = "itmpara: ".(is_array($itmpara) ? json_encode($itmpara) : $itmpara)."\r";
$debug_output .= "item_type: {$item_type}\r";
// 如果 itmpara 为空,直接返回空字符串
if(empty($itmpara)) {
return '';
}
```
- 修改后:
```php
function parse_itmpara_tooltip($itmpara, $item_type = '')
{
global $itmpara_tooltip;
// 如果 itmpara 为空,直接返回空字符串
if(empty($itmpara)) {
return '';
}
```
3. 在 `get_itmpara` 函数中也有调试输出
- 修改前:
```php
function get_itmpara($para)
{
//echo $para, "is a ", gettype($para);
if(empty($para)) $para = Array();
if(!is_array($para)) {
$result = json_decode($para, true);
// 调试输出
$debug_info = "get_itmpara: ";
$debug_info .= "input: {$para}\r";
$debug_info .= "output: ".(is_array($result) ? json_encode($result) : $result)."\r";
//error_log($debug_info);
return $result;
} else return $para;
}
```
- 修改后:
```php
function get_itmpara($para)
{
if(empty($para)) $para = Array();
if(!is_array($para)) {
$result = json_decode($para, true);
return $result;
} else return $para;
}
```
这些修改确保了当物品具有 itmpara 字段时,其特殊属性会在 tooltip 中正确显示,不会显示调试信息。
doc/etc/20240719_itmpara_tooltip_fix5.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 显示问题修复记录(第五次)
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了一个问题:
1. JSON 解析问题导致 itmpara 值显示不完整
- 在调试信息中,itmpara 值只显示了 "{" 而不是完整的 JSON 对象
- 实际的 itmpara 值应该是:{"AddDamageRaw":100,"AddDamagePercentage":10,"lore":"这是一件测试用的物品,起码不会按原样去桃箱。"}
- 但只显示了 "{",这可能是导致前两个键值(AddDamageRaw 和 AddDamagePercentage)不显示的原因
2. 修复 get_itmpara 函数中的 JSON 解析问题
- 修改前:
```php
function get_itmpara($para)
{
if(empty($para)) $para = Array();
if(!is_array($para)) {
$result = json_decode($para, true);
return $result;
} else return $para;
}
```
- 修改后:
```php
function get_itmpara($para)
{
if(empty($para)) $para = Array();
if(!is_array($para)) {
// 尝试修复 JSON 解析问题
// 如果字符串中包含逗号,可能会导致 JSON 解析失败
// 确保字符串是有效的 JSON
$para = trim($para);
// 检查是否是有效的 JSON 格式
if (substr($para, 0, 1) == '{' && substr($para, -1) == '}') {
$result = json_decode($para, true);
// 如果解析失败,尝试修复 JSON 字符串
if ($result === null && json_last_error() !== JSON_ERROR_NONE) {
// 尝试修复不完整的 JSON
// 如果字符串被截断,尝试添加缺失的部分
if (strpos($para, '{"') === 0 && strpos($para, '"}') === false) {
$para .= '"}'; // 添加缺失的右花括号
}
// 再次尝试解析
$result = json_decode($para, true);
}
return $result;
} else {
// 不是 JSON 格式,直接返回
return $para;
}
} else return $para;
}
```
3. 添加调试输出到 parse_itmpara_tooltip 函数
- 修改前:
```php
// 如果 itmpara 不是数组,尝试将其转换为数组
if(!is_array($itmpara)) {
$itmpara = get_itmpara($itmpara);
if(empty($itmpara)) {
return '';
}
}
```
- 修改后:
```php
// 如果 itmpara 不是数组,尝试将其转换为数组
if(!is_array($itmpara)) {
// 添加调试输出,查看原始的 itmpara 值
$debug_info = "\r\nOriginal itmpara: {$itmpara}";
$itmpara = get_itmpara($itmpara);
// 添加调试输出,查看解析后的 itmpara 值
$debug_info .= "\r\nParsed itmpara: ".(is_array($itmpara) ? json_encode($itmpara) : $itmpara);
if(empty($itmpara)) {
return $debug_info; // 返回调试信息而不是空字符串
}
}
```
4. 在 parse_itmpara_tooltip 函数的返回值中添加调试信息
- 修改前:
```php
return rtrim($tooltip, "\r");
```
- 修改后:
```php
// 添加调试信息到返回的 tooltip
if(isset($debug_info)) {
$tooltip .= $debug_info;
}
return rtrim($tooltip, "\r");
```
这些修改有助于我们了解 itmpara 字段的处理过程,找出问题所在。通过调试输出,我们可以看到 itmpara 字段的原始值和解析后的值,从而确定问题的原因。
doc/etc/20240719_itmpara_tooltip_fix6.txt
0 → 100644
View file @
0d3dae35
This diff is collapsed.
Click to expand it.
doc/etc/20240719_itmpara_tooltip_fix7.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 显示问题修复记录(第七次)
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了一个新问题:
1. tooltip 内容中的 JSON 字符串显示不正确,特别是引号 `"` 和其他特殊字符导致了 HTML 属性解析问题
2. 这是因为 tooltip 内容被直接放入了 HTML 属性中,而没有正确转义
修复内容:
1. 修复 tooltip 内容的 HTML 转义问题
- 修改前:
```php
if(!empty($info_f)) $info_f = "class=\"{$info_f}\"";
if(!empty($info_tp)) $info_tp = "{$ttypes}=\"{$info_tp}\"";
$info = "<span {$info_f} {$info_tp}>{$info}</span>";
```
- 修改后:
```php
if(!empty($info_f)) $info_f = "class=\"{$info_f}\"";
// 对 tooltip 内容进行 HTML 转义
if(!empty($info_tp)) {
// 使用 htmlspecialchars 进行 HTML 转义
$escaped_tp = htmlspecialchars($info_tp, ENT_QUOTES | ENT_HTML5, 'UTF-8');
$info_tp = "{$ttypes}=\"{$escaped_tp}\"";
}
$info = "<span {$info_f} {$info_tp}>{$info}</span>";
```
2. 修复 JSON 解析和显示问题
- 在 `parse_itmpara_tooltip` 函数中,添加了安全处理 JSON 输出的代码
- 修改前:
```php
// 初始化调试信息
$debug_info = "\r\n---------- DEBUG INFO ----------";
$debug_info .= "\r\nFunction: parse_itmpara_tooltip";
$debug_info .= "\r\nInput type: " . gettype($itmpara);
$debug_info .= "\r\nInput value: " . (is_array($itmpara) ? json_encode($itmpara) : $itmpara);
$debug_info .= "\r\nItem type: {$item_type}";
```
- 修改后:
```php
// 初始化调试信息
$debug_info = "\r\n---------- DEBUG INFO ----------";
$debug_info .= "\r\nFunction: parse_itmpara_tooltip";
$debug_info .= "\r\nInput type: " . gettype($itmpara);
// 安全地处理 JSON 输出
if(is_array($itmpara)) {
// 使用 JSON_UNESCAPED_UNICODE 确保中文显示正常
$json_str = json_encode($itmpara, JSON_UNESCAPED_UNICODE);
$debug_info .= "\r\nInput value: " . $json_str;
} else {
$debug_info .= "\r\nInput value: " . $itmpara;
}
$debug_info .= "\r\nItem type: {$item_type}";
```
3. 修复 `foreach` 循环中的值输出
- 修改前:
```php
foreach($itmpara as $key => $value) {
$debug_info .= "\r\nProcessing key: {$key} = " . (is_array($value) ? json_encode($value) : $value);
```
- 修改后:
```php
foreach($itmpara as $key => $value) {
// 安全地处理值的输出
if(is_array($value)) {
$value_str = json_encode($value, JSON_UNESCAPED_UNICODE);
} else {
$value_str = $value;
}
$debug_info .= "\r\nProcessing key: {$key} = " . $value_str;
```
这些修改确保了 tooltip 内容中的特殊字符(如引号、尖括号等)能够正确显示,不会导致 HTML 解析错误。同时,使用 `JSON_UNESCAPED_UNICODE` 确保中文字符能够正确显示。
doc/etc/20240719_itmpara_tooltip_fix8.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 配置问题修复记录(第八次)
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了一个新问题:
1. tooltip 内容中显示 "No tooltip config found for key: AddDamageRaw" 和 "No tooltip config found for key: AddDamagePercentage"
2. 这表明系统无法找到 AddDamageRaw 和 AddDamagePercentage 这两个键的配置信息
3. 经过检查,发现问题是键名大小写不匹配:在 tooltip 配置中,键名是 "AddDamageRaw" 和 "AddDamagePercentage",但在 JSON 数据中,键名是 "adddamageraw" 和 "adddamagepercentage"(小写)
修复内容:
1. 修复键名大小写不匹配问题
- 添加了多种键名匹配方式,包括直接匹配、首字母大写、全大写、全小写和驼峰式
- 修改前:
```php
// 检查是否有对应的 tooltip 配置
if(isset($itmpara_tooltip[$key])) {
$debug_info .= "\r\n - Found tooltip config for key: {$key}";
$config = $itmpara_tooltip[$key];
```
- 修改后:
```php
// 检查是否有对应的 tooltip 配置
// 先尝试直接匹配
if(isset($itmpara_tooltip[$key])) {
$debug_info .= "\r\n - Found tooltip config for key: {$key}";
$config = $itmpara_tooltip[$key];
}
// 如果没有找到,尝试将键名转换为首字母大写的形式
elseif(isset($itmpara_tooltip[ucfirst($key)])) {
$debug_info .= "\r\n - Found tooltip config for key (case-insensitive): {$key} -> " . ucfirst($key);
$config = $itmpara_tooltip[ucfirst($key)];
}
// 如果还是没有找到,尝试将键名转换为全大写的形式
elseif(isset($itmpara_tooltip[strtoupper($key)])) {
$debug_info .= "\r\n - Found tooltip config for key (uppercase): {$key} -> " . strtoupper($key);
$config = $itmpara_tooltip[strtoupper($key)];
}
// 如果还是没有找到,尝试将键名转换为全小写的形式
elseif(isset($itmpara_tooltip[strtolower($key)])) {
$debug_info .= "\r\n - Found tooltip config for key (lowercase): {$key} -> " . strtolower($key);
$config = $itmpara_tooltip[strtolower($key)];
}
// 如果还是没有找到,尝试将键名转换为驼峰式的形式
else {
// 尝试将键名转换为驼峰式
$camelKey = preg_replace_callback('/(^|_)([a-z])/', function($matches) {
return strtoupper($matches[2]);
}, $key);
if(isset($itmpara_tooltip[$camelKey])) {
$debug_info .= "\r\n - Found tooltip config for key (camelCase): {$key} -> {$camelKey}";
$config = $itmpara_tooltip[$camelKey];
} else {
$debug_info .= "\r\n - No tooltip config found for key: {$key}";
continue;
}
}
```
2. 修复代码结构问题
- 修复了代码缩进和结构问题,确保代码逻辑清晰
- 移除了多余的 else 语句,避免代码嵌套过深
这些修改确保了系统能够正确匹配 itmpara 字段中的键名,即使键名的大小写不一致。这样,AddDamageRaw 和 AddDamagePercentage 等属性就能够正确显示在 tooltip 中。
doc/etc/20240719_itmpara_tooltip_fix9.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 配置问题修复记录(第九次)
在2024年7月19日,我们实现了 $itmpara 字段在 tooltip 中的显示功能,但在实际使用中发现了一个新问题:
1. 之前的修复似乎没有生效,tooltip 内容中仍然显示 "No tooltip config found for key: AddDamageRaw" 和 "No tooltip config found for key: AddDamagePercentage"
2. 这表明系统仍然无法找到 AddDamageRaw 和 AddDamagePercentage 这两个键的配置信息
修复内容:
1. 添加更详细的调试信息,以便更好地理解问题
- 输出每个键的类型和值
- 修改前:
```php
// 安全地处理 JSON 输出
if(is_array($itmpara)) {
// 使用 JSON_UNESCAPED_UNICODE 确保中文显示正常
$json_str = json_encode($itmpara, JSON_UNESCAPED_UNICODE);
$debug_info .= "\r\nInput value: " . $json_str;
} else {
$debug_info .= "\r\nInput value: " . $itmpara;
}
```
- 修改后:
```php
// 安全地处理 JSON 输出
if(is_array($itmpara)) {
// 使用 JSON_UNESCAPED_UNICODE 确保中文显示正常
$json_str = json_encode($itmpara, JSON_UNESCAPED_UNICODE);
$debug_info .= "\r\nInput value: " . $json_str;
// 输出每个键的类型和值
$debug_info .= "\r\nDetailed key info:";
foreach($itmpara as $k => $v) {
$debug_info .= "\r\n - Key: '{$k}' (" . gettype($k) . ")";
$debug_info .= "\r\n Value: '" . (is_array($v) ? json_encode($v, JSON_UNESCAPED_UNICODE) : $v) . "' (" . gettype($v) . ")";
}
} else {
$debug_info .= "\r\nInput value: " . $itmpara;
}
```
2. 改进键名匹配逻辑,添加更多调试信息
- 输出所有可用的配置键
- 输出每种匹配方式的结果
- 添加大小写不敏感的匹配(使用 strcasecmp)
- 修改前:
```php
// 检查是否有对应的 tooltip 配置
// 先尝试直接匹配
if(isset($itmpara_tooltip[$key])) {
$debug_info .= "\r\n - Found tooltip config for key: {$key}";
$config = $itmpara_tooltip[$key];
}
// 如果没有找到,尝试将键名转换为首字母大写的形式
elseif(isset($itmpara_tooltip[ucfirst($key)])) {
$debug_info .= "\r\n - Found tooltip config for key (case-insensitive): {$key} -> " . ucfirst($key);
$config = $itmpara_tooltip[ucfirst($key)];
}
// 如果还是没有找到,尝试将键名转换为全大写的形式
elseif(isset($itmpara_tooltip[strtoupper($key)])) {
$debug_info .= "\r\n - Found tooltip config for key (uppercase): {$key} -> " . strtoupper($key);
$config = $itmpara_tooltip[strtoupper($key)];
}
// 如果还是没有找到,尝试将键名转换为全小写的形式
elseif(isset($itmpara_tooltip[strtolower($key)])) {
$debug_info .= "\r\n - Found tooltip config for key (lowercase): {$key} -> " . strtolower($key);
$config = $itmpara_tooltip[strtolower($key)];
}
// 如果还是没有找到,尝试将键名转换为驼峰式的形式
else {
// 尝试将键名转换为驼峰式
$camelKey = preg_replace_callback('/(^|_)([a-z])/', function($matches) {
return strtoupper($matches[2]);
}, $key);
if(isset($itmpara_tooltip[$camelKey])) {
$debug_info .= "\r\n - Found tooltip config for key (camelCase): {$key} -> {$camelKey}";
$config = $itmpara_tooltip[$camelKey];
} else {
$debug_info .= "\r\n - No tooltip config found for key: {$key}";
continue;
}
}
```
- 修改后:
```php
// 检查是否有对应的 tooltip 配置
// 输出所有可用的配置键
$debug_info .= "\r\n - Available tooltip config keys: " . implode(', ', array_keys($itmpara_tooltip));
// 先尝试直接匹配
$debug_info .= "\r\n - Direct match check: isset(\$itmpara_tooltip['{$key}']) = " . (isset($itmpara_tooltip[$key]) ? 'true' : 'false');
if(isset($itmpara_tooltip[$key])) {
$debug_info .= "\r\n - Found tooltip config for key: {$key}";
$config = $itmpara_tooltip[$key];
}
// 如果没有找到,尝试将键名转换为首字母大写的形式
else {
$ucfirstKey = ucfirst($key);
$debug_info .= "\r\n - Ucfirst match check: isset(\$itmpara_tooltip['{$ucfirstKey}']) = " . (isset($itmpara_tooltip[$ucfirstKey]) ? 'true' : 'false');
if(isset($itmpara_tooltip[$ucfirstKey])) {
$debug_info .= "\r\n - Found tooltip config for key (ucfirst): {$key} -> {$ucfirstKey}";
$config = $itmpara_tooltip[$ucfirstKey];
}
// 如果还是没有找到,尝试将键名转换为全大写的形式
else {
$upperKey = strtoupper($key);
$debug_info .= "\r\n - Uppercase match check: isset(\$itmpara_tooltip['{$upperKey}']) = " . (isset($itmpara_tooltip[$upperKey]) ? 'true' : 'false');
if(isset($itmpara_tooltip[$upperKey])) {
$debug_info .= "\r\n - Found tooltip config for key (uppercase): {$key} -> {$upperKey}";
$config = $itmpara_tooltip[$upperKey];
}
// 如果还是没有找到,尝试将键名转换为全小写的形式
else {
$lowerKey = strtolower($key);
$debug_info .= "\r\n - Lowercase match check: isset(\$itmpara_tooltip['{$lowerKey}']) = " . (isset($itmpara_tooltip[$lowerKey]) ? 'true' : 'false');
if(isset($itmpara_tooltip[$lowerKey])) {
$debug_info .= "\r\n - Found tooltip config for key (lowercase): {$key} -> {$lowerKey}";
$config = $itmpara_tooltip[$lowerKey];
}
// 如果还是没有找到,尝试将键名转换为驼峰式的形式
else {
// 尝试将键名转换为驼峰式
$camelKey = preg_replace_callback('/(^|_)([a-z])/', function($matches) {
return strtoupper($matches[2]);
}, $key);
$debug_info .= "\r\n - CamelCase match check: isset(\$itmpara_tooltip['{$camelKey}']) = " . (isset($itmpara_tooltip[$camelKey]) ? 'true' : 'false');
if(isset($itmpara_tooltip[$camelKey])) {
$debug_info .= "\r\n - Found tooltip config for key (camelCase): {$key} -> {$camelKey}";
$config = $itmpara_tooltip[$camelKey];
}
// 如果还是没有找到,尝试在所有键中进行大小写不敏感的匹配
else {
$found = false;
foreach(array_keys($itmpara_tooltip) as $configKey) {
if(strcasecmp($configKey, $key) === 0) {
$debug_info .= "\r\n - Found tooltip config for key (strcasecmp): {$key} -> {$configKey}";
$config = $itmpara_tooltip[$configKey];
$found = true;
break;
}
}
if(!$found) {
$debug_info .= "\r\n - No tooltip config found for key: {$key}";
continue;
}
}
}
}
}
}
```
这些修改添加了更详细的调试信息,以便更好地理解问题。通过输出每个键的类型和值,以及每种匹配方式的结果,我们可以更清楚地看到问题所在。此外,我们还添加了大小写不敏感的匹配(使用 strcasecmp),以便更灵活地匹配键名。
doc/etc/20240719_itmpara_tooltip_implementation.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 显示实现记录
在2024年7月19日,游戏中的物品添加了新的字段$itmpara,该字段为一数组,可让物品有着数组中定义的键值的属性。
现在,我们实现了 $itmpara 字段在 tooltip 中的显示功能,使玩家可以直观地了解物品的特殊属性。
以下是对应此功能的实现记录:
1. 创建 itmpara 的 tooltip 配置文件
- 创建了 gamedata\cache\itmpara_tooltip.php 文件,定义了 $itmpara 字段中各个键值对应的 tooltip 显示内容
- 配置文件使用数组格式,每个键值对应一个数组,包含标题、格式、后缀、颜色和条件函数
- 条件函数用于判断是否显示该键值,例如只在武器上显示伤害增加属性
2. 创建处理 itmpara tooltip 的函数
- 创建了 include\game\itmpara_tooltip.func.php 文件,定义了 parse_itmpara_tooltip 和 add_itmpara_tooltip_to_item 函数
- parse_itmpara_tooltip 函数用于解析 itmpara 字段,生成 tooltip 内容
- add_itmpara_tooltip_to_item 函数用于将 itmpara tooltip 添加到物品名称上
3. 修改 parse_nameinfo_desc 函数
- 修改了 include\global.func.php 文件中的 parse_nameinfo_desc 函数,使其支持 itmpara tooltip
- 添加了 itmpara 和 itmk 参数,用于传递 itmpara 字段和物品类型
- 在函数中引入 itmpara_tooltip.func.php 和 itmpara_tooltip.php 文件,解析 itmpara 字段
4. 修改调用 parse_nameinfo_desc 函数的地方
- 修改了 include\game.func.php 文件中的 init_profile 函数
- 修改了 include\game\battle.func.php 文件中的 findcorpse 函数
- 修改了 include\game\itemplace.func.php 文件中的 get_npc_helpinfo 函数
- 修改了 include\vnworld\vnmix.func.php 文件中的 parse_queue_vnmix_info 函数
- 确保在调用 parse_nameinfo_desc 函数时传递 itmpara 参数
5. 实现的功能
- 根据 itmpara 中的键值,显示反应其用途的对应文本
- 例如:{"AddDamageRaw":100,"AddDamagePercentage":10} 会显示为:
最终伤害增加:100
最终伤害增加:10%
- 如果一个物品的 itmpara 中有 lore 值,则直接输出该键值中的字符串到 tooltip
6. 配置文件的扩展性
- 由于 itmpara 键值必然会在之后不断增多,配置文件设计为易于扩展
- 可以通过简单地添加新的键值配置,来支持新的 itmpara 键值
- 配置文件中详细注释了每个配置项的作用和格式
这些修改确保了当物品具有 itmpara 字段时,其特殊属性会在 tooltip 中显示,使玩家可以直观地了解物品的特殊属性。
doc/etc/20240719_itmpara_tooltip_summary.txt
0 → 100644
View file @
0d3dae35
2024年7月19日 $itmpara 字段 tooltip 功能实现总结
## 功能概述
实现了 $itmpara 字段在 tooltip 中的显示功能,使玩家能够看到物品的特殊属性,如伤害增加、防御增加等。
## 实现细节
1. 创建了 `itmpara_tooltip.func.php` 文件,包含以下函数:
- `parse_itmpara_tooltip($itmpara, $item_type = '')` - 解析 itmpara 字段并生成 tooltip 内容
- `add_itmpara_tooltip_to_item($item_name, $itmpara, $item_type = '', $existing_tooltip = '')` - 为物品名称添加 tooltip
- `get_itmpara($para)` - 将 itmpara 字符串转换为数组
2. 创建了 `itmpara_tooltip.php` 配置文件,包含各种 itmpara 键的显示配置:
- 每个键对应一个配置数组,包含标题、格式、后缀、颜色和条件
- 支持的键包括 AddDamageRaw、AddDamagePercentage、lore 等
3. 修改了 `global.func.php` 文件,在 `parse_nameinfo_desc` 函数中添加了对 itmpara tooltip 的支持
4. 添加了调试功能:
- 详细的调试信息,显示 itmpara 的解析过程和结果
- 调试信息仅在玩家的 $clbpara['SetItmparaDebug'] 为 true 时显示
- 添加了 "itmpara调试开关" 物品,用于切换调试模式
## 遇到的问题和解决方案
1. JSON 解析问题:
- 问题:itmpara 字段中的 JSON 字符串可能被截断或格式不正确
- 解决方案:添加了更健壮的 JSON 解析逻辑,包括手动解析和错误处理
2. 键名大小写问题:
- 问题:配置文件中的键名和 JSON 数据中的键名大小写不一致
- 解决方案:添加了多种键名匹配方式,包括直接匹配、首字母大写、全大写、全小写和驼峰式
3. HTML 转义问题:
- 问题:tooltip 内容中的特殊字符(如引号、尖括号)导致 HTML 解析错误
- 解决方案:使用 htmlspecialchars 函数对 tooltip 内容进行 HTML 转义
4. 配置文件加载问题:
- 问题:$itmpara_tooltip 数组没有被正确加载
- 解决方案:直接在函数中定义默认的 $itmpara_tooltip 数组,确保它始终有值
## 使用方法
1. 为物品添加 itmpara 字段:
```php
$itmpara = '{"AddDamageRaw":100,"AddDamagePercentage":10,"lore":"这是一件测试用的物品"}';
```
2. 在物品名称中显示 tooltip:
```php
$item_name = add_itmpara_tooltip_to_item($item_name, $itmpara, $item_type);
```
3. 开启/关闭调试模式:
- 使用 "itmpara调试开关" 物品切换调试模式
- 调试模式下,tooltip 中会显示详细的调试信息
## 后续改进
1. 添加更多的 itmpara 键支持,如防御增加、属性抗性等
2. 优化 tooltip 显示效果,如添加图标、颜色等
3. 添加更多的调试功能,如显示物品的所有属性
4. 考虑将 itmpara 字段的处理逻辑移到专门的文件中,以便更好地组织代码
gamedata/cache/itmpara_tooltip.php
0 → 100644
View file @
0d3dae35
This diff is collapsed.
Click to expand it.
include/game.func.php
View file @
0d3dae35
This diff is collapsed.
Click to expand it.
include/game/battle.func.php
View file @
0d3dae35
...
@@ -20,7 +20,7 @@ function findteam(&$w_pdata)
...
@@ -20,7 +20,7 @@ function findteam(&$w_pdata)
extract
(
$pdata
,
EXTR_REFS
);
extract
(
$pdata
,
EXTR_REFS
);
extract
(
$w_pdata
,
EXTR_PREFIX_ALL
,
'w'
);
extract
(
$w_pdata
,
EXTR_PREFIX_ALL
,
'w'
);
init_battle_rev
(
$pdata
,
$w_pdata
);
init_battle_rev
(
$pdata
,
$w_pdata
);
$main
=
'battle_rev'
;
$main
=
'battle_rev'
;
$log
.=
"你发现了队友<span class=
\"
yellow
\"
>
$w_name
</span>!<br>"
;
$log
.=
"你发现了队友<span class=
\"
yellow
\"
>
$w_name
</span>!<br>"
;
...
@@ -42,12 +42,12 @@ function findcorpse(&$w_pdata)
...
@@ -42,12 +42,12 @@ function findcorpse(&$w_pdata)
extract
(
$w_pdata
,
EXTR_PREFIX_ALL
,
'w'
);
extract
(
$w_pdata
,
EXTR_PREFIX_ALL
,
'w'
);
init_battle_rev
(
$pdata
,
$w_pdata
,
1
);
init_battle_rev
(
$pdata
,
$w_pdata
,
1
);
$main
=
'battle_rev'
;
$main
=
'battle_rev'
;
$log
.=
'你发现了<span class="red">'
.
$w_name
.
'</span>的尸体!<br>'
;
$log
.=
'你发现了<span class="red">'
.
$w_name
.
'</span>的尸体!<br>'
;
# 初始化尸体tooltip
# 初始化尸体tooltip
foreach
(
Array
(
'wep'
,
'wep2'
,
'arb'
,
'arh'
,
'ara'
,
'arf'
,
'art'
,
'itm0'
,
'itm1'
,
'itm2'
,
'itm3'
,
'itm4'
,
'itm5'
,
'itm6'
)
as
$value
)
foreach
(
Array
(
'wep'
,
'wep2'
,
'arb'
,
'arh'
,
'ara'
,
'arf'
,
'art'
,
'itm0'
,
'itm1'
,
'itm2'
,
'itm3'
,
'itm4'
,
'itm5'
,
'itm6'
)
as
$value
)
{
{
$value
=
'w_'
.
$value
;
$value
=
'w_'
.
$value
;
if
(
strpos
(
$value
,
'itm'
)
!==
false
)
if
(
strpos
(
$value
,
'itm'
)
!==
false
)
...
@@ -56,7 +56,7 @@ function findcorpse(&$w_pdata)
...
@@ -56,7 +56,7 @@ function findcorpse(&$w_pdata)
$s_value
=
str_replace
(
'itm'
,
'itms'
,
$value
);
$s_value
=
str_replace
(
'itm'
,
'itms'
,
$value
);
$sk_value
=
str_replace
(
'itm'
,
'itmsk'
,
$value
);
$sk_value
=
str_replace
(
'itm'
,
'itmsk'
,
$value
);
}
}
else
else
{
{
$k_value
=
$value
.
'k'
;
$k_value
=
$value
.
'k'
;
$s_value
=
$value
.
's'
;
$s_value
=
$value
.
's'
;
...
@@ -66,7 +66,15 @@ function findcorpse(&$w_pdata)
...
@@ -66,7 +66,15 @@ function findcorpse(&$w_pdata)
global
$
{
$value
.
'_words'
},
$
{
$k_value
.
'_words'
},
$
{
$s_value
.
'_words'
},
$
{
$sk_value
.
'_words'
};
global
$
{
$value
.
'_words'
},
$
{
$k_value
.
'_words'
},
$
{
$s_value
.
'_words'
},
$
{
$sk_value
.
'_words'
};
# 初始化名称样式
# 初始化名称样式
$
{
$value
.
'_words'
}
=
parse_nameinfo_desc
(
$$value
,
$w_horizon
);
// 判断是背包栏物品还是装备栏物品
if
(
strpos
(
$value
,
'itm'
)
!==
false
)
{
// 背包栏物品的 itmpara 字段名称为 itmpara0、itmpara1 等
$para_value
=
'w_itmpara'
.
substr
(
$value
,
5
);
}
else
{
// 装备栏物品的 itmpara 字段名称为 weppara、arbpara 等
$para_value
=
$value
.
'para'
;
}
$
{
$value
.
'_words'
}
=
parse_nameinfo_desc
(
$$value
,
$w_horizon
,
''
,
''
,
isset
(
$$para_value
)
?
$$para_value
:
''
,
$$k_value
);
# 初始化类别样式
# 初始化类别样式
$
{
$k_value
.
'_words'
}
=
parse_kinfo_desc
(
$$k_value
,
$$sk_value
);
$
{
$k_value
.
'_words'
}
=
parse_kinfo_desc
(
$$k_value
,
$$sk_value
);
# 初始化属性样式
# 初始化属性样式
...
@@ -81,11 +89,11 @@ function findcorpse(&$w_pdata)
...
@@ -81,11 +89,11 @@ function findcorpse(&$w_pdata)
// 初始化抡尸数据
// 初始化抡尸数据
$cstick_flag
=
0
;
$cstick_flag
=
0
;
if
(
!
check_skill_unlock
(
'tl_cstick'
,
$pdata
)
&&
!
check_skill_cost
(
'tl_cstick'
,
$pdata
))
$cstick_flag
=
in_array
(
$w_type
,
get_skillvars
(
'tl_cstick'
,
'notype'
))
?
0
:
1
;
if
(
!
check_skill_unlock
(
'tl_cstick'
,
$pdata
)
&&
!
check_skill_cost
(
'tl_cstick'
,
$pdata
))
$cstick_flag
=
in_array
(
$w_type
,
get_skillvars
(
'tl_cstick'
,
'notype'
))
?
0
:
1
;
// 初始化妙手数据
// 初始化妙手数据
$pickpocket_flag
=
0
;
$pickpocket_flag
=
0
;
if
(
!
check_skill_unlock
(
'tl_pickpocket'
,
$pdata
)
&&
!
check_skill_cost
(
'tl_pickpocket'
,
$pdata
))
$pickpocket_flag
=
1
;
if
(
!
check_skill_unlock
(
'tl_pickpocket'
,
$pdata
)
&&
!
check_skill_cost
(
'tl_pickpocket'
,
$pdata
))
$pickpocket_flag
=
1
;
// 保存发现过女主尸体的记录
// 保存发现过女主尸体的记录
if
(
$w_pdata
[
'type'
]
==
14
)
$clbpara
[
'achvars'
][
'corpse_n14'
]
+=
1
;
if
(
$w_pdata
[
'type'
]
==
14
)
$clbpara
[
'achvars'
][
'corpse_n14'
]
+=
1
;
...
@@ -129,7 +137,7 @@ function senditem()
...
@@ -129,7 +137,7 @@ function senditem()
}
}
$edata
=
$db
->
fetch_array
(
$result
);
$edata
=
$db
->
fetch_array
(
$result
);
if
(
$edata
[
'pls'
]
!=
$pls
)
if
(
$edata
[
'pls'
]
!=
$pls
)
{
{
//登记非功能性地点信息时合并隐藏地点
//登记非功能性地点信息时合并隐藏地点
foreach
(
$hplsinfo
as
$hgroup
=>
$hpls
)
$plsinfo
+=
$hpls
;
foreach
(
$hplsinfo
as
$hgroup
=>
$hpls
)
$plsinfo
+=
$hpls
;
...
@@ -155,7 +163,7 @@ function senditem()
...
@@ -155,7 +163,7 @@ function senditem()
$w_log
=
"<span class=
\"
lime
\"
>
{
$name
}
对你说:“
{
$message
}
”</span><br>"
;
$w_log
=
"<span class=
\"
lime
\"
>
{
$name
}
对你说:“
{
$message
}
”</span><br>"
;
if
(
!
$edata
[
'type'
]){
logsave
(
$edata
[
'pid'
],
$now
,
$w_log
,
'c'
);}
if
(
!
$edata
[
'type'
]){
logsave
(
$edata
[
'pid'
],
$now
,
$w_log
,
'c'
);}
}
}
if
(
$command
!=
'back'
)
if
(
$command
!=
'back'
)
{
{
$itmn
=
substr
(
$command
,
3
);
$itmn
=
substr
(
$command
,
3
);
...
@@ -186,7 +194,7 @@ function senditem()
...
@@ -186,7 +194,7 @@ function senditem()
for
(
$i
=
1
;
$i
<=
6
;
$i
++
)
for
(
$i
=
1
;
$i
<=
6
;
$i
++
)
{
{
if
(
!
$edata
[
'itms'
.
$i
])
if
(
!
$edata
[
'itms'
.
$i
])
{
{
$edata
[
'itm'
.
$i
]
=
$itm
;
$edata
[
'itm'
.
$i
]
=
$itm
;
$edata
[
'itmk'
.
$i
]
=
$itmk
;
$edata
[
'itmk'
.
$i
]
=
$itmk
;
...
@@ -197,7 +205,7 @@ function senditem()
...
@@ -197,7 +205,7 @@ function senditem()
$log
.=
"你将<span class=
\"
yellow
\"
>
{
$edata
[
'itm'
.
$i
]
}
</span>送给了<span class=
\"
yellow
\"
>
$w_name
</span>。<br>"
;
$log
.=
"你将<span class=
\"
yellow
\"
>
{
$edata
[
'itm'
.
$i
]
}
</span>送给了<span class=
\"
yellow
\"
>
$w_name
</span>。<br>"
;
$w_log
=
"<span class=
\"
yellow
\"
>
$name
</span>将<span class=
\"
yellow
\"
>
{
$edata
[
'itm'
.
$i
]
}
</span>送给了你。"
;
$w_log
=
"<span class=
\"
yellow
\"
>
$name
</span>将<span class=
\"
yellow
\"
>
{
$edata
[
'itm'
.
$i
]
}
</span>送给了你。"
;
if
(
!
$w_type
){
logsave
(
$w_pid
,
$now
,
$w_log
,
't'
);}
if
(
!
$w_type
){
logsave
(
$w_pid
,
$now
,
$w_log
,
't'
);}
addnews
(
$now
,
'senditem'
,
$name
,
$w_name
,
$itm
,
$nick
);
addnews
(
$now
,
'senditem'
,
$name
,
$w_name
,
$itm
,
$nick
);
//w_save($w_pid);
//w_save($w_pid);
player_save
(
$edata
);
player_save
(
$edata
);
...
...
include/game/item.test.php
View file @
0d3dae35
...
@@ -206,6 +206,15 @@ function item_test($itmn, &$data) {
...
@@ -206,6 +206,15 @@ function item_test($itmn, &$data) {
//global $rp;
//global $rp;
$rp
=
0
;
$rp
=
0
;
$log
.=
"你使用了<span class=
\"
yellow
\"
>
$itm
</span>。你的RP归零了。<br>"
;
$log
.=
"你使用了<span class=
\"
yellow
\"
>
$itm
</span>。你的RP归零了。<br>"
;
}
elseif
(
$itm
==
'itmpara调试开关'
)
{
// 切换 itmpara 调试模式
if
(
isset
(
$clbpara
[
'SetItmparaDebug'
])
&&
$clbpara
[
'SetItmparaDebug'
]
===
true
)
{
$clbpara
[
'SetItmparaDebug'
]
=
false
;
$log
.=
"你关闭了 itmpara 调试模式。<br>现在物品的 tooltip 中不会显示调试信息。<br>"
;
}
else
{
$clbpara
[
'SetItmparaDebug'
]
=
true
;
$log
.=
"你开启了 itmpara 调试模式。<br>现在物品的 tooltip 中会显示详细的调试信息。<br>"
;
}
}
elseif
(
$itm
==
'对话选择测试器'
)
{
}
elseif
(
$itm
==
'对话选择测试器'
)
{
// 带选择的对话测试
// 带选择的对话测试
$clbpara
[
'dialogue'
]
=
'choiceTestingDialog'
;
$clbpara
[
'dialogue'
]
=
'choiceTestingDialog'
;
...
...
include/game/itemplace.func.php
View file @
0d3dae35
...
@@ -23,7 +23,7 @@ function smartmix_create_recipe_quest($itm,$tp=0,&$data=NULL)
...
@@ -23,7 +23,7 @@ function smartmix_create_recipe_quest($itm,$tp=0,&$data=NULL)
function
smartmix_find_recipe
(
$itm
,
$tp
=
0
)
function
smartmix_find_recipe
(
$itm
,
$tp
=
0
)
{
{
include_once
GAME_ROOT
.
'./include/game/itemmix.func.php'
;
include_once
GAME_ROOT
.
'./include/game/itemmix.func.php'
;
$mix_res
=
array
();
$mix_res
=
array
();
$itm
=
htmlspecialchars_decode
(
itemmix_name_proc
(
$itm
));
$itm
=
htmlspecialchars_decode
(
itemmix_name_proc
(
$itm
));
$mixinfo
=
get_mixinfo
();
$mixinfo
=
get_mixinfo
();
foreach
(
$mixinfo
as
$ma
)
foreach
(
$mixinfo
as
$ma
)
...
@@ -52,7 +52,7 @@ function smartmix_check_available($data)
...
@@ -52,7 +52,7 @@ function smartmix_check_available($data)
}
}
//生成道具序号的全组合
//生成道具序号的全组合
$fc
=
full_combination
(
$packn
,
2
);
$fc
=
full_combination
(
$packn
,
2
);
//所有的组合全部判断一遍是否可以合成,最简单粗暴和兼容
//所有的组合全部判断一遍是否可以合成,最简单粗暴和兼容
$mix_available
=
$mix_overlay_available
=
$mix_sync_available
=
array
();
$mix_available
=
$mix_overlay_available
=
$mix_sync_available
=
array
();
foreach
(
$fc
as
$fcval
){
foreach
(
$fc
as
$fcval
){
...
@@ -102,7 +102,7 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
...
@@ -102,7 +102,7 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
$mhint
=
''
;
$smhint
=
''
;
$mhint
=
''
;
$smhint
=
''
;
if
(
!
empty
(
$itemindex
))
if
(
!
empty
(
$itemindex
))
{
{
$mix_res
=
smartmix_find_recipe
(
$itemindex
,
1
+
2
);
$mix_res
=
smartmix_find_recipe
(
$itemindex
,
1
+
2
);
if
(
$mix_res
){
if
(
$mix_res
){
$smhint
.=
'<span class="blueseed b">'
.
$itemindex
.
'</span>涉及的合成公式:<br><ul>'
;
$smhint
.=
'<span class="blueseed b">'
.
$itemindex
.
'</span>涉及的合成公式:<br><ul>'
;
foreach
(
$mix_res
as
$mval
){
foreach
(
$mix_res
as
$mval
){
...
@@ -119,7 +119,7 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
...
@@ -119,7 +119,7 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
}
}
$smhint
.=
"</ul>"
;
$smhint
.=
"</ul>"
;
}
}
else
else
{
{
$smhint
.=
'没有找到<span class="blueseed b">'
.
$itemindex
.
'</span>的相关合成公式<span class="grey">(不会显示隐藏公式)</span>'
;
$smhint
.=
'没有找到<span class="blueseed b">'
.
$itemindex
.
'</span>的相关合成公式<span class="grey">(不会显示隐藏公式)</span>'
;
}
}
...
@@ -146,8 +146,8 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
...
@@ -146,8 +146,8 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
$mstuff
=
$mresult
=
''
;
$mstuff
=
$mresult
=
''
;
}
}
$o_type
=
$mval
[
'type'
];
$o_type
=
$mval
[
'type'
];
if
(
!
$mstuff
)
{
//配方只显示1次
if
(
!
$mstuff
)
{
//配方只显示1次
sort
(
$mval
[
'stuff'
]);
sort
(
$mval
[
'stuff'
]);
foreach
(
$mval
[
'stuff'
]
as
$ms
){
foreach
(
$mval
[
'stuff'
]
as
$ms
){
$mstuff
.=
parse_smartmix_recipelink
(
$ms
)
.
' + '
;
$mstuff
.=
parse_smartmix_recipelink
(
$ms
)
.
' + '
;
}
}
...
@@ -167,7 +167,7 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
...
@@ -167,7 +167,7 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
for
(
$i
=
0
;
$i
<=
6
;
$i
++
)
for
(
$i
=
0
;
$i
<=
6
;
$i
++
)
{
{
$itemindex
=
$
{
'itm'
.
$i
};
$itemindex
=
$
{
'itm'
.
$i
};
$mix_res
=
smartmix_find_recipe
(
$itemindex
,
1
+
2
);
$mix_res
=
smartmix_find_recipe
(
$itemindex
,
1
+
2
);
if
(
$mix_res
){
if
(
$mix_res
){
$smhint
.=
'<span class="blueseed b">'
.
$itemindex
.
'</span>涉及的合成公式:<br><ul>'
;
$smhint
.=
'<span class="blueseed b">'
.
$itemindex
.
'</span>涉及的合成公式:<br><ul>'
;
foreach
(
$mix_res
as
$mval
){
foreach
(
$mix_res
as
$mval
){
...
@@ -185,7 +185,7 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
...
@@ -185,7 +185,7 @@ function init_itemmix_tips($itemindex='',&$data=NULL)
$smhint
.=
"</ul>"
;
$smhint
.=
"</ul>"
;
}
}
}
}
if
(
!
empty
(
$smhint
))
if
(
!
empty
(
$smhint
))
{
{
//$smhint = "<span class=\"b\">素材不足:</span><br>".$smhint;
//$smhint = "<span class=\"b\">素材不足:</span><br>".$smhint;
$mhint
.=
$smhint
;
$mhint
.=
$smhint
;
...
@@ -215,7 +215,7 @@ function get_npc_helpinfo($nlist,$tooltip=1)
...
@@ -215,7 +215,7 @@ function get_npc_helpinfo($nlist,$tooltip=1)
$tnlist
=
$nlist
;
$tnlist
=
$nlist
;
foreach
(
$tnlist
as
$i
=>
$npcs
)
foreach
(
$tnlist
as
$i
=>
$npcs
)
{
{
if
(
!
empty
(
$npcs
))
if
(
!
empty
(
$npcs
))
{
{
foreach
(
Array
(
'sub'
,
'asub'
,
'esub'
)
as
$tsub
)
foreach
(
Array
(
'sub'
,
'asub'
,
'esub'
)
as
$tsub
)
{
{
...
@@ -234,7 +234,7 @@ function get_npc_helpinfo($nlist,$tooltip=1)
...
@@ -234,7 +234,7 @@ function get_npc_helpinfo($nlist,$tooltip=1)
{
{
$snpc
[
'skill'
]
.=
'(?)'
;
$snpc
[
'skill'
]
.=
'(?)'
;
}
}
else
else
{
{
$snpc
[
'skill'
]
=
'不定'
;
$snpc
[
'skill'
]
=
'不定'
;
}
}
...
@@ -245,7 +245,7 @@ function get_npc_helpinfo($nlist,$tooltip=1)
...
@@ -245,7 +245,7 @@ function get_npc_helpinfo($nlist,$tooltip=1)
{
{
$snpc
[
'gd'
]
=
$snpc
[
'gd'
]
==
'm'
?
'男'
:
'女'
;
$snpc
[
'gd'
]
=
$snpc
[
'gd'
]
==
'm'
?
'男'
:
'女'
;
}
}
else
else
{
{
$snpc
[
'gd'
]
=
'未知'
;
$snpc
[
'gd'
]
=
'未知'
;
}
}
...
@@ -266,17 +266,17 @@ function get_npc_helpinfo($nlist,$tooltip=1)
...
@@ -266,17 +266,17 @@ function get_npc_helpinfo($nlist,$tooltip=1)
{
{
$snpc
[
'pls'
]
=
'原地'
;
$snpc
[
'pls'
]
=
'原地'
;
}
}
else
else
{
{
$snpc
[
'pls'
]
=
$snpc
[
'pls'
]
==
99
?
'随机'
:
$plsinfo
[
$snpc
[
'pls'
]];
$snpc
[
'pls'
]
=
$snpc
[
'pls'
]
==
99
?
'随机'
:
$plsinfo
[
$snpc
[
'pls'
]];
}
}
}
}
}
}
if
(
isset
(
$snpc
[
'pose'
]))
$snpc
[
'poseinfo'
]
=
"<span tooltip=
\"
{
$posetips
[
$snpc
[
'pose'
]]
}
\"
>"
.
$poseinfo
[
$snpc
[
'pose'
]]
.
"</span>"
;
if
(
isset
(
$snpc
[
'pose'
]))
$snpc
[
'poseinfo'
]
=
"<span tooltip=
\"
{
$posetips
[
$snpc
[
'pose'
]]
}
\"
>"
.
$poseinfo
[
$snpc
[
'pose'
]]
.
"</span>"
;
if
(
isset
(
$snpc
[
'tactic'
]))
$snpc
[
'tacinfo'
]
=
"<span tooltip=
\"
{
$tactips
[
$snpc
[
'tactic'
]]
}
\"
>"
.
$tacinfo
[
$snpc
[
'tactic'
]]
.
"</span>"
;
if
(
isset
(
$snpc
[
'tactic'
]))
$snpc
[
'tacinfo'
]
=
"<span tooltip=
\"
{
$tactips
[
$snpc
[
'tactic'
]]
}
\"
>"
.
$tacinfo
[
$snpc
[
'tactic'
]]
.
"</span>"
;
if
(
isset
(
$snpc
[
'club'
]))
$snpc
[
'club'
]
=
$snpc
[
'club'
]
==
99
?
'第一形态'
:
$clubinfo
[
$snpc
[
'club'
]];
if
(
isset
(
$snpc
[
'club'
]))
$snpc
[
'club'
]
=
$snpc
[
'club'
]
==
99
?
'第一形态'
:
$clubinfo
[
$snpc
[
'club'
]];
//格式化装备、道具名
//格式化装备、道具名
foreach
(
Array
(
'wep'
,
'arb'
,
'arh'
,
'ara'
,
'arf'
,
'art'
,
'itm0'
,
'itm1'
,
'itm2'
,
'itm3'
,
'itm4'
,
'itm5'
,
'itm6'
)
as
$value
)
foreach
(
Array
(
'wep'
,
'arb'
,
'arh'
,
'ara'
,
'arf'
,
'art'
,
'itm0'
,
'itm1'
,
'itm2'
,
'itm3'
,
'itm4'
,
'itm5'
,
'itm6'
)
as
$value
)
{
{
if
(
strpos
(
$value
,
'itm'
)
!==
false
)
if
(
strpos
(
$value
,
'itm'
)
!==
false
)
{
{
...
@@ -285,7 +285,7 @@ function get_npc_helpinfo($nlist,$tooltip=1)
...
@@ -285,7 +285,7 @@ function get_npc_helpinfo($nlist,$tooltip=1)
$s_value
=
str_replace
(
'itm'
,
'itms'
,
$value
);
$s_value
=
str_replace
(
'itm'
,
'itms'
,
$value
);
$sk_value
=
str_replace
(
'itm'
,
'itmsk'
,
$value
);
$sk_value
=
str_replace
(
'itm'
,
'itmsk'
,
$value
);
}
}
else
else
{
{
$e_value
=
$value
.
'e'
;
$e_value
=
$value
.
'e'
;
$k_value
=
$value
.
'k'
;
$k_value
=
$value
.
'k'
;
...
@@ -297,7 +297,10 @@ function get_npc_helpinfo($nlist,$tooltip=1)
...
@@ -297,7 +297,10 @@ function get_npc_helpinfo($nlist,$tooltip=1)
//添加tooltip效果
//添加tooltip效果
if
(
$tooltip
)
if
(
$tooltip
)
{
{
if
(
!
empty
(
$snpc
[
$value
]))
$snpc
[
$value
]
=
parse_nameinfo_desc
(
$snpc
[
$value
]);
if
(
!
empty
(
$snpc
[
$value
]))
{
$para_value
=
$value
.
'para'
;
$snpc
[
$value
]
=
parse_nameinfo_desc
(
$snpc
[
$value
],
''
,
''
,
''
,
isset
(
$snpc
[
$para_value
])
?
$snpc
[
$para_value
]
:
''
,
$snpc
[
$k_value
]);
}
if
(
!
empty
(
$snpc
[
$sk_value
]))
$snpc
[
$sk_value
.
'_words'
]
=
parse_skinfo_desc
(
$snpc
[
$sk_value
],
$snpc
[
$k_value
]);
if
(
!
empty
(
$snpc
[
$sk_value
]))
$snpc
[
$sk_value
.
'_words'
]
=
parse_skinfo_desc
(
$snpc
[
$sk_value
],
$snpc
[
$k_value
]);
if
(
!
empty
(
$snpc
[
$k_value
]))
$snpc
[
$k_value
]
=
parse_kinfo_desc
(
$snpc
[
$k_value
]);
if
(
!
empty
(
$snpc
[
$k_value
]))
$snpc
[
$k_value
]
=
parse_kinfo_desc
(
$snpc
[
$k_value
]);
}
}
...
@@ -323,7 +326,7 @@ function get_item_place($which)
...
@@ -323,7 +326,7 @@ function get_item_place($which)
$file
=
config
(
'mapitem'
,
$gamecfg
);
$file
=
config
(
'mapitem'
,
$gamecfg
);
$itemlist
=
openfile
(
$file
);
$itemlist
=
openfile
(
$file
);
$in
=
sizeof
(
$itemlist
);
$in
=
sizeof
(
$itemlist
);
for
(
$i
=
1
;
$i
<
$in
;
$i
++
)
for
(
$i
=
1
;
$i
<
$in
;
$i
++
)
if
(
!
empty
(
$itemlist
[
$i
])
&&
strpos
(
$itemlist
[
$i
],
','
)
!==
false
)
if
(
!
empty
(
$itemlist
[
$i
])
&&
strpos
(
$itemlist
[
$i
],
','
)
!==
false
)
{
{
list
(
$iarea
,
$imap
,
$inum
,
$iname
,
$ikind
,
$ieff
,
$ista
,
$iskind
)
=
explode
(
','
,
$itemlist
[
$i
]);
list
(
$iarea
,
$imap
,
$inum
,
$iname
,
$ikind
,
$ieff
,
$ista
,
$iskind
)
=
explode
(
','
,
$itemlist
[
$i
]);
...
@@ -421,7 +424,7 @@ function get_item_place($which)
...
@@ -421,7 +424,7 @@ function get_item_place($which)
break;
break;
}
}
}
}
}
}
}
}
}*/
}*/
//NPC掉落
//NPC掉落
...
@@ -470,7 +473,7 @@ function get_item_npcdrop($which)
...
@@ -470,7 +473,7 @@ function get_item_npcdrop($which)
{
{
foreach
(
array
(
'wep'
,
'arb'
,
'arh'
,
'ara'
,
'arf'
,
'art'
,
'itm1'
,
'itm2'
,
'itm3'
,
'itm4'
,
'itm5'
,
'itm6'
)
as
$nipval
)
foreach
(
array
(
'wep'
,
'arb'
,
'arh'
,
'ara'
,
'arf'
,
'art'
,
'itm1'
,
'itm2'
,
'itm3'
,
'itm4'
,
'itm5'
,
'itm6'
)
as
$nipval
)
{
{
if
(
!
empty
(
$npcs
[
'sub'
]))
if
(
!
empty
(
$npcs
[
'sub'
]))
{
{
foreach
(
$npcs
[
'sub'
]
as
$npc
)
foreach
(
$npcs
[
'sub'
]
as
$npc
)
{
{
...
...
include/game/itmpara_tooltip.func.php
0 → 100644
View file @
0d3dae35
This diff is collapsed.
Click to expand it.
include/global.func.php
View file @
0d3dae35
This diff is collapsed.
Click to expand it.
include/vnworld/vnmix.func.php
View file @
0d3dae35
...
@@ -21,7 +21,7 @@ function parse_queue_vnmix_info($carr)
...
@@ -21,7 +21,7 @@ function parse_queue_vnmix_info($carr)
}
}
}
}
// 格式化名称
// 格式化名称
$carr
[
'itm_desc'
]
=
parse_nameinfo_desc
(
$carr
[
'itm'
]);
$carr
[
'itm_desc'
]
=
parse_nameinfo_desc
(
$carr
[
'itm'
]
,
''
,
''
,
''
,
isset
(
$carr
[
'itmpara'
])
?
$carr
[
'itmpara'
]
:
''
,
$carr
[
'itmk'
]
);
// 格式化类别
// 格式化类别
$carr
[
'itmk_desc'
]
=
parse_kinfo_desc
(
$carr
[
'itmk'
],
$carr
[
'itmsk'
]);
$carr
[
'itmk_desc'
]
=
parse_kinfo_desc
(
$carr
[
'itmk'
],
$carr
[
'itmsk'
]);
// 合并显示类
// 合并显示类
...
@@ -48,13 +48,13 @@ function get_queue_vnmix_list($id=NULL)
...
@@ -48,13 +48,13 @@ function get_queue_vnmix_list($id=NULL)
return
$db
->
fetch_array
(
$result
);
return
$db
->
fetch_array
(
$result
);
}
}
}
}
else
else
{
{
$result
=
$db
->
query
(
"SELECT * FROM
{
$gtablepre
}
vnmixitem "
);
$result
=
$db
->
query
(
"SELECT * FROM
{
$gtablepre
}
vnmixitem "
);
if
(
$db
->
num_rows
(
$result
))
if
(
$db
->
num_rows
(
$result
))
{
{
while
(
$t
=
$db
->
fetch_array
(
$result
,
MYSQLI_ASSOC
))
while
(
$t
=
$db
->
fetch_array
(
$result
,
MYSQLI_ASSOC
))
{
{
$carr
[
$t
[
'iid'
]]
=
$t
;
$carr
[
$t
[
'iid'
]]
=
$t
;
unset
(
$carr
[
$t
[
'iid'
]][
'iid'
]);
unset
(
$carr
[
$t
[
'iid'
]][
'iid'
]);
}
}
...
@@ -212,7 +212,7 @@ function writeover_vn_mixilst($varr=Array())
...
@@ -212,7 +212,7 @@ function writeover_vn_mixilst($varr=Array())
if
(
$key
==
'itms'
)
$narr
[
'result'
][
3
]
=
$arr
;
if
(
$key
==
'itms'
)
$narr
[
'result'
][
3
]
=
$arr
;
if
(
$key
==
'itmsk'
)
$narr
[
'result'
][
4
]
=
$arr
;
if
(
$key
==
'itmsk'
)
$narr
[
'result'
][
4
]
=
$arr
;
}
}
else
else
{
{
$narr
[
$key
]
=
$arr
;
$narr
[
$key
]
=
$arr
;
}
}
...
@@ -237,11 +237,11 @@ function edit_vn_mixilst($varr,$t)
...
@@ -237,11 +237,11 @@ function edit_vn_mixilst($varr,$t)
global
$checkstr
,
$gamecfg
;
global
$checkstr
,
$gamecfg
;
//先加锁
//先加锁
$lock_file
=
GAME_ROOT
.
'./gamedata/bak/vnmix2.lock'
;
$lock_file
=
GAME_ROOT
.
'./gamedata/bak/vnmix2.lock'
;
if
(
file_exists
(
$lock_file
))
if
(
file_exists
(
$lock_file
))
{
{
return
'有其他管理员正在进行编辑操作,请稍等一会儿再试!'
;
return
'有其他管理员正在进行编辑操作,请稍等一会儿再试!'
;
}
}
else
else
{
{
$cache_file
=
config
(
'vnmixitem'
,
$gamecfg
);
$cache_file
=
config
(
'vnmixitem'
,
$gamecfg
);
if
(
file_exists
(
$cache_file
))
if
(
file_exists
(
$cache_file
))
...
@@ -251,7 +251,7 @@ function edit_vn_mixilst($varr,$t)
...
@@ -251,7 +251,7 @@ function edit_vn_mixilst($varr,$t)
include_once
(
$cache_file
);
include_once
(
$cache_file
);
global
$vn_mixinfo
;
global
$vn_mixinfo
;
}
}
else
else
{
{
return
'合成配方文件不存在!不能进行编辑操作。'
;
return
'合成配方文件不存在!不能进行编辑操作。'
;
}
}
...
...
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