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
6c534279
Commit
6c534279
authored
Apr 17, 2025
by
Nemo Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FEAT: Nuclear Weapon + bugfix
Bugfix: fireseed4 incorrectly triggering on poison
parent
3cfd50f3
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
465 additions
and
11 deletions
+465
-11
doc/etc/20250417_221249_isNuclearWeapon_implementation.txt
doc/etc/20250417_221249_isNuclearWeapon_implementation.txt
+73
-0
doc/etc/20250417_222434_nuclear_core_item_implementation.txt
doc/etc/20250417_222434_nuclear_core_item_implementation.txt
+93
-0
doc/etc/20250417_224500_item_consumption_fix.txt
doc/etc/20250417_224500_item_consumption_fix.txt
+40
-0
doc/etc/20250417_225126_fireseed4_poison_fix.txt
doc/etc/20250417_225126_fireseed4_poison_fix.txt
+45
-0
doc/etc/20250417_225450_fireseed4_skill_check_fix.txt
doc/etc/20250417_225450_fireseed4_skill_check_fix.txt
+56
-0
gamedata/cache/itmpara_tooltip.php
gamedata/cache/itmpara_tooltip.php
+10
-0
include/game/item.nouveau_booster1.php
include/game/item.nouveau_booster1.php
+61
-9
include/game/item.poison.php
include/game/item.poison.php
+1
-1
include/game/revattr.func.php
include/game/revattr.func.php
+86
-1
No files found.
doc/etc/20250417_221249_isNuclearWeapon_implementation.txt
0 → 100644
View file @
6c534279
# isNuclearWeapon 核武器功能实装
## 功能概述
实现了 `itmpara` 字段中的 `isNuclearWeapon` 键值,使武器具有群体攻击效果。当玩家使用含有该键值的武器战斗并对敌人造成伤害时,会对战斗区域内的所有人(包括自己和敌人)造成额外的伤害。
## 实装内容
1. 在 `gamedata/cache/itmpara_tooltip.php` 文件中添加了 `isNuclearWeapon` 的 tooltip 配置
2. 在 `include/game/revattr.func.php` 文件的 `get_hurt_events` 函数中添加了核武器效果的处理逻辑
## 实装细节
### 1. Tooltip 配置
在 `itmpara_tooltip.php` 文件中添加了以下配置:
```php
// 核武器相关
'isNuclearWeapon' => [
'title' => '群体攻击武器',
'format' => '此武器会对战斗区域内的所有人造成伤害',
'suffix' => '',
'condition' => function($item_type, $value) {
return $value == 1;
}
],
```
这样,当玩家查看含有 `isNuclearWeapon` 键值的武器时,会在 tooltip 中看到"群体攻击武器:此武器会对战斗区域内的所有人造成伤害"的提示。
### 2. 核武器效果实现
在 `revattr.func.php` 文件的 `get_hurt_events` 函数中添加了核武器效果的处理逻辑:
1. **伤害池计算**:
- 根据 `$clbpara['randver1']` 的值和本次战斗伤害计算伤害池
- 当 `randver1` 等于 128 时,伤害池 = 战斗伤害 * 7.77
- 当 `randver1` 大于 64 时,伤害池 = 战斗伤害 * 1.2
- 否则,伤害池 = 战斗伤害 * 0.8
- 如果 `randver1` 不存在,默认使用 0.8 倍率
2. **目标选择**:
- 随机选择 2 到 22 个玩家
- 从数据库中获取与攻击者处于同一位置的所有玩家
- 将攻击者和防守者也加入目标列表
- 随机打乱目标列表并限制数量
3. **伤害分配**:
- 计算每个玩家受到的伤害 = 伤害池 / 玩家数量
- 对于拥有 `fireseed3` 或 `fireseed4` 技能的玩家,或防御值超过 10000 的玩家,只受到 1 点伤害
- 对于其他玩家,受到平均伤害,但生命值不会低于 1
- 更新受影响玩家的生命值
4. **日志输出**:
- 在战斗日志中显示核武器效果的触发
- 显示每个受影响玩家受到的伤害
## 使用方法
1. 为武器添加 `isNuclearWeapon` 键值:
```php
$itmpara = '{"isNuclearWeapon":1}';
```
2. 当玩家使用该武器战斗并造成伤害时,会自动触发核武器效果
## 注意事项
1. 核武器效果会影响战斗区域内的所有人,包括攻击者自己
2. 伤害池的计算受 `$clbpara['randver1']` 的影响,可以通过调整该值来控制核武器的威力
3. 拥有 `fireseed3` 或 `fireseed4` 技能的玩家,或防御值超过 10000 的玩家,只会受到 1 点伤害
4. 核武器造成的伤害不会导致玩家死亡,最低会保留 1 点生命值
doc/etc/20250417_222434_nuclear_core_item_implementation.txt
0 → 100644
View file @
6c534279
# ☢核子核心☢ 物品实装
## 功能概述
实现了 "☢核子核心☢" 物品,这是一种武器改造物品,使用后会为玩家当前装备的武器添加 `isNuclearWeapon` 键值,使其成为核武器,能够对战斗区域内的所有人造成伤害。
## 实装内容
在 `include/game/item.nouveau_booster1.php` 文件中添加了 "☢核子核心☢" 物品的处理逻辑。
## 实装细节
1. **物品基本信息**:
- 名称:☢核子核心☢
- 类型:Y(改造物品)
- 功能:为装备的武器添加 `isNuclearWeapon` 键值
2. **使用条件**:
- 玩家必须装备武器才能使用该物品
- 如果武器已经是核武器(已有 `isNuclearWeapon` 键值),则不能再次改造
3. **改造效果**:
- 为武器的 `itmpara` 数据添加 `isNuclearWeapon` 键值,设为 1
- 在武器名称前添加 "☢" 前缀,以便玩家识别
- 使武器具有核武器效果,能够对战斗区域内的所有人造成伤害
4. **使用流程**:
- 检查玩家是否装备了武器
- 获取当前武器的 `itmpara` 数据
- 检查武器是否已经是核武器
- 添加 `isNuclearWeapon` 键值
- 更新武器名称
- 消耗物品
5. **反馈信息**:
- 如果未装备武器,提示玩家必须装备武器才能使用
- 如果武器已经是核武器,提示不需要再次改造
- 改造成功后,提示玩家武器已变成核武器,并说明其效果
## 代码实现
```php
// 核子核心武器改造物品
if ($itm == '☢核子核心☢' && $itmk == 'Y') {
// 检查是否装备了武器
if (empty($wep) || $weps == 0) {
$log .= "你必须装备武器才能使用<span class='red'>{$itm}</span>。<br>";
return true;
}
// 获取当前武器的itmpara数据
$weapon_para = !empty($weppara) ? $weppara : array();
// 如果武器已经是核武器,则不能再次改造
if (!empty($weapon_para['isNuclearWeapon'])) {
$log .= "你的<span class='yellow'>{$wep}</span>已经是核武器了,不需要再次改造。<br>";
return true;
}
// 添加isNuclearWeapon键值
$weapon_para['isNuclearWeapon'] = 1;
// 更新武器的itmpara数据
$weppara = $weapon_para;
// 更新武器名称
$wep = "☢" . $wep;
$log .= "你将<span class='red'>{$itm}</span>安装到了你的武器上。<br>";
$log .= "你的武器变成了<span class='yellow'>{$wep}</span>!现在它可以对战斗区域内的所有人造成伤害了。<br>";
// 消耗物品
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
return true;
}
```
## 使用方法
1. 获取 "☢核子核心☢" 物品
2. 装备想要改造的武器
3. 使用 "☢核子核心☢" 物品
4. 武器将变成核武器,名称前会添加 "☢" 前缀
5. 使用该武器战斗时,会对战斗区域内的所有人造成伤害
## 注意事项
1. 核武器效果会影响战斗区域内的所有人,包括使用者自己,使用时需谨慎
2. 已经是核武器的武器不能再次改造
3. 核武器的伤害池计算受 `$clbpara['randver1']` 的影响,可以通过调整该值来控制核武器的威力
4. 拥有 `fireseed3` 或 `fireseed4` 技能的玩家,或防御值超过 10000 的玩家,只会受到 1 点伤害
doc/etc/20250417_224500_item_consumption_fix.txt
0 → 100644
View file @
6c534279
# 物品消耗问题修复
## 问题描述
在使用 "☢核子核心☢" 物品和技能书物品("现实逃避论~风中残烛之卷"、"现实逃避论~一转攻势之卷"、"现实逃避论~全卷")后,这些物品没有从玩家物品栏中消失,导致玩家可以无限使用同一个物品。
## 问题原因
在 `item.nouveau_booster1.php` 文件中,物品消耗的代码使用了局部变量 `$itm`、`$itmk`、`$itmsk`、`$itme` 和 `$itms`,而不是直接修改玩家物品栏中的对应变量 `${'itm'.$itmn}`、`${'itmk'.$itmn}`、`${'itmsk'.$itmn}`、`${'itme'.$itmn}` 和 `${'itms'.$itmn}`。
这导致虽然局部变量被清空了,但玩家物品栏中的物品并没有被移除。
## 修复内容
修改了 `item.nouveau_booster1.php` 文件中的物品消耗代码,将局部变量替换为直接修改玩家物品栏的变量:
1. 对于 "☢核子核心☢" 物品:
```php
// 消耗物品
${'itm'.$itmn} = '';
${'itmk'.$itmn} = '';
${'itmsk'.$itmn} = '';
${'itme'.$itmn} = 0;
${'itms'.$itmn} = 0;
${'itmpara'.$itmn} = '';
```
2. 对于三本技能书物品,也进行了相同的修改。
## 修复效果
1. 现在使用 "☢核子核心☢" 物品后,该物品会正确地从玩家物品栏中消失
2. 使用技能书物品后,技能书也会正确地从玩家物品栏中消失
3. 玩家不能再无限使用同一个物品
## 注意事项
1. 在 PHP 中,使用 `extract($data, EXTR_REFS)` 后,局部变量 `$itm`、`$itmk` 等并不会自动映射回 `$data` 数组中的对应元素
2. 当需要修改玩家物品栏中的物品时,应该使用 `${'itm'.$itmn}` 这样的变量引用方式
3. 这个问题可能存在于其他物品处理代码中,建议检查其他物品处理函数是否有类似问题
doc/etc/20250417_225126_fireseed4_poison_fix.txt
0 → 100644
View file @
6c534279
# 种火IV毒物伤害免疫修复
## 问题描述
在食用有毒的物品时,哪怕未持有fireseed4技能,也会显示种火IV被触发,并受到0点伤害。
## 问题原因
问题出在 `include/game/item.poison.php` 文件中对种火IV技能的检查方式。原代码使用了 `check_skill_unlock('fireseed4', $data)` 函数来检查玩家是否拥有种火IV技能,但这个函数的返回值与预期不符。
`check_skill_unlock` 函数在玩家没有技能时返回字符串 "noskill",而不是布尔值 false。在PHP中,非空字符串在布尔上下文中会被视为 true,这导致条件判断始终为真,即使玩家没有种火IV技能。
## 修复内容
修改了 `include/game/item.poison.php` 文件中的技能检查方式,不再使用 `check_skill_unlock` 函数,而是直接检查玩家的 `clbpara['skill']` 数组中是否包含 'fireseed4':
```php
# 「种火IV」效果判定:
if(!empty($data['clbpara']['skill']) && in_array('fireseed4', $data['clbpara']['skill'])) {
$log .= "<span class='yellow'>「种火IV」使{$name}受到的所有伤害变为0!</span><br>";
$damage = 0;
}
```
## 修复前代码
```php
# 「种火IV」效果判定:
if(check_skill_unlock('fireseed4', $data)) {
$log .= "<span class='yellow'>「种火IV」使{$name}受到的所有伤害变为0!</span><br>";
$damage = 0;
}
```
## 修复效果
1. 现在只有当玩家真正拥有种火IV技能时,才会触发伤害免疫效果
2. 没有种火IV技能的玩家在食用有毒物品时会正常受到伤害
3. 不会再显示错误的种火IV触发消息
## 注意事项
1. `check_skill_unlock` 函数的返回值需要特别注意,它返回0表示技能已解锁,返回其他值(如字符串)表示技能未解锁
2. 在进行技能检查时,直接检查 `clbpara['skill']` 数组是更可靠的方法
3. 这个问题可能存在于其他使用 `check_skill_unlock` 函数的地方,建议检查其他相关代码
doc/etc/20250417_225450_fireseed4_skill_check_fix.txt
0 → 100644
View file @
6c534279
# 种火IV技能检查修复
## 问题描述
在游戏中,种火IV技能的检查存在问题,导致即使玩家没有该技能,也会触发种火IV的效果。具体表现为:
1. 在食用有毒物品时,即使没有种火IV技能,也会显示种火IV被触发,并受到0点伤害
2. 在陷阱伤害计算中,使用了正确的检查方式,但代码结构可能导致其他问题
## 问题原因
问题出在使用 `check_skill_unlock` 函数来检查玩家是否拥有种火IV技能。这个函数在玩家没有技能时返回字符串 "noskill",而不是布尔值 false。在PHP中,非空字符串在布尔上下文中会被视为 true,这导致条件判断始终为真。
## 修复内容
1. 在 `include/game/item.poison.php` 文件中修改了种火IV技能的检查方式:
```php
# 「种火IV」效果判定:
if(!empty($data['clbpara']['skill']) && in_array('fireseed4', $data['clbpara']['skill'])) {
$log .= "<span class='yellow'>「种火IV」使{$name}受到的所有伤害变为0!</span><br>";
$damage = 0;
}
```
2. 在 `include/game/itemmain.func.php` 文件中,陷阱伤害计算部分已经使用了正确的检查方式,但为了保持一致性,确认了代码结构:
```php
# 「种火IV」效果判定:
if(!empty($data['clbpara']['skill']) && in_array('fireseed4', $data['clbpara']['skill']))
{
$log .= "<span class='yellow'>「种火IV」使{$name}受到的所有伤害变为0!</span><br>";
$damage = 0;
}
else
{
# 计算陷阱伤害
$damage = calc_trap_damage($data,NULL,$playerflag,$selflag);
# 检查陷阱是否被迎击
$damage = check_trap_def_event($data,$damage,$playerflag,$selflag);
}
```
## 修复效果
1. 现在只有当玩家真正拥有种火IV技能时,才会触发伤害免疫效果
2. 没有种火IV技能的玩家在食用有毒物品时会正常受到伤害
3. 没有种火IV技能的玩家在触发陷阱时会正常受到伤害
4. 不会再显示错误的种火IV触发消息
## 注意事项
1. 在进行技能检查时,直接检查 `clbpara['skill']` 数组是更可靠的方法
2. 使用 `check_skill_unlock` 函数时需要特别注意其返回值,它返回0表示技能已解锁,返回其他值(如字符串)表示技能未解锁
3. 在条件判断中,应该使用 `check_skill_unlock('skill_name', $data) === 0` 这样的严格比较,而不是简单的 `if(check_skill_unlock('skill_name', $data))`
4. 对于其他可能使用 `check_skill_unlock` 函数的地方,建议检查并修改为直接检查技能数组的方式,或使用严格比较
gamedata/cache/itmpara_tooltip.php
View file @
6c534279
...
...
@@ -344,6 +344,16 @@ $itmpara_tooltip = [
}
],
// 核武器相关
'isNuclearWeapon'
=>
[
'title'
=>
'群体攻击武器'
,
'format'
=>
'此武器会对战斗区域内的所有人造成伤害'
,
'suffix'
=>
''
,
'condition'
=>
function
(
$item_type
,
$value
)
{
return
$value
==
1
;
}
],
// lore 特殊处理,直接显示内容
'lore'
=>
[
'title'
=>
''
,
...
...
include/game/item.nouveau_booster1.php
View file @
6c534279
...
...
@@ -129,9 +129,13 @@ function item_nouveau_booster1($itmn, &$data) {
$log
.=
"你一怒之下把这本破书撕了个稀巴烂!<br>"
;
}
$itm
=
$itmk
=
$itmsk
=
''
;
$itme
=
$itms
=
0
;
// 消耗物品
$
{
'itm'
.
$itmn
}
=
''
;
$
{
'itmk'
.
$itmn
}
=
''
;
$
{
'itmsk'
.
$itmn
}
=
''
;
$
{
'itme'
.
$itmn
}
=
0
;
$
{
'itms'
.
$itmn
}
=
0
;
$
{
'itmpara'
.
$itmn
}
=
''
;
return
true
;
...
...
@@ -152,9 +156,13 @@ function item_nouveau_booster1($itmn, &$data) {
$log
.=
"你一怒之下把这本破书撕了个稀巴烂!<br>"
;
}
$itm
=
$itmk
=
$itmsk
=
''
;
$itme
=
$itms
=
0
;
// 消耗物品
$
{
'itm'
.
$itmn
}
=
''
;
$
{
'itmk'
.
$itmn
}
=
''
;
$
{
'itmsk'
.
$itmn
}
=
''
;
$
{
'itme'
.
$itmn
}
=
0
;
$
{
'itms'
.
$itmn
}
=
0
;
$
{
'itmpara'
.
$itmn
}
=
''
;
return
true
;
}
...
...
@@ -186,14 +194,58 @@ function item_nouveau_booster1($itmn, &$data) {
$log
.=
"你一怒之下把这本破书撕了个稀巴烂!<br>"
;
}
$itm
=
$itmk
=
$itmsk
=
''
;
$itme
=
$itms
=
0
;
// 消耗物品
$
{
'itm'
.
$itmn
}
=
''
;
$
{
'itmk'
.
$itmn
}
=
''
;
$
{
'itmsk'
.
$itmn
}
=
''
;
$
{
'itme'
.
$itmn
}
=
0
;
$
{
'itms'
.
$itmn
}
=
0
;
$
{
'itmpara'
.
$itmn
}
=
''
;
return
true
;
}
}
// 核子核心武器改造物品
if
(
$itm
==
'☢核子核心☢'
&&
$itmk
==
'Y'
)
{
// 检查是否装备了武器
if
(
empty
(
$wep
)
||
$weps
==
0
)
{
$log
.=
"你必须装备武器才能使用<span class='red'>
{
$itm
}
</span>。<br>"
;
return
true
;
}
// 获取当前武器的itmpara数据
$weapon_para
=
!
empty
(
$weppara
)
?
$weppara
:
array
();
// 如果武器已经是核武器,则不能再次改造
if
(
!
empty
(
$weapon_para
[
'isNuclearWeapon'
]))
{
$log
.=
"你的<span class='yellow'>
{
$wep
}
</span>已经是核武器了,不需要再次改造。<br>"
;
return
true
;
}
// 添加isNuclearWeapon键值
$weapon_para
[
'isNuclearWeapon'
]
=
1
;
// 更新武器的itmpara数据
$weppara
=
$weapon_para
;
// 更新武器名称
$wep
=
"☢"
.
$wep
;
$log
.=
"你将<span class='red'>
{
$itm
}
</span>安装到了你的武器上。<br>"
;
$log
.=
"你的武器变成了<span class='yellow'>
{
$wep
}
</span>!现在它可以对战斗区域内的所有人造成伤害了。<br>"
;
// 消耗物品
$
{
'itm'
.
$itmn
}
=
''
;
$
{
'itmk'
.
$itmn
}
=
''
;
$
{
'itmsk'
.
$itmn
}
=
''
;
$
{
'itme'
.
$itmn
}
=
0
;
$
{
'itms'
.
$itmn
}
=
0
;
$
{
'itmpara'
.
$itmn
}
=
''
;
return
true
;
}
// 如果没有匹配的物品,返回 false
return
false
;
}
...
...
include/game/item.poison.php
View file @
6c534279
...
...
@@ -27,7 +27,7 @@ function item_poison($itmn, &$data) {
}
# 「种火IV」效果判定:
if
(
check_skill_unlock
(
'fireseed4'
,
$data
))
{
if
(
!
empty
(
$data
[
'clbpara'
][
'skill'
])
&&
in_array
(
'fireseed4'
,
$data
[
'clbpara'
][
'skill'
]
))
{
$log
.=
"<span class='yellow'>「种火IV」使
{
$name
}
受到的所有伤害变为0!</span><br>"
;
$damage
=
0
;
}
...
...
include/game/revattr.func.php
View file @
6c534279
...
...
@@ -2353,7 +2353,7 @@ namespace revattr
//防守方(pd)在受到伤害后触发的事件
function
get_hurt_events
(
&
$pa
,
&
$pd
,
$active
)
{
global
$log
,
$infinfo
,
$exdmginf
;
global
$log
,
$infinfo
,
$exdmginf
,
$db
,
$tablepre
;
# pd存在防具受损况,在这里应用
if
(
!
empty
(
$pd
[
'armor_hurt'
]))
...
...
@@ -2374,6 +2374,91 @@ namespace revattr
# 将pa造成的伤害记录在pd的成就里
if
(
!
$pd
[
'type'
]
&&
$pa
[
'final_damage'
]
>=
1000000
)
$pd
[
'clbpara'
][
'achvars'
][
'takedmg'
]
=
$pa
[
'final_damage'
];
# 核武器效果判定
if
(
!
empty
(
$pa
[
'weppara'
][
'isNuclearWeapon'
]))
{
// 计算伤害池
$damage_pool
=
$pa
[
'final_damage'
];
if
(
!
empty
(
$pa
[
'clbpara'
][
'randver1'
]))
{
if
(
$pa
[
'clbpara'
][
'randver1'
]
==
128
)
{
$damage_pool
=
$damage_pool
*
7.77
;
}
elseif
(
$pa
[
'clbpara'
][
'randver1'
]
>
64
)
{
$damage_pool
=
$damage_pool
*
1.2
;
}
else
{
$damage_pool
=
$damage_pool
*
0.8
;
}
}
else
{
$damage_pool
=
$damage_pool
*
0.8
;
// 默认值
}
// 随机选择玩家数量
$player_count
=
rand
(
2
,
22
);
// 获取同一位置的玩家
$query
=
"SELECT * FROM
{
$tablepre
}
players WHERE pls='
{
$pa
[
'pls'
]
}
' AND hp>0 AND pid<>'
{
$pa
[
'pid'
]
}
' AND pid<>'
{
$pd
[
'pid'
]
}
'"
;
$result
=
$db
->
query
(
$query
);
$players
=
array
();
while
(
$player
=
$db
->
fetch_array
(
$result
))
{
$players
[]
=
$player
;
}
// 将攻击者和防守者也加入列表
$players
[]
=
$pa
;
$players
[]
=
$pd
;
// 随机打乱玩家列表
shuffle
(
$players
);
// 限制玩家数量
$players
=
array_slice
(
$players
,
0
,
min
(
$player_count
,
count
(
$players
)));
// 计算每个玩家受到的伤害
$damage_per_player
=
ceil
(
$damage_pool
/
count
(
$players
));
$log
.=
"<span class='red'>
{
$pa
[
'nm'
]
}
的核武器对区域内的所有人造成了伤害!</span><br>"
;
// 应用伤害
foreach
(
$players
as
$player
)
{
$actual_damage
=
$damage_per_player
;
// 特殊条件检查
if
(
!
empty
(
$player
[
'clbpara'
][
'skill'
])
&&
(
in_array
(
'fireseed3'
,
$player
[
'clbpara'
][
'skill'
])
||
in_array
(
'fireseed4'
,
$player
[
'clbpara'
][
'skill'
]))
||
$player
[
'def'
]
>
10000
)
{
$actual_damage
=
1
;
$log
.=
"
{
$player
[
'name'
]
}
受到了<span class='yellow'>1</span>点伤害!<br>"
;
}
else
{
// 生命值不能低于1
$new_hp
=
max
(
1
,
$player
[
'hp'
]
-
$actual_damage
);
$actual_damage
=
$player
[
'hp'
]
-
$new_hp
;
$player
[
'hp'
]
=
$new_hp
;
$log
.=
"
{
$player
[
'name'
]
}
受到了<span class='yellow'>
{
$actual_damage
}
</span>点伤害!<br>"
;
// 如果不是攻击者或防守者,更新数据库
if
(
$player
[
'pid'
]
!=
$pa
[
'pid'
]
&&
$player
[
'pid'
]
!=
$pd
[
'pid'
])
{
$query
=
"UPDATE
{
$tablepre
}
players SET hp='
{
$player
[
'hp'
]
}
' WHERE pid='
{
$player
[
'pid'
]
}
'"
;
$db
->
query
(
$query
);
}
}
}
}
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