3 define(
'CURSCRIPT',
'game');
5 require
'./include/common.inc.php';
8 require
GAME_ROOT.
'./include/game.func.php';
14 $result =
$db->query(
"SELECT * FROM {$tablepre}players WHERE name = '$cuser' AND type = 0");
16 if(!
$db->num_rows(
$result)) { header(
"Location: valid.php");exit(); }
22 $tr =
$db->query(
"SELECT `password` FROM {$tablepre}users WHERE username='$cuser'");
23 $tp =
$db->fetch_array($tr);
26 $db->query(
"UPDATE {$tablepre}players SET pass='$password' WHERE name='$cuser'");
49 $result =
$db->query(
"SELECT lid,time,log FROM {$tablepre}log WHERE toid = '$pid' AND prcsd = 0 ORDER BY time,lid");
52 $log .= date(
"H:i:s",$logtemp[
'time']).
','.$logtemp[
'log'].
'<br />';
53 $llist .= $logtemp[
'lid'].
',';
57 $db->query(
"UPDATE {$tablepre}log SET prcsd=1 WHERE toid = '$pid' AND lid IN $llist");
66 $log .=
"<span class=\"yellow b\">{$noisesec}秒前,{$plsinfo[$noisepls]}传来了{$noiseinfo[$noisemode]}。</span><br>";
69 $log .=
"<span class=\"yellow b\">{$noisemin}分钟前,{$plsinfo[$noisepls]}传来了{$noiseinfo[$noisemode]}。</span><br>";
73 if ($club==0 && !isset($clubavl))
75 include_once
GAME_ROOT.
'./include/game/clubslct.func.php';
77 $clubavl[0]=0; $clubavl[1]=$c1; $clubavl[2]=$c2; $clubavl[3]=$c3;
82 $cdover = $cdsec*1000 + $cdmsec + $cdtime;
84 $rmcdtime = $nowmtime >= $cdover ? 0 : $cdover - $nowmtime;
87 if(
$coldtimeon && $rmcdtime > 0 && (strpos($command,
'move')===0 || strpos($command,
'search')===0 || (strpos($command,
'itm')===0)&&($command !=
'itemget') || strpos($sp_cmd,
'sp_weapon')===0 || strpos($command,
'song')===0)){
88 $log .=
'<span class="yellow">冷却时间尚未结束!</span><br>';
92 if($mode !==
'combat' && $mode !==
'corpse' && strpos(
$action,
'pacorpse')===
false && $mode !==
'senditem'){
95 if($command ==
'menu') {
98 }
elseif($mode ==
'command') {
99 if($command ==
'move') {
100 include_once
GAME_ROOT.
'./include/game/search.func.php';
103 }
elseif($command ==
'search') {
104 include_once
GAME_ROOT.
'./include/game/search.func.php';
107 }
elseif(strpos($command,
'itm') === 0) {
108 include_once
GAME_ROOT.
'./include/game/item.func.php';
109 $item = substr($command,3);
112 }
elseif(strpos($command,
'rest') === 0) {
113 if($command==
'rest3' && !in_array($pls,
$hospitals)){
114 $log .=
'<span class="yellow">你所在的位置并非医院,不能静养!</span><br>';
116 $state = substr($command,4,1);
119 }
elseif($command ==
'itemmain') {
121 }
elseif($command ==
'song') {
122 $sname=trim(trim($art,
'【'),
'】');
123 include_once
GAME_ROOT.
'./include/game/song.inc.php';
126 }
elseif($command ==
'special') {
127 if($sp_cmd ==
'sp_word'){
128 include_once
GAME_ROOT.
'./include/game/special.func.php';
131 }
elseif($sp_cmd ==
'sp_adtsk'){
132 include_once
GAME_ROOT.
'./include/game/special.func.php';
135 }
elseif($sp_cmd ==
'sp_trapadtsk'){
139 foreach(Array(1,2,3,4,5,6) as $imn)
140 if(strpos(${
'itmk'.$imn},
'B')===0 && ${
'itme'.$imn} > 0 ){
146 $log .=
'<span class="red">你没有电池,无法改造陷阱!</span><br />';
152 foreach(Array(1,2,3,4,5,6) as $imn)
153 if(${
'itm'.$imn} ==
'毒药' && ${
'itmk'.$imn} ==
'Y' && ${
'itme'.$imn} > 0 ){
159 $log .=
'<span class="red">你没有毒药,无法改造陷阱!</span><br />';
165 $log .=
'<span class="red">你不懂得如何改造陷阱!</span><br />';
171 foreach(Array(1,2,3,4,5,6) as $imn)
172 if(strpos(${
'itmk'.$imn},
'T')===0 && ${
'itme'.$imn} > 0 ){
178 $log .=
'<span class="red">你的背包中没有陷阱,无法改造!</span><br />';
181 else $mode =
'sp_trapadtsk';
183 }
elseif($sp_cmd ==
'sp_trapadtskselected'){
184 if (!isset($choice) || $choice==
'menu')
190 $choice=(int)$choice;
191 if ($choice<1 || $choice>6)
192 $log.=
'<span class="red">无此物品。</span><br />';
195 include_once
GAME_ROOT.
'./include/game/special.func.php';
200 }
elseif($sp_cmd ==
'sp_pbomb'){
202 }
elseif($sp_cmd ==
'sp_weapon'){
203 include_once
GAME_ROOT.
'./include/game/special.func.php';
207 }
elseif($sp_cmd ==
'oneonone'){
209 }
elseif($sp_cmd ==
'sp_skpts'){
210 include_once
GAME_ROOT.
'./include/game/clubskills.func.php';
212 $p12[1]=1; $p12[2]=2;
218 }
elseif($command ==
'team') {
219 include_once
GAME_ROOT.
'./include/game/team.func.php';
220 if($teamcmd ==
'teamquit') {
226 }
elseif($mode ==
'item') {
227 include_once
GAME_ROOT.
'./include/game/item2.func.php';
228 $item = substr($command,3);
230 }
elseif($mode ==
'itemmain') {
231 include_once
GAME_ROOT.
'./include/game/itemmain.func.php';
232 if($command ==
'itemget') {
234 }
elseif($command ==
'itemadd') {
236 }
elseif($command ==
'itemmerge') {
239 }
elseif($command ==
'itemmove') {
241 }
elseif(strpos($command,
'drop') === 0) {
242 $drop_item = substr($command,4);
244 }
elseif(strpos($command,
'off') === 0) {
245 $off_item = substr($command,3);
248 }
elseif(strpos($command,
'swap') === 0) {
249 $swap_item = substr($command,4);
252 }
elseif($command ==
'itemmix') {
253 if (isset($itemselect) && $itemselect==999)
258 if (!isset($mixmask))
261 if(isset(${
'mitm'.$i}) && ${
'mitm'.$i} ==
$i)
267 if ($mixmask&(1<<(
$i-1)))
270 if (isset($itemselect))
275 }
elseif($mode ==
'special') {
276 include_once
GAME_ROOT.
'./include/game/special.func.php';
277 if(strpos($command,
'pose') === 0) {
278 $pose = substr($command,4,1);
279 $log .=
"基础姿态变为<span class=\"yellow\">$poseinfo[$pose]</span>。<br> ";
281 }
elseif(strpos($command,
'tac') === 0) {
282 $tactic = substr($command,3,1);
283 $log .=
"应战策略变为<span class=\"yellow\">$tacinfo[$tactic]</span>。<br> ";
285 }
elseif(strpos($command,
'inf') === 0) {
286 $infpos = substr($command,3,1);
288 }
elseif(strpos($command,
'chkp') === 0) {
289 $itmn = substr($command,4,1);
291 }
elseif(strpos($command,
'shop') === 0) {
292 $shop = substr($command,4,2);
294 }
elseif(strpos($command,
'clubsel') === 0) {
295 $clubchosen = substr($command,7,1);
296 include_once
GAME_ROOT.
'./include/game/clubslct.func.php';
301 $log.=
"称号选择失败,称号一旦被选择便无法更改。<br>";
304 else $log.=
"称号选择非法!<br>";
307 }
elseif($mode ==
'senditem') {
308 include_once
GAME_ROOT.
'./include/game/battle.func.php';
310 }
elseif($mode ==
'combat') {
311 include_once
GAME_ROOT.
'./include/game/combat.func.php';
313 }
elseif($mode ==
'rest') {
314 include_once
GAME_ROOT.
'./include/state.func.php';
322 }
elseif($mode ==
'corpse') {
323 include_once
GAME_ROOT.
'./include/game/itemmain.func.php';
325 }
elseif($mode ==
'team') {
326 include_once
GAME_ROOT.
'./include/game/team.func.php';
327 if ($command==
"teammake")
teammake($nteamID,$nteamPass);
328 if ($command==
"teamjoin")
teamjoin($nteamID,$nteamPass);
329 if ($command==
"teamquit")
teamquit($nteamID,$nteamPass);
330 }
elseif($mode ==
'shop') {
331 if(in_array($pls,
$shops)){
332 if($command ==
'shop') {
335 include_once
GAME_ROOT.
'./include/game/itemmain.func.php';
336 itembuy($command,$shoptype,$buynum);
339 $log .=
'<span class="yellow">你所在的地区没有商店。</span><br />';
342 }
elseif($mode ==
'deathnote') {
344 include_once
GAME_ROOT.
'./include/game/item2.func.php';
345 deathnote($item,$dnname,$dndeath,$dngender,$dnicon,$name);
347 $log .=
'嗯,暂时还不想杀人。<br>你合上了■DeathNote■。<br>';
350 }
elseif($mode ==
'oneonone') {
352 include_once
GAME_ROOT.
'./include/game/special.func.php';
358 }
elseif ($mode ==
'sp_skpts') {
359 include_once
GAME_ROOT.
'./include/game/clubskills.func.php';
362 $p12[1]=1; $p12[2]=2;
363 }
elseif ($mode ==
'sp_pbomb') {
364 include_once
GAME_ROOT.
'./include/game/special.func.php';
375 $cid = str_replace(
'pacorpse',
'',
$action);
377 $result =
$db->query(
"SELECT * FROM {$tablepre}players WHERE pid='$cid' AND hp=0");
380 include_once
GAME_ROOT.
'./include/game/battle.func.php';
389 $cdsec = floor($nowmtime/1000);
390 $cdmsec = fmod($nowmtime , 1000);
391 $cdtime = $cmdcdtime;
394 $rmcdtime = $cmdcdtime;
404 $gamedata[
'innerHTML'][
'notice'] = ob_get_contents();
409 $log .=
"行动冷却时间:<span id=\"timer\" class=\"yellow\">0.0</span>秒<br>";
416 $dtime = date(
"Y年m月d日H时i分s秒",
$endtime);
419 $result =
$db->query(
"SELECT name FROM {$tablepre}players WHERE pid='$bid'");
423 include
template(
'death');
424 $gamedata[
'innerHTML'][
'cmd'] = ob_get_contents();
430 include
template(
'itemfind');
431 $gamedata[
'innerHTML'][
'cmd'] = ob_get_contents();
432 }
elseif($state == 1 || $state == 2 || $state ==3) {
434 include
template(
'rest');
435 $gamedata[
'innerHTML'][
'cmd'] = ob_get_contents();
438 if($mode&&file_exists(
GAME_ROOT.TPLDIR.
'/'.$mode.
'.htm')) {
439 include
template($mode);
441 include
template(
'command');
443 $gamedata[
'innerHTML'][
'cmd'] = ob_get_contents();
446 $log .=
'游戏流程故障,请联系管理员<br>';
452 if(isset($url)){
$gamedata[
'url'] = $url;}
457 $main ? include
template(
$main) : include
template(
'profile');
463 $gamedata[
'innerHTML'][
'chattype'] =
"<select name=\"chattype\" value=\"2\"><option value=\"0\" selected>$chatinfo[0]<option value=\"1\" >$chatinfo[1]</select>";
465 $gamedata[
'innerHTML'][
'chattype'] =
"<select name=\"chattype\" value=\"2\"><option value=\"0\" selected>$chatinfo[0]</select>";
getclub($who, &$c1, &$c2, &$c3)
if(!$db->num_rows($result)) $pdata
if(!defined('IN_GAME')) use_func_item($usemode, $item)
if(PHP_VERSION< '4.3.0') $action
itemmix($mlist, $itemselect=-1)
【生存者数:<?php echo $alivenum?> 人】< input type="button"value="显示全部幸存者"onClick="$('alivemode').value='all';$('gbmode').value='none';postCmd('alive','alive.php');"></p > if($gamblingon &&$gamestate >=20) elseif($gamblingon &&$gamestate<=10)
if(!$cuser||!$cpass) $result
if(!defined('IN_GAME')) teamcheck()
if(strpos($username,'Yoshiko')!==false) if(preg_match($iplimit, $onlineip)) $password
itembuy($item, $shop, $bnum=1)
config($file= '', $cfg=1)
deathnote($itmd=0, $dnname='', $dndeath='', $dngender='m', $dnicon=1, $sfn)
gexit($message= '', $file= '', $line=0)
if(!defined( 'IN_GAME')) itemuse($itmn)
if(!defined( 'IN_GAME')) combat($active=1, $wep_kind= '')
if(!defined('IN_GAME')) getword()
compatible_json_encode($data)
if(!defined('IN_GAME')) move($moveto=99)
if(!defined('IN_GAME')) init_playerdata()