• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP floattostring函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: show

 function show()
 {
     global $CONF, $LNG, $PLANET, $USER, $db, $resource, $UNI;
     //$PlanetRess = new ResourceUpdate();
     //$PlanetRess->CalcResource();
     //$PlanetRess->SavePlanetToDB();
     $this->tplObj->loadscript('p_trader.js');
     if ($_POST) {
         //if($_SESSION['last']['user_side'] != 'game.php?page=p_trade'){
         //	$this->printMessage("Page error, err nr 5.", true, array('game.php?page=ptrade', 2));
         //	die();
         //}
         //$PlanetRess = new ResourceUpdate();
         //$PlanetRess->CalcResource();
         //$PlanetRess->SavePlanetToDb();
         /*totalPoints
         		oldMetal
         		oldCrystal
         		oldDeuterium
         		newMetal
         		newCrystal
         		newDeuterium
         		*/
         $total_points = isset($_POST['totalPoints']) ? $_POST['totalPoints'] : 0;
         $new_metal = isset($_POST['newMetal']) ? $_POST['newMetal'] : 0;
         $new_crystal = isset($_POST['newCrystal']) ? $_POST['newCrystal'] : 0;
         $new_deuterium = isset($_POST['newDeuterium']) ? $_POST['newDeuterium'] : 0;
         $userId = isset($_POST['userid']) ? $_POST['userid'] : null;
         $recalculate = $new_metal + 2 * $new_crystal + 4 * $new_deuterium;
         if ($recalculate != $total_points && $recalculate - $total_points > 2000) {
             $this->printMessage("Error with inputs.", true, array('game.php?page=PTrader', 2));
             die;
         }
         if ($new_metal < 0 || $new_crystal < 0 || $new_deuterium < 0) {
             $this->printMessage("ERROR with negative numbers.", true, array('game.php?page=PTrader', 2));
             die;
         }
         //	if($USER['antimatter'] < 250 && $USER['premium_reward_days'] < TIMESTAMP){
         //	$this->printMessage("Not enough antimatter.", true, array('game.php?page=PTrader', 2));
         //		die();
         //	}
         $PLANET['metal'] = $GLOBALS['DATABASE']->sql_escape($new_metal);
         $PLANET['crystal'] = $GLOBALS['DATABASE']->sql_escape($new_crystal);
         $PLANET['deuterium'] = $GLOBALS['DATABASE']->sql_escape($new_deuterium);
         $GLOBALS['DATABASE']->query("UPDATE " . PLANETS . " set `metal` = '" . $GLOBALS['DATABASE']->sql_escape($new_metal) . "', `crystal` = '" . $GLOBALS['DATABASE']->sql_escape($new_crystal) . "', `deuterium` = '" . $GLOBALS['DATABASE']->sql_escape($new_deuterium) . "' where `id` = '" . $PLANET['id'] . "' ;");
         if ($USER['premium_reward_days'] < TIMESTAMP) {
             //$GLOBALS['DATABASE']->query("UPDATE ".USERS." set `antimatter` = antimatter - '250' WHERE `id` = '".$USER['id']."' ;");
         }
         $this->printMessage("Exchange has been successfully made.", true, array('game.php?page=PTrader', 2));
         die;
     }
     $recalculate = $PLANET['metal'] + $PLANET['crystal'] * 2 + $PLANET['deuterium'] * 4;
     //$GLOBALS['DATABASE']->query("UPDATE ".USERS." set `ptrader_total` = '".$recalculate."' where `id` = '".$USER['id']."' ;");
     $_SESSION['total_p'] = $recalculate;
     $this->tplObj->assign_vars(array('total_points' => pretty_number(floattostring($recalculate)), 'total_points11' => floattostring($recalculate), 'planet_metal' => pretty_number($PLANET['metal']), 'planet_crystal' => pretty_number($PLANET['crystal']), 'planet_deuterium' => pretty_number($PLANET['deuterium']), 'planet_metal11' => $PLANET['metal'], 'planet_crystal11' => $PLANET['crystal'], 'planet_deuterium11' => $PLANET['deuterium'], 'planet_metal_t' => pretty_number($PLANET['metal']), 'planet_crystal_t' => pretty_number(floattostring($PLANET['crystal'] * 2)), 'planet_deuterium_t' => pretty_number(floattostring($PLANET['deuterium'] * 4))));
     $this->display('page.ptrader.default.tpl');
 }
开发者ID:Decoder1978,项目名称:Xterium,代码行数:57,代码来源:class.ShowPTraderPage.php


示例2: calculateSteal

/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <[email protected]>
 * @copyright 2009 Lucky <[email protected]> (XGProyecto)
 * @copyright 2011 Slaver <[email protected]> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function calculateSteal($attackFleets, $defenderPlanet, $ForSim = false)
{
    //Steal-Math by Slaver for 2Moons(http://www.titanspace.org) based on http://www.owiki.de/Beute
    global $pricelist, $db;
    $SortFleets = array();
    $Sumcapacity = '0';
    foreach ($attackFleets as $FleetID => $Attacker) {
        $SortFleets[$FleetID] = '0';
        foreach ($Attacker['detail'] as $Element => $amount) {
            $SortFleets[$FleetID] = bcadd($SortFleets[$FleetID], bcmul($pricelist[$Element]['capacity'], floattostring($amount)));
        }
        $SortFleets[$FleetID] = bcsub($SortFleets[$FleetID], $Attacker['fleet']['fleet_resource_metal']);
        $SortFleets[$FleetID] = bcsub($SortFleets[$FleetID], $Attacker['fleet']['fleet_resource_crystal']);
        $SortFleets[$FleetID] = bcsub($SortFleets[$FleetID], $Attacker['fleet']['fleet_resource_deuterium']);
        $SortFleets[$FleetID] = bcsub($SortFleets[$FleetID], $Attacker['fleet']['fleet_resource_norio']);
        $Sumcapacity = bcadd($Sumcapacity, $SortFleets[$FleetID]);
    }
    $AllCapacity = $Sumcapacity;
    // Step 1
    $booty['metal'] = min(bcdiv($Sumcapacity, 3), bcdiv(floattostring($defenderPlanet['metal']), 2));
    $Sumcapacity = bcsub($Sumcapacity, $booty['metal']);
    // Step 2
    $booty['crystal'] = min(bcdiv($Sumcapacity, 2), bcdiv(floattostring($defenderPlanet['crystal']), 2));
    $Sumcapacity = bcsub($Sumcapacity, $booty['crystal']);
    // Step 3
    $booty['deuterium'] = min($Sumcapacity, bcdiv(floattostring($defenderPlanet['deuterium']), 2));
    $Sumcapacity = bcsub($Sumcapacity, $booty['deuterium']);
    // Step 6
    $booty['norio'] = min(bcdiv($Sumcapacity, 2), bcdiv(floattostring($defenderPlanet['norio']), 2));
    $Sumcapacity = bcsub($Sumcapacity, $booty['norio']);
    // Step 4
    $oldMetalBooty = $booty['metal'];
    $booty['metal'] = bcadd($booty['metal'], min(bcdiv($Sumcapacity, 2), max(bcsub(bcdiv(floattostring($defenderPlanet['metal']), 2), $booty['metal']), 0)));
    $Sumcapacity = bcsub($Sumcapacity, bcsub($booty['metal'], $oldMetalBooty));
    // Step 5
    $booty['crystal'] = bcadd($booty['crystal'], min($Sumcapacity, max(bcsub(bcdiv(floattostring($defenderPlanet['crystal']), 2), $booty['crystal']), 0)));
    // Step 7
    $booty['norio'] = bcadd($booty['norio'], min($Sumcapacity, max(bcsub(bcdiv(floattostring($defenderPlanet['norio']), 2), $booty['norio']), 0)));
    if ($ForSim) {
        return $booty;
    }
    $Qry = "";
    foreach ($SortFleets as $FleetID => $Capacity) {
        $Factor = bcdiv($Capacity, $AllCapacity, 10);
        $Qry .= "UPDATE " . FLEETS . " SET ";
        $Qry .= "`fleet_resource_metal` = `fleet_resource_metal` + '" . bcmul($booty['metal'], $Factor, 0) . "', ";
        $Qry .= "`fleet_resource_crystal` = `fleet_resource_crystal` + '" . bcmul($booty['crystal'], $Factor, 0) . "', ";
        $Qry .= "`fleet_resource_deuterium` = `fleet_resource_deuterium` + '" . bcmul($booty['deuterium'], $Factor, 0) . "', ";
        $Qry .= "`fleet_resource_norio` = `fleet_resource_norio` + '" . bcmul($booty['norio'], $Factor, 0) . "' ";
        $Qry .= "WHERE fleet_id = '" . $FleetID . "';";
    }
    $db->multi_query($Qry);
    return $booty;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:70,代码来源:calculateSteal.php


示例3: calculateAKSSteal

 public static function calculateAKSSteal($attackFleets, $defenderPlanet, $ForSim = false)
 {
     //Steal-Math by Slaver for 2Moons(http://code.google.com/p/2moons/) based on http://www.owiki.de/Beute
     global $pricelist;
     $SortFleets = array();
     foreach ($attackFleets as $FleetID => $Attacker) {
         foreach ($Attacker['detail'] as $Element => $amount) {
             $SortFleets[$FleetID] += $pricelist[$Element]['capacity'] * $amount;
         }
         $SortFleets[$FleetID] -= $Attacker['fleet']['fleet_resource_metal'] - $Attacker['fleet']['fleet_resource_crystal'] - $Attacker['fleet']['fleet_resource_deuterium'];
     }
     $Sumcapacity = array_sum($SortFleets);
     // Step 1
     $booty['metal'] = min($Sumcapacity / 3, $defenderPlanet['metal'] / 2);
     $Sumcapacity -= $booty['metal'];
     // Step 2
     $booty['crystal'] = min($Sumcapacity / 2, $defenderPlanet['crystal'] / 2);
     $Sumcapacity -= $booty['crystal'];
     // Step 3
     $booty['deuterium'] = min($Sumcapacity, $defenderPlanet['deuterium'] / 2);
     $Sumcapacity -= $booty['deuterium'];
     // Step 4
     $booty['tritium'] = min($Sumcapacity, $defenderPlanet['tritium'] / 2);
     $Sumcapacity -= $booty['tritium'];
     // Step 5
     $oldMetalBooty = $booty['metal'];
     $booty['metal'] += min($Sumcapacity / 2, max($defenderPlanet['metal'] / 2 - $booty['metal'], 0));
     $Sumcapacity += $oldMetalBooty - $booty['metal'];
     // Step 6
     $booty['crystal'] += min($Sumcapacity, max($defenderPlanet['crystal'] / 2 - $booty['crystal'], 0));
     $booty['metal'] = max($booty['metal'], 0);
     $booty['crystal'] = max($booty['crystal'], 0);
     $booty['deuterium'] = max($booty['deuterium'], 0);
     $booty['deuterium'] = max($booty['tritium'], 0);
     $steal = array_map('floor', $booty);
     if ($ForSim) {
         return $steal;
     }
     $AllCapacity = array_sum($SortFleets);
     $QryUpdateFleet = "";
     foreach ($SortFleets as $FleetID => $Capacity) {
         $QryUpdateFleet = "UPDATE {{table}} SET ";
         $QryUpdateFleet .= "`fleet_resource_metal` =  `fleet_resource_metal` + '" . floattostring($steal['metal'] * ($Capacity / $AllCapacity)) . "', ";
         $QryUpdateFleet .= "`fleet_resource_crystal` =  `fleet_resource_crystal` +'" . floattostring($steal['crystal'] * ($Capacity / $AllCapacity)) . "', ";
         $QryUpdateFleet .= "`fleet_resource_deuterium` =  `fleet_resource_deuterium` +'" . floattostring($steal['deuterium'] * ($Capacity / $AllCapacity)) . "', ";
         $QryUpdateFleet .= "`fleet_resource_tritium` =  `fleet_resource_tritium` +'" . floattostring($steal['tritium'] * ($Capacity / $AllCapacity)) . "' ";
         $QryUpdateFleet .= "WHERE fleet_id = '" . $FleetID . "' ";
         $QryUpdateFleet .= "LIMIT 1;";
         doquery($QryUpdateFleet, 'fleets');
     }
     return $steal;
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:52,代码来源:class.FlyingFleetHandler.php


示例4: StoreGoodsToPlanet

 function StoreGoodsToPlanet($Start = false)
 {
     global $db;
     $Qry = "UPDATE " . PLANETS . " SET ";
     $Qry .= "`metal` = `metal` + '" . floattostring($this->_fleet['fleet_resource_metal']) . "', ";
     $Qry .= "`crystal` = `crystal` + '" . floattostring($this->_fleet['fleet_resource_crystal']) . "', ";
     $Qry .= "`deuterium` = `deuterium` + '" . floattostring($this->_fleet['fleet_resource_deuterium']) . "' ";
     $Qry .= "WHERE ";
     $Qry .= "`id` = '" . ($Start == true ? $this->_fleet['fleet_start_id'] : $this->_fleet['fleet_end_id']) . "';";
     $db->query($Qry);
     $this->UpdateFleet('fleet_resource_metal', '0');
     $this->UpdateFleet('fleet_resource_crystal', '0');
     $this->UpdateFleet('fleet_resource_deuterium', '0');
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:14,代码来源:class.MissionFunctions.php


示例5: ShowQuickEditorPage

function ShowQuickEditorPage()
{
    global $LNG, $db, $reslist, $resource;
    $action = request_var('action', '');
    $edit = request_var('edit', '');
    $id = request_var('id', 0);
    switch ($edit) {
        case 'planet':
            $DataIDs = array_merge($reslist['fleet'], $reslist['build'], $reslist['defense']);
            foreach ($DataIDs as $ID) {
                $SpecifyItemsPQ .= "`" . $resource[$ID] . "`,";
            }
            $PlanetData = $db->uniquequery("SELECT " . $SpecifyItemsPQ . " `name`, `id_owner`, `planet_type`, `galaxy`, `system`, `planet`, `destruyed`, `diameter`, `field_current`, `field_current`, `field_max`, `temp_min`, `temp_max`, `metal`, `crystal`, `deuterium` FROM " . PLANETS . " WHERE `id` = '" . $id . "';");
            $reslist['build'] = $reslist['allow'][$PlanetData['planet_type']];
            if ($action == 'send') {
                $QryUpdateString = "UPDATE " . PLANETS . " SET ";
                foreach ($DataIDs as $ID) {
                    $QryUpdateString .= "`" . $resource[$ID] . "` = '" . floattostring(round(abs(request_var($resource[$ID], 0.0)), 0)) . "', ";
                }
                $QryUpdateString .= "`metal` = '" . floattostring(round(abs(request_var('metal', 0.0)), 0)) . "', ";
                $QryUpdateString .= "`crystal` = '" . floattostring(round(abs(request_var('crystal', 0.0)), 0)) . "', ";
                $QryUpdateString .= "`deuterium` = '" . floattostring(round(abs(request_var('deuterium', 0.0)), 0)) . "', ";
                $QryUpdateString .= "`field_max` = '" . request_var('field_max', 0) . "', ";
                $QryUpdateString .= "`name` = '" . $db->sql_escape(request_var('name', '')) . "' ";
                $QryUpdateString .= "WHERE `id` = '" . $id . "' LIMIT 1;";
                $db->query($QryUpdateString);
                exit(sprintf($LNG['qe_edit_sucess'], $PlanetData['name'], $PlanetData['galaxy'], $PlanetData['system'], $PlanetData['planet']));
            }
            $UserInfo = $db->uniquequery("SELECT `username` FROM " . USERS . " WHERE `id` = '" . $PlanetData['id_owner'] . "'");
            $build = $defense = $fleet = array();
            foreach ($reslist['build'] as $ID) {
                $build[] = array('type' => $resource[$ID], 'name' => $LNG['tech'][$ID], 'count' => pretty_number($PlanetData[$resource[$ID]]), 'input' => $PlanetData[$resource[$ID]]);
            }
            foreach ($reslist['fleet'] as $ID) {
                $fleet[] = array('type' => $resource[$ID], 'name' => $LNG['tech'][$ID], 'count' => pretty_number($PlanetData[$resource[$ID]]), 'input' => $PlanetData[$resource[$ID]]);
            }
            foreach ($reslist['defense'] as $ID) {
                $defense[] = array('type' => $resource[$ID], 'name' => $LNG['tech'][$ID], 'count' => pretty_number($PlanetData[$resource[$ID]]), 'input' => $PlanetData[$resource[$ID]]);
            }
            $template = new template();
            $template->page_header();
            $template->assign_vars(array('qe_resources' => $LNG['qe_resources'], 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'qe_defensive' => $LNG['qe_defensive'], 'qe_fleet' => $LNG['qe_fleet'], 'qe_build' => $LNG['qe_build'], 'qe_input' => $LNG['qe_input'], 'qe_count' => $LNG['qe_count'], 'qe_name' => $LNG['qe_name'], 'qe_reset' => $LNG['qe_reset'], 'qe_send' => $LNG['qe_send'], 'qe_temp' => $LNG['qe_temp'], 'qe_fields' => $LNG['qe_fields'], 'qe_owner' => $LNG['qe_owner'], 'qe_coords' => $LNG['qe_coords'], 'qe_id' => $LNG['qe_id'], 'qe_info' => $LNG['qe_info'], 'build' => $build, 'fleet' => $fleet, 'defense' => $defense, 'id' => $id, 'ownerid' => $PlanetData['id_owner'], 'ownername' => $UserInfo['username'], 'name' => $PlanetData['name'], 'galaxy' => $PlanetData['galaxy'], 'system' => $PlanetData['system'], 'planet' => $PlanetData['planet'], 'field_min' => $PlanetData['field_current'], 'field_max' => $PlanetData['field_max'], 'temp_min' => $PlanetData['temp_min'], 'temp_max' => $PlanetData['temp_max'], 'metal' => floattostring($PlanetData['metal']), 'crystal' => floattostring($PlanetData['crystal']), 'deuterium' => floattostring($PlanetData['deuterium']), 'metal_c' => pretty_number($PlanetData['metal']), 'crystal_c' => pretty_number($PlanetData['crystal']), 'deuterium_c' => pretty_number($PlanetData['deuterium'])));
            $template->show('adm/QuickEditorPlanet.tpl');
            break;
        case 'player':
            break;
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:48,代码来源:ShowQuickEditorPage.php


示例6: DoFleetJump

 private function DoFleetJump()
 {
     global $USER, $PLANET, $resource, $LNG, $db, $reslist;
     if (!$_POST) {
         return false;
     }
     $RestString = $this->GetNextJumpWaitTime($PLANET);
     $NextJumpTime = $RestString['value'];
     $JumpTime = TIMESTAMP;
     if ($NextJumpTime != 0) {
         return $LNG['in_jump_gate_already_used'] . $RestString['string'];
     }
     $TargetPlanet = request_var('jmpto', 0);
     $TargetGate = $db->uniquequery("SELECT `id`, `last_jump_time` FROM " . PLANETS . " WHERE `id` = '" . $TargetPlanet . "' AND `sprungtor` > '0';");
     if (!isset($TargetGate)) {
         return $LNG['in_jump_gate_doesnt_have_one'];
     }
     $RestString = $this->GetNextJumpWaitTime($TargetGate);
     if ($RestString['value'] != 0) {
         return $LNG['in_jump_gate_not_ready_target'] . $RestString['string'];
     }
     $ShipArray = array();
     $SubQueryOri = "";
     $SubQueryDes = "";
     foreach ($reslist['fleet'] as $Ship) {
         $ShipArray[$Ship] = min(max(request_var('ship' . $Ship, 0.0), 0), $PLANET[$resource[$Ship]]);
         $SubQueryOri .= "`" . $resource[$Ship] . "` = `" . $resource[$Ship] . "` - '" . floattostring($ShipArray[$Ship]) . "', ";
         $SubQueryDes .= "`" . $resource[$Ship] . "` = `" . $resource[$Ship] . "` + '" . floattostring($ShipArray[$Ship]) . "', ";
         $PLANET[$resource[$Ship]] -= floattostring($ShipArray[$Ship]);
     }
     if (empty($SubQueryOri)) {
         return $LNG['in_jump_gate_error_data'];
     }
     $SQL = "UPDATE " . PLANETS . " SET ";
     $SQL .= $SubQueryOri;
     $SQL .= "`last_jump_time` = '" . $JumpTime . "' ";
     $SQL .= "WHERE ";
     $SQL .= "`id` = '" . $PLANET['id'] . "';";
     $SQL .= "UPDATE " . PLANETS . " SET ";
     $SQL .= $SubQueryDes;
     $SQL .= "`last_jump_time` = '" . $JumpTime . "' ";
     $SQL .= "WHERE ";
     $SQL .= "`id` = '" . $TargetGate['id'] . "';";
     $db->multi_query($SQL);
     $PLANET['last_jump_time'] = $JumpTime;
     $RestString = $this->GetNextJumpWaitTime($PLANET);
     return $LNG['in_jump_gate_done'] . $RestString['string'];
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:48,代码来源:class.ShowInfosPage.php


示例7: calculateAKSSteal

 public static function calculateAKSSteal($attackFleets, $defenderPlanet, $ForSim = false)
 {
     //Steal-Math by Slaver for 2Moons(http://www.titanspace.org) based on http://www.owiki.de/Beute
     global $pricelist, $db;
     $SortFleets = array();
     foreach ($attackFleets as $FleetID => $Attacker) {
         foreach ($Attacker['detail'] as $Element => $amount) {
             if ($Element != 210) {
                 //fix probos capacity in attack by jstar
                 $SortFleets[$FleetID] += $pricelist[$Element]['capacity'] * $amount;
             }
         }
         $SortFleets[$FleetID] -= $Attacker['fleet']['fleet_resource_metal'] - $Attacker['fleet']['fleet_resource_crystal'] - $Attacker['fleet']['fleet_resource_deuterium'];
     }
     $Sumcapacity = array_sum($SortFleets);
     //FIX JTSAMPER
     $booty['deuterium'] = min($Sumcapacity / 3, $defenderPlanet['deuterium'] / 2);
     $Sumcapacity -= $booty['deuterium'];
     $booty['crystal'] = min($Sumcapacity / 2, $defenderPlanet['crystal'] / 2);
     $Sumcapacity -= $booty['crystal'];
     $booty['metal'] = min($Sumcapacity, $defenderPlanet['metal'] / 2);
     $Sumcapacity -= $booty['metal'];
     $oldMetalBooty = $booty['crystal'];
     $booty['crystal'] += min($Sumcapacity / 2, max($defenderPlanet['crystal'] / 2 - $booty['crystal'], 0));
     $Sumcapacity += $oldMetalBooty - $booty['crystal'];
     $booty['metal'] += min($Sumcapacity, max($defenderPlanet['metal'] / 2 - $booty['metal'], 0));
     $booty['metal'] = max($booty['metal'], 0);
     $booty['crystal'] = max($booty['crystal'], 0);
     $booty['deuterium'] = max($booty['deuterium'], 0);
     //END FIX
     $steal = array_map('floor', $booty);
     if ($ForSim) {
         return $steal;
     }
     $AllCapacity = array_sum($SortFleets);
     $QryUpdateFleet = "";
     foreach ($SortFleets as $FleetID => $Capacity) {
         $QryUpdateFleet = 'UPDATE {{table}} SET ';
         $QryUpdateFleet .= '`fleet_resource_metal` = `fleet_resource_metal` + ' . floattostring($steal['metal'] * ($Capacity / $AllCapacity)) . ', ';
         $QryUpdateFleet .= '`fleet_resource_crystal` = `fleet_resource_crystal` +' . floattostring($steal['crystal'] * ($Capacity / $AllCapacity)) . ', ';
         $QryUpdateFleet .= '`fleet_resource_deuterium` = `fleet_resource_deuterium` +' . floattostring($steal['deuterium'] * ($Capacity / $AllCapacity)) . ' ';
         $QryUpdateFleet .= 'WHERE fleet_id = ' . $FleetID . ' ';
         $QryUpdateFleet .= 'LIMIT 1;';
         doquery($QryUpdateFleet, 'fleets');
     }
     return $steal;
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:47,代码来源:class.FlyingFleetHandler.php


示例8: show

 public function show()
 {
     global $USER, $PLANET, $resource, $pricelist, $reslist, $LNG;
     $targetGalaxy = HTTP::_GP('galaxy', (int) $PLANET['galaxy']);
     $targetSystem = HTTP::_GP('system', (int) $PLANET['system']);
     $targetPlanet = HTTP::_GP('planet', (int) $PLANET['planet']);
     $targetType = HTTP::_GP('type', (int) $PLANET['planet_type']);
     $mission = HTTP::_GP('target_mission', 0);
     $Fleet = array();
     $FleetRoom = 0;
     $allyInfo = $GLOBALS['DATABASE']->query("SELECT FleetCapa FROM `uni1_alliance` WHERE id = " . $USER['ally_id'] . ";");
     $allyInfo = $GLOBALS['DATABASE']->fetch_array($allyInfo);
     $listorder = array(210, 212, 202, 203, 204, 205, 229, 209, 206, 207, 208, 217, 215, 213, 211, 220, 224, 219, 223, 225, 226, 214, 216, 230, 227, 228, 222, 218, 221);
     foreach ($listorder as $id => $ShipID) {
         $amount = max(0, round(HTTP::_GP('ship' . $ShipID, 0.0, 0.0)));
         if ($amount < 1 || $ShipID == 212) {
             continue;
         }
         $Fleet[$ShipID] = $amount;
         $FleetRoom += $pricelist[$ShipID]['capacity'] * $amount;
         $FleetRoom += $FleetRoom / 100 * getbonusOneBis(1207, $USER['academy_1207']) + $FleetRoom / 100 * $allyInfo['FleetCapa'];
     }
     foreach ($Fleet as $Ship => $Count) {
         if ($Count > $PLANET[$resource[$Ship]]) {
             $this->printMessage($LNG['fl_not_all_ship_avalible']);
         }
     }
     $FleetRoom *= 1 + $USER['factor']['ShipStorage'];
     if (empty($Fleet)) {
         FleetFunctions::GotoFleetPage();
     }
     $FleetData = array('fleetroom' => floattostring($FleetRoom), 'gamespeed' => FleetFunctions::GetGameSpeedFactor(), 'fleetspeedfactor' => max(0, 1 + $USER['factor']['FlyTime']), 'planet' => array('galaxy' => $PLANET['galaxy'], 'system' => $PLANET['system'], 'planet' => $PLANET['planet'], 'planet_type' => $PLANET['planet_type']), 'maxspeed' => FleetFunctions::GetFleetMaxSpeed($Fleet, $USER), 'ships' => FleetFunctions::GetFleetShipInfo($Fleet, $USER), 'fleetMinDuration' => MIN_FLEET_TIME);
     $token = getRandomString();
     $_SESSION['fleet'][$token] = array('time' => TIMESTAMP, 'fleet' => $Fleet, 'fleetRoom' => $FleetRoom);
     $shortcutList = $this->GetUserShotcut();
     $colonyList = $this->GetColonyList();
     $ACSList = $this->GetAvalibleACS();
     if (!empty($shortcutList)) {
         $shortcutAmount = max(array_keys($shortcutList));
     } else {
         $shortcutAmount = 0;
     }
     $this->tplObj->loadscript('flotten.js');
     $this->tplObj->execscript('updateVars();FleetTime();window.setInterval("FleetTime()", 1000);');
     $this->tplObj->assign_vars(array('token' => $token, 'mission' => $mission, 'shortcutList' => $shortcutList, 'shortcutMax' => $shortcutAmount, 'colonyList' => $colonyList, 'ACSList' => $ACSList, 'galaxy' => $targetGalaxy, 'system' => $targetSystem, 'planet' => $targetPlanet, 'type' => $targetType, 'speedSelect' => FleetFunctions::$allowedSpeed, 'typeSelect' => array(1 => $LNG['type_planet'][1], 2 => $LNG['type_planet'][2], 3 => $LNG['type_planet'][3], 4 => $LNG['type_planet'][4]), 'fleetdata' => $FleetData));
     $this->display('page.fleetStep1.default.tpl');
 }
开发者ID:Decoder1978,项目名称:Xterium,代码行数:47,代码来源:class.ShowFleetStep1Page.php


示例9: StoreGoodsToPlanet

 function StoreGoodsToPlanet($Start = false)
 {
     global $db;
     $Qry = "UPDATE " . PLANETS . " SET ";
     $Qry .= "`metal` = `metal` + '" . floattostring($this->_fleet['fleet_resource_metal']) . "', ";
     $Qry .= "`crystal` = `crystal` + '" . floattostring($this->_fleet['fleet_resource_crystal']) . "', ";
     $Qry .= "`deuterium` = `deuterium` + '" . floattostring($this->_fleet['fleet_resource_deuterium']) . "' ";
     $Qry .= "WHERE ";
     if ($Start == true) {
         $Qry .= "`galaxy` = '" . $this->_fleet['fleet_start_galaxy'] . "' AND `system` = '" . $this->_fleet['fleet_start_system'] . "' AND `planet` = '" . $this->_fleet['fleet_start_planet'] . "' AND `planet_type` = '" . $this->_fleet['fleet_start_type'] . "' ";
     } else {
         $Qry .= "`galaxy` = '" . $this->_fleet['fleet_end_galaxy'] . "' AND `system` = '" . $this->_fleet['fleet_end_system'] . "' AND `planet` = '" . $this->_fleet['fleet_end_planet'] . "' AND `planet_type` = '" . $this->_fleet['fleet_end_type'] . "' ";
     }
     $Qry .= "LIMIT 1;";
     $db->query($Qry);
     $this->UpdateFleet('fleet_resource_metal', '0');
     $this->UpdateFleet('fleet_resource_crystal', '0');
     $this->UpdateFleet('fleet_resource_deuterium', '0');
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:19,代码来源:class.MissionFunctions.php


示例10: show

 public function show()
 {
     global $USER, $PLANET, $pricelist, $reslist, $LNG;
     $targetGalaxy = HTTP::_GP('galaxy', (int) $PLANET['galaxy']);
     $targetSystem = HTTP::_GP('system', (int) $PLANET['system']);
     $targetPlanet = HTTP::_GP('planet', (int) $PLANET['planet']);
     $targetType = HTTP::_GP('type', (int) $PLANET['planet_type']);
     $mission = HTTP::_GP('target_mission', 0);
     $Fleet = array();
     $FleetRoom = 0;
     foreach ($reslist['fleet'] as $id => $ShipID) {
         $amount = max(0, round(HTTP::_GP('ship' . $ShipID, 0.0, 0.0)));
         if ($amount < 1 || $ShipID == 212) {
             continue;
         }
         $Fleet[$ShipID] = $amount;
         $FleetRoom += $pricelist[$ShipID]['capacity'] * $amount;
     }
     $FleetRoom *= 1 + $USER['factor']['ShipStorage'];
     if (empty($Fleet)) {
         FleetFunctions::GotoFleetPage();
     }
     $FleetData = array('fleetroom' => floattostring($FleetRoom), 'gamespeed' => FleetFunctions::GetGameSpeedFactor(), 'fleetspeedfactor' => max(0, 1 + $USER['factor']['FlyTime']), 'planet' => array('galaxy' => $PLANET['galaxy'], 'system' => $PLANET['system'], 'planet' => $PLANET['planet'], 'planet_type' => $PLANET['planet_type']), 'maxspeed' => FleetFunctions::GetFleetMaxSpeed($Fleet, $USER), 'ships' => FleetFunctions::GetFleetShipInfo($Fleet, $USER), 'fleetMinDuration' => MIN_FLEET_TIME);
     $token = getRandomString();
     $_SESSION['fleet'][$token] = array('time' => TIMESTAMP, 'fleet' => $Fleet, 'fleetRoom' => $FleetRoom);
     $shortcutList = $this->GetUserShotcut();
     $colonyList = $this->GetColonyList();
     $ACSList = $this->GetAvalibleACS();
     if (!empty($shortcutList)) {
         $shortcutAmount = max(array_keys($shortcutList));
     } else {
         $shortcutAmount = 0;
     }
     $this->tplObj->loadscript('flotten.js');
     $this->tplObj->execscript('updateVars();FleetTime();window.setInterval("FleetTime()", 1000);');
     $this->assign(array('token' => $token, 'mission' => $mission, 'shortcutList' => $shortcutList, 'shortcutMax' => $shortcutAmount, 'colonyList' => $colonyList, 'ACSList' => $ACSList, 'galaxy' => $targetGalaxy, 'system' => $targetSystem, 'planet' => $targetPlanet, 'type' => $targetType, 'speedSelect' => FleetFunctions::$allowedSpeed, 'typeSelect' => array(1 => $LNG['type_planet'][1], 2 => $LNG['type_planet'][2], 3 => $LNG['type_planet'][3]), 'fleetdata' => $FleetData));
     $this->display('page.fleetStep1.default.tpl');
 }
开发者ID:sincilite,项目名称:Evermoon,代码行数:38,代码来源:ShowFleetStep1Page.class.php


示例11: SendFleet

 /** FLEET FUNCTIONS **/
 function SendFleet($FleetData)
 {
     $FleetData = array_merge(array('mission' => 3, 'galaxy' => 0, 'system' => 0, 'planet' => 0, 'planettype' => 0, 'fleetgroup' => 0, 'speed' => 10, 'metal' => 0, 'crystal' => 0, 'deuterium' => 0, 'holdingtime' => 0, 'fleet' => array()), $FleetData);
     $mission = $FleetData['mission'];
     $galaxy = $FleetData['galaxy'];
     $system = $FleetData['system'];
     $planet = $FleetData['planet'];
     $planettype = $FleetData['planettype'];
     $fleet_group = $FleetData['fleetgroup'];
     $GenFleetSpeed = $FleetData['speed'];
     $TransportMetal = $FleetData['metal'];
     $TransportCrystal = $FleetData['crystal'];
     $TransportDeuterium = $FleetData['deuterium'];
     $holdingtime = $FleetData['holdingtime'];
     $rawfleetarray = $FleetData['fleet'];
     if ($planettype != 1 && $planettype != 3) {
         return false;
     }
     if ($this->PLANET['galaxy'] == $galaxy && $this->PLANET['system'] == $system && $this->PLANET['planet'] == $planet && $this->PLANET['planet_type'] == $planettype) {
         return false;
     }
     if ($galaxy > $CONF['max_galaxy'] || $galaxy < 1 || $system > $CONF['max_system'] || $system < 1 || $planet > $CONF['max_planets'] + 1 || $planet < 1) {
         return false;
     }
     if (empty($mission)) {
         return false;
     }
     $ActualFleets = parent::GetCurrentFleets($USER['id']);
     if (parent::GetMaxFleetSlots($USER) <= $ActualFleets) {
         return false;
     }
     $fleet_group_mr = 0;
     if (!empty($fleet_group) && $mission == 2) {
         $aks_count_mr = $db->uniquequery("SELECT COUNT(*) as state FROM " . AKS . " WHERE `id` = '" . $fleet_group . "' AND `eingeladen` LIKE '%" . $USER['id'] . "%';");
         if ($aks_count_mr['state'] > 0) {
             $fleet_group_mr = $fleet_group;
         } else {
             $mission = 1;
         }
     }
     $ActualFleets = parent::GetCurrentFleets($USER['id']);
     $TargetPlanet = $db->uniquequery("SELECT `id`, `id_owner`,`destruyed`,`ally_deposit` FROM " . PLANETS . " WHERE `universe` = '" . $UNI . "' AND `galaxy` = '" . $galaxy . "' AND `system` = '" . $system . "' AND `planet` = '" . $planet . "' AND `planet_type` = '" . ($planettype == 2 ? 1 : $planettype) . "';");
     if ($mission != 15 && $TargetPlanet["destruyed"] != 0 || $mission != 15 && $mission != 7 && empty($TargetPlanet['id_owner'])) {
         return false;
     }
     $MyDBRec = $USER;
     $FleetArray = parent::GetFleetArray($rawfleetarray);
     if (!is_array($FleetArray)) {
         return false;
     }
     $FleetStorage = 0;
     $FleetShipCount = 0;
     $fleet_array = "";
     $FleetSubQRY = "";
     foreach ($FleetArray as $Ship => $Count) {
         if ($Count > $this->PLANET[$resource[$Ship]] || $Count < 0) {
             return false;
         }
         $FleetStorage += $pricelist[$Ship]["capacity"] * $Count;
         $FleetShipCount += $Count;
         $fleet_array .= $Ship . "," . $Count . ";";
         $FleetSubQRY .= "`" . $resource[$Ship] . "` = `" . $resource[$Ship] . "` - '" . floattostring($Count) . "', ";
     }
     $error = 0;
     $fleetmission = $mission;
     $YourPlanet = false;
     $UsedPlanet = false;
     if ($mission == 11) {
         $maxexpde = parent::GetCurrentFleets($USER['id'], 11);
         if ($maxexpde >= $CONF['max_dm_missions']) {
             return false;
         }
     } elseif ($mission == 15) {
         $MaxExpedition = $USER[$resource[124]];
         if ($MaxExpedition == 0) {
             return false;
         }
         $ExpeditionEnCours = parent::GetCurrentFleets($USER['id'], 15);
         $EnvoiMaxExpedition = floor(sqrt($MaxExpedition));
         if ($ExpeditionEnCours >= $EnvoiMaxExpedition) {
             return false;
         }
     }
     $YourPlanet = isset($TargetPlanet['id_owner']) && $TargetPlanet['id_owner'] == $USER['id'] ? true : false;
     $UsedPlanet = isset($TargetPlanet['id_owner']) ? true : false;
     $HeDBRec = $YourPlanet ? $MyDBRec : GetUserByID($TargetPlanet['id_owner'], array('id', 'onlinetime', 'ally_id', 'urlaubs_modus', 'banaday', 'authattack'));
     if ($HeDBRec['urlaubs_modus'] && $mission != 8) {
         return false;
     }
     if (!$YourPlanet && ($mission == 1 || $mission == 2 || $mission == 5 || $mission == 6 || $mission == 9)) {
         if ($CONF['adm_attack'] == 1 && $UsedPlanet['authattack'] > $USER['authlevel']) {
             return false;
         }
         $UserPoints = $USER;
         $User2Points = $db->uniquequery("SELECT `total_points` FROM " . STATPOINTS . " WHERE `stat_type` = '1' AND `id_owner` = '" . $HeDBRec['id'] . "';");
         $IsNoobProtec = CheckNoobProtec($UserPoints, $User2Points, $HeDBRec);
         if ($IsNoobProtec['NoobPlayer']) {
             return false;
         } elseif ($IsNoobProtec['StrongPlayer']) {
//.........这里部分代码省略.........
开发者ID:joancefet,项目名称:Beta7,代码行数:101,代码来源:class.bot.php


示例12: show


//.........这里部分代码省略.........
         $elementIDd = array(212, 202, 203, 204, 205);
         $elementIDa = array(209, 206, 207, 217, 215, 213, 211, 219);
         $elementIDq = array(225, 226, 214, 216, 227, 228, 222, 218, 221);
     }
     $Missiles = array();
     $Domes = array();
     $Orbits = array();
     foreach ($reslist['missile'] as $elementID) {
         $Missiles[$elementID] = $PLANET[$resource[$elementID]];
     }
     foreach ($reslist['defense'] as $elementID) {
         $Domes[$elementID] = $PLANET[$resource[$elementID]];
         $Orbits[$elementID] = $PLANET[$resource[$elementID]];
     }
     $MaxMissiles = BuildFunctions::getMaxConstructibleRockets($USER, $PLANET, $Missiles);
     $MaxDomes = BuildFunctions::getMaxConstructibleDomes($USER, $PLANET, $Domes);
     $MaxOrbits = BuildFunctions::getMaxConstructibleOrbits($USER, $PLANET, $Orbits);
     foreach ($elementALL as $Element) {
         $costRessources = BuildFunctions::getElementPrice($USER, $PLANET, $Element);
         $costOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $costRessources);
         $elementTime = BuildFunctions::getBuildingTime($USER, $PLANET, $Element, $costRessources);
         $buyable = BuildFunctions::isElementBuyable($USER, $PLANET, $Element, $costRessources);
         $maxBuildable = BuildFunctions::getMaxConstructibleElements($USER, $PLANET, $Element, $costRessources);
         if (isset($MaxMissiles[$Element])) {
             $maxBuildable = min($maxBuildable, $MaxMissiles[$Element]);
         }
         if (isset($MaxDomes[$Element])) {
             $maxBuildable = min($maxBuildable, $MaxDomes[$Element]);
         }
         if (isset($MaxOrbits[$Element])) {
             $maxBuildable = min($maxBuildable, $MaxOrbits[$Element]);
         }
         $AlreadyBuild = in_array($Element, $reslist['one']) && (isset($elementInQueue[$Element]) || $PLANET[$resource[$Element]] != 0);
         $elementListall[$Element] = array('id' => $Element, 'available' => $PLANET[$resource[$Element]], 'costRessources' => $costRessources, 'costOverflow' => $costOverflow, 'elementTime' => $elementTime, 'buyable' => $buyable, 'maxBuildable' => floattostring($maxBuildable), 'AlreadyBuild' => $AlreadyBuild, 'techacc' => BuildFunctions::isTechnologieAccessible($USER, $PLANET, $Element));
     }
     foreach ($elementIDs as $Element) {
         $AllTech = array();
         $GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_vars_requriements` WHERE elementID = " . $Element . " ;");
         if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) {
             while ($x = $GLOBALS['DATABASE']->fetch_array($GetAll)) {
                 $AllTech[] = $x;
             }
         }
         $costRessources = BuildFunctions::getElementPrice($USER, $PLANET, $Element);
         $costOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $costRessources);
         $elementTime = BuildFunctions::getBuildingTime($USER, $PLANET, $Element, $costRessources);
         $buyable = BuildFunctions::isElementBuyable($USER, $PLANET, $Element, $costRessources);
         $maxBuildable = BuildFunctions::getMaxConstructibleElements($USER, $PLANET, $Element, $costRessources);
         if (isset($MaxMissiles[$Element])) {
             $maxBuildable = min($maxBuildable, $MaxMissiles[$Element]);
         }
         if (isset($MaxDomes[$Element])) {
             $maxBuildable = min($maxBuildable, $MaxDomes[$Element]);
         }
         if (isset($MaxOrbits[$Element])) {
             $maxBuildable = min($maxBuildable, $MaxOrbits[$Element]);
         }
         $AlreadyBuild = in_array($Element, $reslist['one']) && (isset($elementInQueue[$Element]) || $PLANET[$resource[$Element]] != 0);
         $elementList[$Element] = array('id' => $Element, 'available' => $PLANET[$resource[$Element]], 'costRessources' => $costRessources, 'costOverflow' => $costOverflow, 'elementTime' => $elementTime, 'buyable' => $buyable, 'maxBuildable' => floattostring($maxBuildable), 'AlreadyBuild' => $AlreadyBuild, 'AllTech' => $AllTech, 'techacc' => BuildFunctions::isTechnologieAccessible($USER, $PLANET, $Element));
     }
     foreach ($elementIDq as $Element) {
         $AllTech = array();
         $GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_vars_requriements` WHERE elementID = " . $Element . " ;");
         if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) {
             while ($x = $GLOBALS['DATABASE']->fetch_array($GetAll)) {
                 $AllTech[] = $x;
开发者ID:Decoder1978,项目名称:Xterium,代码行数:67,代码来源:class.ShowShipyardPage.php


示例13: Menus

 private function Menus()
 {
     global $PLANET, $LNG, $USER, $CONF;
     //PlanetMenu
     if (empty($this->UserPlanets)) {
         $this->getplanets();
     }
     $this->loadscript("planetmenu.js");
     $this->loadscript("topnav.js");
     $this->execscript("PlanetMenu();");
     $this->phpself = "?page=" . request_var('page', '') . "&amp;mode=" . request_var('mode', '');
     $PlanetSelect = array();
     $Scripttime = array();
     foreach ($this->UserPlanets as $CurPlanetID => $PlanetQuery) {
         if (!empty($PlanetQuery['b_building_id'])) {
             $QueueArray = explode(";", $PlanetQuery['b_building_id']);
             $ActualCount = count($QueueArray);
             for ($ID = 0; $ID < $ActualCount; $ID++) {
                 $ListIDArray = explode(",", $QueueArray[$ID]);
                 if ($ListIDArray[3] > TIMESTAMP) {
                     $Scripttime[$PlanetQuery['id']][] = $ListIDArray[3];
                 }
             }
         }
         $Planetlist[$PlanetQuery['id']] = array('url' => $this->phpself . "&amp;cp=" . $PlanetQuery['id'], 'name' => $PlanetQuery['name'] . ($PlanetQuery['planet_type'] == 3 ? " (" . $LNG['fcm_moon'] . ")" : ""), 'image' => $PlanetQuery['image'], 'galaxy' => $PlanetQuery['galaxy'], 'system' => $PlanetQuery['system'], 'planet' => $PlanetQuery['planet'], 'ptype' => $PlanetQuery['planet_type']);
         $PlanetSelect[$this->phpself . "&amp;cp=" . $PlanetQuery['id']] = $PlanetQuery['name'] . ($PlanetQuery['planet_type'] == 3 ? " (" . $LNG['fcm_moon'] . ")" : "") . "&nbsp;[" . $PlanetQuery['galaxy'] . ":" . $PlanetQuery['system'] . ":" . $PlanetQuery['planet'] . "]&nbsp;&nbsp;";
     }
     if ($USER['urlaubs_modus'] == 1) {
         $CONF['metal_basic_income'] = 0;
         $CONF['crystal_basic_income'] = 0;
         $CONF['deuterium_basic_income'] = 0;
         $CONF['norio_basic_income'] = 0;
     }
     $this->assign_vars(array('PlanetMenu' => $Planetlist, 'show_planetmenu' => $LNG['show_planetmenu'], 'current_pid' => $PLANET['id'], 'Scripttime' => json_encode($Scripttime), 'lm_overview' => $LNG['lm_overview'], 'lm_empire' => $LNG['lm_empire'], 'lm_buildings' => $LNG['lm_buildings'], 'lm_resources' => $LNG['lm_resources'], 'lm_trader' => $LNG['lm_trader'], 'lm_fleettrader' => $LNG['lm_fleettrader'], 'lm_research' => $LNG['lm_research'], 'lm_shipshard' => $LNG['lm_shipshard'], 'lm_fleet' => $LNG['lm_fleet'], 'lm_technology' => $LNG['lm_technology'], 'lm_galaxy' => $LNG['lm_galaxy'], 'lm_defenses' => $LNG['lm_defenses'], 'lm_alliance' => $LNG['lm_alliance'], 'lm_forums' => $LNG['lm_forums'], 'lm_officiers' => $LNG['lm_officiers'], 'lm_statistics' => $LNG['lm_statistics'], 'lm_records' => $LNG['lm_records'], 'lm_topkb' => $LNG['lm_topkb'], 'lm_search' => $LNG['lm_search'], 'lm_battlesim' => $LNG['lm_battlesim'], 'lm_messages' => $LNG['lm_messages'], 'lm_notes' => $LNG['lm_notes'], 'lm_buddylist' => $LNG['lm_buddylist'], 'lm_chat' => $LNG['lm_chat'], 'lm_support' => $LNG['lm_support'], 'lm_faq' => $LNG['lm_faq'], 'lm_options' => $LNG['lm_options'], 'lm_banned' => $LNG['lm_banned'], 'lm_rules' => $LNG['lm_rules'], 'lm_logout' => $LNG['lm_logout'], 'new_message' => $USER['new_message'], 'forum_url' => $CONF['forum_url'], 'lm_administration' => $LNG['lm_administration'], 'topnav' => true, 'metal' => $PLANET['metal'], 'crystal' => $PLANET['crystal'], 'deuterium' => $PLANET['deuterium'], 'norio' => $PLANET['norio'], 'energy' => $PLANET["energy_max"] + $PLANET["energy_used"] < 0 ? colorRed(pretty_number($PLANET["energy_max"] + $PLANET["energy_used"]) . "/" . pretty_number($PLANET["energy_max"])) : pretty_number($PLANET["energy_max"] + $PLANET["energy_used"]) . "/" . pretty_number($PLANET["energy_max"]), 'darkmatter' => pretty_number($USER["darkmatter"]), 'metal_max' => shortly_number($PLANET["metal_max"]), 'crystal_max' => shortly_number($PLANET["crystal_max"]), 'deuterium_max' => shortly_number($PLANET["deuterium_max"]), 'norio_max' => shortly_number($PLANET["norio_max"]), 'alt_metal_max' => pretty_number($PLANET["metal_max"]), 'alt_crystal_max' => pretty_number($PLANET["crystal_max"]), 'alt_deuterium_max' => pretty_number($PLANET["deuterium_max"]), 'alt_norio_max' => pretty_number($PLANET["norio_max"]), 'js_metal_max' => floattostring($PLANET["metal_max"]), 'js_crystal_max' => floattostring($PLANET["crystal_max"]), 'js_deuterium_max' => floattostring($PLANET["deuterium_max"]), 'js_norio_max' => floattostring($PLANET["norio_max"]), 'js_metal_hr' => $PLANET['planet_type'] == 1 ? floattostring($PLANET['metal_perhour'] + $CONF['metal_basic_income'] * $CONF['resource_multiplier']) : 0, 'js_crystal_hr' => $PLANET['planet_type'] == 1 ? floattostring($PLANET['crystal_perhour'] + $CONF['crystal_basic_income'] * $CONF['resource_multiplier']) : 0, 'js_deuterium_hr' => $PLANET['planet_type'] == 1 ? floattostring($PLANET['deuterium_perhour'] + $CONF['deuterium_basic_income'] * $CONF['resource_multiplier']) : 0, 'js_norio_hr' => $PLANET['planet_type'] == 1 ? floattostring($PLANET['norio_perhour'] + $CONF['norio_basic_income'] * $CONF['resource_multiplier']) : 0, 'current_planet' => $this->phpself . "&amp;cp=" . $PLANET['id'], 'tn_vacation_mode' => $LNG['tn_vacation_mode'], 'closed' => !$CONF['game_disable'] ? $LNG['ov_closed'] : false, 'vacation' => $USER['urlaubs_modus'] ? date(TDFORMAT, $USER['urlaubs_until']) : false, 'delete' => $USER['db_deaktjava'] ? sprintf($LNG['tn_delete_mode'], date(TDFORMAT, strtotime("+7 day", $USER['db_deaktjava']))) : false, 'image' => $PLANET['image'], 'settings_tnstor' => $USER['settings_tnstor'], 'PlanetSelect' => $PlanetSelect, 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'Norio' => $LNG['Norio'], 'Darkmatter' => $LNG['Darkmatter'], 'Energy' => $LNG['Energy']));
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:35,代码来源:class.template.

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP floatval函数代码示例发布时间:2022-05-15
下一篇:
PHP floatcmp函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap