コード例 #1
0
function Admin_Expedition()
{
    global $session;
    global $db_prefix;
    global $GlobalUser;
    // Обработка POST-запроса.
    if (method() === "POST") {
    }
    ?>

<?php 
    echo AdminPanel();
    ?>

TODO: Планируется переработка параметров экспедиции.<br><br>

<?php 
    $exptab = LoadExpeditionSettings();
    print_r($exptab);
}
コード例 #2
0
function ExpeditionHold($queue, $fleet_obj, $fleet, $origin, $target)
{
    global $loca_lang;
    global $GlobalUni;
    $exptab = LoadExpeditionSettings();
    $hold_time = $fleet_obj['flight_time'] / 3600;
    loca_add("common", $GlobalUni['lang']);
    loca_add("technames", $GlobalUni['lang']);
    loca_add("expedition", $GlobalUni['lang']);
    // Событие экспедиции.
    $chance = mt_rand(0, 99);
    if ($chance < $exptab['chance_success'] + $hold_time) {
        $expcount = $target['m'];
        // счётчик посещений
        if ($expcount <= $exptab['depleted_min']) {
            $chance_depleted = 0;
        } else {
            if ($expcount <= $exptab['depleted_med']) {
                $chance_depleted = $exptab['chance_depleted_min'];
            } else {
                if ($expcount <= $exptab['depleted_max']) {
                    $chance_depleted = $exptab['chance_depleted_med'];
                } else {
                    $chance_depleted = $exptab['chance_depleted_max'];
                }
            }
        }
        $chance = mt_rand(0, 99);
        if ($chance >= $chance_depleted) {
            if ($chance >= $exptab['chance_alien']) {
                $text = Exp_BattleAliens($queue, $fleet_obj, $fleet, $origin, $target);
            } else {
                if ($chance >= $exptab['chance_pirates']) {
                    $text = Exp_BattlePirates($queue, $fleet_obj, $fleet, $origin, $target);
                } else {
                    if ($chance >= $exptab['chance_dm']) {
                        $text = Exp_DarkMatterFound($queue, $fleet_obj, $fleet, $origin, $target);
                    } else {
                        if ($chance >= $exptab['chance_lost']) {
                            $text = Exp_NothingHappens($queue, $fleet_obj, $fleet, $origin, $target);
                        } else {
                            if ($chance >= $exptab['chance_delay']) {
                                $text = Exp_DelayFleet($queue, $fleet_obj, $fleet, $origin, $target);
                            } else {
                                if ($chance >= $exptab['chance_accel']) {
                                    $text = Exp_AccelFleet($queue, $fleet_obj, $fleet, $origin, $target);
                                } else {
                                    if ($chance >= $exptab['chance_res']) {
                                        $text = Exp_ResourcesFound($queue, $fleet_obj, $fleet, $origin, $target);
                                    } else {
                                        if ($chance >= $exptab['chance_fleet']) {
                                            $text = Exp_FleetFound($queue, $fleet_obj, $fleet, $origin, $target);
                                        } else {
                                            $text = Exp_TraderFound($queue, $fleet_obj, $fleet, $origin, $target);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        } else {
            $text = Exp_NothingHappens($queue, $fleet_obj, $fleet, $origin, $target);
        }
    } else {
        $text = Exp_NothingHappens($queue, $fleet_obj, $fleet, $origin, $target);
    }
    // DEBUG
    //$text = Exp_FleetFound ($queue, $fleet_obj, $fleet, $origin, $target);
    // Обновляем счётчик посещений экспедиции на планете.
    AdjustResources(1, 0, 0, $target['planet_id'], '+');
    // Бортовой журнал, дополнение связиста
    if ($fleet[210] > 0) {
        $text .= "\n<br/>\n<br/>\n" . Logbook($expcount, $exptab);
    }
    SendMessage($fleet_obj['owner_id'], "Командование флотом", "Результат экспедиции [" . $target['g'] . ":" . $target['s'] . ":" . $target['p'] . "]", $text, 3, $queue['end']);
}