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

Merge branch 'amarillonmc:nachster' into nachster

parents 9a705980 be5b37a2
...@@ -293,15 +293,12 @@ ...@@ -293,15 +293,12 @@
/** 获取敌方技能页面 */ /** 获取敌方技能页面 */
function getEnemySkillPage($tdata) { function getEnemySkillPage($tdata) {
global $cskills; global $cskills;
$uidata = $tdata;
$array = array(); $array = array();
foreach ($tdata['clbpara']['skill'] as $skid) { foreach ($tdata['clbpara']['skill'] as $skid) {
$cskill = $cskills[$skid]; $cskill = $cskills[$skid];
$name = $cskill['name']; $name = $cskill['name'];
$cdesc = parse_skilldesc($skid, $uidata); $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( $new_array = array(
'id' => $skid, 'id' => $skid,
'name' => $name, 'name' => $name,
...@@ -394,6 +391,27 @@ ...@@ -394,6 +391,27 @@
"max" => emix_calc_maxenum(), "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( echo (json_encode(array(
"page" => "game", "page" => "game",
/** 玩家状态 */ /** 玩家状态 */
...@@ -637,6 +655,8 @@ ...@@ -637,6 +655,8 @@
"areaNum" => $areanum, "areaNum" => $areanum,
/** 每次禁区增加数 */ /** 每次禁区增加数 */
"areaAdd" => $areaadd, "areaAdd" => $areaadd,
/** 是否解除禁区 */
"isHack" => $hack,
), ),
/** 攻击方式 */ /** 攻击方式 */
"attackType" => array( "attackType" => array(
...@@ -687,6 +707,8 @@ ...@@ -687,6 +707,8 @@
"crafting" => $club != 20, "crafting" => $club != 20,
/** 元素口袋 */ /** 元素口袋 */
"element" => $club == 20, "element" => $club == 20,
/** 控制面板 */
"control" => isset($clbpara['console']),
), ),
/** 安全箱物品 */ /** 安全箱物品 */
"depotItems" => depot_getlist($name,$type), "depotItems" => depot_getlist($name,$type),
...@@ -705,6 +727,21 @@ ...@@ -705,6 +727,21 @@
"time" => $dtime, "time" => $dtime,
"name" => (!empty($kname) && (in_array($state, Array(20, 21, 22, 23, 24, 28, 29)))) ? $kname : null, "name" => (!empty($kname) && (in_array($state, Array(20, 21, 22, 23, 24, 28, 29)))) ? $kname : null,
) : 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( "searchState" => array(
...@@ -715,7 +752,7 @@ ...@@ -715,7 +752,7 @@
"props" => $itmsk0_words != '--' ? $itmsk0_words : '', "props" => $itmsk0_words != '--' ? $itmsk0_words : '',
"quality" => $itme0, "quality" => $itme0,
"durability" => $itms0, "durability" => $itms0,
"canMerge" => preg_match('/^H|^P/',$itmk0) && $itms0 !== $nosta, "canMerge" => checkMerge(),
) : null, ) : null,
/** 发现敌人 */ /** 发现敌人 */
"findEnemy" => $tdata['nameinfo'] ? array( "findEnemy" => $tdata['nameinfo'] ? array(
......
...@@ -781,9 +781,9 @@ $jgamedata = compatible_json_encode($gamedata); ...@@ -781,9 +781,9 @@ $jgamedata = compatible_json_encode($gamedata);
//$json = new Services_JSON(); //$json = new Services_JSON();
//$jgamedata = $json->encode($gamedata); //$jgamedata = $json->encode($gamedata);
//if(!strstr($_SERVER['HTTP_REFERER'], 'php')) { //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'; include './api.php';
} else { } else {
echo $jgamedata; echo $jgamedata;
} }
......
...@@ -36,7 +36,20 @@ if($hp<=0 || $state>=10) { ...@@ -36,7 +36,20 @@ if($hp<=0 || $state>=10) {
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'] != '') {
echo json_encode(array( echo json_encode(array(
"page" => "end", "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 { } else {
include template('ending'); include template('ending');
......
...@@ -170,9 +170,9 @@ if(isset($opendialog)) ...@@ -170,9 +170,9 @@ if(isset($opendialog))
} }
//if (!strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') { //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'; include './api.php';
} else { } else {
include template('game'); include template('game');
} }
......
...@@ -58,6 +58,34 @@ if(!empty($roomact)) ...@@ -58,6 +58,34 @@ if(!empty($roomact))
else else
{ {
if (isset($_GET['is_new'])) { 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( echo json_encode(array(
// 当前回合数 // 当前回合数
"num" => $gamenum, "num" => $gamenum,
...@@ -90,6 +118,14 @@ else ...@@ -90,6 +118,14 @@ else
"deathNum" => $deathnum, "deathNum" => $deathnum,
// 当前房间号: // 当前房间号:
"roomID" => $groomid, "roomID" => $groomid,
// 最大房间数
"maxRooms" => $max_rooms,
// 是否可创建房间
"canCreateRoom" => $now_rooms < $max_rooms && !$groomid && (!empty($cuser) && !empty($cpass)),
// 房间
"rooms" => $rooms,
// 站长留言
"news" => $adminmsg,
// 用户名 // 用户名
"username" => $cuser, "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