當前位置: 首頁>>代碼示例>>PHP>>正文


PHP save_gameinfo函數代碼示例

本文整理匯總了PHP中save_gameinfo函數的典型用法代碼示例。如果您正苦於以下問題:PHP save_gameinfo函數的具體用法?PHP save_gameinfo怎麽用?PHP save_gameinfo使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了save_gameinfo函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: antiAFK

function antiAFK($timelimit = 0)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'gameflow_antiafk'));
    if (empty($timelimit)) {
        $timelimit = $antiAFKertime;
    }
    $timelimit *= 60;
    $deadline = $now - $timelimit;
    $result = $db->query("SELECT * FROM {$tablepre}players WHERE type=0 AND endtime < '{$deadline}' AND hp>'0' AND state<'10'");
    while ($al = $db->fetch_array($result)) {
        $afkerlist[$al['pid']] = array('name' => $al['name'], 'pls' => $al['pls']);
    }
    if (empty($afkerlist)) {
        return;
    }
    foreach ($afkerlist as $kid => $kcontent) {
        $db->query("UPDATE {$tablepre}players SET hp='0',state='32' WHERE pid='{$kid}' AND type='0' AND hp>'0' AND state<'10'");
        if ($db->affected_rows()) {
            addnews($now, 'death32', $kcontent['name'], '', $kcontent['pls']);
            $alivenum--;
            $deathnum++;
        }
    }
    save_gameinfo();
    return;
}
開發者ID:winddramon,項目名稱:dts,代碼行數:29,代碼來源:main.php

示例2: kill

function kill(&$pa, &$pd)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    $chprocess($pa, $pd);
    eval(import_module('sys', 'logger'));
    if (in_array($pd['state'], array(20, 21, 22, 23, 24, 25, 27, 29))) {
        if (\skillbase\skill_query(58, $pd) && (int) \skillbase\skill_getvalue(58, 'r', $pd) == 0) {
            \skillbase\skill_setvalue(58, 'r', '1', $pd);
            if ($pd['state'] == 27 && !$pd['sourceless']) {
                $log .= "<span class=\"lime\">但是,由於你及時按下了BOMB鍵,你原地滿血複活了!</span><br>";
                $w_log = "<span class=\"lime\">但是,由於{$pd['name']}及時按下了BOMB鍵,其原地滿血複活了!</span><br>";
                \logger\logsave($pa['pid'], $now, $w_log, 'b');
            } else {
                //擊殺複活提示將接管player_kill_enemy進行
            }
            $pd['state'] = 0;
            $pd['hp'] = $pd['mhp'];
            $pd['skill58_flag'] = 1;
            if ($pd['type'] == 0) {
                $alivenum++;
            }
            save_gameinfo();
            addnews($now, 'revival', $pd['name']);
            //滿血複活時加成效果(這個其實是技能“新生”的內容,但直接做在一起好了)
            $pd['mhp'] += $pd['lvl'] * 2;
            $pd['hp'] += $pd['lvl'] * 2;
            $pd['def'] += $pd['lvl'] * 5;
        }
    }
}
開發者ID:DTS-China,項目名稱:dts,代碼行數:32,代碼來源:main.php

示例3: reset_game

function reset_game()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    $chprocess();
    eval(import_module('sys', 'gameflow_combo'));
    //重設連鬥判斷死亡數
    $combonum = $deathlimit;
    save_gameinfo();
}
開發者ID:Tian-hao,項目名稱:dts,代碼行數:11,代碼來源:main.php

示例4: rs_game

function rs_game($xmode = 0)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    $chprocess($xmode);
    eval(import_module('sys'));
    if ($gametype == 2 && $xmode & 2) {
        $weather = 1;
        save_gameinfo();
    }
}
開發者ID:sillycross,項目名稱:dts,代碼行數:12,代碼來源:main.php

示例5: kill

function kill(&$pa, &$pd)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    $chprocess($pa, $pd);
    eval(import_module('sys', 'logger'));
    if (in_array($pd['state'], array(20, 21, 22, 23, 24, 25, 27, 29))) {
        if (\skillbase\skill_query(427, $pd)) {
            if ($pa['type'] == 88 || $pa['type'] == 1) {
                $log .= "<span class=\"linen\">都告訴你了,對某些NPC無效……快去死吧。</span><br>";
                return;
            }
            \skillbase\skill_setvalue(427, 'r', '1', $pd);
            if ($pd['state'] == 27 && !$pd['sourceless']) {
                $log .= "<span class=\"lime\">但是,由於你及時按下了BOMB鍵,你原地滿血複活了!</span><br>";
                $w_log = "<span class=\"lime\">但是,由於{$pd['name']}及時按下了BOMB鍵,其原地滿血複活了!</span><br>";
                \logger\logsave($pa['pid'], $now, $w_log, 'b');
            } else {
                //擊殺複活提示將接管player_kill_enemy進行
            }
            $pd['state'] = 0;
            $pd['hp'] = $pd['mhp'];
            $pd['skill427_flag'] = 1;
            $deathnum--;
            if ($pd['type'] == 0) {
                $alivenum++;
            }
            save_gameinfo();
            if (\skillbase\skill_query(424, $pd)) {
                $clv = \skillbase\skill_getvalue(424, 'lvl', $pd);
                $clv = $clv - 2;
                if ($clv < 0) {
                    $clv = 0;
                }
                \skillbase\skill_setvalue(424, 'lvl', $clv, $pd);
            }
            //陷阱殺人得技能點一起放在這裏
            if ($pd['state'] == 27) {
                $pa['skillpoint'] += 2;
                if (\skillbase\skill_query(424, $pa)) {
                    $clv = \skillbase\skill_getvalue(424, 'lvl', $pa);
                    $clv++;
                    \skillbase\skill_setvalue(424, 'lvl', $clv, $pa);
                }
            }
            addnews($now, 'revival', $pd['name']);
        }
    }
}
開發者ID:hikawiier,項目名稱:dtsmod-campfire,代碼行數:50,代碼來源:main.php

示例6: duel

function duel($time = 0, $keyitm = '')
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player'));
    if ($gamestate < 30) {
        return 30;
    } elseif ($gamestate >= 50) {
        return 51;
    } else {
        $time = $time == 0 ? $now : $time;
        $gamestate = 50;
        save_gameinfo();
        addnews($time, 'duelkey', $name, $keyitm);
        addnews($time, 'duel');
        systemputchat($time, 'duel');
        return 50;
    }
}
開發者ID:Tian-hao,項目名稱:dts,代碼行數:20,代碼來源:main.php

示例7: itemuse_uee

function itemuse_uee($itmn = 0)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'logger'));
    $itm =& ${'itm' . $itmn};
    $itmk =& ${'itmk' . $itmn};
    $itme =& ${'itme' . $itmn};
    $itms =& ${'itms' . $itmn};
    $itmsk =& ${'itmsk' . $itmn};
    if (!$itms) {
        $log .= '此道具不存在,請重新選擇。<br>';
        $mode = 'command';
        return;
    }
    if (!$itme) {
        $log .= "<span class=\"yellow\">{$itm}</span>已經沒電,請尋找<span class=\"yellow\">電池</span>充電。<br>";
        $mode = 'command';
        return;
    }
    $hack_dice = rand(0, 99);
    $hack_proc = calculate_hack_proc_rate();
    if ($hack_dice < $hack_proc) {
        $hack = 1;
        $log .= '入侵禁區控製係統成功了!全部禁區都被解除了!<br>';
        \map\movehtm();
        addnews($now, 'hack', $name);
        save_gameinfo();
    } else {
        $log .= '可是,入侵禁區控製係統失敗了……<br>';
    }
    $itme--;
    $log .= "消耗了<span class=\"yellow\">{$itm}</span>的電力。<br>";
    if ($itme <= 0) {
        $log .= "<span class=\"red\">{$itm}</span>的電池耗盡了。";
    }
    post_hack_events($itmn);
    return;
}
開發者ID:winddramon,項目名稱:dts,代碼行數:40,代碼來源:main.php

示例8: kill_all_AFKer

function kill_all_AFKer($timelimit = 1)
{
    global $now, $db, $tablepre, $antiAFKertime, $alivenum, $deathnum, $antiAFKintv, $cmd_info;
    $cmd_info = '';
    if (!is_numeric($timelimit)) {
        $cmd_info .= '時間間隔錯誤!<br>';
        return;
    } elseif ($timelimit < $antiAFKintv) {
        $cmd_info .= '時間間隔太短,可能波及正常玩家。';
        return;
    }
    $cmd_info .= '將殺死: ' . $timelimit . ' 分鍾內沒有任何行動的玩家。<br>';
    $timelimit *= 60;
    $deadline = $now - $timelimit;
    $result = $db->query("SELECT * FROM {$tablepre}players WHERE type=0 AND endtime < '{$deadline}' AND hp>'0' AND state<'10'");
    while ($al = $db->fetch_array($result)) {
        $afkerlist[$al['pid']] = array('name' => $al['name'], 'pls' => $al['pls']);
    }
    if (!$afkerlist) {
        $cmd_info .= '沒有符合條件的角色。';
        return;
    }
    foreach ($afkerlist as $kid => $kcontent) {
        $db->query("UPDATE {$tablepre}players SET hp='0',state='32' WHERE pid='{$kid}' AND type='0' AND hp>'0' AND state<'10'");
        if ($db->affected_rows()) {
            adminlog('killafker', $kid);
            $cmd_info .= '角色 ' . $kcontent['name'] . ' 被殺死。<br>';
            addnews($now, 'death32', $kcontent['name'], '', $kcontent['pls']);
            $alivenum--;
            $deathnum++;
        } else {
            $cmd_info .= '無法殺死角色 ' . $kcontent['name'] . ' 。<br>';
        }
    }
    save_gameinfo();
    return;
}
開發者ID:winddramon,項目名稱:dts,代碼行數:37,代碼來源:antiAFKmng.php

示例9: enter_battlefield


//.........這裏部分代碼省略.........
        $arte = 1;
        $arts = 1;
        $artsk = 'zZ';
    } elseif ($name == '時期') {
        $art = '擊敗鬼畜級思念的紋章';
        $artk = 'A';
        $arte = 1;
        $arts = 1;
        $artsk = 'zZ';
    } elseif ($name == '槍斃的某神' || $name == '精靈們的手指舞') {
        $art = 'TDG地雷的證明';
        $artk = 'A';
        $arte = 1;
        $arts = 1;
        $artsk = 'zZ';
    }
    $state = 0;
    $bid = 0;
    $inf = $teamID = $teamPass = '';
    ///////////////////////////////////////////////////////////////
    require config('card', $gamecfg);
    if ($card == 81) {
        $arr = array('0');
        $r = rand(1, 100);
        if ($r <= 20) {
            $arr = $cardindex['S'];
        } else {
            if ($r <= 60) {
                $arr = $cardindex['A'];
            } else {
                if ($r <= 80) {
                    $arr = $cardindex['B'];
                } else {
                    $arr = $cardindex['C'];
                }
            }
        }
        $c = count($arr) - 1;
        $card = $arr[rand(0, $c)];
    }
    $cardfix = $cards[$card];
    $cardname = $carddesc[$card]['name'];
    $cardrare = $carddesc[$card]['rare'];
    ///////////////////////////////////////////////////////////////
    foreach ($cardfix as $key => $value) {
        if (substr($key, 0, 3) == "itm") {
            $tt = substr($key, -1);
            $ts = substr($key, 0, strlen($key) - 1);
            ${$ts}[$tt] = $value;
        } else {
            ${$key} = $value;
        }
    }
    ///////////////////////////////////////////////////////////////
    $db->query("INSERT INTO {$tablepre}players (name,pass,type,endtime,gd,sNo,icon,club,hp,mhp,sp,msp,att,def,pls,lvl,`exp`,money,bid,inf,rage,pose,tactic,killnum,state,wp,wk,wg,wc,wd,wf,teamID,teamPass,wep,wepk,wepe,weps,arb,arbk,arbe,arbs,arh,arhk,arhe,arhs,ara,arak,arae,aras,arf,arfk,arfe,arfs,art,artk,arte,arts,itm0,itmk0,itme0,itms0,itm1,itmk1,itme1,itms1,itm2,itmk2,itme2,itms2,itm3,itmk3,itme3,itms3,itm4,itmk4,itme4,itms4,itm5,itmk5,itme5,itms5,itm6,itmk6,itme6,itms6,wepsk,arbsk,arhsk,arask,arfsk,artsk,itmsk0,itmsk1,itmsk2,itmsk3,itmsk4,itmsk5,itmsk6,card,cardname,skillpoint) VALUES ('{$name}','{$pass}','{$type}','{$endtime}','{$gd}','{$sNo}','{$icon}','{$club}','{$hp}','{$mhp}','{$sp}','{$msp}','{$att}','{$def}','{$pls}','{$lvl}','{$exp}','{$money}','{$bid}','{$inf}','{$rage}','{$pose}','{$tactic}','{$state}','{$killnum}','{$wp}','{$wk}','{$wg}','{$wc}','{$wd}','{$wf}','{$teamID}','{$teamPass}','{$wep}','{$wepk}','{$wepe}','{$weps}','{$arb}','{$arbk}','{$arbe}','{$arbs}','{$arh}','{$arhk}','{$arhe}','{$arhs}','{$ara}','{$arak}','{$arae}','{$aras}','{$arf}','{$arfk}','{$arfe}','{$arfs}','{$art}','{$artk}','{$arte}','{$arts}','{$itm['0']}','{$itmk['0']}','{$itme['0']}','{$itms['0']}','{$itm['1']}','{$itmk['1']}','{$itme['1']}','{$itms['1']}','{$itm['2']}','{$itmk['2']}','{$itme['2']}','{$itms['2']}','{$itm['3']}','{$itmk['3']}','{$itme['3']}','{$itms['3']}','{$itm['4']}','{$itmk['4']}','{$itme['4']}','{$itms['4']}','{$itm['5']}','{$itmk['5']}','{$itme['5']}','{$itms['5']}','{$itm['6']}','{$itmk['6']}','{$itme['6']}','{$itms['6']}','{$wepsk}','{$arbsk}','{$arhsk}','{$arask}','{$arfsk}','{$artsk}','{$itmsk['0']}','{$itmsk['1']}','{$itmsk['2']}','{$itmsk['3']}','{$itmsk['4']}','{$itmsk['5']}','{$itmsk['6']}','{$card}','{$cardname}','{$skillpoint}')");
    $db->query("UPDATE {$gtablepre}users SET lastgame='{$gamenum}' WHERE username='{$name}'");
    ///////////////////////////////////////////////////////////////
    $pp = \player\fetch_playerdata($name);
    //為了靈活性,直接處理所有技能,在固定稱號的時候記得要寫入skills不然進遊戲就沒技能了
    //if (isset($cardfix['club'])){
    //	\clubbase\club_acquire($cardfix['club'],$pp);
    //}
    if (is_array($cardfix['skills'])) {
        foreach ($cardfix['skills'] as $key => $value) {
            if (defined('MOD_SKILL' . $key)) {
                \skillbase\skill_acquire($key, $pp);
                if ($value > 0) {
                    \skillbase\skill_setvalue($key, 'lvl', $value, $pp);
                }
            }
        }
    }
    \player\player_save($pp);
    ///////////////////////////////////////////////////////////////
    if ($cardrare == "S") {
        $rarecolor = "orange";
    } else {
        if ($cardrare == 'A') {
            $rarecolor = "linen";
        } else {
            if ($cardrare == 'B') {
                $rarecolor = "brickred";
            } else {
                if ($cardrare == 'C') {
                    $rarecolor = "seagreen";
                }
            }
        }
    }
    if ($udata['groupid'] >= 6 || $cuser == $gamefounder) {
        addnews($now, 'newgm', "<span class=\"" . $rarecolor . "\">" . $cardname . '</span> ' . $name, "{$sexinfo[$gd]}{$sNo}號", $ip);
    } else {
        addnews($now, 'newpc', "<span class=\"" . $rarecolor . "\">" . $cardname . '</span> ' . $name, "{$sexinfo[$gd]}{$sNo}號", $ip);
    }
    if ($validnum >= $validlimit && $gamestate == 20) {
        $gamestate = 30;
    }
    //$gamestate = $validnum < $validlimit ? 20 : 30;
    save_gameinfo();
}
開發者ID:winddramon,項目名稱:dts,代碼行數:101,代碼來源:valid.func.php

示例10: wthchange

function wthchange($itm, $itmsk)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'map', 'player', 'logger', 'weather'));
    if ($weather >= 14 && $weather <= 16) {
        addnews($now, 'wthfail', $name, $weather, $itm);
        $log .= "你使用了{$itm}。<br /><span class=\"red\">但是惡劣的天氣並未發生任何變化!</span><br />";
    } else {
        if ($itmsk == 99) {
            $weather = rand(0, 13);
        } elseif ($itmsk == 98) {
            $weather = rand(10, 13);
        } elseif ($itmsk == 97) {
            $weather = rand(0, 9);
        } elseif ($itmsk == 96) {
            $weather = rand(8, 9);
        } elseif (!empty($itmsk) && is_numeric($itmsk)) {
            if ($itmsk >= 0 && $itmsk < count($wthinfo)) {
                $weather = $itmsk;
            } else {
                $weather = 0;
            }
        } else {
            $weather = 0;
        }
        save_gameinfo();
        addnews($now, 'wthchange', $name, $weather, $itm);
        $log .= "你使用了{$itm}。<br />天氣突然轉變成了<span class=\"red\">{$wthinfo[$weather]}</span>!<br />";
    }
    return;
}
開發者ID:winddramon,項目名稱:dts,代碼行數:33,代碼來源:main.php

示例11: gamesysctl_cwth

function gamesysctl_cwth($wth)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'weather', 'logger', 'itemmain', 'player'));
    if ($wth == $weather) {
        $log .= "當你提交了操作後,一個大大error出現在了畫麵上,雖然你是一個不講鷹語的愛國者,但是“錯誤”這個單詞你還是認識的。<br><span class='yellow'>畫麵下方的錯誤原因中寫著:當前天氣已為{$wthinfo[$wth]},不需要再次修改。</span><br>";
    } elseif (!isset($wthinfo[$wth])) {
        $log .= "當你提交了操作後,一個大大error出現在了畫麵上,雖然你是一個不講鷹語的愛國者,但是“錯誤”這個單詞你還是認識的。<br><span class='yellow'>畫麵下方的錯誤原因中寫著:提交的天氣數據錯誤,請重新確認。</span><br>";
    } else {
        $log .= "當你提交了操作後,控製麵板上的數據開始飛速刷新,你不由得分了下神。當你再次抬起頭時,窗外的天氣已經變成了<span class='yellow'>{$wthinfo[$wth]}</span>!<br>但等你再看向控製台時,它已經因為<span class='red'>能源不足</span>自動休眠了……這能量核心是山寨的吧!?<br>";
        $weather = $wth;
        save_gameinfo();
        addnews($now, 'gsc_cwth', $name, $wth);
        foreach (array(1, 2, 3, 4, 5, 6) as $i) {
            if (${'itm' . $i} == '能量核心' && ${'itms' . $i} > 0) {
                $core['itme'] =& ${'itme' . $i};
                $core['itms'] =& ${'itms' . $i};
                $core['itm'] =& ${'itm' . $i};
                $core['itmk'] =& ${'itmk' . $i};
                $core['itmsk'] =& ${'itmsk' . $i};
                \itemmain\itms_reduce($core);
                break;
            }
        }
    }
}
開發者ID:hikawiier,項目名稱:dtsmod-campfire,代碼行數:28,代碼來源:main.php

示例12: hack

function hack($itmn = 0)
{
    global $log, $hack, $hack_obbs, $club, $now, $name, $alivenum, $deathnum, $hp, $state, $nick;
    global ${'itm' . $itmn}, ${'itmk' . $itmn}, ${'itme' . $itmn}, ${'itms' . $itmn}, ${'itmsk' . $itmn};
    $itm =& ${'itm' . $itmn};
    $itmk =& ${'itmk' . $itmn};
    $itme =& ${'itme' . $itmn};
    $itms =& ${'itms' . $itmn};
    $itmsk =& ${'itmsk' . $itmn};
    if (!$itms) {
        $log .= '此道具不存在,請重新選擇。<br>';
        $mode = 'command';
        return;
    }
    if (!$itme) {
        $log .= "<span class=\"yellow\">{$itm}</span>已經沒電,請尋找<span class=\"yellow\">電池</span>充電。<br>";
        $mode = 'command';
        return;
    }
    $hack_dice = rand(0, 99);
    if ($hack_dice < $hack_obbs || $club == 7 && $hack_dice < 95) {
        $hack = 1;
        $log .= '入侵禁區控製係統成功了!全部禁區都被解除了!<br>';
        include_once GAME_ROOT . './include/system.func.php';
        movehtm();
        addnews($now, 'hack', $nick . ' ' . $name);
        storyputchat($now, 'hack');
        save_gameinfo();
    } else {
        $log .= '可是,入侵禁區控製係統失敗了……<br>';
    }
    if ($club == 7) {
        $e_dice = rand(0, 1);
        if ($e_dice == 1) {
            $itme--;
            $log .= "消耗了<span class=\"yellow\">{$itm}</span>的電力。<br>";
        } else {
            $log .= "由於操作迅速,<span class=\"yellow\">{$itm}</span>的電力沒有消耗。<br>";
        }
    } else {
        $itme--;
        $log .= "消耗了<span class=\"yellow\">{$itm}</span>的電力。<br>";
    }
    $hack_dice2 = rand(0, 99);
    if ($hack_dice2 < 5 && $club != 7) {
        $log .= '由於你的不當操作,禁區係統防火牆鎖定了你的電腦並遠程引爆了它。幸好你本人的位置並沒有被發現。<br>';
        $itm = $itmk = $itmsk = '';
        $itme = $itms = 0;
    } elseif ($hack_dice2 < 8 && $club != 7) {
        $log .= "<span class=\"evergreen\">“小心隔牆有耳哦。”</span>——林無月<br>";
        include_once GAME_ROOT . './include/state.func.php';
        $log .= '你擅自入侵禁區控製係統,被控製係統遠程消滅!<br>';
        death('hack');
    } elseif ($itme <= 0) {
        $log .= "<span class=\"red\">{$itm}</span>的電池耗盡了。";
    }
    return;
}
開發者ID:jiangtiandao,項目名稱:phpdts,代碼行數:58,代碼來源:item2.func.php

示例13: kill

function kill(&$pa, &$pd)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys'));
    $pd['hp'] = 0;
    if (!isset($pd['sourceless']) || $pd['sourceless'] == 0) {
        $pd['bid'] = $pa['pid'];
    }
    if ($pa['pid'] != $pd['pid']) {
        $kilmsg = \player\get_player_killmsg($pa);
    } else {
        $kilmsg = '';
    }
    if ($pd['type'] == 0 && $pd['pid'] != $pa['pid']) {
        $pa['killnum']++;
    }
    deathnews($pa, $pd);
    $deathnum++;
    if ($pd['type'] == 0) {
        $alivenum--;
    }
    $pd['endtime'] = $now;
    save_gameinfo();
    return $kilmsg;
}
開發者ID:DTS-China,項目名稱:dts,代碼行數:27,代碼來源:main.php

示例14: routine

function routine()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys'));
    if (CURSCRIPT !== 'chat') {
        $plock = fopen(GAME_ROOT . './gamedata/process.lock', 'ab');
        flock($plock, LOCK_EX);
        load_gameinfo();
        updategame();
        save_gameinfo();
        fclose($plock);
    }
}
開發者ID:hikawiier,項目名稱:dtsmod-campfire,代碼行數:15,代碼來源:gamectl.php

示例15: itemuse

function itemuse(&$theitem)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'itemmain', 'logger'));
    $itm =& $theitem['itm'];
    $itmk =& $theitem['itmk'];
    $itme =& $theitem['itme'];
    $itms =& $theitem['itms'];
    $itmsk =& $theitem['itmsk'];
    if (strpos($itmk, 'Y') === 0 || strpos($itmk, 'Z') === 0) {
        if ($itm == '挑戰者之印') {
            if (in_array($gametype, $pve_ignore_mode)) {
                $log .= "你使用了{$itm},但是什麽也沒有發生(當前遊戲模式下不允許PVE)。<br>";
                return;
            }
            $log .= '你已經呼喚了幻影執行官,現在尋找並擊敗他們,<br>並且搜尋他們的ID卡吧!<br>';
            addnpc(7, 0, 1);
            addnpc(7, 1, 1);
            addnpc(7, 2, 1);
            addnews($now, 'secphase', $name);
            $itm = $itmk = $itmsk = '';
            $itme = $itms = 0;
            return;
        } elseif ($itm == '破滅之詩') {
            if (in_array($gametype, $pve_ignore_mode)) {
                $log .= "你使用了{$itm},但是什麽也沒有發生(當前遊戲模式下不允許PVE)。<br>";
                return;
            }
            $rp = 0;
            $log .= '在你唱出那單一的旋律的霎那,<br>整個虛擬世界起了翻天覆地的變化……<br>';
            addnpc(4, 0, 1);
            eval(import_module('weather'));
            $log .= '世界響應著這旋律,產生了異變……<br>';
            \weather\wthchange($itm, $itmsk);
            addnews($now, 'thiphase', $name);
            $hack = 1;
            $log .= '因為破滅之歌的作用,全部鎖定被打破了!<br>';
            \map\movehtm();
            addnews($now, 'hack2', $name);
            save_gameinfo();
            $itm = $itmk = $itmsk = '';
            $itme = $itms = 0;
            return;
        } elseif ($itm == '黑色碎片') {
            if (in_array($gametype, $pve_ignore_mode)) {
                $log .= "你使用了{$itm},但是什麽也沒有發生(當前遊戲模式下不允許PVE)。<br>";
                return;
            }
            $log .= '你已經呼喚了一個未知的存在,現在尋找並擊敗她,<br>並且搜尋她的遊戲解除鑰匙吧!<br>';
            addnews($now, 'dfphase', $name);
            addnpc(12, 0, 1);
            $itm = $itmk = $itmsk = '';
            $itme = $itms = 0;
            return;
        }
    }
    $chprocess($theitem);
}
開發者ID:hikawiier,項目名稱:dtsmod-campfire,代碼行數:60,代碼來源:main.php


注:本文中的save_gameinfo函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。