Commit f9f83410 authored by luluxia's avatar luluxia

fix: 修复新前端接口部分问题;

去除了负面状态不必要的部分;
添加了获取攻击方式的函数;
parent 8aef64a7
...@@ -424,6 +424,29 @@ ...@@ -424,6 +424,29 @@
} }
return $sameitem; return $sameitem;
} }
/** 获取攻击方式 */
function getAttackType() {
global $pdata, $attinfo, $nosta;
$w1 = substr($pdata['wepk'], 1, 1);
$w2 = substr($pdata['wepk'], 2, 1);
if (empty($w2) || is_numeric($w2)) {
$w2 = '';
}
if (($w1 == 'G' || $w1 == 'J') && ($pdata['weps'] == $nosta)) {
$w1 = 'P';
}
$type['type1'] = array(
'id' => $w1,
'name' => $attinfo[$w1],
);
if ($w2) {
$type['type2'] = array(
'id' => $w2,
'name' => $attinfo[$w2],
);
}
return $type;
}
echo (json_encode(array( echo (json_encode(array(
"page" => "game", "page" => "game",
/** 玩家状态 */ /** 玩家状态 */
...@@ -537,7 +560,7 @@ ...@@ -537,7 +560,7 @@
/** 击杀数 */ /** 击杀数 */
"killNum" => $killnum, "killNum" => $killnum,
/** 负面状态 */ /** 负面状态 */
"debuff" => $inf ? $inf : ['无'], "debuff" => $inf,
"debuffList" => $infinfo, "debuffList" => $infinfo,
/** 装备 */ /** 装备 */
"equipment" => array( "equipment" => array(
...@@ -678,18 +701,7 @@ ...@@ -678,18 +701,7 @@
"isHack" => $hack, "isHack" => $hack,
), ),
/** 攻击方式 */ /** 攻击方式 */
"attackType" => array( "attackType" => getAttackType(),
/** 方式1 */
"type1" => array(
"id" => substr($wepk,1,1),
"name" => $attinfo[substr($wepk,1,1)],
),
/** 方式2 */
"type2" => array(
"id" => substr($wepk,2,1) ? substr($wepk,2,1) : null,
"name" => substr($wepk,2,1) ? $attinfo[substr($wepk,2,1)] : null,
),
),
/** 视野 */ /** 视野 */
"semo" => $clbpara['smeo'], "semo" => $clbpara['smeo'],
/** 合成 */ /** 合成 */
......
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