当前位置: 首页>>代码示例>>PHP>>正文


PHP RestoreFleetToPlanet函数代码示例

本文整理汇总了PHP中RestoreFleetToPlanet函数的典型用法代码示例。如果您正苦于以下问题:PHP RestoreFleetToPlanet函数的具体用法?PHP RestoreFleetToPlanet怎么用?PHP RestoreFleetToPlanet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了RestoreFleetToPlanet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: missionCaseStayAlly

/**
 * MissionCaseStayAlly @todo description
 *
 * @global array $lang @see common.php
 * @param array $fleetRow @see common.php
 * @return bool true.
 */
function missionCaseStayAlly($fleetRow)
{
    global $lang;
    $readConnection = Nova::getSingleton('core/database_connection_pool')->getConnection('core_read');
    $startPlanet = $readConnection->select(array('name', 'id_owner'))->from($readConnection->getDeprecatedTable('planets'))->where('galaxy =?', $fleetRow['fleet_start_galaxy'])->where('system =?', $fleetRow['fleet_start_system'])->where('planet =?', $fleetRow['fleet_start_planet'])->query()->fetch();
    $endPlanet = $readConnection->select(array('name', 'id_owner'))->from($readConnection->getDeprecatedTable('planets'))->where('galaxy =?', $fleetRow['fleet_end_galaxy'])->where('system =?', $fleetRow['fleet_end_system'])->where('planet =?', $fleetRow['fleet_end_planet'])->query()->fetch();
    $fleetStartLink = GetStartAdressLink($fleetRow, '');
    $fleetEndLink = GetTargetAdressLink($fleetRow, '');
    if ($fleetRow['fleet_mess'] == 0) {
        if ($fleetRow['fleet_end_stay'] <= time()) {
            $readConnection->update($readConnection->getDeprecatedTable('fleets'), array('fleet_mess' => 1), array('fleet_id =?' => $fleetRow['fleet_id']));
        } else {
            if ($fleetRow['fleet_start_time'] <= time()) {
                $message = sprintf($lang['sys_tran_mess_owner'], $endPlanet['name'], $fleetEndLink, $fleetRow['fleet_resource_metal'], $lang['Metal'], $fleetRow['fleet_resource_crystal'], $lang['Crystal'], $fleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
                SendSimpleMessage($startPlanet['id_owner'], '', $fleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $message);
                $message = sprintf($lang['sys_tran_mess_user'], $startPlanet['name'], $fleetStartLink, $endPlanet['name'], $fleetEndLink, $fleetRow['fleet_resource_metal'], $lang['Metal'], $fleetRow['fleet_resource_crystal'], $lang['Crystal'], $fleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
                SendSimpleMessage($endPlanet['id_owner'], '', $fleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $message);
            }
        }
    } else {
        if ($fleetRow['fleet_end_time'] <= time()) {
            $message = sprintf($lang['sys_tran_mess_back'], $startPlanet['name'], $fleetStartLink);
            SendSimpleMessage($startPlanet['id_owner'], '', $fleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $message);
            RestoreFleetToPlanet($fleetRow, true);
            $readConnection->delete($readConnection->getDeprecatedTable('fleets'), array('fleet_id =?' => $fleetRow['fleet_id']));
        }
    }
    return true;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:36,代码来源:MissionCaseStayAlly.php

示例2: flt_mission_colonize

function flt_mission_colonize(&$mission_data)
{
    $fleet_row =& $mission_data['fleet'];
    $src_user_row =& $mission_data['src_user'];
    global $lang;
    $TargetAdress = sprintf($lang['sys_adress_planet'], $fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet']);
    $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']);
    $TheMessage = $lang['sys_colo_no_colonizer'];
    if ($fleet_array[SHIP_COLONIZER] >= 1) {
        $TheMessage = $lang['sys_colo_notfree'];
        if (!$mission_data['dst_planet'] || empty($mission_data['dst_planet'])) {
            $iPlanetCount = get_player_current_colonies($src_user_row);
            // Can we colonize more planets?
            $TheMessage = $lang['sys_colo_maxcolo'];
            if ($iPlanetCount < get_player_max_colonies($src_user_row)) {
                // Yes, we can colonize
                $TheMessage = $lang['sys_colo_badpos'];
                $NewOwnerPlanet = uni_create_planet($fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet'], $fleet_row['fleet_owner'], "{$lang['sys_colo_defaultname']} {$iPlanetCount}", false, array('user_row' => $src_user_row));
                if ($NewOwnerPlanet) {
                    $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok'];
                    msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_SPY, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
                    $fleet_array[SHIP_COLONIZER]--;
                    $fleet_row['fleet_amount']--;
                    $fleet_row['fleet_array'] = sys_unit_arr2str($fleet_array);
                    return RestoreFleetToPlanet($fleet_row, false);
                }
            }
        }
    }
    doquery("UPDATE `{{fleets}}` SET `fleet_mess` = '1' WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;");
    msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_SPY, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], "{$lang['sys_colo_arrival']}{$TargetAdress}{$TheMessage}");
    return CACHE_FLEET;
}
开发者ID:divyinfo,项目名称:SuperNova,代码行数:33,代码来源:flt_mission_colonize.php

示例3: flt_mission_relocate

function flt_mission_relocate($mission_data)
{
    $fleet_row = $mission_data['fleet'];
    $destination_planet = $mission_data['dst_planet'];
    if (!$destination_planet || !is_array($destination_planet)) {
        doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
        return CACHE_FLEET;
    }
    /*
        // flt_mission_relocate
        $TargetAdress         = sprintf ($lang['sys_adress_planet'], $fleet_row['fleet_start_galaxy'], $fleet_row['fleet_start_system'], $fleet_row['fleet_start_planet']);
        $TargetAddedGoods     = sprintf ($lang['sys_stay_mess_goods'],
                          $lang['Metal'], pretty_number($fleet_row['fleet_resource_metal']),
                          $lang['Crystal'], pretty_number($fleet_row['fleet_resource_crystal']),
                          $lang['Deuterium'], pretty_number($fleet_row['fleet_resource_deuterium']));
    
        $TargetMessage        = $lang['sys_stay_mess_back'] ."<a href=\"galaxy.php?mode=3&galaxy=". $fleet_row['fleet_start_galaxy'] ."&system=". $fleet_row['fleet_start_system'] ."\">";
        $TargetMessage       .= $TargetAdress. "</a>". $lang['sys_stay_mess_bend'] ."<br />". $TargetAddedGoods;
    
        SendSimpleMessage ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_end_time'], 5, $lang['sys_mess_qg'], $lang['sys_mess_fleetback'], $TargetMessage);
    */
    global $lang;
    $TargetUserID = $destination_planet['id_owner'];
    $TargetAdress = sprintf($lang['sys_adress_planet'], $fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet']);
    $TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($fleet_row['fleet_resource_metal']), $lang['Crystal'], pretty_number($fleet_row['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($fleet_row['fleet_resource_deuterium']));
    $TargetMessage = $lang['sys_stay_mess_start'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $fleet_row['fleet_end_galaxy'] . "&system=" . $fleet_row['fleet_end_system'] . "\">";
    $TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_end'] . "<br />" . $TargetAddedGoods;
    msg_send_simple_message($TargetUserID, '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_qg'], $lang['sys_stay_mess_stay'], $TargetMessage);
    return RestoreFleetToPlanet($fleet_row, false);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:30,代码来源:flt_mission_relocate.php

示例4: MissionCaseStay

/**
 * This file is part of XNova:Legacies
 *
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 * @see http://www.xnova-ng.org/
 *
 * Copyright (c) 2009-2010, XNova Support Team <http://www.xnova-ng.org>
 * All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *                                --> NOTICE <--
 *  This file is part of the core development branch, changing its contents will
 * make you unable to use the automatic updates manager. Please refer to the
 * documentation for further information about customizing XNova.
 *
 */
function MissionCaseStay($FleetRow)
{
    global $lang, $resource;
    if ($FleetRow['fleet_mess'] == 0) {
        if ($FleetRow['fleet_start_time'] <= time()) {
            $QryGetTargetPlanet = "SELECT * FROM {{table}} ";
            $QryGetTargetPlanet .= "WHERE ";
            $QryGetTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
            $QryGetTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
            $QryGetTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
            $QryGetTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';";
            $TargetPlanet = doquery($QryGetTargetPlanet, 'planets', true);
            $TargetUserID = $TargetPlanet['id_owner'];
            $TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
            $TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($FleetRow['fleet_resource_metal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($FleetRow['fleet_resource_deuterium']));
            $TargetMessage = $lang['sys_stay_mess_start'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $FleetRow['fleet_end_galaxy'] . "&system=" . $FleetRow['fleet_end_system'] . "\">";
            $TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_end'] . "<br />" . $TargetAddedGoods;
            SendSimpleMessage($TargetUserID, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_qg'], $lang['sys_stay_mess_stay'], $TargetMessage);
            RestoreFleetToPlanet($FleetRow, false);
            doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets');
        }
    } else {
        if ($FleetRow['fleet_end_time'] <= time()) {
            $TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_start_galaxy'], $FleetRow['fleet_start_system'], $FleetRow['fleet_start_planet']);
            $TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($FleetRow['fleet_resource_metal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($FleetRow['fleet_resource_deuterium']));
            $TargetMessage = $lang['sys_stay_mess_back'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $FleetRow['fleet_start_galaxy'] . "&system=" . $FleetRow['fleet_start_system'] . "\">";
            $TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_bend'] . "<br />" . $TargetAddedGoods;
            SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_qg'], $lang['sys_mess_fleetback'], $TargetMessage);
            RestoreFleetToPlanet($FleetRow, true);
            doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets');
        }
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:61,代码来源:MissionCaseStay.php

示例5: flt_mission_transport

/**
 * flt_mission_transport.php
 *
 * @version 2.0 return cacher result
 * @version 1
 * @copyright 2008 By Chlorel for XNova
 */
function flt_mission_transport(&$mission_data)
{
    $fleet_row =& $mission_data['fleet'];
    $source_planet =& $mission_data['src_planet'];
    $destination_planet =& $mission_data['dst_planet'];
    if (!isset($destination_planet['id']) || !$destination_planet['id_owner']) {
        // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
        flt_send_back($fleet_row);
        return CACHE_FLEET;
    }
    global $lang;
    $Message = sprintf($lang['sys_tran_mess_user'], $source_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_start_', 3, ''), $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']);
    msg_send_simple_message($fleet_row['fleet_target_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
    if ($fleet_row['fleet_target_owner'] != $fleet_row['fleet_owner']) {
        msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
    }
    /*
      $Message = sprintf( $lang['sys_tran_mess_owner'],
                  $TargetName, uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''),
                  $fleet_row['fleet_resource_metal'], $lang['Metal'],
                  $fleet_row['fleet_resource_crystal'], $lang['Crystal'],
                  $fleet_row['fleet_resource_deuterium'], $lang['Deuterium'] );
      msg_send_simple_message ( $StartOwner, '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
    */
    return RestoreFleetToPlanet($fleet_row, false, true);
}
开发者ID:divyinfo,项目名称:SuperNova,代码行数:33,代码来源:flt_mission_transport.php

示例6: flt_mission_transport

/**
 * flt_mission_transport.php
 *
 * @version 2.0 return cacher result
 * @version 1
 * @copyright 2008 By Chlorel for XNova
 */
function flt_mission_transport($mission_data)
{
    $fleet_row = $mission_data['fleet'];
    $source_planet = $mission_data['src_planet'];
    $destination_planet = $mission_data['dst_planet'];
    if (!$destination_planet || !is_array($destination_planet) || !$destination_planet['id_owner']) {
        doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
        return CACHE_FLEET;
    }
    /*
      // flt_mission_transport
      $Message = sprintf($lang['sys_tran_mess_back'], $StartName, GetStartAdressLink($fleet_row, ''));
      SendSimpleMessage($StartOwner, '', $fleet_row['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message);
    */
    global $lang;
    $StartName = $source_planet['name'];
    $StartOwner = $fleet_row['fleet_owner'];
    $TargetName = $destination_planet['name'];
    $TargetOwner = $fleet_row['fleet_target_owner'];
    $Message = sprintf($lang['sys_tran_mess_owner'], $TargetName, uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']);
    msg_send_simple_message($StartOwner, '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
    if ($TargetOwner != $StartOwner) {
        $Message = sprintf($lang['sys_tran_mess_user'], $StartName, uni_render_coordinates_href($fleet_row, 'fleet_start_', 3, ''), $TargetName, uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']);
        msg_send_simple_message($TargetOwner, '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
    }
    return RestoreFleetToPlanet($fleet_row, false, true);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:34,代码来源:flt_mission_transport.php

示例7: MissionCaseColonisation

function MissionCaseColonisation($FleetRow)
{
    global $lang, $resource;
    $iPlanetCount = mysql_result(doquery("SELECT count(*) FROM {{table}} WHERE `id_owner` = '" . $FleetRow['fleet_owner'] . "' AND `planet_type` = '1'", 'planets'), 0);
    if ($FleetRow['fleet_mess'] == 0) {
        $iGalaxyPlace = mysql_result(doquery("SELECT count(*) FROM {{table}} WHERE `galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND `system` = '" . $FleetRow['fleet_end_system'] . "' AND `planet` = '" . $FleetRow['fleet_end_planet'] . "';", 'galaxy'), 0);
        $TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
        if ($iGalaxyPlace == 0) {
            if ($iPlanetCount >= MAX_PLAYER_PLANETS) {
                $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_maxcolo'] . MAX_PLAYER_PLANETS . $lang['sys_colo_planet'];
                SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
                doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
            } else {
                $NewOwnerPlanet = CreateOnePlanetRecord($FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet'], $FleetRow['fleet_owner'], $lang['sys_colo_defaultname'], false);
                if ($NewOwnerPlanet == true) {
                    $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok'];
                    SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
                    if ($FleetRow['fleet_amount'] == 1) {
                        doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
                    } else {
                        $CurrentFleet = explode(";", $FleetRow['fleet_array']);
                        $NewFleet = "";
                        foreach ($CurrentFleet as $Item => $Group) {
                            if ($Group != '') {
                                $Class = explode(",", $Group);
                                if ($Class[0] == 208) {
                                    if ($Class[1] > 1) {
                                        $NewFleet .= $Class[0] . "," . ($Class[1] - 1) . ";";
                                    }
                                } else {
                                    if ($Class[1] != 0) {
                                        $NewFleet .= $Class[0] . "," . $Class[1] . ";";
                                    }
                                }
                            }
                        }
                        $QryUpdateFleet = "UPDATE {{table}} SET ";
                        $QryUpdateFleet .= "`fleet_array` = '" . $NewFleet . "', ";
                        $QryUpdateFleet .= "`fleet_amount` = `fleet_amount` - 1, ";
                        $QryUpdateFleet .= "`fleet_mess` = '1' ";
                        $QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';";
                        doquery($QryUpdateFleet, 'fleets');
                    }
                } else {
                    $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_badpos'];
                    SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
                    doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
                }
            }
        } else {
            $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_notfree'];
            SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
            doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
        }
    } else {
        RestoreFleetToPlanet($FleetRow, true);
        doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:59,代码来源:MissionCaseColonisation.php

示例8: MissionCaseTransport

/**
 * MissionCaseTransport.php
 *
 * @version 1
 * @copyright 2008 By Chlorel for XNova
 */
function MissionCaseTransport($FleetRow)
{
    global $lang;
    $QryStartPlanet = "SELECT * FROM {{table}} ";
    $QryStartPlanet .= "WHERE ";
    $QryStartPlanet .= "`galaxy` = '" . $FleetRow['fleet_start_galaxy'] . "' AND ";
    $QryStartPlanet .= "`system` = '" . $FleetRow['fleet_start_system'] . "' AND ";
    $QryStartPlanet .= "`planet` = '" . $FleetRow['fleet_start_planet'] . "' AND ";
    $QryStartPlanet .= "`planet_type` = '" . $FleetRow['fleet_start_type'] . "';";
    $StartPlanet = doquery($QryStartPlanet, 'planets', true);
    $StartName = $StartPlanet['name'];
    $StartOwner = $StartPlanet['id_owner'];
    $QryTargetPlanet = "SELECT * FROM {{table}} ";
    $QryTargetPlanet .= "WHERE ";
    $QryTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
    $QryTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
    $QryTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
    $QryTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';";
    $TargetPlanet = doquery($QryTargetPlanet, 'planets', true);
    $TargetName = $TargetPlanet['name'];
    $TargetOwner = $TargetPlanet['id_owner'];
    if ($FleetRow['fleet_mess'] == 0) {
        if ($FleetRow['fleet_start_time'] < time()) {
            StoreGoodsToPlanet($FleetRow, false);
            $Message = sprintf($lang['sys_tran_mess_owner'], $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium'], $FleetRow['fleet_resource_appolonium'], $lang['Appolonium']);
            SendSimpleMessage($StartOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
            if ($TargetOwner != $StartOwner) {
                $Message = sprintf($lang['sys_tran_mess_user'], $StartName, GetStartAdressLink($FleetRow, ''), $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium'], $FleetRow['fleet_resource_appolonium'], $lang['Appolonium']);
                SendSimpleMessage($TargetOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
            }
            $QryUpdateFleet = "UPDATE {{table}} SET ";
            $QryUpdateFleet .= "`fleet_resource_metal` = '0' , ";
            $QryUpdateFleet .= "`fleet_resource_crystal` = '0' , ";
            $QryUpdateFleet .= "`fleet_resource_deuterium` = '0' , ";
            $QryUpdateFleet .= "`fleet_resource_appolonium` = '0' , ";
            $QryUpdateFleet .= "`fleet_mess` = '1' ";
            $QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
            $QryUpdateFleet .= "LIMIT 1 ;";
            doquery($QryUpdateFleet, 'fleets');
        }
    } else {
        if ($FleetRow['fleet_end_time'] < time()) {
            $Message = sprintf($lang['sys_tran_mess_back'], $StartName, GetStartAdressLink($FleetRow, ''));
            SendSimpleMessage($StartOwner, '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message);
            RestoreFleetToPlanet($FleetRow, true);
            //Piratenangriff nach Zufallsprinzip
            $zufall = 0;
            $zufall = rand(1, 10);
            if ($zufall == 7) {
                Piratenangriff($FleetRow);
                $zufall = 0;
            }
            // Ende Piratenangriff
            doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
        }
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:63,代码来源:MissionCaseTransport.php

示例9: MissionCaseStayAlly

function MissionCaseStayAlly($FleetRow)
{
    global $lang;
    $QryStartPlanet = "SELECT name, id_owner FROM {{table}} ";
    $QryStartPlanet .= "WHERE ";
    $QryStartPlanet .= "`galaxy` = '" . $FleetRow['fleet_start_galaxy'] . "' AND ";
    $QryStartPlanet .= "`system` = '" . $FleetRow['fleet_start_system'] . "' AND ";
    $QryStartPlanet .= "`planet` = '" . $FleetRow['fleet_start_planet'] . "';";
    $StartPlanet = doquery($QryStartPlanet, 'planets', true);
    $StartName = $StartPlanet['name'];
    $StartOwner = $StartPlanet['id_owner'];
    $QryTargetPlanet = "SELECT name, id_owner FROM {{table}} ";
    $QryTargetPlanet .= "WHERE ";
    $QryTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
    $QryTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
    $QryTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "';";
    $TargetPlanet = doquery($QryTargetPlanet, 'planets', true);
    $TargetName = $TargetPlanet['name'];
    $TargetOwner = $TargetPlanet['id_owner'];
    switch ($FleetRow['fleet_mess']) {
        case '0':
            if ($FleetRow['fleet_start_time'] <= time()) {
                $Message = sprintf($lang['sys_tran_mess_owner'], $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
                SendSimpleMessage($StartOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
                $Message = sprintf($lang['sys_tran_mess_user'], $StartName, GetStartAdressLink($FleetRow, ''), $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
                SendSimpleMessage($TargetOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
                $QryUpdateFleet = "UPDATE {{table}} SET ";
                $QryUpdateFleet .= "`fleet_mess` = 1 ";
                $QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
                $QryUpdateFleet .= "LIMIT 1 ;";
                doquery($QryUpdateFleet, 'fleets');
            }
            break;
        case '1':
            if ($FleetRow['fleet_end_stay'] <= time()) {
                $QryUpdateFleet = "UPDATE {{table}} SET ";
                $QryUpdateFleet .= "`fleet_mess` = 2 ";
                $QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
                $QryUpdateFleet .= "LIMIT 1 ;";
                doquery($QryUpdateFleet, 'fleets');
            }
            break;
        default:
            if ($FleetRow['fleet_end_time'] < time()) {
                $Message = sprintf($lang['sys_tran_mess_back'], $StartName, GetStartAdressLink($FleetRow, ''));
                SendSimpleMessage($StartOwner, '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message);
                RestoreFleetToPlanet($FleetRow, true);
                doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
            }
            break;
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:52,代码来源:MissionCaseStayAlly.php

示例10: MissionCaseACS

/**
 * This file is under the GPL liscence, which must be included with the file under distrobution (license.txt)
 * This file was made by Anthony (MadnessRed) [http://madnessred.co.cc/]
 * This file return acs fleets as missioncaseattack will ont return attack fleets.
 * Do not edit this comment block
 */
function MissionCaseACS($FleetRow)
{
    global $phpEx, $pricelist, $lang, $resource, $CombatCaps, $game_config;
    includelang('tech');
    includelang('system');
    if ($FleetRow['fleet_mess'] == 0 && $FleetRow['fleet_start_time'] > time()) {
        //Well... acs in dealt with in misioncaseattack.php, so all we need to do is make the fleet return
        $QryUpdateFleet = "UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' LIMIT 1 ;";
        doquery($QryUpdateFleet, 'fleets');
    } elseif ($FleetRow['fleet_end_time'] <= time()) {
        RestoreFleetToPlanet($FleetRow);
        doquery('DELETE FROM {{table}} WHERE `fleet_id`=' . $FleetRow['fleet_id'], 'fleets');
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:20,代码来源:MissionCaseACS.php

示例11: flt_mission_relocate

/**
 * MissionCaseStay.php
 *
 * version 2.0 returns results for new fleet handler
 * @version 1.1
 * @copyright 2008 by Chlorel for XNova
 */
function flt_mission_relocate($mission_data)
{
    $fleet_row =& $mission_data['fleet'];
    $destination_planet =& $mission_data['dst_planet'];
    if (!$destination_planet || !is_array($destination_planet)) {
        // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
        flt_send_back($mission_data['fleet']);
        return CACHE_FLEET;
    }
    global $lang;
    $Message = sprintf($lang['sys_tran_mess_user'], $mission_data['src_planet']['name'], uni_render_coordinates_href($fleet_row, 'fleet_start_', 3, ''), $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']) . '<br />' . $lang['sys_relocate_mess_user'];
    foreach (sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) {
        $Message .= $lang['tech'][$ship_id] . ' - ' . $ship_count . '<br />';
    }
    msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_qg'], $lang['sys_stay_mess_stay'], $Message);
    return RestoreFleetToPlanet($fleet_row, false);
}
开发者ID:hayalolsam,项目名称:SuperNova,代码行数:24,代码来源:flt_mission_relocate.php

示例12: flt_mission_colonize

function flt_mission_colonize($mission_data)
{
    $fleet_row = $mission_data['fleet'];
    $src_user_row = $mission_data['src_user'];
    $destination_planet = $mission_data['dst_planet'];
    global $lang;
    $TargetAdress = sprintf($lang['sys_adress_planet'], $fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet']);
    $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']);
    $TheMessage = $lang['sys_colo_no_colonizer'];
    if ($fleet_array[SHIP_COLONIZER] >= 1) {
        $TheMessage = $lang['sys_colo_notfree'];
        if (!$destination_planet) {
            $iMaxColo = $src_user_row['colonisation_tech'] + 1;
            $iPlanetCount = doquery("SELECT count(*) as `planet_count` FROM `{{planets}}` WHERE `id_owner` = '{$fleet_row['fleet_owner']}' AND `planet_type` = '1';", '', true);
            $iPlanetCount = $iPlanetCount['planet_count'];
            // Can we colonize more planets?
            $TheMessage = $lang['sys_colo_maxcolo'];
            if ($iPlanetCount < $iMaxColo && $iPlanetCount < $GLOBALS['config']->player_max_colonies + 1) {
                // Yes, we can colonize
                $TheMessage = $lang['sys_colo_badpos'];
                $NewOwnerPlanet = uni_create_planet($fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet'], $fleet_row['fleet_owner'], "{$lang['sys_colo_defaultname']} ¹{$iPlanetCount}");
                if ($NewOwnerPlanet) {
                    $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok'];
                    msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_SPY, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
                    $fleet_array[SHIP_COLONIZER]--;
                    $fleet_row['fleet_amount']--;
                    $fleet_row['fleet_array'] = sys_unit_arr2str($fleet_array);
                    if ($fleet_row['fleet_array']) {
                        $GLOBALS['debug']->warning("Sending several type of ships with colonizer leads to resource duplication. Resource duplicate X time where X - number of ship type<br>Fleet: {$fleet_row['fleet_array']}", 'Colonization With Fleet', 304);
                    }
                    return RestoreFleetToPlanet($fleet_row, false);
                }
            }
        }
    }
    doquery("UPDATE `{{fleets}}` SET `fleet_mess` = '1' WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;");
    msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_SPY, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], "{$lang['sys_colo_arrival']}{$TargetAdress}{$TheMessage}");
    return CACHE_FLEET;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:39,代码来源:flt_mission_colonize.php

示例13: MissionCaseSave

/**
 * MissionCaseSave.php
 *
 * @version 1 By Chlorel for XNova
 */
function MissionCaseSave($FleetRow)
{
    global $lang;
    $QryStartPlanet = "SELECT * FROM {{table}} ";
    $QryStartPlanet .= "WHERE ";
    $QryStartPlanet .= "`galaxy` = '" . $FleetRow['fleet_start_galaxy'] . "' AND ";
    $QryStartPlanet .= "`system` = '" . $FleetRow['fleet_start_system'] . "' AND ";
    $QryStartPlanet .= "`planet` = '" . $FleetRow['fleet_start_planet'] . "' AND ";
    $QryStartPlanet .= "`planet_type` = '" . $FleetRow['fleet_start_type'] . "';";
    $StartPlanet = doquery($QryStartPlanet, 'planets', true);
    $StartName = $StartPlanet['name'];
    $StartOwner = $StartPlanet['id_owner'];
    $QryTargetPlanet = "SELECT * FROM {{table}} ";
    $QryTargetPlanet .= "WHERE ";
    $QryTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
    $QryTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
    $QryTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
    $QryTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';";
    $TargetPlanet = doquery($QryTargetPlanet, 'planets', true);
    $TargetName = $TargetPlanet['name'];
    $TargetOwner = $TargetPlanet['id_owner'];
    if ($FleetRow['fleet_mess'] == 0) {
        if ($FleetRow['fleet_start_time'] < time()) {
            $QryUpdateFleet = "UPDATE {{table}} SET ";
            $QryUpdateFleet .= "`fleet_mess` = '1' ";
            $QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
            $QryUpdateFleet .= "LIMIT 1 ;";
            doquery($QryUpdateFleet, 'fleets');
        }
    } else {
        if ($FleetRow['fleet_end_time'] < time()) {
            $Message = sprintf($lang['sys_save_mess_back'], $StartName, GetStartAdressLink($FleetRow, ''));
            SendSimpleMessage($StartOwner, '', $FleetRow['fleet_end_time'], 4, $lang['sys_mess_save'], $lang['sys_mess_fleetback'], $Message);
            RestoreFleetToPlanet($FleetRow, true);
            doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
        }
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:43,代码来源:MissionCaseSave.php

示例14: MissionCaseAttack


//.........这里部分代码省略.........
                SendSimpleMessage($id, '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $lang['sys_mess_attack_report'], $raport2);
            }
        }
        $user1 = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $user1stat . "';", 'users');
        while ($user1data = mysql_fetch_assoc($user1)) {
            $strtruemmermetaluser1 = $strtruemmermetal + $user1data['kbmetal'];
            $strtruemmercrystaluser1 = $strtruemmercrystal + $user1data['kbcrystal'];
            $strtruemmerappoloniumuser1 = $strtruemmerappolonium + $user1data['kbappolonium'];
            $user1lostunits = $user1lostunits + $user1data['lostunits'];
            $user1shotunits = $user1shotunits + $user1data['desunits'];
            $user1wons = $user1data['wons'];
            $user1loos = $user1data['loos'];
            $user1draws = $user1data['draws'];
        }
        $user2 = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $user2stat . "';", 'users');
        while ($user2data = mysql_fetch_assoc($user2)) {
            $strtruemmermetaluser2 = $strtruemmermetal + $user2data['kbmetal'];
            $strtruemmercrystaluser2 = $strtruemmercrystal + $user2data['kbcrystal'];
            $strtruemmerappoloniumuser2 = $strtruemmerappolonium + $user2data['kbappolonium'];
            $user2lostunits = $user2lostunits + $user2data['lostunits'];
            $user2shotunits = $user2shotunits + $user2data['desunits'];
            $user2wons = $user2data['wons'];
            $user2loos = $user2data['loos'];
            $user2draws = $user2data['draws'];
        }
        if ($result['won'] == "a") {
            $user1wons = $user1wons + 1;
            $user2loos = $user2loos + 1;
        } elseif ($result['won'] == "w") {
            $user1draws = $user1draws + 1;
            $user2draws = $user2draws + 1;
        } elseif ($result['won'] == "r") {
            $user1loos = $user1loos + 1;
            $user2wons = $user2wons + 1;
        }
        $QryUpdateuserstat = "UPDATE {{table}} SET ";
        $QryUpdateuserstat .= "`wons` = '" . $user1wons . "', ";
        $QryUpdateuserstat .= "`loos` = '" . $user1loos . "', ";
        $QryUpdateuserstat .= "`draws` = '" . $user1draws . "', ";
        $QryUpdateuserstat .= "`kbmetal` = '" . $strtruemmermetaluser1 . "', ";
        $QryUpdateuserstat .= "`kbcrystal` = '" . $strtruemmercrystaluser1 . "', ";
        $QryUpdateuserstat .= "`kbappolonium` = '" . $strtruemmerappoloniumuser1 . "', ";
        $QryUpdateuserstat .= "`lostunits` = '" . $user1lostunits . "', ";
        $QryUpdateuserstat .= "`desunits` = '" . $user1shotunits . "' ";
        $QryUpdateuserstat .= "WHERE ";
        $QryUpdateuserstat .= "`id` = '" . $FleetRow['fleet_owner'] . "';";
        doquery($QryUpdateuserstat, 'users');
        $QryUpdateuser2stat = "UPDATE {{table}} SET ";
        $QryUpdateuser2stat .= "`wons` = '" . $user2wons . "', ";
        $QryUpdateuser2stat .= "`loos` = '" . $user2loos . "', ";
        $QryUpdateuser2stat .= "`draws` = '" . $user2draws . "', ";
        $QryUpdateuser2stat .= "`kbmetal` = '" . $strtruemmermetaluser2 . "', ";
        $QryUpdateuser2stat .= "`kbcrystal` = '" . $strtruemmercrystaluser2 . "', ";
        $QryUpdateuser2stat .= "`kbappolonium` = '" . $strtruemmerappoloniumuser2 . "', ";
        $QryUpdateuser2stat .= "`lostunits` = '" . $user2lostunits . "', ";
        $QryUpdateuser2stat .= "`desunits` = '" . $user2shotunits . "' ";
        $QryUpdateuser2stat .= "WHERE ";
        $QryUpdateuser2stat .= "`id` = '" . $targetUser['id'] . "';";
        doquery($QryUpdateuser2stat, 'users');
        $CurrentUser = doquery("SELECT * FROM {{table}} WHERE id = " . $FleetRow['fleet_owner'], 'users', true);
        $CurrentUserID = $CurrentUser['id'];
        $AddPoint = $CurrentUser['xpraid'] + 1;
        $QryUpdateOfficier = "UPDATE {{table}} SET ";
        $QryUpdateOfficier .= "`xpraid` = '" . $AddPoint . "' ";
        $QryUpdateOfficier .= "WHERE id = '" . $CurrentUserID . "' ";
        $QryUpdateOfficier .= "LIMIT 1 ;";
        doquery($QryUpdateOfficier, 'users');
        $RaidsTotal = $CurrentUser['raids'] + 1;
        if ($result['won'] == "a") {
            $RaidsWin = $CurrentUser['raidswin'] + 1;
            $QryUpdateRaidsCompteur = "UPDATE {{table}} SET ";
            $QryUpdateRaidsCompteur .= "`raidswin` ='" . $RaidsWin . "', ";
            $QryUpdateRaidsCompteur .= "`raids` ='" . $RaidsTotal . "' ";
            $QryUpdateRaidsCompteur .= "WHERE id = '" . $CurrentUserID . "' ";
            $QryUpdateRaidsCompteur .= "LIMIT 1 ;";
            doquery($QryUpdateRaidsCompteur, 'users');
        } elseif ($result['won'] == "r" || $result['won'] == "w") {
            $RaidsLoose = $CurrentUser['raidsloose'] + 1;
            $QryUpdateRaidsCompteur = "UPDATE {{table}} SET ";
            $QryUpdateRaidsCompteur .= "`raidsloose` ='" . $RaidsLoose . "', ";
            $QryUpdateRaidsCompteur .= "`raids` ='" . $RaidsTotal . "' ";
            $QryUpdateRaidsCompteur .= "WHERE id = '" . $CurrentUserID . "' ";
            $QryUpdateRaidsCompteur .= "LIMIT 1 ;";
            doquery($QryUpdateRaidsCompteur, 'users');
        }
    } elseif ($FleetRow['fleet_end_time'] <= time()) {
        $Message = sprintf($lang['sys_tran_mess_angriffback'], $TargetName, GetTargetAdressLink($FleetRow, ''), pretty_number($FleetRow['fleet_resource_metal']), $lang['Metal'], pretty_number($FleetRow['fleet_resource_crystal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_deuterium']), $lang['Deuterium'], pretty_number($FleetRow['fleet_resource_appolonium']), $lang['Appolonium']);
        SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 3, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message);
        RestoreFleetToPlanet($FleetRow);
        doquery('DELETE FROM {{table}} WHERE `fleet_id`=' . $FleetRow['fleet_id'], 'fleets');
        //Piratenangriff nach Zufallsprinzip
        $zufall = 0;
        $zufall = rand(1, 10);
        if ($zufall == 7) {
            Piratenangriff($FleetRow);
            $zufall = 0;
        }
        // Ende Piratenangriff
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:MissionCaseAttack.php

示例15: MissionCaseSpy


//.........这里部分代码省略.........
                        $LS = $a[1];
                        $QryTargetGalaxy = "SELECT * FROM {{table}} WHERE ";
                        $QryTargetGalaxy .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
                        $QryTargetGalaxy .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
                        $QryTargetGalaxy .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "';";
                        $TargetGalaxy = doquery($QryTargetGalaxy, 'galaxy', true);
                        $CristalDebris = $TargetGalaxy['crystal'];
                        $SpyToolDebris = $LS * 300;
                        $MaterialsInfo = SpyTarget($TargetPlanet, 0, $lang['sys_spy_maretials']);
                        $Materials = $MaterialsInfo['String'];
                        $PlanetFleetInfo = SpyTarget($TargetPlanet, 1, $lang['sys_spy_fleet']);
                        $PlanetFleet = $Materials;
                        $PlanetFleet .= $PlanetFleetInfo['String'];
                        $PlanetDefenInfo = SpyTarget($TargetPlanet, 2, $lang['sys_spy_defenses']);
                        $PlanetDefense = $PlanetFleet;
                        $PlanetDefense .= $PlanetDefenInfo['String'];
                        $PlanetBuildInfo = SpyTarget($TargetPlanet, 3, $lang['tech'][0]);
                        $PlanetBuildings = $PlanetDefense;
                        $PlanetBuildings .= $PlanetBuildInfo['String'];
                        $TargetTechnInfo = SpyTarget($TargetUser, 4, $lang['tech'][100]);
                        $TargetTechnos = $PlanetBuildings;
                        $TargetTechnos .= $TargetTechnInfo['String'];
                        // Stehende Flotten
                        $TargetAllyInfo = SpyTarget($TargetPlanet, 5, $lang['sys_spy_stayfleets']);
                        $TargetAllyFleet = $TargetTechnos;
                        $TargetAllyFleet .= $TargetAllyInfo['String'];
                        $TargetForce = $PlanetFleetInfo['Count'] * $LS / 4;
                        if ($TargetForce > 100) {
                            $TargetForce = 100;
                        }
                        $TargetChances = rand(0, $TargetForce);
                        $SpyerChances = rand(0, 100);
                        if ($TargetChances >= $SpyerChances) {
                            $DestProba = "<font color=\"red\">" . $lang['sys_mess_spy_destroyed'] . "</font>";
                            //Wenn die Spiosonden abgeschossen wurden werden sie jetzt in der DB gelöscht.
                            doquery("DELETE FROM {{table}} WHERE `fleet_owner` = '" . $TargetUserID . "' AND  `fleet_mission`=6 AND `fleet_mission`='" . $FleetRow['fleet_id'] . "';", 'fleets');
                        } elseif ($TargetChances < $SpyerChances) {
                            $DestProba = sprintf($lang['sys_mess_spy_lostproba'], $TargetChances);
                        }
                        $AttackLink = "<center>";
                        $AttackLink .= "<a href=\"fleet.php?galaxy=" . $FleetRow['fleet_end_galaxy'] . "&system=" . $FleetRow['fleet_end_system'] . "";
                        $AttackLink .= "&planet=" . $FleetRow['fleet_end_planet'] . "&planettype=" . $FleetRow['fleet_end_type'] . "";
                        $AttackLink .= "&target_mission=1";
                        $AttackLink .= " \">" . $lang['type_mission'][1] . "";
                        $AttackLink .= "</a></center>";
                        $MessageEnd = "<center>" . $DestProba . "</center>";
                        $pT = $TargetSpyLvl + $TargetEspia - ($CurrentSpyLvl + $CurrentEspia);
                        $pW = $CurrentSpyLvl + $CurrentEspia - ($TargetSpyLvl + $TargetEspia);
                        if ($TargetSpyLvl + $TargetEspia > $CurrentSpyLvl + $CurrentEspia) {
                            $ST = $LS - pow($pT, 2);
                        }
                        if ($CurrentSpyLvl + $CurrentEspia > $TargetSpyLvl + $TargetEspia) {
                            $ST = $LS + pow($pW, 2);
                        }
                        if ($TargetSpyLvl == $CurrentSpyLvl) {
                            $ST = $CurrentSpyLvl;
                        }
                        if ($ST <= "1") {
                            $SpyMessage = $Materials . "<br />" . $AttackLink . $MessageEnd;
                        }
                        if ($ST == "2") {
                            $SpyMessage = $PlanetFleet . "<br />" . $AttackLink . $MessageEnd;
                        }
                        if ($ST == "4" or $ST == "3") {
                            $SpyMessage = $PlanetDefense . "<br />" . $AttackLink . $MessageEnd;
                        }
                        if ($ST == "5" or $ST == "6") {
                            $SpyMessage = $PlanetBuildings . "<br />" . $AttackLink . $MessageEnd;
                        }
                        if ($ST >= "7") {
                            $SpyMessage = $TargetAllyFleet . "<br />" . $AttackLink . $MessageEnd;
                        }
                        SendSimpleMessage($CurrentUserID, '', $FleetRow['fleet_start_time'], 0, $lang['sys_mess_qg'], $lang['sys_mess_spy_report'], $SpyMessage);
                        $TargetMessage = $lang['sys_mess_spy_ennemyfleet'] . " " . $CurrentPlanet['name'];
                        $TargetMessage .= "<a href=\"galaxy.php?mode=3&galaxy=" . $CurrentPlanet['galaxy'] . "&system=" . $CurrentPlanet['system'] . "\">";
                        $TargetMessage .= "[" . $CurrentPlanet['galaxy'] . ":" . $CurrentPlanet['system'] . ":" . $CurrentPlanet['planet'] . "]</a> ";
                        $TargetMessage .= $lang['sys_mess_spy_seen_at'] . " " . $TargetPlanet['name'];
                        $TargetMessage .= " [" . $TargetPlanet['galaxy'] . ":" . $TargetPlanet['system'] . ":" . $TargetPlanet['planet'] . "].";
                        SendSimpleMessage($TargetUserID, '', $FleetRow['fleet_start_time'], 0, $lang['sys_mess_spy_control'], $lang['sys_mess_spy_activity'], $TargetMessage);
                    }
                    if ($TargetChances >= $SpyerChances) {
                        $QryUpdateGalaxy = "UPDATE {{table}} SET ";
                        $QryUpdateGalaxy .= "`crystal` = `crystal` + '" . (0 + $SpyToolDebris) . "' ";
                        $QryUpdateGalaxy .= "WHERE `id_planet` = '" . $TargetPlanet['id'] . "';";
                        doquery("DELETE FROM {{table}} WHERE `fleet_id` = " . $FleetRow['fleet_id'], 'fleets');
                        doquery($QryUpdateGalaxy, 'galaxy');
                    } else {
                        doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "';", 'fleets');
                    }
                }
            } else {
                // Rueckkehr der Spiosonden
                if ($FleetRow['fleet_end_time'] <= time()) {
                    RestoreFleetToPlanet($FleetRow, true);
                    doquery("DELETE FROM {{table}} WHERE `fleet_id` = " . $FleetRow['fleet_id'], 'fleets');
                }
            }
        }
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:MissionCaseSpy.php


注:本文中的RestoreFleetToPlanet函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。