Exemple #1
0
function move($moveto = 99)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'map', 'logger'));
    $plsnum = sizeof($plsinfo);
    if ($moveto == 'main' || $moveto < 0 || $moveto >= $plsnum) {
        $log .= '请选择正确的移动地点。<br>';
        return;
    } elseif ($pls == $moveto) {
        $log .= '相同地点,不需要移动。<br>';
        return;
    } elseif (array_search($moveto, $arealist) <= $areanum && !$hack) {
        $log .= $plsinfo[$moveto] . '是禁区,还是离远点吧!<br>';
        return;
    }
    $movesp = calculate_move_sp_cost();
    if ($sp <= $movesp) {
        $log .= "体力不足,不能移动!<br>还是先睡会儿吧!<br>";
        return;
    }
    $sp -= $movesp;
    $log .= "你消耗<span class=\"yellow\">{$movesp}</span>点体力,移动到了{$plsinfo[$moveto]}。<br>";
    $pls = $moveto;
    move_to_area($moveto);
    return;
}
Exemple #2
0
function move($moveto = 99)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'map', 'logger'));
    $plsnum = sizeof($plsinfo) - sizeof($hidden_arealist);
    if ($moveto == 'main' || $moveto < 0 || $moveto >= $plsnum && !in_array($moveto, $hidden_arealist)) {
        $log .= '请选择正确的移动地点。<br>';
        return;
    } elseif ($pls == $moveto) {
        $log .= '相同地点,不需要移动。<br>';
        return;
    } elseif (array_search($moveto, $arealist) <= $areanum && !$hack && !in_array($moveto, $hidden_arealist)) {
        $log .= $plsinfo[$moveto] . '是禁区,还是离远点吧!<br>';
        return;
    } elseif (in_array($moveto, $hidden_arealist)) {
        $move_overlimit_flag = false;
        foreach (array_keys($h_a_group) as $hagnum) {
            if (in_array($pls, array_keys($h_a_group[$hagnum])) && in_array($moveto, array_keys($h_a_group[$hagnum]))) {
                $move_overlimit_flag = false;
            } else {
                $move_overlimit_flag = true;
            }
        }
        if ($move_overlimit_flag) {
            $log .= "地图上没有{$plsinfo[$moveto]}啊?是不是你看错了?<br>";
            return;
        }
    }
    $movesp = max(calculate_move_sp_cost(), 1);
    if ($sp <= $movesp) {
        $log .= "体力不足,不能移动!<br>还是先睡会儿吧!<br>";
        return;
    }
    $sp -= $movesp;
    $log .= "你消耗<span class=\"yellow\">{$movesp}</span>点体力,移动到了{$plsinfo[$moveto]}。<br>";
    $pls = $moveto;
    move_to_area($moveto);
    return;
}