Commit 512048e9 authored by winddramon's avatar winddramon Committed by GitHub

Merge branch 'amarillonmc:nachster' into nachster

parents 9a705980 be5b37a2
......@@ -293,15 +293,12 @@
/** 获取敌方技能页面 */
function getEnemySkillPage($tdata) {
global $cskills;
$uidata = $tdata;
$array = array();
foreach ($tdata['clbpara']['skill'] as $skid) {
$cskill = $cskills[$skid];
$name = $cskill['name'];
$cdesc = parse_skilldesc($skid, $uidata);
$num_input = $cskill['num_input'];
$input = $cskill['input'];
$unlock_flag = check_skill_unlock($skid, $uidata);
$unlock_desc = parse_skilllockdesc($skid, $unlock_flag);
$new_array = array(
'id' => $skid,
'name' => $name,
......@@ -394,6 +391,27 @@
"max" => emix_calc_maxenum(),
);
}
/** 检查获取的物品是否可进行合并 */
function checkMerge() {
global $wep, $wepk, $wepe, $weps, $wepsk;
global $itm0, $itmk0, $itme0, $itms0, $itmsk0, $nosta;
$check = false;
if (preg_match('/^(WC|WD|WF|Y|B|C|TN|GB|M|V)/', $itmk0) && $itms0 !== $nosta) {
if ($wep == $itm0 && $wepk == $itmk0 && $wepe == $itme0 && $wepsk == $itmsk0) {
$check = true;
} else {
for ($i = 1; $i <= 6; $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})) {
$check = true;
}
}
}
} else if (preg_match('/^H|^P/',$itmk0) && $itms0 !== $nosta) {
$check = true;
}
return $check;
}
echo (json_encode(array(
"page" => "game",
/** 玩家状态 */
......@@ -637,6 +655,8 @@
"areaNum" => $areanum,
/** 每次禁区增加数 */
"areaAdd" => $areaadd,
/** 是否解除禁区 */
"isHack" => $hack,
),
/** 攻击方式 */
"attackType" => array(
......@@ -687,6 +707,8 @@
"crafting" => $club != 20,
/** 元素口袋 */
"element" => $club == 20,
/** 控制面板 */
"control" => isset($clbpara['console']),
),
/** 安全箱物品 */
"depotItems" => depot_getlist($name,$type),
......@@ -705,6 +727,21 @@
"time" => $dtime,
"name" => (!empty($kname) && (in_array($state, Array(20, 21, 22, 23, 24, 28, 29)))) ? $kname : null,
) : null,
/** 弹框 */
"dialog" => $clbpara['dialogue'],
/** 不可跳过弹框 */
"noSkipDialog" => $clbpara['noskip_dialogue'],
/** 游戏状态 */
"isGameOver" => $gamestate == 0,
/** 控制面板 */
"controlPanel" => array(
/** 可用信道 */
"channel" => $gamevars['api'],
/** 共计信道 */
"channelAll" => $gamevars['apis'],
/** 按钮 */
"noButton" => $clbpara['nobutton'],
)
),
/** 搜寻状态 */
"searchState" => array(
......@@ -715,7 +752,7 @@
"props" => $itmsk0_words != '--' ? $itmsk0_words : '',
"quality" => $itme0,
"durability" => $itms0,
"canMerge" => preg_match('/^H|^P/',$itmk0) && $itms0 !== $nosta,
"canMerge" => checkMerge(),
) : null,
/** 发现敌人 */
"findEnemy" => $tdata['nameinfo'] ? array(
......
......@@ -781,9 +781,9 @@ $jgamedata = compatible_json_encode($gamedata);
//$json = new Services_JSON();
//$jgamedata = $json->encode($gamedata);
//if(!strstr($_SERVER['HTTP_REFERER'], 'php')) {
if($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != ''){
if ($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
include './api.php';
} else {
} else {
echo $jgamedata;
}
......
......@@ -36,7 +36,20 @@ if($hp<=0 || $state>=10) {
if ($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
echo json_encode(array(
"page" => "end",
"title" => $stateinfo[$state],
"title" => $hp <= 0 ? $stateinfo[$state] : $gwin[$winmode],
"deadInfo" => $hp <= 0 ? array(
"avatar" => $iconImg,
"motto" => $motto,
"info" => $dinfo[$state],
"time" => $dtime,
"killer" => !empty($kname) && $state >= 10 ? $kname : null,
) : null,
"flag" => array(
"number" => $sNo,
"killNum" => $killnum,
"winner" => $winner,
"state" => $state,
)
));
} else {
include template('ending');
......
......@@ -170,9 +170,9 @@ if(isset($opendialog))
}
//if (!strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
if($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != ''){
if ($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
include './api.php';
} else {
} else {
include template('game');
}
......
......@@ -58,6 +58,34 @@ if(!empty($roomact))
else
{
if (isset($_GET['is_new'])) {
$now_rooms = !empty($roomlist) ? count($roomlist) : 0;
$rooms = array();
foreach ($roomlist as $rkey => $rinfo) {
$room = array();
$room['id'] = $rkey;
$room['status'] = $gstate[$rinfo['gamestate']];
$room['owner'] = $rinfo['groomownid'];
$room['nums'] = $rinfo['groomnums'];
$action = array();
if (!empty($cuser) && !empty($cpass)) {
if (!empty($groomid)) {
if ($groomid == $rkey) {
$action[] = '退出';
if (!empty($rinfo['groomownid']) && $rinfo['groomownid'] == $cuser) {
$action[] = '解散';
}
} else {
$action[] = '-';
}
} else {
$action[] = '加入';
}
} else {
$action[] = '-';
}
$room['action'] = $action;
$rooms[] = $room;
}
echo json_encode(array(
// 当前回合数
"num" => $gamenum,
......@@ -90,6 +118,14 @@ else
"deathNum" => $deathnum,
// 当前房间号:
"roomID" => $groomid,
// 最大房间数
"maxRooms" => $max_rooms,
// 是否可创建房间
"canCreateRoom" => $now_rooms < $max_rooms && !$groomid && (!empty($cuser) && !empty($cpass)),
// 房间
"rooms" => $rooms,
// 站长留言
"news" => $adminmsg,
// 用户名
"username" => $cuser,
));
......
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