public function show() { global $USER, $PLANET, $resource, $reslist, $LNG, $pricelist; $updateID = HTTP::_GP('id', 0); if (!empty($updateID) && $_SERVER['REQUEST_METHOD'] === 'POST' && $USER['urlaubs_modus'] == 0) { if (isModulAvalible(MODULE_OFFICIER) && in_array($updateID, $reslist['officier'])) { $this->UpdateOfficier($updateID); } elseif (isModulAvalible(MODULE_DMEXTRAS) && in_array($updateID, $reslist['dmfunc'])) { $this->UpdateExtra($updateID); } } $darkmatterList = array(); $officierList = array(); if (isModulAvalible(MODULE_DMEXTRAS)) { foreach ($reslist['dmfunc'] as $Element) { if ($USER[$resource[$Element]] > TIMESTAMP) { $this->tplObj->execscript("GetOfficerTime(" . $Element . ", " . ($USER[$resource[$Element]] - TIMESTAMP) . ");"); } $costResources = BuildFunctions::getElementPrice($USER, $PLANET, $Element); $buyable = BuildFunctions::isElementBuyable($USER, $PLANET, $Element, $costResources); $costOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $costResources); $elementBonus = BuildFunctions::getAvalibleBonus($Element); $darkmatterList[$Element] = array('timeLeft' => max($USER[$resource[$Element]] - TIMESTAMP, 0), 'costResources' => $costResources, 'buyable' => $buyable, 'time' => $pricelist[$Element]['time'], 'costOverflow' => $costOverflow, 'elementBonus' => $elementBonus); } } if (isModulAvalible(MODULE_OFFICIER)) { foreach ($reslist['officier'] as $Element) { if (!BuildFunctions::isTechnologieAccessible($USER, $PLANET, $Element)) { continue; } $costResources = BuildFunctions::getElementPrice($USER, $PLANET, $Element); $buyable = BuildFunctions::isElementBuyable($USER, $PLANET, $Element, $costResources); $costOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $costResources); $elementBonus = BuildFunctions::getAvalibleBonus($Element); $officierList[$Element] = array('level' => $USER[$resource[$Element]], 'maxLevel' => $pricelist[$Element]['max'], 'costResources' => $costResources, 'buyable' => $buyable, 'costOverflow' => $costOverflow, 'elementBonus' => $elementBonus); } } $this->assign(array('officierList' => $officierList, 'darkmatterList' => $darkmatterList, 'of_dm_trade' => sprintf($LNG['of_dm_trade'], $LNG['tech'][921]))); $this->display('page.officier.default.tpl'); }
public function show() { global $USER, $PLANET, $LNG, $resource, $pricelist, $reslist, $CombatCaps, $ProdGrid; $elementID = HTTP::_GP('id', 0); $this->setWindow('popup'); $this->initTemplate(); $productionTable = array(); $FleetInfo = array(); $MissileList = array(); $gateData = array(); $CurrentLevel = 0; $ressIDs = array_merge(array(), $reslist['resstype'][1], $reslist['resstype'][2]); if (in_array($elementID, $reslist['prod']) && in_array($elementID, $reslist['build'])) { /* Data for eval */ $BuildEnergy = $USER[$resource[113]]; $BuildTemp = $PLANET['temp_max']; $BuildLevelFactor = $PLANET[$resource[$elementID] . '_porcent']; $CurrentLevel = $PLANET[$resource[$elementID]]; $BuildStartLvl = max($CurrentLevel - 2, 0); for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 15; $BuildLevel++) { foreach ($ressIDs as $ID) { if (!isset($ProdGrid[$elementID]['production'][$ID])) { continue; } $Production = eval(ResourceUpdate::getProd($ProdGrid[$elementID]['production'][$ID])); if (in_array($ID, $reslist['resstype'][2])) { $Production *= Config::get()->energySpeed; } else { $Production *= Config::get()->resource_multiplier; } $productionTable['production'][$BuildLevel][$ID] = $Production; } } $productionTable['usedResource'] = array_keys($productionTable['production'][$BuildStartLvl]); } elseif (in_array($elementID, $reslist['storage'])) { $CurrentLevel = $PLANET[$resource[$elementID]]; $BuildStartLvl = max($CurrentLevel - 2, 0); for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 15; $BuildLevel++) { foreach ($ressIDs as $ID) { if (!isset($ProdGrid[$elementID]['storage'][$ID])) { continue; } $production = round(eval(ResourceUpdate::getProd($ProdGrid[$elementID]['storage'][$ID]))); $production *= Config::get()->resource_multiplier; $production *= STORAGE_FACTOR; $productionTable['storage'][$BuildLevel][$ID] = $production; } } $productionTable['usedResource'] = array_keys($productionTable['storage'][$BuildStartLvl]); } elseif (in_array($elementID, $reslist['fleet'])) { $FleetInfo = array('structure' => $pricelist[$elementID]['cost'][901] + $pricelist[$elementID]['cost'][902], 'tech' => $pricelist[$elementID]['tech'], 'attack' => $CombatCaps[$elementID]['attack'], 'shield' => $CombatCaps[$elementID]['shield'], 'capacity' => $pricelist[$elementID]['capacity'], 'speed1' => $pricelist[$elementID]['speed'], 'speed2' => $pricelist[$elementID]['speed2'], 'consumption1' => $pricelist[$elementID]['consumption'], 'consumption2' => $pricelist[$elementID]['consumption2'], 'rapidfire' => array('from' => array(), 'to' => array())); $fleetIDs = array_merge($reslist['fleet'], $reslist['defense']); foreach ($fleetIDs as $fleetID) { if (isset($CombatCaps[$elementID]['sd']) && !empty($CombatCaps[$elementID]['sd'][$fleetID])) { $FleetInfo['rapidfire']['to'][$fleetID] = $CombatCaps[$elementID]['sd'][$fleetID]; } if (isset($CombatCaps[$fleetID]['sd']) && !empty($CombatCaps[$fleetID]['sd'][$elementID])) { $FleetInfo['rapidfire']['from'][$fleetID] = $CombatCaps[$fleetID]['sd'][$elementID]; } } } elseif (in_array($elementID, $reslist['defense'])) { $FleetInfo = array('structure' => $pricelist[$elementID]['cost'][901] + $pricelist[$elementID]['cost'][902], 'attack' => $CombatCaps[$elementID]['attack'], 'shield' => $CombatCaps[$elementID]['shield'], 'rapidfire' => array('from' => array(), 'to' => array())); $fleetIDs = array_merge($reslist['fleet'], $reslist['defense']); foreach ($fleetIDs as $fleetID) { if (isset($CombatCaps[$elementID]['sd']) && !empty($CombatCaps[$elementID]['sd'][$fleetID])) { $FleetInfo['rapidfire']['to'][$fleetID] = $CombatCaps[$elementID]['sd'][$fleetID]; } if (isset($CombatCaps[$fleetID]['sd']) && !empty($CombatCaps[$fleetID]['sd'][$elementID])) { $FleetInfo['rapidfire']['from'][$fleetID] = $CombatCaps[$fleetID]['sd'][$elementID]; } } } if ($elementID == 43 && $PLANET[$resource[43]] > 0) { $this->tplObj->loadscript('gate.js'); $nextTime = self::getNextJumpWaitTime($PLANET['last_jump_time']); $gateData = array('nextTime' => _date($LNG['php_tdformat'], $nextTime, $USER['timezone']), 'restTime' => max(0, $nextTime - TIMESTAMP), 'startLink' => $PLANET['name'] . ' ' . strip_tags(BuildPlanetAdressLink($PLANET)), 'gateList' => $this->getTargetGates(), 'fleetList' => $this->getAvailableFleets()); } elseif ($elementID == 44 && $PLANET[$resource[44]] > 0) { $MissileList = array(502 => $PLANET[$resource[502]], 503 => $PLANET[$resource[503]]); } $this->assign(array('elementID' => $elementID, 'productionTable' => $productionTable, 'CurrentLevel' => $CurrentLevel, 'MissileList' => $MissileList, 'Bonus' => BuildFunctions::getAvalibleBonus($elementID), 'FleetInfo' => $FleetInfo, 'gateData' => $gateData)); $this->display('page.information.default.tpl'); }
public function show() { global $USER, $PLANET, $dpath, $LNG, $resource, $pricelist, $reslist, $CombatCaps, $ProdGrid, $CONF; $elementID = HTTP::_GP('id', 0); $AllTech = array(); $GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_vars_requriements` WHERE elementID = " . $elementID . " ;"); if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) { while ($x = $GLOBALS['DATABASE']->fetch_array($GetAll)) { $AllTech[] = $x; } } $productionTable = array(); $FleetInfo = array(); $MissileList = array(); $gateData = array(); $CurrentLevel = 0; $ressIDs = array_merge(array(), $reslist['resstype'][1], $reslist['resstype'][2], $reslist['resstype'][4]); if (in_array($elementID, $reslist['prod']) && in_array($elementID, $reslist['build'])) { $BuildLevelFactor = 10; $BuildTemp = $PLANET['temp_max']; $CurrentLevel = $PLANET[$resource[$elementID]]; $BuildEnergy = $USER[$resource[113]]; $BuildLevel = max($CurrentLevel, 0); $BuildStartLvl = max($CurrentLevel - 0, 0); for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 8; $BuildLevel++) { foreach ($ressIDs as $ID) { if (!isset($ProdGrid[$elementID]['production'][$ID])) { continue; } $Production = eval(ResourceUpdate::getProd($ProdGrid[$elementID]['production'][$ID])); if ($ID < 905) { $Production *= Config::get('resource_multiplier'); } $productionTable['production'][$BuildLevel][$ID] = $Production; } } $productionTable['usedResource'] = array_keys($productionTable['production'][$BuildStartLvl]); } elseif (in_array($elementID, $reslist['storage'])) { $BuildLevelFactor = 10; $BuildTemp = $PLANET['temp_max']; $CurrentLevel = $PLANET[$resource[$elementID]]; $BuildEnergy = $USER[$resource[113]]; $BuildLevel = max($CurrentLevel, 0); $BuildStartLvl = max($CurrentLevel - 0, 0); for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 8; $BuildLevel++) { foreach ($ressIDs as $ID) { if (!isset($ProdGrid[$elementID]['storage'][$ID])) { continue; } $productionTable['storage'][$BuildLevel][$ID] = round(eval(ResourceUpdate::getProd($ProdGrid[$elementID]['storage'][$ID]))) * Config::get('resource_multiplier') * STORAGE_FACTOR; } } $productionTable['usedResource'] = array_keys($productionTable['storage'][$BuildStartLvl]); } elseif (in_array($elementID, $reslist['fleet'])) { $MaxSpeed = 15000; $FleetInfo = array('structure' => ($pricelist[$elementID]['cost'][901] + $pricelist[$elementID]['cost'][902]) / 10, 'structureTech' => ($pricelist[$elementID]['cost'][901] + $pricelist[$elementID]['cost'][902]) / 10 * (1 + 0.1 * $USER['shield_tech'] + $USER['factor']['Shield']), 'tech' => $pricelist[$elementID]['tech'], 'attack' => $CombatCaps[$elementID]['attack'], 'attackTech' => $CombatCaps[$elementID]['attack'] * (1 + 0.1 * $USER['military_tech'] + $USER['factor']['Attack']) * (rand(80, 120) / 100), 'shield' => $CombatCaps[$elementID]['shield'], 'shieldTech' => $CombatCaps[$elementID]['shield'] * (1 + 0.1 * $USER['defence_tech'] + $USER['factor']['Defensive']), 'capacity' => $pricelist[$elementID]['capacity'], 'speed1' => 100 / 15000 * $pricelist[$elementID]['speed'], 'speed2' => $pricelist[$elementID]['speed2'], 'consumption1' => $pricelist[$elementID]['consumption'], 'consumption2' => $pricelist[$elementID]['consumption2'], 'rapidfire' => array('from' => array(), 'to' => array())); $fleetIDs = array_merge($reslist['fleet'], $reslist['defense']); foreach ($fleetIDs as $fleetID) { if (isset($CombatCaps[$elementID]['sd']) && !empty($CombatCaps[$elementID]['sd'][$fleetID])) { $FleetInfo['rapidfire']['to'][$fleetID] = $CombatCaps[$elementID]['sd'][$fleetID]; } if (isset($CombatCaps[$fleetID]['sd']) && !empty($CombatCaps[$fleetID]['sd'][$elementID])) { $FleetInfo['rapidfire']['from'][$fleetID] = $CombatCaps[$fleetID]['sd'][$elementID]; } } } elseif (in_array($elementID, $reslist['defense'])) { $FleetInfo = array('structure' => ($pricelist[$elementID]['cost'][901] + $pricelist[$elementID]['cost'][902]) / 10, 'structureTech' => ($pricelist[$elementID]['cost'][901] + $pricelist[$elementID]['cost'][902]) / 10 * (1 + 0.1 * $USER['shield_tech'] + $USER['factor']['Shield']), 'attack' => $CombatCaps[$elementID]['attack'], 'attackTech' => $CombatCaps[$elementID]['attack'] * (1 + 0.1 * $USER['military_tech'] + $USER['factor']['Attack']) * (rand(80, 120) / 100), 'shield' => $CombatCaps[$elementID]['shield'], 'shieldTech' => $CombatCaps[$elementID]['shield'] * (1 + 0.1 * $USER['defence_tech'] + $USER['factor']['Defensive']), 'capacity' => 0, 'speed1' => 0, 'rapidfire' => array('from' => array(), 'to' => array())); $fleetIDs = array_merge($reslist['fleet'], $reslist['defense']); foreach ($fleetIDs as $fleetID) { if (isset($CombatCaps[$elementID]['sd']) && !empty($CombatCaps[$elementID]['sd'][$fleetID])) { $FleetInfo['rapidfire']['to'][$fleetID] = $CombatCaps[$elementID]['sd'][$fleetID]; } if (isset($CombatCaps[$fleetID]['sd']) && !empty($CombatCaps[$fleetID]['sd'][$elementID])) { $FleetInfo['rapidfire']['from'][$fleetID] = $CombatCaps[$fleetID]['sd'][$elementID]; } } } if ($elementID == 43 && $PLANET[$resource[43]] > 0) { $this->tplObj->loadscript('gate.js'); $nextTime = self::getNextJumpWaitTime($PLANET['last_jump_time']); $gateData = array('nextTime' => _date($LNG['php_tdformat'], $nextTime, $USER['timezone']), 'restTime' => max(0, $nextTime - TIMESTAMP), 'startLink' => $PLANET['name'] . ' ' . strip_tags(BuildPlanetAdressLink($PLANET)), 'gateList' => $this->getTargetGates(), 'fleetList' => $this->getAvalibleFleets()); } elseif ($elementID == 44 && $PLANET[$resource[44]] > 0) { $MissileList = array(502 => $PLANET[$resource[502]], 503 => $PLANET[$resource[503]]); } $number = 1; $elementBonus = ''; if ($LNG['gameeffect'][$elementID] != '') { $elementBonus = BuildFunctions::getAvalibleEffect($elementID); } if (!$elementBonus) { $number = 0; } $this->tplObj->assign_vars(array('planetinfo1' => $PLANET['metal_mine'], 'planetinfo2' => $PLANET['crystal_mine'], 'planetinfo3' => $PLANET['deuterium_sintetizer'], 'planetinfo4' => $PLANET['solar_plant'], 'planetinfo5' => $PLANET['headquarters_antaris'], 'planetinfo14' => $PLANET['robot_factory'], 'planetinfo21' => $PLANET['hangar'], 'planetinfo31' => $PLANET['laboratory'], 'planetinfo45' => $PLANET['barracks'], 'planetinfo46' => $PLANET['defense_base'], 'planetinfo48' => $PLANET['elyrium_mine'], 'planetinfo106' => $USER['spy_tech'], 'planetinfo109' => $USER['military_tech'], 'planetinfo110' => $USER['defence_tech'], 'planetinfo111' => $USER['shield_tech'], 'planetinfo113' => $USER['energy_tech'], 'planetinfo115' => $USER['combustion_tech'], 'planetinfo117' => $USER['impulse_motor_tech'], 'planetinfo118' => $USER['hyperspace_motor_tech'], 'planetinfo140' => $USER['extraction_tech'], 'planetinfo141' => $USER['control_room_tech'], 'planetinfo142' => $USER['subspace_tech'], 'planetinfo143' => $USER['particle_tech'], 'planetinfo144' => $USER['antaris_tech'], 'planetinfo145' => $USER['infrastructure_tech'], 'planetinfo146' => $USER['virus_tech'], 'number' => $number, 'elementBonus' => $elementBonus, 'elementID' => $elementID, 'productionTable' => $productionTable, 'CurrentLevel' => $CurrentLevel, 'MissileList' => $MissileList, 'Bonus' => BuildFunctions::getAvalibleBonus($elementID), 'FleetInfo' => $FleetInfo, 'gateData' => $gateData, 'AllTech' => $AllTech, 'techacc' => BuildFunctions::isTechnologieAccessible($USER, $PLANET, $elementID))); $this->display('page.infomation.default.tpl'); }
public function show() { global $USER, $CONF, $PLANET, $resource, $reslist, $LNG, $pricelist; $updateID = HTTP::_GP('id', 0); if (!empty($updateID) && $_SERVER['REQUEST_METHOD'] === 'POST' && $USER['urlaubs_modus'] == 0) { if (isModulAvalible(MODULE_OFFICIER) && in_array($updateID, $reslist['officier'])) { $this->UpdateOfficier($updateID); } elseif (isModulAvalible(MODULE_DMEXTRAS) && in_array($updateID, $reslist['dmfunc'])) { $this->UpdateExtra($updateID); } } $this->tplObj->loadscript('officier.js'); $darkmatterList = array(); $officierList = array(); if (isModulAvalible(MODULE_DMEXTRAS)) { foreach ($reslist['dmfunc'] as $Element) { if ($USER[$resource[$Element]] > TIMESTAMP) { $this->tplObj->execscript("GetOfficerTime(" . $Element . ", " . ($USER[$resource[$Element]] - TIMESTAMP) . ");"); } $costRessources = BuildFunctions::getElementPrice($USER, $PLANET, $Element); $buyable = BuildFunctions::isElementBuyable($USER, $PLANET, $Element, $costRessources); $costOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $costRessources); $elementBonus = BuildFunctions::getAvalibleBonus($Element); $darkmatterList[$Element] = array('timeLeft' => max($USER[$resource[$Element]] - TIMESTAMP, 0), 'costRessources' => $costRessources, 'buyable' => $buyable, 'time' => $pricelist[$Element]['time'], 'costOverflow' => $costOverflow, 'elementBonus' => $elementBonus); } } if (isModulAvalible(MODULE_OFFICIER)) { foreach ($reslist['officier'] 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); $buyable = BuildFunctions::isElementBuyable($USER, $PLANET, $Element, $costRessources); $costOverflow = BuildFunctions::getRestPrice($USER, $PLANET, $Element, $costRessources); $elementBonus = BuildFunctions::getAvalibleBonus($Element); $officierList[$Element] = array('level' => $USER[$resource[$Element]], 'maxLevel' => $pricelist[$Element]['max'], 'costRessources' => $costRessources, 'buyable' => $buyable, 'costOverflow' => $costOverflow, 'elementBonus' => $elementBonus, 'AllTech' => $AllTech, 'techacc' => BuildFunctions::isTechnologieAccessible($USER, $PLANET, $Element)); } } $close_to = 1; if ($USER['rpg_geologue'] >= 1 && $USER['rpg_amiral'] >= 1 && $USER['training_step'] == 23) { $GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET `training_step` = '24' WHERE `id` = " . $USER['id'] . ";"); $GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET `experience_peace` = `experience_peace` + '24' WHERE `id` = " . $USER['id'] . ";"); $close_to = 0; } $manual_23_step = 1; if ($USER['training'] == 0 && $USER['training_step'] == 23 && $close_to == 1) { $manual_23_step = 0; } $this->tplObj->assign_vars(array('manual_23_step' => $manual_23_step, 'close_to' => $close_to, 'officierList' => $officierList, 'darkmatterList' => $darkmatterList, 'of_dm_trade' => sprintf($LNG['of_dm_trade'], $LNG['tech'][921]))); $this->display('page.officier.default.tpl'); }
public function show() { global $USER, $PLANET, $dpath, $LNG, $resource, $pricelist, $reslist, $CombatCaps, $ProdGrid, $CONF; $elementID = HTTP::_GP('id', 0); $this->setWindow('popup'); $this->initTemplate(); $productionTable = array(); $FleetInfo = array(); $MissileList = array(); $gateData = array(); $CurrentLevel = 0; $ressIDs = array_merge(array(), $reslist['resstype'][1], $reslist['resstype'][2], $reslist['resstype'][3]); if (in_array($elementID, $reslist['prod']) && in_array($elementID, $reslist['build'])) { $BuildLevelFactor = 10; $BuildTemp = $PLANET['temp_max']; $CurrentLevel = $PLANET[$resource[$elementID]]; $BuildEnergy = $USER[$resource[113]]; $BuildLevel = max($CurrentLevel, 0); $BuildStartLvl = max($CurrentLevel - 2, 0); $premium_resource = 0; $peacefull_resource = 0; if ($USER['premium_reward_extraction'] > 0 && $USER['premium_reward_extraction_days'] > TIMESTAMP) { $premium_resource = $USER['premium_reward_extraction']; } $premium_resource = $premium_resource; if ($USER['experience_peace_level'] > 0) { $peacefull_resource = $USER['experience_peace_level']; } $peacefull_resource = $peacefull_resource; $academy_mines = 0; if ($USER['academy_1201'] > 0) { $academy_mines = getbonusOneBis(1201, $USER['academy_1201']); } $academy_mines = $academy_mines; $daily_prod_bonus = 0; if ($USER['daily_produ'] > TIMESTAMP) { $daily_prod_bonus = 30; } $daily_prod_bonus = $daily_prod_bonus; $academy_energy = 0; if ($USER['academy_1202'] > 0) { $academy_energy = getbonusOneBis(1202, $USER['academy_1202']); } $academy_energy = $academy_energy; $academy_fusion = 0; if ($USER['academy_1209'] > 0) { $academy_fusion = getbonusOneBis(1209, $USER['academy_1209']); } $academy_fusion = $academy_fusion; $academy_solar = 0; if ($USER['academy_1210'] > 0) { $academy_solar = getbonusOneBis(1210, $USER['academy_1210']); } $academy_solar = $academy_solar; $combat_collider = 0; if ($USER['combat_reward_collider'] > 0) { $combat_collider = $USER['combat_reward_collider']; } $combat_collider = $combat_collider; $allyInfo = $GLOBALS['DATABASE']->query("SELECT alliance_prod FROM `uni1_alliance` WHERE id = " . $USER['ally_id'] . ";"); $allyInfo = $GLOBALS['DATABASE']->fetch_array($allyInfo); $alliance_prod = 0; if ($allyInfo['alliance_prod'] > 0) { $alliance_prod = $allyInfo['alliance_prod']; } $alliance_prod = $alliance_prod; for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 15; $BuildLevel++) { foreach ($ressIDs as $ID) { if (!isset($ProdGrid[$elementID]['production'][$ID])) { continue; } $Production = eval(ResourceUpdate::getProd($ProdGrid[$elementID]['production'][$ID])); if ($ID != 911 && $ID != 921) { $Production *= Config::get('resource_multiplier'); } $productionTable['production'][$BuildLevel][$ID] = $Production; } } $productionTable['usedResource'] = array_keys($productionTable['production'][$BuildStartLvl]); } elseif (in_array($elementID, $reslist['storage'])) { $BuildLevelFactor = 10; $BuildTemp = $PLANET['temp_max']; $CurrentLevel = $PLANET[$resource[$elementID]]; $BuildEnergy = $USER[$resource[113]]; $BuildLevel = max($CurrentLevel, 0); $BuildStartLvl = max($CurrentLevel - 2, 0); $premium_storage = 1; if ($USER['premium_reward_storing'] > 0 && $USER['premium_reward_storing_days'] > TIMESTAMP) { $premium_storage = $USER['premium_reward_storing']; } $premium_storage = $premium_storage; $academy_storage = 0; if ($USER['academy_1204'] > 0) { $academy_storage = getbonusOneBis(1204, $USER['academy_1204']); } $academy_storage = $academy_storage; for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 15; $BuildLevel++) { foreach ($ressIDs as $ID) { if (!isset($ProdGrid[$elementID]['storage'][$ID])) { continue; } $productionTable['storage'][$BuildLevel][$ID] = round(eval(ResourceUpdate::getProd($ProdGrid[$elementID]['storage'][$ID]))) * Config::get('resource_multiplier') * STORAGE_FACTOR; } } $productionTable['usedResource'] = array_keys($productionTable['storage'][$BuildStartLvl]); } elseif (in_array($elementID, $reslist['fleet'])) { $FleetInfo = array('structure' => $pricelist[$elementID]['cost'][901] + $pricelist[$elementID]['cost'][902], 'tech' => $pricelist[$elementID]['tech'], 'attack' => $CombatCaps[$elementID]['attack'], 'shield' => $CombatCaps[$elementID]['shield'], 'capacity' => $pricelist[$elementID]['capacity'], 'speed1' => $pricelist[$elementID]['speed'], 'speed2' => $pricelist[$elementID]['speed2'], 'consumption1' => $pricelist[$elementID]['consumption'], 'consumption2' => $pricelist[$elementID]['consumption2'], 'rapidfire' => array('from' => array(), 'to' => array())); $fleetIDs = array_merge($reslist['fleet'], $reslist['defense']); foreach ($fleetIDs as $fleetID) { if (isset($CombatCaps[$elementID]['sd']) && !empty($CombatCaps[$elementID]['sd'][$fleetID])) { $FleetInfo['rapidfire']['to'][$fleetID] = $CombatCaps[$elementID]['sd'][$fleetID]; } if (isset($CombatCaps[$fleetID]['sd']) && !empty($CombatCaps[$fleetID]['sd'][$elementID])) { $FleetInfo['rapidfire']['from'][$fleetID] = $CombatCaps[$fleetID]['sd'][$elementID]; } } } elseif (in_array($elementID, $reslist['defense'])) { $FleetInfo = array('structure' => $pricelist[$elementID]['cost'][901] + $pricelist[$elementID]['cost'][902], 'attack' => $CombatCaps[$elementID]['attack'], 'shield' => $CombatCaps[$elementID]['shield'], 'rapidfire' => array('from' => array(), 'to' => array())); $fleetIDs = array_merge($reslist['fleet'], $reslist['defense']); foreach ($fleetIDs as $fleetID) { if (isset($CombatCaps[$elementID]['sd']) && !empty($CombatCaps[$elementID]['sd'][$fleetID])) { $FleetInfo['rapidfire']['to'][$fleetID] = $CombatCaps[$elementID]['sd'][$fleetID]; } if (isset($CombatCaps[$fleetID]['sd']) && !empty($CombatCaps[$fleetID]['sd'][$elementID])) { $FleetInfo['rapidfire']['from'][$fleetID] = $CombatCaps[$fleetID]['sd'][$elementID]; } } } if ($elementID == 43 && $PLANET[$resource[43]] > 0) { $this->tplObj->loadscript('gate.js'); $nextTime = self::getNextJumpWaitTime($PLANET['last_jump_time'], $PLANET['sprungtor']); $gateData = array('nextTime' => _date($LNG['php_tdformat'], $nextTime, $USER['timezone']), 'restTime' => max(0, $nextTime - TIMESTAMP), 'startLink' => $PLANET['name'] . ' ' . strip_tags(BuildPlanetAdressLink($PLANET)), 'gateList' => $this->getTargetGates(), 'fleetList' => $this->getAvalibleFleets()); } elseif ($elementID == 44 && $PLANET[$resource[44]] > 0) { $MissileList = array(502 => $PLANET[$resource[502]], 503 => $PLANET[$resource[503]]); } $this->tplObj->assign_vars(array('elementID' => $elementID, 'productionTable' => $productionTable, 'CurrentLevel' => $CurrentLevel, 'MissileList' => $MissileList, 'Bonus' => BuildFunctions::getAvalibleBonus($elementID), 'FleetInfo' => $FleetInfo, 'gateData' => $gateData)); $this->display('page.infomation.default.tpl'); }