コード例 #1
0
ファイル: main.php プロジェクト: nahakyuu/dts
function act()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'logger', 'itemmain', 'itemshop', 'input'));
    if ($mode == 'command' && $command == 'special' && $sp_cmd == 'sp_shop') {
        ob_clean();
        include template(MOD_ITEMSHOP_SP_SHOP);
        $cmd = ob_get_contents();
        ob_clean();
        return;
    }
    if ($mode == 'special' && strpos($command, 'shop') === 0) {
        $shop = substr($command, 4, 2);
        shoplist($shop);
        return;
    }
    if ($mode == 'shop') {
        if (check_in_shop_area($pls)) {
            if ($command == 'menu') {
                //离开商店
                $mode = 'command';
                return;
            } else {
                if ($command == 'shop') {
                    //返回初级页面
                    ob_clean();
                    include template(MOD_ITEMSHOP_SP_SHOP);
                    $cmd = ob_get_contents();
                    ob_clean();
                    return;
                } else {
                    itembuy($command, $shoptype, $buynum);
                    return;
                }
            }
        } else {
            $log .= '<span class="yellow">你所在的地区没有商店。</span><br />';
            $mode = 'command';
            return;
        }
    }
    $chprocess();
}
コード例 #2
0
ファイル: command.php プロジェクト: jiangtiandao/phpdts
     $pose = substr($command, 4, 1);
     $log .= "基础姿态变为<span class=\"yellow\">{$poseinfo[$pose]}</span>。<br> ";
     $mode = 'command';
 } elseif (strpos($command, 'tac') === 0) {
     $tactic = substr($command, 3, 1);
     $log .= "应战策略变为<span class=\"yellow\">{$tacinfo[$tactic]}</span>。<br> ";
     $mode = 'command';
 } elseif (strpos($command, 'inf') === 0) {
     $infpos = substr($command, 3, 1);
     chginf($infpos);
 } elseif (strpos($command, 'chkp') === 0) {
     $itmn = substr($command, 4, 1);
     chkpoison($itmn);
 } elseif (strpos($command, 'shop') === 0) {
     $shop = substr($command, 4, 2);
     shoplist($shop);
 } elseif (strpos($command, 'clubsel') === 0) {
     $clubchosen = substr($command, 7, 1);
     include_once GAME_ROOT . './include/game/clubslct.func.php';
     $retval = selectclub($clubchosen);
     if ($retval == 0) {
         $log .= "称号选择成功。<br>";
     } else {
         if ($retval == 1) {
             $log .= "称号选择失败,称号一旦被选择便无法更改。<br>";
         } else {
             if ($retval == 2) {
                 $log .= "未选择称号。<br>";
             } else {
                 $log .= "称号选择非法!<br>";
             }