Commit 2fce5e88 authored by Nemo Ma's avatar Nemo Ma

itmpara fix

parent 523809f3
2024年7月19日 修复 $itmpara 字段在装备交换时的问题
在2024年7月19日,我们修复了将具有itmpara字段的武器装备时,背包里面的itmpara(如itmpara6)没有被正确剔除的问题。
但在修复后,出现了一个新问题:已有itmpara字段的武器在和没有itmpara字段的武器交换时,前者的itmpara字段会被错误地清空,而它应该被保留。
以下是对应此问题的修复记录:
1. 修复 `item.weapon.php` 文件中的装备逻辑
- 在装备武器或防具时,确保清零背包中的 `itmpara` 字段,但保留 `itmpara` 变量中的值
- 修改前:
```php
${$eqp} = $itm;
${$eqp.'k'} = $itmk;
${$eqp.'e'} = $itme;
${$eqp.'s'} = $itms;
${$eqp.'sk'} = $itmsk;
${$eqp.'para'} = $itmpara;
$log .= "装备了<span class=\"yellow\">$itm</span>。<br>";
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
// 清除背包中的itmpara字段
${'itmpara' . $itmn} = '';
```
- 修改后:
```php
${$eqp} = $itm;
${$eqp.'k'} = $itmk;
${$eqp.'e'} = $itme;
${$eqp.'s'} = $itms;
${$eqp.'sk'} = $itmsk;
${$eqp.'para'} = $itmpara;
$log .= "装备了<span class=\"yellow\">$itm</span>。<br>";
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
// 清除背包中的itmpara字段,但保留itmpara变量中的值
${'itmpara' . $itmn} = '';
```
2. 修复 `item.weapon.php` 文件中的替换装备逻辑
- 在替换武器或防具时,确保将卸下装备的 `itmpara` 值正确地设置到背包中的 `itmpara` 字段
- 修改前:
```php
$itm = $itmt;
$itmk = $itmkt;
$itme = $itmet;
$itms = $itmst;
$itmsk = $itmskt;
$itmpara = $itmparat;
// 清除背包中的itmpara字段
${'itmpara' . $itmn} = '';
$log .= "卸下了<span class=\"red\">$itm</span>,装备了<span class=\"yellow\">{${$eqp}}</span>。<br>";
```
- 修改后:
```php
$itm = $itmt;
$itmk = $itmkt;
$itme = $itmet;
$itms = $itmst;
$itmsk = $itmskt;
$itmpara = $itmparat;
// 将背包中的itmpara字段设置为卸下装备的itmpara值
${'itmpara' . $itmn} = $itmparat;
$log .= "卸下了<span class=\"red\">$itm</span>,装备了<span class=\"yellow\">{${$eqp}}</span>。<br>";
```
这些修改确保了当武器或防具被装备时,背包中的 `itmpara` 字段会被正确处理,同时在交换装备时,已有 `itmpara` 字段的武器的 `itmpara` 值会被正确保留。
2024年7月19日 修复 $itmpara 字段在背包中的清零问题
在2024年7月19日,游戏中的物品添加了新的字段$itmpara,该字段为一数组,可让物品有着数组中定义的键值的属性。
在实现过程中,发现当将具有itmpara字段的武器装备时,其背包里面的itmpara(如itmpara6)并没有被正确剔除,导致背包中的itmpara字段仍然存在,可能会影响后续的物品操作。
以下是对应此问题的修复记录:
1. 修复 `item.weapon.php` 文件中的装备逻辑
- 在装备武器或防具时,确保清零背包中的 `itmpara` 字段
- 修改前:
```php
${$eqp} = $itm;
${$eqp.'k'} = $itmk;
${$eqp.'e'} = $itme;
${$eqp.'s'} = $itms;
${$eqp.'sk'} = $itmsk;
${$eqp.'para'} = $itmpara;
$log .= "装备了<span class=\"yellow\">$itm</span>。<br>";
$itm = $itmk = $itmsk = $itmpara = '';
$itme = $itms = 0;
```
- 修改后:
```php
${$eqp} = $itm;
${$eqp.'k'} = $itmk;
${$eqp.'e'} = $itme;
${$eqp.'s'} = $itms;
${$eqp.'sk'} = $itmsk;
${$eqp.'para'} = $itmpara;
$log .= "装备了<span class=\"yellow\">$itm</span>。<br>";
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
// 清除背包中的itmpara字段
${'itmpara' . $itmn} = '';
```
2. 修复 `item.weapon.php` 文件中的替换装备逻辑
- 在替换武器或防具时,确保清零背包中的 `itmpara` 字段
- 修改前:
```php
$itm = $itmt;
$itmk = $itmkt;
$itme = $itmet;
$itms = $itmst;
$itmsk = $itmskt;
$itmpara = $itmparat;
$log .= "卸下了<span class=\"red\">$itm</span>,装备了<span class=\"yellow\">{${$eqp}}</span>。<br>";
```
- 修改后:
```php
$itm = $itmt;
$itmk = $itmkt;
$itme = $itmet;
$itms = $itmst;
$itmsk = $itmskt;
$itmpara = $itmparat;
// 清除背包中的itmpara字段
${'itmpara' . $itmn} = '';
$log .= "卸下了<span class=\"red\">$itm</span>,装备了<span class=\"yellow\">{${$eqp}}</span>。<br>";
```
这些修改确保了当武器或防具被装备时,背包中的 `itmpara` 字段会被正确清零,避免背包中的 `itmpara` 字段影响后续的物品操作。
2024年7月19日 修复 $itmpara0 字段清零问题
在2024年7月19日,游戏中的物品添加了新的字段$itmpara,该字段为一数组,可让物品有着数组中定义的键值的属性。
在实现过程中,发现获得具有itmpara字段的物品时,itmpara0没有被正确清除,导致后续获得的物品可能会继承之前物品的itmpara属性。
以下是对应此问题的修复记录:
1. 修复 `itemget` 函数中的物品合并逻辑
- 在物品合并后,确保清零 `itmpara0` 字段
- 修改前:
```php
$itm0 = $itmk0 = $itmsk0 = '';
$itme0 = $itms0 = 0;
$itmpara0 = '';
$mode = 'command';
return;
```
- 修改后:
```php
$itm0 = $itmk0 = $itmsk0 = $itmpara0 = '';
$itme0 = $itms0 = 0;
$mode = 'command';
return;
```
2. 修复 `itemadd` 函数中的物品添加逻辑
- 在物品添加到背包后,确保清零 `itmpara0` 字段
- 修改前:
```php
${'itm'.$i} = $itm0;
${'itmk'.$i} = $itmk0;
${'itme'.$i} = $itme0;
${'itms'.$i} = $itms0;
${'itmsk'.$i} = $itmsk0;
${'itmpara'.$i} = $itmpara0;
$itm0 = $itmk0 = $itmsk = $itmpara = '';
$itme0 = $itms0 = 0;
```
- 修改后:
```php
${'itm'.$i} = $itm0;
${'itmk'.$i} = $itmk0;
${'itme'.$i} = $itme0;
${'itms'.$i} = $itms0;
${'itmsk'.$i} = $itmsk0;
${'itmpara'.$i} = $itmpara0;
$itm0 = $itmk0 = $itmsk0 = $itmpara0 = '';
$itme0 = $itms0 = 0;
```
这些修改确保了当获得物品时,`itmpara0` 字段会被正确清零,避免后续获得的物品继承之前物品的 `itmpara` 属性。
2024年7月19日 修复 $itmpara 字段清零问题
在2024年7月19日,游戏中的物品添加了新的字段$itmpara,该字段为一数组,可让物品有着数组中定义的键值的属性。
在实现过程中,发现当卸下有weppara属性的武器时,其itmpara数据(也即该weppara)并没有被更新·清零,导致如果有没有itmpara数据的武器被换上,该武器也会具有之前的weppara属性。
以下是对应此问题的修复记录:
1. 修复 `weapon_loss` 函数
- 在武器损坏时,确保清零 `weppara` 字段
- 修改前:`$pa['wep'] = '拳头'; $pa['wep_kind'] = 'N'; $pa['wepk'] = 'WN'; $pa['wepe'] = 0; $pa['weps'] = $nosta; $pa['wepsk'] = '';`
- 修改后:`$pa['wep'] = '拳头'; $pa['wep_kind'] = 'N'; $pa['wepk'] = 'WN'; $pa['wepe'] = 0; $pa['weps'] = $nosta; $pa['wepsk'] = ''; $pa['weppara'] = '';`
2. 检查其他相关函数
- `itemoff` 函数:已经正确处理了 `weppara` 字段的清零
- `change_subwep` 函数:已经正确处理了 `weppara` 和 `wep2para` 字段的交换
- `destory_single_equip` 函数:已经正确处理了装备 `para` 字段的清零
- `armor_hurt` 函数:已经正确处理了防具 `para` 字段的清零
这些修改确保了当武器或装备被卸下或损坏时,相应的 `para` 字段会被正确清零,避免新装备的武器或装备继承之前的属性。
...@@ -474,7 +474,7 @@ function item_dice($itmn, &$data) { ...@@ -474,7 +474,7 @@ function item_dice($itmn, &$data) {
$itme1 = $itme2 = $itme3 = $itme4 = $itme5 = $itme6 = 1; $itme1 = $itme2 = $itme3 = $itme4 = $itme5 = $itme6 = 1;
$itms1 = $itms2 = $itms3 = $itms4 = $itms5 = $itms6 = 1; $itms1 = $itms2 = $itms3 = $itms4 = $itms5 = $itms6 = 1;
$itmsk1 = $itmsk2 = $itmsk3 = $itmsk4 = $itmsk5 = $itmsk6 = ''; $itmsk1 = $itmsk2 = $itmsk3 = $itmsk4 = $itmsk5 = $itmsk6 = '';
$itmpara1 = $itmpara2 = $itmpara3 = $itmpara4 = $itmpara5 = $itmpara6 = 0; $itmpara1 = $itmpara2 = $itmpara3 = $itmpara4 = $itmpara5 = $itmpara6 = '';
}else{ }else{
//Otherwise, we swap every item in player's bag with random items at player's location. //Otherwise, we swap every item in player's bag with random items at player's location.
$log .= '一道白光闪过,你背包中的物品都消失了,但是……<br>'; $log .= '一道白光闪过,你背包中的物品都消失了,但是……<br>';
......
...@@ -8,14 +8,14 @@ if (! defined ( 'IN_GAME' )) { ...@@ -8,14 +8,14 @@ if (! defined ( 'IN_GAME' )) {
function item_weapon($itmn, &$data) { function item_weapon($itmn, &$data) {
global $log, $mode, $nosta; global $log, $mode, $nosta;
extract($data, EXTR_REFS); extract($data, EXTR_REFS);
$itm = & ${'itm' . $itmn}; $itm = & ${'itm' . $itmn};
$itmk = & ${'itmk' . $itmn}; $itmk = & ${'itmk' . $itmn};
$itme = & ${'itme' . $itmn}; $itme = & ${'itme' . $itmn};
$itms = & ${'itms' . $itmn}; $itms = & ${'itms' . $itmn};
$itmsk = & ${'itmsk' . $itmn}; $itmsk = & ${'itmsk' . $itmn};
$itmpara = & get_itmpara(${'itmpara' . $itmn}); $itmpara = & get_itmpara(${'itmpara' . $itmn});
if(strpos($itmk, 'W') === 0) { if(strpos($itmk, 'W') === 0) {
$eqp = 'wep'; $eqp = 'wep';
$noeqp = 'WN'; $noeqp = 'WN';
...@@ -44,7 +44,7 @@ function item_weapon($itmn, &$data) { ...@@ -44,7 +44,7 @@ function item_weapon($itmn, &$data) {
$eqp = 'art'; $eqp = 'art';
$noeqp = ''; $noeqp = '';
} }
//global ${$eqp}, ${$eqp.'k'}, ${$eqp.'e'}, ${$eqp.'s'}, ${$eqp.'sk'}; //global ${$eqp}, ${$eqp.'k'}, ${$eqp.'e'}, ${$eqp.'s'}, ${$eqp.'sk'};
//global $artk; //global $artk;
if((($artk=='XX')||($artk=='XY'))&&($eqp == 'art')){ if((($artk=='XX')||($artk=='XY'))&&($eqp == 'art')){
...@@ -72,7 +72,7 @@ function item_weapon($itmn, &$data) { ...@@ -72,7 +72,7 @@ function item_weapon($itmn, &$data) {
$itmnumlimit = $itme>=$itms ? $itms : $itme; $itmnumlimit = $itme>=$itms ? $itms : $itme;
} }
if (($noeqp && strpos(${$eqp.'k'}, $noeqp) === 0) || !${$eqp.'s'}) { if (($noeqp && strpos(${$eqp.'k'}, $noeqp) === 0) || !${$eqp.'s'}) {
// 装备道具时,进行单次套装检测 // 装备道具时,进行单次套装检测
include_once GAME_ROOT.'./include/game/itemmain.func.php'; include_once GAME_ROOT.'./include/game/itemmain.func.php';
reload_single_set_item($data,$eqp,$itm,1); reload_single_set_item($data,$eqp,$itm,1);
...@@ -84,8 +84,10 @@ function item_weapon($itmn, &$data) { ...@@ -84,8 +84,10 @@ function item_weapon($itmn, &$data) {
${$eqp.'sk'} = $itmsk; ${$eqp.'sk'} = $itmsk;
${$eqp.'para'} = $itmpara; ${$eqp.'para'} = $itmpara;
$log .= "装备了<span class=\"yellow\">$itm</span>。<br>"; $log .= "装备了<span class=\"yellow\">$itm</span>。<br>";
$itm = $itmk = $itmsk = $itmpara = ''; $itm = $itmk = $itmsk = '';
$itme = $itms = 0; $itme = $itms = 0;
// 清除背包中的itmpara字段,但保留itmpara变量中的值
${'itmpara' . $itmn} = '';
} else { } else {
// 替换装备时,进行单次套装检测 // 替换装备时,进行单次套装检测
...@@ -113,6 +115,8 @@ function item_weapon($itmn, &$data) { ...@@ -113,6 +115,8 @@ function item_weapon($itmn, &$data) {
$itms = $itmst; $itms = $itmst;
$itmsk = $itmskt; $itmsk = $itmskt;
$itmpara = $itmparat; $itmpara = $itmparat;
// 将背包中的itmpara字段设置为卸下装备的itmpara值
${'itmpara' . $itmn} = $itmparat;
$log .= "卸下了<span class=\"red\">$itm</span>,装备了<span class=\"yellow\">{${$eqp}}</span>。<br>"; $log .= "卸下了<span class=\"red\">$itm</span>,装备了<span class=\"yellow\">{${$eqp}}</span>。<br>";
} }
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
///include/game/itemmain.func.php ///include/game/itemmain.func.php
// Issue: // Issue:
// preg_replace // preg_replace
// //
//*/ //*/
if(!defined('IN_GAME')) { if(!defined('IN_GAME')) {
...@@ -105,7 +105,7 @@ function calc_trap_damage(&$pa,$pd=NULL,$playerflag=0,$selflag=0) ...@@ -105,7 +105,7 @@ function calc_trap_damage(&$pa,$pd=NULL,$playerflag=0,$selflag=0)
} }
// 随机数大神的陷阱 // 随机数大神的陷阱
if($pa['itmk0'] == 'TO8') if($pa['itmk0'] == 'TO8')
{ {
$damage = $pa['hp'] / 8; $damage = $pa['hp'] / 8;
return $damage; return $damage;
} }
...@@ -122,7 +122,7 @@ function calc_trap_damage(&$pa,$pd=NULL,$playerflag=0,$selflag=0) ...@@ -122,7 +122,7 @@ function calc_trap_damage(&$pa,$pd=NULL,$playerflag=0,$selflag=0)
if($pa['itmk0'] == 'TOr') if($pa['itmk0'] == 'TOr')
{ {
$log .= "<br>可能是因为制作陷阱的人正在反叛随机数大神,<br> $log .= "<br>可能是因为制作陷阱的人正在反叛随机数大神,<br>
<span class=\"yellow\">你看到天上突然有一颗骰子掉了下来,爆炸在你的头上!</span><br>"; <span class=\"yellow\">你看到天上突然有一颗骰子掉了下来,爆炸在你的头上!</span><br>";
$damage = diceroll($pa['mhp']); $damage = diceroll($pa['mhp']);
return $damage; return $damage;
} }
...@@ -140,7 +140,7 @@ function calc_trap_damage(&$pa,$pd=NULL,$playerflag=0,$selflag=0) ...@@ -140,7 +140,7 @@ function calc_trap_damage(&$pa,$pd=NULL,$playerflag=0,$selflag=0)
$pa['skilllog'] .= "已经跳到你腿上的<span class='yellow'>{$pa['itm0']}</span>显然被你非凡的气魄震慑到了!你仅"; $pa['skilllog'] .= "已经跳到你腿上的<span class='yellow'>{$pa['itm0']}</span>显然被你非凡的气魄震慑到了!你仅";
$damage = round($damage * (1 - ($damage_p/100))); $damage = round($damage * (1 - ($damage_p/100)));
} }
return $damage; return $damage;
} }
...@@ -153,7 +153,7 @@ function check_trap_def_event(&$pa,$damage,$playerflag=0,$selflag=0) ...@@ -153,7 +153,7 @@ function check_trap_def_event(&$pa,$damage,$playerflag=0,$selflag=0)
include_once GAME_ROOT.'./include/game/revattr.func.php'; include_once GAME_ROOT.'./include/game/revattr.func.php';
if(empty($pa['ex_keys'])) $pa['ex_keys'] = array_merge(\revattr\get_equip_ex_array($pa),\revattr\get_wep_ex_array($pa)); if(empty($pa['ex_keys'])) $pa['ex_keys'] = array_merge(\revattr\get_equip_ex_array($pa),\revattr\get_wep_ex_array($pa));
# 计算迎击概率(锡安迎击率+20) # 计算迎击概率(锡安迎击率+20)
if(!empty($pa['ex_keys']) && in_array('m',$pa['ex_keys'])) if(!empty($pa['ex_keys']) && in_array('m',$pa['ex_keys']))
{ {
$pa['minedetect'] = 1; $pa['minedetect'] = 1;
$def_obbs = $pa['club'] == 7 ? 60 : 40; $def_obbs = $pa['club'] == 7 ? 60 : 40;
...@@ -208,7 +208,7 @@ function trap(&$data=NULL){ ...@@ -208,7 +208,7 @@ function trap(&$data=NULL){
$data = &$pdata; $data = &$pdata;
} }
extract($data,EXTR_REFS); extract($data,EXTR_REFS);
$playerflag = $itmsk0 ? true : false; $playerflag = $itmsk0 ? true : false;
$selflag = $itmsk0 == $pid ? true : false; $selflag = $itmsk0 == $pid ? true : false;
$dice=diceroll(99); $dice=diceroll(99);
...@@ -221,7 +221,7 @@ function trap(&$data=NULL){ ...@@ -221,7 +221,7 @@ function trap(&$data=NULL){
{ {
$trname = $wdata['name'];$trtype = $wdata['type'];$trperfix = '<span class="yellow">'.$trname.'</span>设置的'; $trname = $wdata['name'];$trtype = $wdata['type'];$trperfix = '<span class="yellow">'.$trname.'</span>设置的';
} }
else else
{ {
$trname = $trtype = $trperfix = ''; $trname = $trtype = $trperfix = '';
} }
...@@ -251,7 +251,7 @@ function trap(&$data=NULL){ ...@@ -251,7 +251,7 @@ function trap(&$data=NULL){
if($damage) if($damage)
{ {
$tmp_club=$club; $tmp_club=$club;
$hp -= $damage; $hp -= $damage;
$trapkill = false; $trapkill = false;
if($playerflag) if($playerflag)
...@@ -263,12 +263,12 @@ function trap(&$data=NULL){ ...@@ -263,12 +263,12 @@ function trap(&$data=NULL){
$log .= "受到<span class=\"dmg\">$damage</span>点伤害!<br>"; $log .= "受到<span class=\"dmg\">$damage</span>点伤害!<br>";
# 踩雷rp结算 # 踩雷rp结算
$rp_up = -1 * $rp / 2; $rp_up = -1 * $rp / 2;
include_once GAME_ROOT.'./include/state.func.php'; include_once GAME_ROOT.'./include/state.func.php';
if($rp_up) rpup_rev($data,$rp_up); if($rp_up) rpup_rev($data,$rp_up);
# 陷阱击杀 # 陷阱击杀
if($hp <= 0) if($hp <= 0)
{ {
if(!empty($wdata)) if(!empty($wdata))
{ {
...@@ -288,7 +288,7 @@ function trap(&$data=NULL){ ...@@ -288,7 +288,7 @@ function trap(&$data=NULL){
$log .= "你被{$trperfix}陷阱杀死了!"; $log .= "你被{$trperfix}陷阱杀死了!";
if($killmsg && !$selflag){ if($killmsg && !$selflag){
$log .= "<span class=\"yellow\">{$trname}对你说:“{$killmsg}”</span><br>"; $log .= "<span class=\"yellow\">{$trname}对你说:“{$killmsg}”</span><br>";
} }
if ($tmp_club==99) $log.="<span class=\"lime\">但由于你及时按下了BOMB键,你原地满血复活了!</span><br>"; if ($tmp_club==99) $log.="<span class=\"lime\">但由于你及时按下了BOMB键,你原地满血复活了!</span><br>";
} }
$trapkill = true; $trapkill = true;
...@@ -338,7 +338,7 @@ function trap(&$data=NULL){ ...@@ -338,7 +338,7 @@ function trap(&$data=NULL){
{ {
$w_log = "<span class=\"yellow\">{$name}触发了你设置的陷阱{$itm0},但是没有受到任何伤害!</span><br>"; $w_log = "<span class=\"yellow\">{$name}触发了你设置的陷阱{$itm0},但是没有受到任何伤害!</span><br>";
logsave ( $itmsk0, $now, $w_log ,'b'); logsave ( $itmsk0, $now, $w_log ,'b');
} }
} }
$log .= "糟糕,你触发了{$trperfix}陷阱<span class=\"yellow\">$itm0</span>!"; $log .= "糟糕,你触发了{$trperfix}陷阱<span class=\"yellow\">$itm0</span>!";
if(!empty($data['minedetect'])) if(!empty($data['minedetect']))
...@@ -359,12 +359,12 @@ function trap(&$data=NULL){ ...@@ -359,12 +359,12 @@ function trap(&$data=NULL){
return; return;
} }
# 陷阱回避 # 陷阱回避
else else
{ {
# 检查成就 # 检查成就
// include_once GAME_ROOT.'./include/game/achievement.func.php'; // include_once GAME_ROOT.'./include/game/achievement.func.php';
// check_trap_miss_achievement($achievement,$selflag,$itm0,$itme0); // check_trap_miss_achievement($achievement,$selflag,$itm0,$itme0);
# logsave # logsave
if($playerflag && !$selflag) if($playerflag && !$selflag)
{ {
...@@ -386,7 +386,7 @@ function trap(&$data=NULL){ ...@@ -386,7 +386,7 @@ function trap(&$data=NULL){
else else
{ {
$log .= "你发现了{$trperfix}陷阱<span class=\"yellow\">$itm0</span>,不过你并没有触发它。陷阱看上去还可以重复使用。<br>"; $log .= "你发现了{$trperfix}陷阱<span class=\"yellow\">$itm0</span>,不过你并没有触发它。陷阱看上去还可以重复使用。<br>";
} }
$itmsk0 = '';$itmk0 = str_replace('TO','TN',$itmk0); $itmsk0 = '';$itmk0 = str_replace('TO','TN',$itmk0);
$mode = 'itemfind'; $mode = 'itemfind';
return; return;
...@@ -401,7 +401,7 @@ function trap(&$data=NULL){ ...@@ -401,7 +401,7 @@ function trap(&$data=NULL){
else else
{ {
$log .= "你触发了{$trperfix}陷阱<span class=\"yellow\">$itm0</span>,不过你成功地回避了陷阱。<br>"; $log .= "你触发了{$trperfix}陷阱<span class=\"yellow\">$itm0</span>,不过你成功地回避了陷阱。<br>";
} }
$itm0 = $itmk0 = $itmsk0 = ''; $itm0 = $itmk0 = $itmsk0 = '';
$itme0 = $itms0 = 0; $itme0 = $itms0 = 0;
$mode = 'command'; $mode = 'command';
...@@ -442,7 +442,7 @@ function itemfind(&$data=NULL) { ...@@ -442,7 +442,7 @@ function itemfind(&$data=NULL) {
} }
} }
function itemget(&$data=NULL) function itemget(&$data=NULL)
{ {
global $log,$nosta,$mode,$cmd; global $log,$nosta,$mode,$cmd;
if(!isset($data)) if(!isset($data))
...@@ -471,21 +471,22 @@ function itemget(&$data=NULL) ...@@ -471,21 +471,22 @@ function itemget(&$data=NULL)
} }
if(preg_match('/^(WC|WD|WF|Y|B|C|TN|GA|GB|M|V)/',$itmk0) && $itms0 !== $nosta){ if(preg_match('/^(WC|WD|WF|Y|B|C|TN|GA|GB|M|V)/',$itmk0) && $itms0 !== $nosta){
//global $wep,$wepk,$wepe,$weps,$wepsk; //global $wep,$wepk,$wepe,$weps,$wepsk;
if($wep == $itm0 && $wepk == $itmk0 && $wepe == $itme0 && $wepsk == $itmsk0){ if($wep == $itm0 && $wepk == $itmk0 && $wepe == $itme0 && $wepsk == $itmsk0 && $weppara == $itmpara0){
$weps += $itms0; $weps += $itms0;
$log .= "与装备着的武器<span class=\"yellow\">$wep</span>合并了。"; $log .= "与装备着的武器<span class=\"yellow\">$wep</span>合并了。";
$itm0 = $itmk0 = $itmsk0 = ''; $itm0 = $itmk0 = $itmsk0 = $itmpara0 = '';
$itme0 = $itms0 = 0; $itme0 = $itms0 = 0;
$mode = 'command'; $mode = 'command';
return; return;
}else{ }else{
for($i = 1;$i <= 6;$i++){ for($i = 1;$i <= 6;$i++){
//global ${'itm'.$i},${'itmk'.$i},${'itme'.$i},${'itms'.$i},${'itmsk'.$i}; //global ${'itm'.$i},${'itmk'.$i},${'itme'.$i},${'itms'.$i},${'itmsk'.$i};
if((${'itms'.$i})&&($itm0 == ${'itm'.$i})&&($itmk0 == ${'itmk'.$i})&&($itme0 == ${'itme'.$i})&&($itmsk0 == ${'itmsk'.$i})){ if((${'itms'.$i})&&($itm0 == ${'itm'.$i})&&($itmk0 == ${'itmk'.$i})&&($itme0 == ${'itme'.$i})&&($itmsk0 == ${'itmsk'.$i})&&($itmpara0 == ${'itmpara'.$i})){
${'itms'.$i} += $itms0; ${'itms'.$i} += $itms0;
$log .= "与包裹里的<span class=\"yellow\">$itm0</span>合并了。"; $log .= "与包裹里的<span class=\"yellow\">$itm0</span>合并了。";
$itm0 = $itmk0 = $itmsk0 = ''; $itm0 = $itmk0 = $itmsk0 = '';
$itme0 = $itms0 = 0; $itme0 = $itms0 = 0;
$itmpara0 = '';
$mode = 'command'; $mode = 'command';
return; return;
} }
...@@ -506,7 +507,7 @@ function itemget(&$data=NULL) ...@@ -506,7 +507,7 @@ function itemget(&$data=NULL)
if(bot_check_getitem($data)) itemadd($data); if(bot_check_getitem($data)) itemadd($data);
else itemdrop($data); else itemdrop($data);
} }
else else
{ {
include template('itemmerge0'); include template('itemmerge0');
$cmd = ob_get_contents(); $cmd = ob_get_contents();
...@@ -554,7 +555,7 @@ function itemdrop($item,&$data=NULL) { ...@@ -554,7 +555,7 @@ function itemdrop($item,&$data=NULL) {
$itmsk = & ${'ar'.$itmn.'sk'}; $itmsk = & ${'ar'.$itmn.'sk'};
} else*/ } else*/
if(strpos($item,'itm') === 0) { if(strpos($item,'itm') === 0) {
$itmn = substr($item,3,1); $itmn = substr($item,3,1);
//global ${'itm'.$itmn},${'itmk'.$itmn},${'itme'.$itmn},${'itms'.$itmn},${'itmsk'.$itmn}; //global ${'itm'.$itmn},${'itmk'.$itmn},${'itme'.$itmn},${'itms'.$itmn},${'itmsk'.$itmn};
...@@ -601,7 +602,7 @@ function itemdrop($item,&$data=NULL) { ...@@ -601,7 +602,7 @@ function itemdrop($item,&$data=NULL) {
$mode = 'command'; $mode = 'command';
return; return;
} }
if ((strpos ( $itmk, 'Y' ) === 0 || strpos ( $itmk, 'Z' ) === 0) && ($itm == '棱镜八面体')) if ((strpos ( $itmk, 'Y' ) === 0 || strpos ( $itmk, 'Z' ) === 0) && ($itm == '棱镜八面体'))
{ {
$theitem = array('itm' => &$itm, 'itmk' => &$itmk, 'itme' => &$itme,'itms' => &$itms,'itmsk' => &$itmsk); $theitem = array('itm' => &$itm, 'itmk' => &$itmk, 'itme' => &$itme,'itms' => &$itms,'itmsk' => &$itmsk);
...@@ -609,7 +610,7 @@ function itemdrop($item,&$data=NULL) { ...@@ -609,7 +610,7 @@ function itemdrop($item,&$data=NULL) {
include_once GAME_ROOT . './include/game/item.func.php'; include_once GAME_ROOT . './include/game/item.func.php';
octitem_rotate($theitem, 7); octitem_rotate($theitem, 7);
} }
if(strpos($itmsk,'v')!==false) if(strpos($itmsk,'v')!==false)
{ {
$log .= "{$itm}在地上化作点点碎片,随风消逝了。<br>"; $log .= "{$itm}在地上化作点点碎片,随风消逝了。<br>";
...@@ -617,7 +618,7 @@ function itemdrop($item,&$data=NULL) { ...@@ -617,7 +618,7 @@ function itemdrop($item,&$data=NULL) {
} }
else else
{ {
$db->query("INSERT INTO {$tablepre}mapitem (itm, itmk, itme, itms, itmsk ,pls) VALUES ('$itm', '$itmk', '$itme', '$itms', '$itmsk', '$pls')"); $db->query("INSERT INTO {$tablepre}mapitem (itm, itmk, itme, itms, itmsk ,itmpara, pls) VALUES ('$itm', '$itmk', '$itme', '$itms', '$itmsk', '$itmpara', '$pls')");
$drop_iid = $db->insert_id(); $drop_iid = $db->insert_id();
$log .= "你丢弃了<span class=\"red\">$itm</span>。<br>"; $log .= "你丢弃了<span class=\"red\">$itm</span>。<br>";
check_add_searchmemory($drop_iid,'itm',$itm,$data); check_add_searchmemory($drop_iid,'itm',$itm,$data);
...@@ -687,7 +688,7 @@ function itemoff($item){ ...@@ -687,7 +688,7 @@ function itemoff($item){
$itms0 = $itms; $itms0 = $itms;
$itmsk0 = $itmsk; $itmsk0 = $itmsk;
$itmpara0 = $itmpara; $itmpara0 = $itmpara;
if($item == 'wep'){ if($item == 'wep'){
$itm = '拳头'; $itm = '拳头';
$itmsk = ''; $itmsk = '';
...@@ -729,7 +730,7 @@ function itemadd(&$data=NULL) ...@@ -729,7 +730,7 @@ function itemadd(&$data=NULL)
${'itms'.$i} = $itms0; ${'itms'.$i} = $itms0;
${'itmsk'.$i} = $itmsk0; ${'itmsk'.$i} = $itmsk0;
${'itmpara'.$i} = $itmpara0; ${'itmpara'.$i} = $itmpara0;
$itm0 = $itmk0 = $itmsk = $itmpara = ''; $itm0 = $itmk0 = $itmsk0 = $itmpara0 = '';
$itme0 = $itms0 = 0; $itme0 = $itms0 = 0;
$mode = 'command'; $mode = 'command';
return; return;
...@@ -753,15 +754,15 @@ function itemadd(&$data=NULL) ...@@ -753,15 +754,15 @@ function itemadd(&$data=NULL)
function itemmerge($itn1,$itn2){ function itemmerge($itn1,$itn2){
global $log,$mode; global $log,$mode;
if($itn1 == $itn2) { if($itn1 == $itn2) {
$log .= '需要选择两个物品才能进行合并!'; $log .= '需要选择两个物品才能进行合并!';
$mode = 'itemmerge'; $mode = 'itemmerge';
return; return;
} }
global $nosta,${'itm'.$itn1},${'itmk'.$itn1},${'itme'.$itn1},${'itms'.$itn1},${'itmsk'.$itn1},${'itm'.$itn2},${'itmk'.$itn2},${'itme'.$itn2},${'itms'.$itn2},${'itmsk'.$itn2}, ${'itmpara'.$itn1}, ${'itmpara'.$itn2}; global $nosta,${'itm'.$itn1},${'itmk'.$itn1},${'itme'.$itn1},${'itms'.$itn1},${'itmsk'.$itn1},${'itm'.$itn2},${'itmk'.$itn2},${'itme'.$itn2},${'itms'.$itn2},${'itmsk'.$itn2}, ${'itmpara'.$itn1}, ${'itmpara'.$itn2};
$it1 = & ${'itm'.$itn1}; $it1 = & ${'itm'.$itn1};
$itk1 = & ${'itmk'.$itn1}; $itk1 = & ${'itmk'.$itn1};
$ite1 = & ${'itme'.$itn1}; $ite1 = & ${'itme'.$itn1};
...@@ -774,13 +775,13 @@ function itemmerge($itn1,$itn2){ ...@@ -774,13 +775,13 @@ function itemmerge($itn1,$itn2){
$its2 = & ${'itms'.$itn2}; $its2 = & ${'itms'.$itn2};
$itsk2 = & ${'itmsk'.$itn2}; $itsk2 = & ${'itmsk'.$itn2};
$itpara2 = & ${'itmpara'.$itn2}; $itpara2 = & ${'itmpara'.$itn2};
if(!$its1 || !$its2) { if(!$its1 || !$its2) {
$log .= '请选择正确的物品进行合并!'; $log .= '请选择正确的物品进行合并!';
$mode = 'itemmerge'; $mode = 'itemmerge';
return; return;
} }
if($its1==$nosta || $its2==$nosta) { if($its1==$nosta || $its2==$nosta) {
$log .= '耐久是无限的物品不能合并!'; $log .= '耐久是无限的物品不能合并!';
$mode = 'itemmerge'; $mode = 'itemmerge';
...@@ -809,7 +810,7 @@ function itemmerge($itn1,$itn2){ ...@@ -809,7 +810,7 @@ function itemmerge($itn1,$itn2){
$its2 += $its1; $its2 += $its1;
$it1 = $itk1 = $itsk1 = $itpara1 = ''; $it1 = $itk1 = $itsk1 = $itpara1 = '';
$ite1 = $its1 = 0; $ite1 = $its1 = 0;
$log .= "你合并了 <span class=\"yellow\">$it2</span>。"; $log .= "你合并了 <span class=\"yellow\">$it2</span>。";
$mode = 'command'; $mode = 'command';
return; return;
...@@ -839,7 +840,7 @@ function itemmix($mlist, $itemselect=-1) { ...@@ -839,7 +840,7 @@ function itemmix($mlist, $itemselect=-1) {
global $itmk1,$itmk2,$itmk3,$itmk4,$itmk5,$itmk6,$itmsk1,$itmsk2,$itmsk3,$itmsk4,$itmsk5,$itmsk6; global $itmk1,$itmk2,$itmk3,$itmk4,$itmk5,$itmk6,$itmsk1,$itmsk2,$itmsk3,$itmsk4,$itmsk5,$itmsk6;
global $syncn,$synck,$synce,$syncs,$syncsk,$sync,$reqname,$star; global $syncn,$synck,$synce,$syncs,$syncsk,$sync,$reqname,$star;
global $cmd; global $cmd;
$mlist2 = array_unique($mlist); $mlist2 = array_unique($mlist);
if(count($mlist) != count($mlist2)) { if(count($mlist) != count($mlist2)) {
$log .= '相同道具不能进行合成!<br>'; $log .= '相同道具不能进行合成!<br>';
$mode = 'itemmix'; $mode = 'itemmix';
...@@ -1002,7 +1003,7 @@ function itemmix($mlist, $itemselect=-1) { ...@@ -1002,7 +1003,7 @@ function itemmix($mlist, $itemselect=-1) {
foreach($mlist as $k) foreach($mlist as $k)
if (1<=$k && $k<=6) if (1<=$k && $k<=6)
$mask|=(1<<((int)$k-1)); $mask|=(1<<((int)$k-1));
$cmd.='<input type="hidden" id="mode" name="mode" value="itemmain">'; $cmd.='<input type="hidden" id="mode" name="mode" value="itemmain">';
$cmd.='<input type="hidden" id="command" name="command" value="itemmix">'; $cmd.='<input type="hidden" id="command" name="command" value="itemmix">';
$cmd.='<input type="hidden" id="mixmask" name="mixmask" value="'.$mask.'">'; $cmd.='<input type="hidden" id="mixmask" name="mixmask" value="'.$mask.'">';
...@@ -1020,7 +1021,7 @@ function itemmix($mlist, $itemselect=-1) { ...@@ -1020,7 +1021,7 @@ function itemmix($mlist, $itemselect=-1) {
$i=(int)$itemselect; $i=(int)$itemselect;
if ($i<0 || $i>$sync) if ($i<0 || $i>$sync)
{ {
$mode='command'; return; $mode='command'; return;
} }
foreach($mlist as $val) foreach($mlist as $val)
{ {
...@@ -1070,7 +1071,7 @@ function itemmix($mlist, $itemselect=-1) { ...@@ -1070,7 +1071,7 @@ function itemmix($mlist, $itemselect=-1) {
foreach($mlist as $k) foreach($mlist as $k)
if (1<=$k && $k<=6) if (1<=$k && $k<=6)
$mask|=(1<<((int)$k-1)); $mask|=(1<<((int)$k-1));
$cmd.='<input type="hidden" id="mode" name="mode" value="itemmain">'; $cmd.='<input type="hidden" id="mode" name="mode" value="itemmain">';
$cmd.='<input type="hidden" id="command" name="command" value="itemmix">'; $cmd.='<input type="hidden" id="command" name="command" value="itemmix">';
$cmd.='<input type="hidden" id="mixmask" name="mixmask" value="'.$mask.'">'; $cmd.='<input type="hidden" id="mixmask" name="mixmask" value="'.$mask.'">';
...@@ -1088,7 +1089,7 @@ function itemmix($mlist, $itemselect=-1) { ...@@ -1088,7 +1089,7 @@ function itemmix($mlist, $itemselect=-1) {
$i=(int)$itemselect; $i=(int)$itemselect;
if ($i<0 || $i>$sync) if ($i<0 || $i>$sync)
{ {
$mode='command'; return; $mode='command'; return;
} }
foreach($mlist as $val) foreach($mlist as $val)
{ {
...@@ -1109,9 +1110,9 @@ function itemmix($mlist, $itemselect=-1) { ...@@ -1109,9 +1110,9 @@ function itemmix($mlist, $itemselect=-1) {
$mixinfo = get_mixinfo(); $mixinfo = get_mixinfo();
//if(!empty($vn_mixinfo)) $mixinfo = array_merge($mixinfo,$vn_mixinfo); //if(!empty($vn_mixinfo)) $mixinfo = array_merge($mixinfo,$vn_mixinfo);
foreach($mixinfo as $minfo) { foreach($mixinfo as $minfo) {
if(!array_diff($mixitem,$minfo['stuff']) && !array_diff($minfo['stuff'],$mixitem) && count($mixitem) == count($minfo['stuff'])){ if(!array_diff($mixitem,$minfo['stuff']) && !array_diff($minfo['stuff'],$mixitem) && count($mixitem) == count($minfo['stuff'])){
$mixflag = true; $mixflag = true;
break; break;
} }
} }
...@@ -1120,7 +1121,7 @@ function itemmix($mlist, $itemselect=-1) { ...@@ -1120,7 +1121,7 @@ function itemmix($mlist, $itemselect=-1) {
$itmstr .= $val.' '; $itmstr .= $val.' ';
} }
$itmstr = substr($itmstr,0,-1); $itmstr = substr($itmstr,0,-1);
if(!$mixflag || $club == 20) { if(!$mixflag || $club == 20) {
//Added an additional check here so even Club20 somehow entered itemmix, nothing can be made. //Added an additional check here so even Club20 somehow entered itemmix, nothing can be made.
$log .= "<span class=\"yellow\">$itmstr</span>不能合成!<br>"; $log .= "<span class=\"yellow\">$itmstr</span>不能合成!<br>";
...@@ -1143,11 +1144,11 @@ function itemmix($mlist, $itemselect=-1) { ...@@ -1143,11 +1144,11 @@ function itemmix($mlist, $itemselect=-1) {
elseif((strpos($itmk0,'H') === 0)&&($club == 16)&&($itms0 !== $nosta)){ $itms0 = ceil($itms0*2); } elseif((strpos($itmk0,'H') === 0)&&($club == 16)&&($itms0 !== $nosta)){ $itms0 = ceil($itms0*2); }
elseif(($itmk0 == 'EE' || $itmk0 == 'ER') && ($club == 7)){ $itme0 *= 5; } elseif(($itmk0 == 'EE' || $itmk0 == 'ER') && ($club == 7)){ $itme0 *= 5; }
//elseif(($itm0 == '移动PC' || $itm0 == '广域生命探测器') && ($club == 7)){ $itme0 *= 3; } //elseif(($itm0 == '移动PC' || $itm0 == '广域生命探测器') && ($club == 7)){ $itme0 *= 3; }
//检查成就 //检查成就
include_once GAME_ROOT.'./include/game/achievement.func.php'; include_once GAME_ROOT.'./include/game/achievement.func.php';
check_mixitem_achievement_rev($name,$itm0); check_mixitem_achievement_rev($name,$itm0);
itemget(); itemget();
} }
return; return;
...@@ -1231,7 +1232,7 @@ function itemmove($from,$to){ ...@@ -1231,7 +1232,7 @@ function itemmove($from,$to){
$tpara = $fpara; $tpara = $fpara;
$f = $fk = $fsk = $fpara = ''; $f = $fk = $fsk = $fpara = '';
$fe = $fs = 0; $fe = $fs = 0;
}else { }else {
$log .= "将<span class=\"yellow\">{$f}</span>与<span class=\"yellow\">{$t}</span>互换了位置。<br>"; $log .= "将<span class=\"yellow\">{$f}</span>与<span class=\"yellow\">{$t}</span>互换了位置。<br>";
$temp = $t; $temp = $t;
...@@ -1252,13 +1253,13 @@ function itemmove($from,$to){ ...@@ -1252,13 +1253,13 @@ function itemmove($from,$to){
$fs = $temps; $fs = $temps;
$fsk = $tempsk; $fsk = $tempsk;
$fpara = $temppara; $fpara = $temppara;
} }
return; return;
} }
function itembuy($item,$shop,$bnum=1,&$data=NULL) function itembuy($item,$shop,$bnum=1,&$data=NULL)
{ {
global $log,$mode,$now,$areanum,$areaadd,$shops; global $log,$mode,$now,$areanum,$areaadd,$shops;
global $db,$tablepre; global $db,$tablepre;
...@@ -1338,7 +1339,7 @@ function itembuy($item,$shop,$bnum=1,&$data=NULL) ...@@ -1338,7 +1339,7 @@ function itembuy($item,$shop,$bnum=1,&$data=NULL)
$itmsk0 = $iteminfo['itmsk']; $itmsk0 = $iteminfo['itmsk'];
$itmpara0 = $iteminfo['itmpara']; $itmpara0 = $iteminfo['itmpara'];
itemget($data); itemget($data);
return; return;
} }
...@@ -1380,7 +1381,7 @@ function getcorpse($item,&$data=NULL) ...@@ -1380,7 +1381,7 @@ function getcorpse($item,&$data=NULL)
} }
//$edata = $db->fetch_array($result); //$edata = $db->fetch_array($result);
if($edata['hp']>0) { if($edata['hp']>0) {
$log .= '对方尚未死亡!<br>'; $log .= '对方尚未死亡!<br>';
$action = ''; $bid = 0; $action = ''; $bid = 0;
...@@ -1454,7 +1455,7 @@ function getcorpse($item,&$data=NULL) ...@@ -1454,7 +1455,7 @@ function getcorpse($item,&$data=NULL)
$mode = 'command'; $mode = 'command';
return; return;
} }
if($item == 'pickpocket') if($item == 'pickpocket')
{ {
//用视野保存一下,可以吗? //用视野保存一下,可以吗?
...@@ -1473,7 +1474,7 @@ function getcorpse($item,&$data=NULL) ...@@ -1473,7 +1474,7 @@ function getcorpse($item,&$data=NULL)
$mode = 'command'; $mode = 'command';
return; return;
} }
if($item == 'wep' || $item == 'wep2') { if($item == 'wep' || $item == 'wep2') {
$itm0 = $edata[$item]; $itm0 = $edata[$item];
$itmk0 = $edata[$item.'k']; $itmk0 = $edata[$item.'k'];
...@@ -1482,7 +1483,7 @@ function getcorpse($item,&$data=NULL) ...@@ -1482,7 +1483,7 @@ function getcorpse($item,&$data=NULL)
$itmsk0 = $edata[$item.'sk']; $itmsk0 = $edata[$item.'sk'];
$itmpara0 = $edata[$item.'para']; $itmpara0 = $edata[$item.'para'];
$edata[$item] = $edata[$item.'k'] = $edata[$item.'sk'] = $edata[$item.'para'] = ''; $edata[$item] = $edata[$item.'k'] = $edata[$item.'sk'] = $edata[$item.'para'] = '';
$edata[$item.'e'] = $edata[$item.'s'] = 0; $edata[$item.'e'] = $edata[$item.'s'] = 0;
} elseif(strpos($item,'ar') === 0) { } elseif(strpos($item,'ar') === 0) {
$itm0 = $edata[$item]; $itm0 = $edata[$item];
$itmk0 = $edata[$item.'k']; $itmk0 = $edata[$item.'k'];
...@@ -1491,7 +1492,7 @@ function getcorpse($item,&$data=NULL) ...@@ -1491,7 +1492,7 @@ function getcorpse($item,&$data=NULL)
$itmsk0 = $edata[$item.'sk']; $itmsk0 = $edata[$item.'sk'];
$itmpara0 = $edata[$item.'para']; $itmpara0 = $edata[$item.'para'];
$edata[$item] = $edata[$item.'k'] = $edata[$item.'sk'] = $edata[$item.'para'] = ''; $edata[$item] = $edata[$item.'k'] = $edata[$item.'sk'] = $edata[$item.'para'] = '';
$edata[$item.'e'] = $edata[$item.'s'] = 0; $edata[$item.'e'] = $edata[$item.'s'] = 0;
} elseif(strpos($item,'itm') === 0) { } elseif(strpos($item,'itm') === 0) {
$itmn = substr($item,3,1); $itmn = substr($item,3,1);
$itm0 = $edata['itm'.$itmn]; $itm0 = $edata['itm'.$itmn];
...@@ -1501,7 +1502,7 @@ function getcorpse($item,&$data=NULL) ...@@ -1501,7 +1502,7 @@ function getcorpse($item,&$data=NULL)
$itmsk0 = $edata['itmsk'.$itmn]; $itmsk0 = $edata['itmsk'.$itmn];
$itmpara0 = $edata['itmpara'.$itmn]; $itmpara0 = $edata['itmpara'.$itmn];
$edata['itm'.$itmn] = $edata['itmk'.$itmn] = $edata['itmsk'.$itmn] = $edata['itmpara'.$itmn] = ''; $edata['itm'.$itmn] = $edata['itmk'.$itmn] = $edata['itmsk'.$itmn] = $edata['itmpara'.$itmn] = '';
$edata['itme'.$itmn] = $edata['itms'.$itmn] = 0; $edata['itme'.$itmn] = $edata['itms'.$itmn] = 0;
} elseif($item == 'money') { } elseif($item == 'money') {
$money += $edata['money']; $money += $edata['money'];
$log .= '获得了金钱 <span class="yellow">'.$edata['money'].'</span>。<br>'; $log .= '获得了金钱 <span class="yellow">'.$edata['money'].'</span>。<br>';
...@@ -1568,16 +1569,16 @@ function change_subwep($s=2,&$data=NULL) ...@@ -1568,16 +1569,16 @@ function change_subwep($s=2,&$data=NULL)
$no_swepflag = 1; $no_swepflag = 1;
} }
${$seqp} = ${$eqp}; ${$eqp} = $swep; ${$seqp} = ${$eqp}; ${$eqp} = $swep;
${$seqpk} = ${$eqp.'k'}; ${$eqp.'k'} = $swepk; ${$seqpk} = ${$eqp.'k'}; ${$eqp.'k'} = $swepk;
${$seqpe} = ${$eqp.'e'}; ${$eqp.'e'} = $swepe; ${$seqpe} = ${$eqp.'e'}; ${$eqp.'e'} = $swepe;
${$seqps} = ${$eqp.'s'}; ${$eqp.'s'} = $sweps; ${$seqps} = ${$eqp.'s'}; ${$eqp.'s'} = $sweps;
${$seqpsk} = ${$eqp.'sk'}; ${$eqp.'sk'} = $swepsk; ${$seqpsk} = ${$eqp.'sk'}; ${$eqp.'sk'} = $swepsk;
${$seqpara} = ${$eqp.'para'}; ${$eqp.'para'} = $sweppara; ${$seqpara} = ${$eqp.'para'}; ${$eqp.'para'} = $sweppara;
$sweplog = ''; $sweplog = '';
if(!$no_wepflag) $sweplog.="收起了<span class='yellow'>{$wep2}</span>"; if(!$no_wepflag) $sweplog.="收起了<span class='yellow'>{$wep2}</span>";
if(!$no_swepflag) if(!$no_swepflag)
{ {
if(!empty($sweplog)) $sweplog .= ','; if(!empty($sweplog)) $sweplog .= ',';
$sweplog .="拿出了<span class='yellow'>{$wep}</span>"; $sweplog .="拿出了<span class='yellow'>{$wep}</span>";
...@@ -1593,7 +1594,7 @@ function change_subwep($s=2,&$data=NULL) ...@@ -1593,7 +1594,7 @@ function change_subwep($s=2,&$data=NULL)
function destory_single_equip(&$pa,$equip) function destory_single_equip(&$pa,$equip)
{ {
global $log; global $log;
$equip_list = get_equip_list(); $equip_list = get_equip_list();
if(in_array($equip,$equip_list)) if(in_array($equip,$equip_list))
...@@ -1602,7 +1603,7 @@ function destory_single_equip(&$pa,$equip) ...@@ -1602,7 +1603,7 @@ function destory_single_equip(&$pa,$equip)
$pa[$equip.'e'] = $pa[$equip.'s'] = 0; $pa[$equip.'e'] = $pa[$equip.'s'] = 0;
reload_equip_items($pa); reload_equip_items($pa);
} }
else else
{ {
$log .= "传入了非法的道具位名。"; $log .= "传入了非法的道具位名。";
return; return;
...@@ -1626,7 +1627,7 @@ function destory_single_item(&$pa,$i,$costlog=0) ...@@ -1626,7 +1627,7 @@ function destory_single_item(&$pa,$i,$costlog=0)
$pa['itm'.$i] = $pa['itmk'.$i] = $pa['itmsk'.$i] = $pa['itmpara'.$i] = ''; $pa['itm'.$i] = $pa['itmk'.$i] = $pa['itmsk'.$i] = $pa['itmpara'.$i] = '';
$pa['itme'.$i] = $pa['itms'.$i] = 0; $pa['itme'.$i] = $pa['itms'.$i] = 0;
} }
else else
{ {
$log .= "传入了非法的道具位名。"; $log .= "传入了非法的道具位名。";
return; return;
...@@ -1692,7 +1693,7 @@ function reload_set_items(&$pa) ...@@ -1692,7 +1693,7 @@ function reload_set_items(&$pa)
{ {
if(check_skill_unlock('inf_cursed',$pa)) getclubskill('inf_cursed',$pa['clbpara']); if(check_skill_unlock('inf_cursed',$pa)) getclubskill('inf_cursed',$pa['clbpara']);
} }
else else
{ {
if(!check_skill_unlock('inf_cursed',$pa)) lostclubskill('inf_cursed',$pa['clbpara']); if(!check_skill_unlock('inf_cursed',$pa)) lostclubskill('inf_cursed',$pa['clbpara']);
} }
...@@ -1742,7 +1743,7 @@ function check_item_edit_event($pa,&$pd,$event) ...@@ -1742,7 +1743,7 @@ function check_item_edit_event($pa,&$pd,$event)
$flag = 0; $flag = 0;
# 「渗透」效果判定 # 「渗透」效果判定
if($event == 'c8_infilt') if($event == 'c8_infilt')
{ {
for($i=0;$i<=6;$i++) for($i=0;$i<=6;$i++)
{ {
if(!empty($pd['itms'.$i])) if(!empty($pd['itms'.$i]))
...@@ -1762,13 +1763,13 @@ function check_item_edit_event($pa,&$pd,$event) ...@@ -1762,13 +1763,13 @@ function check_item_edit_event($pa,&$pd,$event)
//偷懒,尝试12次添加诅咒属性 //偷懒,尝试12次添加诅咒属性
for($i=1;$i<=12;$i++) for($i=1;$i<=12;$i++)
{ {
$curse_id = rand(1,12); $curse_id = rand(1,12);
//1-6表示背包道具 //1-6表示背包道具
if($curse_id <= 6) if($curse_id <= 6)
{ {
if(!empty($pd['itms'.$i]) && strpos($pd['itmsk'.$i],'V')===False) if(!empty($pd['itms'.$i]) && strpos($pd['itmsk'.$i],'V')===False)
{ {
$pd['itmsk'.$i] .= 'V'; $pd['itmsk'.$i] .= 'V';
$flag = 1; $flag = 1;
} }
...@@ -1778,10 +1779,10 @@ function check_item_edit_event($pa,&$pd,$event) ...@@ -1778,10 +1779,10 @@ function check_item_edit_event($pa,&$pd,$event)
{ {
$curse_equipment = (Array('wep','arb','arh','ara','arf','art'))[$curse_id - 7]; $curse_equipment = (Array('wep','arb','arh','ara','arf','art'))[$curse_id - 7];
if(!empty($pd[$curse_equipment]) && strpos($pd[$curse_equipment.'sk'],'V')===False) if(!empty($pd[$curse_equipment]) && strpos($pd[$curse_equipment.'sk'],'V')===False)
{ {
$pd[$curse_equipment.'sk'] .= 'V'; $pd[$curse_equipment.'sk'] .= 'V';
$flag = 1; $flag = 1;
} }
} }
if($flag == 1) break; if($flag == 1) break;
} }
...@@ -1814,7 +1815,7 @@ function weapon_loss(&$pa,$hurtvalue,$force_imp=0,$check_sk=0) ...@@ -1814,7 +1815,7 @@ function weapon_loss(&$pa,$hurtvalue,$force_imp=0,$check_sk=0)
else $log.= "<span class='grey'>{$pa['nm']}{$pa['wep']}的攻击力上升了".abs($hurtvalue)."!……为什么啊?</span><br>"; else $log.= "<span class='grey'>{$pa['nm']}{$pa['wep']}的攻击力上升了".abs($hurtvalue)."!……为什么啊?</span><br>";
} }
} }
else else
{ {
$pa['weps'] = max(0,$pa['weps']-$hurtvalue); $pa['weps'] = max(0,$pa['weps']-$hurtvalue);
if(!$pa['type']) if(!$pa['type'])
...@@ -1830,7 +1831,7 @@ function weapon_loss(&$pa,$hurtvalue,$force_imp=0,$check_sk=0) ...@@ -1830,7 +1831,7 @@ function weapon_loss(&$pa,$hurtvalue,$force_imp=0,$check_sk=0)
} }
} }
//消耗型武器 //消耗型武器
else else
{ {
if($pa['weps'] != $nosta) if($pa['weps'] != $nosta)
{ {
...@@ -1847,8 +1848,8 @@ function weapon_loss(&$pa,$hurtvalue,$force_imp=0,$check_sk=0) ...@@ -1847,8 +1848,8 @@ function weapon_loss(&$pa,$hurtvalue,$force_imp=0,$check_sk=0)
$log .= "{$pa['nm']}的<span class=\"red\">{$pa['wep']}</span>用光了!<br>"; $log .= "{$pa['nm']}的<span class=\"red\">{$pa['wep']}</span>用光了!<br>";
$wep_loss_flag = 1; $wep_loss_flag = 1;
} }
} }
elseif($pa['wep_kind'] == 'G' || $pa['wep_kind'] == 'J') elseif($pa['wep_kind'] == 'G' || $pa['wep_kind'] == 'J')
{ {
if(!$pa['type']) if(!$pa['type'])
{ {
...@@ -1887,7 +1888,7 @@ function weapon_loss(&$pa,$hurtvalue,$force_imp=0,$check_sk=0) ...@@ -1887,7 +1888,7 @@ function weapon_loss(&$pa,$hurtvalue,$force_imp=0,$check_sk=0)
if($check_sk && !empty($pa['wepsk'])) unset_ex_from_array($pa,get_itmsk_array($pa['wepsk'])); if($check_sk && !empty($pa['wepsk'])) unset_ex_from_array($pa,get_itmsk_array($pa['wepsk']));
$pa['wep'] = '拳头'; $pa['wep_kind'] = 'N'; $pa['wepk'] = 'WN'; $pa['wep'] = '拳头'; $pa['wep_kind'] = 'N'; $pa['wepk'] = 'WN';
$pa['wepe'] = 0; $pa['weps'] = $nosta; $pa['wepsk'] = ''; $pa['wepe'] = 0; $pa['weps'] = $nosta; $pa['wepsk'] = ''; $pa['weppara'] = '';
return -1; return -1;
} }
} }
...@@ -1927,10 +1928,10 @@ function armor_hurt(&$pa,$which,$hurtvalue,$check_sk=0) ...@@ -1927,10 +1928,10 @@ function armor_hurt(&$pa,$which,$hurtvalue,$check_sk=0)
$pa[$which] = '内衣'; $pa[$which.'k'] = 'DN'; $pa[$which] = '内衣'; $pa[$which.'k'] = 'DN';
$pa[$which.'e'] = 0; $pa[$which.'s'] = $nosta; $pa[$which.'sk'] = ''; $pa[$which.'para'] = ''; $pa[$which.'e'] = 0; $pa[$which.'s'] = $nosta; $pa[$which.'sk'] = ''; $pa[$which.'para'] = '';
} }
else else
{ {
$pa[$which] = $pa[$which.'k'] = $pa[$which.'sk'] = ''; $pa[$which.'para'] = ''; $pa[$which] = $pa[$which.'k'] = $pa[$which.'sk'] = ''; $pa[$which.'para'] = '';
$pa[$which.'e'] = $pa[$which.'s'] = 0; $pa[$which.'e'] = $pa[$which.'s'] = 0;
} }
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment