while ($irak = mysql_fetch_array($iraks_query)) { $Record++; $fpage[$irak['zeit']] = ''; if ($irak['zeit'] > time()) { $time = $irak['zeit'] - time(); $fpage[$irak['zeit']] .= InsertJavaScriptChronoApplet("fm", $Record, $time, true); $planet_start = doquery("SELECT * FROM {{table}} WHERE\n galaxy = '" . $irak['galaxy'] . "' AND\n system = '" . $irak['system'] . "' AND\n planet = '" . $irak['planet'] . "' AND\n planet_type = '1'", 'planets'); $user_planet = doquery("SELECT * FROM {{table}} WHERE\n galaxy = '" . $irak['galaxy_angreifer'] . "' AND\n system = '" . $irak['system_angreifer'] . "' AND\n planet = '" . $irak['planet_angreifer'] . "' AND\n planet_type = '1'", 'planets', true); if (mysql_num_rows($planet_start) == 1) { $planet = mysql_fetch_array($planet_start); } $fpage[$irak['zeit']] .= "<table style='width:100%' cellspacing='0' cellpadding='0' border='0' >\n <tr><td style='width:12%;font-size:80%;' class='sb'>-</td>\n <td style='width:13%; font-size:80%; color:#00FF00;' class='sb'>" . date("H:i:s", $irak['zeit']) . "</td>\n <td style='width:75%; font-size:80%;' class='sb'> Ein Raketenangriff(" . $irak['anzahl'] . ") von " . $user_planet['name'] . ""; $fpage[$irak['zeit']] .= '<a href="galaxy.php?mode=3&galaxy=' . $irak["galaxy_angreifer"] . '&system=' . $irak["system_angreifer"] . '&planet=' . $irak["planet_angreifer"] . '">[' . $irak["galaxy_angreifer"] . ':' . $irak["system_angreifer"] . ':' . $irak["planet_angreifer"] . ']</a>'; $fpage[$irak['zeit']] .= 'wird auf Planet' . $planet["name"] . ' '; $fpage[$irak['zeit']] .= '<a href="galaxy.php?mode=3&galaxy=' . $irak["galaxy"] . '&system=' . $irak["system"] . '&planet=' . $irak["planet"] . '">[' . $irak["galaxy"] . ':' . $irak["system"] . ':' . $irak["planet"] . ']</a>'; $fpage[$irak['zeit']] .= InsertJavaScriptChronoApplet("fm", $Record, $time, false); $fpage[$irak['zeit']] .= "</td></tr></table>"; } } $parse = $lang; if ($game_config['OverviewNewsFrame'] == '1') { $parse['NewsFrame'] = "" . stripslashes($game_config['OverviewNewsText']) . ""; $parse['NewsFrame2'] = "<table style='width:10px'>\n <tr><td align='left'><a href=\"javascript:animatedcollapse.toggle('new0004')\" title='" . $lang['over_0015'] . "'><img src='./styl/image/overview/News_01.gif' style='height:25px; width:25px;' alt=''></a></td></tr>\n </table>"; } else { $parse['NewsFrame'] = "" . $lang['over_0016'] . ""; $parse['NewsFrame2'] = "<table style='width:10px'>\n <tr><td align='left'><a href=\"javascript:animatedcollapse.toggle('new0004')\" title='" . $lang['over_0016'] . "'><img src='./styl/image/overview/News_02.gif' style='height:25px; width:25px;' alt=''></a></td></tr>\n </table>"; } if ($game_config['OverviewExternChat'] == '1') { $parse['ExternalTchatFrame'] = "<table><tr><td style='font-size:90%'>" . stripslashes($game_config['OverviewExternChatCmd']) . "</td></tr></table>"; } if ($game_config['OverviewClickBanner'] != '') {
function ShowBuildingInfoPage($CurrentUser, $CurrentPlanet, $BuildID) { global $dpath, $lang, $resource, $pricelist, $CombatCaps; includeLang('infos'); $GateTPL = ''; $DestroyTPL = ''; $TableHeadTPL = ''; $parse = $lang; // Données de base $parse['dpath'] = $dpath; $parse['name'] = $lang['info'][$BuildID]['name']; $parse['image'] = $BuildID; $parse['description'] = $lang['info'][$BuildID]['description']; if ($BuildID >= 1 && $BuildID <= 3) { // Cas des mines $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_p_hour}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID == 4) { // Centrale Solaire $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>"; } elseif ($BuildID == 12) { // Centrale Fusion $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_deuter}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID >= 14 && $BuildID <= 32) { // Batiments Generaux $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 33) { // Batiments Terraformer $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID == 34) { // Dépot d'alliance $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 44) { // Silo de missiles $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 41) { // Batiments lunaires $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID == 42) { // Phalange $PageTPL = gettemplate('info_buildings_table'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_range}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>"; $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 43) { // Porte de Saut $PageTPL = gettemplate('info_buildings_general'); $GateTPL = gettemplate('gate_fleet_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID >= 106 && $BuildID <= 199) { // Laboratoire $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID >= 202 && $BuildID <= 215) { // Flotte $PageTPL = gettemplate('info_buildings_fleet'); $parse['element_typ'] = $lang['tech'][200]; $parse['rf_info_to'] = ShowRapidFireTo($BuildID); // Rapid Fire vers $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID); // Rapid Fire de $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); // Points de Structure $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); // Points d'Attaque $parse['capacity_pt'] = pretty_number($pricelist[$BuildID]['capacity']); // Capacitée de fret $parse['base_speed'] = pretty_number($pricelist[$BuildID]['speed']); // Vitesse de base $parse['base_conso'] = pretty_number($pricelist[$BuildID]['consumption']); // Consommation de base if ($BuildID == 202) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; // Vitesse rééquipée $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['consumption2']) . ")</font>"; // Consommation apres rééquipement } elseif ($BuildID == 211) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; // Vitesse rééquipée } } elseif ($BuildID >= 401 && $BuildID <= 408) { // Defenses $PageTPL = gettemplate('info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $parse['rf_info_to'] = ShowRapidFireTo($BuildID); // Rapid Fire vers $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID); // Rapid Fire de $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); // Points de Structure $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); // Points d'Attaque } elseif ($BuildID >= 502 && $BuildID <= 503) { // Misilles $PageTPL = gettemplate('info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); // Points de Structure $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); // Points d'Attaque } elseif ($BuildID >= 601 && $BuildID <= 615) { // Officiers $PageTPL = gettemplate('info_officiers_general'); } // ---- Tableau d'evolution if ($TableHeadTPL != '') { $parse['table_head'] = parsetemplate($TableHeadTPL, $lang); $parse['table_data'] = ShowProductionTable($CurrentUser, $CurrentPlanet, $BuildID, $TableTPL); } // La page principale $page = parsetemplate($PageTPL, $parse); if ($GateTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { $RestString = GetNextJumpWaitTime($CurrentPlanet); $parse['gate_start_link'] = BuildPlanetAdressLink($CurrentPlanet); if ($RestString['value'] != 0) { $parse['gate_time_script'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true); $parse['gate_wait_time'] = "<div id=\"bxx" . "Gate" . "1" . "\"></div>"; $parse['gate_script_go'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false); } else { $parse['gate_time_script'] = ""; $parse['gate_wait_time'] = ""; $parse['gate_script_go'] = ""; } $parse['gate_dest_moons'] = BuildJumpableMoonCombo($CurrentUser, $CurrentPlanet); $parse['gate_fleet_rows'] = BuildFleetListRows($CurrentPlanet); $page .= parsetemplate($GateTPL, $parse); } } if ($DestroyTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { // ---- Destruction $NeededRessources = GetBuildingPrice($CurrentUser, $CurrentPlanet, $BuildID, true, true); $DestroyTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $BuildID) / 2; $parse['destroyurl'] = "buildings.php?cmd=destroy&building=" . $BuildID; // Non balisé les balises sont dans le tpl $parse['levelvalue'] = $CurrentPlanet[$resource[$BuildID]]; // Niveau du batiment a detruire $parse['nfo_metal'] = $lang['Metal']; $parse['nfo_crysta'] = $lang['Crystal']; $parse['nfo_deuter'] = $lang['Deuterium']; $parse['metal'] = pretty_number($NeededRessources['metal']); // Cout en metal de la destruction $parse['crystal'] = pretty_number($NeededRessources['crystal']); // Cout en cristal de la destruction $parse['deuterium'] = pretty_number($NeededRessources['deuterium']); // Cout en deuterium de la destruction $parse['destroytime'] = pretty_time($DestroyTime); // Durée de la destruction // L'insert de destruction $page .= parsetemplate($DestroyTPL, $parse); } } return $page; }
public function __construct($CurrentUser, $CurrentPlanet, $BuildID) { global $dpath, $lang, $resource, $pricelist, $CombatCaps, $phpEx, $xgp_root; $GateTPL = ''; $DestroyTPL = ''; $TableHeadTPL = ''; $parse = $lang; $parse['dpath'] = $dpath; $parse['name'] = $lang['info'][$BuildID]['name']; $parse['image'] = $BuildID; $parse['description'] = $lang['info'][$BuildID]['description']; if ($BuildID >= 1 && $BuildID <= 3) { $PageTPL = gettemplate('infos/info_buildings_table'); $DestroyTPL = gettemplate('infos/info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{in_level}</td><td class=\"c\">{in_prod_p_hour}</td><td class=\"c\">{in_difference}</td><td class=\"c\">{in_used_energy}</td><td class=\"c\">{in_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID == 4) { $PageTPL = gettemplate('infos/info_buildings_table'); $DestroyTPL = gettemplate('infos/info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{in_level}</td><td class=\"c\">{in_prod_energy}</td><td class=\"c\">{in_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>"; } elseif ($BuildID == 12) { $PageTPL = gettemplate('infos/info_buildings_table'); $DestroyTPL = gettemplate('infos/info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{in_level}</td><td class=\"c\">{in_prod_energy}</td><td class=\"c\">{in_difference}</td><td class=\"c\">{in_used_deuter}</td><td class=\"c\">{in_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID >= 14 && $BuildID <= 32) { $PageTPL = gettemplate('infos/info_buildings_general'); $DestroyTPL = gettemplate('infos/info_buildings_destroy'); } elseif ($BuildID == 33) { $PageTPL = gettemplate('infos/info_buildings_general'); } elseif ($BuildID == 34) { $PageTPL = gettemplate('infos/info_buildings_general'); $DestroyTPL = gettemplate('infos/info_buildings_destroy'); } elseif ($BuildID == 44) { $PageTPL = gettemplate('infos/info_buildings_general'); $DestroyTPL = gettemplate('infos/info_buildings_destroy'); } elseif ($BuildID == 41) { $PageTPL = gettemplate('infos/info_buildings_general'); } elseif ($BuildID == 42) { $PageTPL = gettemplate('infos/info_buildings_table'); $TableHeadTPL = "<tr><td class=\"c\">{in_level}</td><td class=\"c\">{in_range}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>"; $DestroyTPL = gettemplate('infos/info_buildings_destroy'); } elseif ($BuildID == 43) { $PageTPL = gettemplate('infos/info_buildings_general'); $GateTPL = gettemplate('infos/info_gate_table'); $DestroyTPL = gettemplate('infos/info_buildings_destroy'); if ($_POST) { message($this->DoFleetJump($CurrentUser, $CurrentPlanet), "game.php?page=infos&gid=43", 2); } } elseif ($BuildID >= 106 && $BuildID <= 199) { $PageTPL = gettemplate('infos/info_buildings_general'); } elseif ($BuildID >= 202 && $BuildID <= 224) { $PageTPL = gettemplate('infos/info_buildings_fleet'); $parse['element_typ'] = $lang['tech'][200]; $parse['rf_info_to'] = $this->ShowRapidFireTo($BuildID); $parse['rf_info_fr'] = $this->ShowRapidFireFrom($BuildID); $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); $parse['capacity_pt'] = pretty_number($pricelist[$BuildID]['capacity']); $parse['base_speed'] = pretty_number($pricelist[$BuildID]['speed']); $parse['base_conso'] = pretty_number($pricelist[$BuildID]['consumption']); if ($BuildID == 202) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['consumption2']) . ")</font>"; } elseif ($BuildID == 211) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; } } elseif ($BuildID >= 401 && $BuildID <= 411) { $PageTPL = gettemplate('infos/info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $parse['rf_info_to'] = $this->ShowRapidFireTo($BuildID); $parse['rf_info_fr'] = $this->ShowRapidFireFrom($BuildID); $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); } elseif ($BuildID >= 502 && $BuildID <= 503) { $PageTPL = gettemplate('infos/info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); } elseif ($BuildID >= 601 && $BuildID <= 615) { $PageTPL = gettemplate('infos/info_officiers_general'); } if ($TableHeadTPL != '') { $parse['table_head'] = parsetemplate($TableHeadTPL, $lang); $parse['table_data'] = $this->ShowProductionTable($CurrentUser, $CurrentPlanet, $BuildID, $TableTPL); } $page = parsetemplate($PageTPL, $parse); if ($GateTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { $RestString = $this->GetNextJumpWaitTime($CurrentPlanet); $parse['gate_start_link'] = BuildPlanetAdressLink($CurrentPlanet); if ($RestString['value'] != 0) { include $xgp_root . 'includes/functions/InsertJavaScriptChronoApplet.' . $phpEx; $parse['gate_time_script'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true); $parse['gate_wait_time'] = "<div id=\"bxx" . "Gate" . "1" . "\"></div>"; $parse['gate_script_go'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false); } else { $parse['gate_time_script'] = ""; $parse['gate_wait_time'] = ""; $parse['gate_script_go'] = ""; } $parse['gate_dest_moons'] = $this->BuildJumpableMoonCombo($CurrentUser, $CurrentPlanet); $parse['gate_fleet_rows'] = $this->BuildFleetListRows($CurrentPlanet); $page .= parsetemplate($GateTPL, $parse); } } if ($DestroyTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { $NeededRessources = GetBuildingPrice($CurrentUser, $CurrentPlanet, $BuildID, true, true); $DestroyTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $BuildID) / 2; $parse['destroyurl'] = "game.php?page=buildings&cmd=destroy&building=" . $BuildID; $parse['levelvalue'] = $CurrentPlanet[$resource[$BuildID]]; $parse['nfo_metal'] = $lang['Metal']; $parse['nfo_crysta'] = $lang['Crystal']; $parse['nfo_deuter'] = $lang['Deuterium']; $parse['metal'] = pretty_number($NeededRessources['metal']); $parse['crystal'] = pretty_number($NeededRessources['crystal']); $parse['deuterium'] = pretty_number($NeededRessources['deuterium']); $parse['destroytime'] = pretty_time($DestroyTime); $page .= parsetemplate($DestroyTPL, $parse); } } return display($page); }
function BuildFleetEventTable($FleetRow, $Status, $Owner, $Label, $Record) { global $lang; $FleetStyle = array(1 => 'attack', 2 => 'federation', 3 => 'transport', 4 => 'deploy', 5 => 'hold', 6 => 'espionage', 7 => 'colony', 8 => 'harvest', 9 => 'destroy', 10 => 'missile', 15 => 'transport'); $FleetStatus = array(0 => 'flight', 1 => 'holding', 2 => 'return'); if ($Owner == true) { $FleetPrefix = 'own'; } else { $FleetPrefix = ''; } $RowsTPL = gettemplate('overview_fleet_event'); $MissionType = $FleetRow['fleet_mission']; $FleetContent = CreateFleetPopupedFleetLink($FleetRow, $lang['ov_fleet'], $FleetPrefix . $FleetStyle[$MissionType]); $FleetCapacity = CreateFleetPopupedMissionLink($FleetRow, $lang['type_mission'][$MissionType], $FleetPrefix . $FleetStyle[$MissionType]); $StartPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '" . $FleetRow['fleet_start_galaxy'] . "' AND `system` = '" . $FleetRow['fleet_start_system'] . "' AND `planet` = '" . $FleetRow['fleet_start_planet'] . "' AND `planet_type` = '" . $FleetRow['fleet_start_type'] . "';", 'planets', true); $StartType = $FleetRow['fleet_start_type']; $TargetPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND `system` = '" . $FleetRow['fleet_end_system'] . "' AND `planet` = '" . $FleetRow['fleet_end_planet'] . "' AND `planet_type` = '" . $FleetRow['fleet_end_type'] . "';", 'planets', true); $TargetType = $FleetRow['fleet_end_type']; if ($Status != 2) { if ($StartType == 1) { $StartID = $lang['ov_planet_to']; } elseif ($StartType == 3) { $StartID = $lang['ov_moon_to']; } $StartID .= $StartPlanet['name'] . " "; $StartID .= GetStartAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); if ($MissionType != 15) { if ($TargetType == 1) { $TargetID = $lang['ov_planet_to_target']; } elseif ($TargetType == 2) { $TargetID = $lang['ov_debris_to_target']; } elseif ($TargetType == 3) { $TargetID = $lang['ov_moon_to_target']; } } else { $TargetID = $lang['ov_explo_to_target']; } $TargetID .= $TargetPlanet['name'] . " "; $TargetID .= GetTargetAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); } else { if ($StartType == 1) { $StartID = $lang['ov_back_planet']; } elseif ($StartType == 3) { $StartID = $lang['ov_back_moon']; } $StartID .= $StartPlanet['name'] . " "; $StartID .= GetStartAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); if ($MissionType != 15) { if ($TargetType == 1) { $TargetID = $lang['ov_planet_from']; } elseif ($TargetType == 2) { $TargetID = $lang['ov_debris_from']; } elseif ($TargetType == 3) { $TargetID = $lang['ov_moon_from']; } } else { $TargetID = $lang['ov_explo_from']; } $TargetID .= $TargetPlanet['name'] . " "; $TargetID .= GetTargetAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); } if ($Owner == true) { $EventString = $lang['ov_une']; $EventString .= $FleetContent; } else { $EventString = $lang['ov_une_hostile']; $EventString .= $FleetContent; $EventString .= $lang['ov_hostile']; $EventString .= BuildHostileFleetPlayerLink($FleetRow); } if ($Status == 0) { $Time = $FleetRow['fleet_start_time']; $Rest = $Time - time(); $EventString .= $lang['ov_vennant']; $EventString .= $StartID; $EventString .= $lang['ov_atteint']; $EventString .= $TargetID; $EventString .= $lang['ov_mission']; } elseif ($Status == 1) { $Time = $FleetRow['fleet_end_stay']; $Rest = $Time - time(); $EventString .= $lang['ov_vennant']; $EventString .= $StartID; $EventString .= $lang['ov_explo_stay']; $EventString .= $TargetID; $EventString .= $lang['ov_explo_mission']; } elseif ($Status == 2) { $Time = $FleetRow['fleet_end_time']; $Rest = $Time - time(); $EventString .= $lang['ov_rentrant']; $EventString .= $TargetID; $EventString .= $StartID; $EventString .= $lang['ov_mission']; } $EventString .= $FleetCapacity; $bloc['fleet_status'] = $FleetStatus[$Status]; $bloc['fleet_prefix'] = $FleetPrefix; $bloc['fleet_style'] = $FleetStyle[$MissionType]; $bloc['fleet_javai'] = InsertJavaScriptChronoApplet($Label, $Record, $Rest, true); $bloc['fleet_order'] = $Label . $Record; $bloc['fleet_time'] = gmdate("H:i:s", $Time + 1 * 60 * 60); $bloc['fleet_descr'] = $EventString; $bloc['fleet_javas'] = InsertJavaScriptChronoApplet($Label, $Record, $Rest, false); return parsetemplate($RowsTPL, $bloc); }
public function BuildFleetEventTable($FleetRow, $Status, $Owner, $Label, $Record) { global $lang; $FleetStyle = array(1 => 'attack', 2 => 'federation', 3 => 'transport', 4 => 'deploy', 5 => 'hold', 6 => 'espionage', 7 => 'colony', 8 => 'harvest', 9 => 'destroy', 10 => 'missile', 15 => 'transport'); $FleetStatus = array(0 => 'flight', 1 => 'holding', 2 => 'return'); if ($Owner == true) { $FleetPrefix = 'own'; } else { $FleetPrefix = ''; } $RowsTPL = gettemplate('overview/overview_fleet_event'); $MissionType = $FleetRow['fleet_mission']; $FleetContent = $this->CreateFleetPopupedFleetLink($FleetRow, "flotas", $FleetPrefix . $FleetStyle[$MissionType]); $FleetCapacity = $this->CreateFleetPopupedMissionLink($FleetRow, $lang['type_mission'][$MissionType], $FleetPrefix . $FleetStyle[$MissionType]); $StartPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '" . intval($FleetRow['fleet_start_galaxy']) . "' AND `system` = '" . intval($FleetRow['fleet_start_system']) . "' AND `planet` = '" . intval($FleetRow['fleet_start_planet']) . "' AND `planet_type` = '" . intval($FleetRow['fleet_start_type']) . "';", 'planets', true); $StartType = $FleetRow['fleet_start_type']; $TargetPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '" . intval($FleetRow['fleet_end_galaxy']) . "' AND `system` = '" . intval($FleetRow['fleet_end_system']) . "' AND `planet` = '" . intval($FleetRow['fleet_end_planet']) . "' AND `planet_type` = '" . intval($FleetRow['fleet_end_type']) . "';", 'planets', true); $TargetType = $FleetRow['fleet_end_type']; if ($Status != 2) { if ($StartType == 1) { $StartID = $lang['cff_from_the_planet']; } elseif ($StartType == 3) { $StartID = $lang['cff_from_the_moon']; } $StartID .= $StartPlanet['name'] . " "; $StartID .= GetStartAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); if ($MissionType != 15) { if ($TargetType == 1) { $TargetID = $lang['cff_the_planet']; } elseif ($TargetType == 2) { $TargetID = $lang['cff_debris_field']; } elseif ($TargetType == 3) { $TargetID = $lang['cff_to_the_moon']; } } else { $TargetID = $lang['cff_the_position']; } $TargetID .= $TargetPlanet['name'] . " "; $TargetID .= GetTargetAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); } else { if ($StartType == 1) { $StartID = $lang['cff_to_the_planet']; } elseif ($StartType == 3) { $StartID = $lang['cff_the_moon']; } $StartID .= $StartPlanet['name'] . " "; $StartID .= GetStartAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); if ($MissionType != 15) { if ($TargetType == 1) { $TargetID = $lang['cff_from_planet']; } elseif ($TargetType == 2) { $TargetID = $lang['cff_from_debris_field']; } elseif ($TargetType == 3) { $TargetID = $lang['cff_from_the_moon']; } } else { $TargetID = $lang['cff_from_position']; } $TargetID .= $TargetPlanet['name'] . " "; $TargetID .= GetTargetAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); } if ($MissionType == 10) { $EventString = $lang['cff_missile_attack'] . " ( " . eregi_replace("(503,)", "", $FleetRow["fleet_array"]) . " ) "; $Time = $FleetRow['fleet_start_time']; $Rest = $Time - time(); $EventString .= $lang['cff_from']; $EventString .= $StartID; $EventString .= $lang['cff_to']; $EventString .= $TargetID; $EventString .= "."; } else { if ($Owner == true) { $EventString = $lang['cff_one_of_your']; $EventString .= $FleetContent; } else { $EventString = $lang['cff_a']; $EventString .= $FleetContent; $EventString .= $lang['cff_of']; $EventString .= $this->BuildHostileFleetPlayerLink($FleetRow); } if ($Status == 0) { $Time = $FleetRow['fleet_start_time']; $Rest = $Time - time(); $EventString .= $lang['cff_goes']; $EventString .= $StartID; $EventString .= $lang['cff_toward']; $EventString .= $TargetID; $EventString .= $lang['cff_with_the_mission_of']; } elseif ($Status == 1) { $Time = $FleetRow['fleet_end_stay']; $Rest = $Time - time(); $EventString .= $lang['cff_goes']; $EventString .= $StartID; $EventString .= $lang['cff_to_explore']; $EventString .= $TargetID; $EventString .= $lang['cff_with_the_mission_of']; } elseif ($Status == 2) { $Time = $FleetRow['fleet_end_time']; $Rest = $Time - time(); $EventString .= $lang['cff_comming_back']; $EventString .= $TargetID; $EventString .= $StartID; $EventString .= $lang['cff_with_the_mission_of']; } $EventString .= $FleetCapacity; } $bloc['fleet_status'] = $FleetStatus[$Status]; $bloc['fleet_prefix'] = $FleetPrefix; $bloc['fleet_style'] = $FleetStyle[$MissionType]; $bloc['fleet_javai'] = InsertJavaScriptChronoApplet($Label, $Record, $Rest, true); $bloc['fleet_order'] = $Label . $Record; $bloc['fleet_descr'] = $EventString; $bloc['fleet_javas'] = InsertJavaScriptChronoApplet($Label, $Record, $Rest, false); return parsetemplate($RowsTPL, $bloc); }
public function __construct() { global $USER, $PLANET, $dpath, $LNG, $resource, $pricelist, $reslist, $CombatCaps, $ProdGrid, $CONF, $OfficerInfo; $BuildID = request_var('gid', 0); $template = new template(); $template->isPopup(true); if (in_array($BuildID, $reslist['prod']) && $BuildID != 212) { $BuildLevelFactor = 10; $BuildTemp = $PLANET['temp_max']; $CurrentBuildtLvl = $PLANET[$resource[$BuildID]]; $BuildEnergy = $USER[$resource[113]]; /*$BuildLevel = ($CurrentBuildtLvl > 0) ? $CurrentBuildtLvl : 1; $Prod[1] = (floor(eval($ProdGrid[$BuildID]['formule']['metal']) * $CONF['resource_multiplier']) * (1 + (TIMESTAMP - $USER[$resource[703]] <= 0) ? ($ExtraDM[703]['add']) : 0)); $Prod[2] = (floor(eval($ProdGrid[$BuildID]['formule']['crystal']) * $CONF['resource_multiplier']) * (1 + (TIMESTAMP - $USER[$resource[703]] <= 0) ? ($ExtraDM[703]['add']) : 0)); $Prod[7] = (floor(eval($ProdGrid[$BuildID]['formule']['norio']) * $CONF['resource_multiplier']) * (1 + (TIMESTAMP - $USER[$resource[703]] <= 0) ? ($ExtraDM[703]['add']) : 0)); $Prod[3] = (floor(eval($ProdGrid[$BuildID]['formule']['deuterium']) * $CONF['resource_multiplier']) * (1 + (TIMESTAMP - $USER[$resource[703]] <= 0) ? ($ExtraDM[703]['add']) : 0)); $Prod[4] = (floor(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']) * (1 + (TIMESTAMP - $USER[$resource[704]] <= 0) ? ($ExtraDM[704]['add']) : 0)); $Prod[12] = (floor(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']));*/ $BuildLevel = max($CurrentBuildtLvl, 1); $Prod[1] = round(eval($ProdGrid[$BuildID]['formule']['metal']) * $CONF['resource_multiplier']); $Prod[2] = round(eval($ProdGrid[$BuildID]['formule']['crystal']) * $CONF['resource_multiplier']); $Prod[7] = round(eval($ProdGrid[$BuildID]['formule']['norio']) * $CONF['resource_multiplier']); $Prod[3] = round(eval($ProdGrid[$BuildID]['formule']['deuterium']) * $CONF['resource_multiplier']); $Prod[4] = round(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']); $Prod[12] = round(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']); $BuildStartLvl = max($CurrentBuildtLvl - 2, 1); $ActualProd = floor($Prod[$BuildID]); $ActualNeed = $BuildID != 12 ? floor($Prod[4]) : floor($Prod[3]); $ProdFirst = 0; for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 15; $BuildLevel++) { /*$Prod[1] = floor(eval($ProdGrid[$BuildID]['formule']['metal']) * $CONF['resource_multiplier']); $Prod[2] = floor(eval($ProdGrid[$BuildID]['formule']['crystal']) * $CONF['resource_multiplier']); $Prod[3] = floor(eval($ProdGrid[$BuildID]['formule']['deuterium']) * $CONF['resource_multiplier']); $Prod[4] = floor(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']); $Prod[7] = floor(eval($ProdGrid[$BuildID]['formule']['norio']) * $CONF['resource_multiplier']); $Prod[12] = floor(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']);*/ $Prod[1] = round(eval($ProdGrid[$BuildID]['formule']['metal']) * $CONF['resource_multiplier']); $Prod[2] = round(eval($ProdGrid[$BuildID]['formule']['crystal']) * $CONF['resource_multiplier']); $Prod[3] = round(eval($ProdGrid[$BuildID]['formule']['deuterium']) * $CONF['resource_multiplier']); $Prod[7] = round(eval($ProdGrid[$BuildID]['formule']['norio']) * $CONF['resource_multiplier']); $Prod[4] = round(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']); $Prod[12] = round(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']); $NeesRess = $BuildID != 12 ? floor($Prod[4]) : floor($Prod[3]); $prod = pretty_number(floor($Prod[$BuildID])); $prod_diff = colorNumber(pretty_number(floor($Prod[$BuildID] - $ActualProd))); $need = colorNumber(pretty_number(floor($NeesRess))); $need_diff = colorNumber(pretty_number(floor($NeesRess - $ActualNeed))); if ($ProdFirst == 0) { $ProdFirst = floor($Prod[$BuildID]); } $ProductionTable[] = array('BuildLevel' => $BuildLevel, 'prod' => $prod, 'prod_diff' => $prod_diff, 'need' => $need, 'need_diff' => $need_diff); } } elseif (in_array($BuildID, $reslist['fleet'])) { for ($Type = 200; $Type < 500; $Type++) { if ($CombatCaps[$BuildID]['sd'][$Type] > 1) { $RapidFire['to'][$LNG['tech'][$Type]] = $CombatCaps[$BuildID]['sd'][$Type]; } if ($CombatCaps[$Type]['sd'][$BuildID] > 1) { $RapidFire['from'][$LNG['tech'][$Type]] = $CombatCaps[$Type]['sd'][$BuildID]; } } $FleetInfo[$LNG['in_struct_pt']] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal'] + $pricelist[$BuildID]['norio']); $FleetInfo[$LNG['in_shield_pt']] = pretty_number($CombatCaps[$BuildID]['shield']); $FleetInfo[$LNG['in_attack_pt']] = pretty_number($CombatCaps[$BuildID]['attack']); $FleetInfo[$LNG['in_capacity']] = pretty_number($pricelist[$BuildID]['capacity']); $FleetInfo[$LNG['in_base_speed']][] = pretty_number($pricelist[$BuildID]['speed']); $FleetInfo[$LNG['in_consumption']][] = pretty_number($pricelist[$BuildID]['consumption']); $FleetInfo[$LNG['in_base_speed']][] = pretty_number($pricelist[$BuildID]['speed2']); $FleetInfo[$LNG['in_consumption']][] = pretty_number($pricelist[$BuildID]['consumption2']); } elseif (in_array($BuildID, $reslist['defense'])) { for ($Type = 200; $Type < 500; $Type++) { if ($CombatCaps[$BuildID]['sd'][$Type] > 1) { $RapidFire['to'][$LNG['tech'][$Type]] = $CombatCaps[$BuildID]['sd'][$Type]; } if ($CombatCaps[$Type]['sd'][$BuildID] > 1) { $RapidFire['from'][$LNG['tech'][$Type]] = $CombatCaps[$Type]['sd'][$BuildID]; } } $FleetInfo[$LNG['in_struct_pt']] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal'] + $pricelist[$BuildID]['norio']); $FleetInfo[$LNG['in_shield_pt']] = pretty_number($CombatCaps[$BuildID]['shield']); $FleetInfo[$LNG['in_attack_pt']] = pretty_number($CombatCaps[$BuildID]['attack']); } elseif ($BuildID == 43 && $PLANET[$resource[43]] > 0) { $template->loadscript('flotten.js'); $GateFleetList['jump'] = $this->DoFleetJump(); $RestString = $this->GetNextJumpWaitTime($PLANET); if ($RestString['value'] != 0) { include_once ROOT_PATH . 'includes/functions/InsertJavaScriptChronoApplet.php'; $template->assign_vars(array('gate_time_script' => InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true), 'gate_script_go' => InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false))); } $GateFleetList['start_link'] = BuildPlanetAdressLink($PLANET); $GateFleetList['moons'] = $this->BuildJumpableMoonCombo($USER, $PLANET); $GateFleetList['fleets'] = $this->BuildFleetListRows($PLANET); } if (in_array($BuildID, $reslist['officier'])) { $description = $OfficerInfo[$BuildID]['info'] ? sprintf($LNG['info'][$BuildID]['description'], is_float($OfficerInfo[$BuildID]['info']) ? $OfficerInfo[$BuildID]['info'] * 100 : $OfficerInfo[$BuildID]['info'], $pricelist[$BuildID]['max']) : sprintf($LNG['info'][$BuildID]['description'], $pricelist[$BuildID]['max']); } else { $description = $LNG['info'][$BuildID]['description']; } $template->assign_vars(array('id' => $BuildID, 'name' => $LNG['info'][$BuildID]['name'], 'image' => $BuildID, 'description' => $description, 'ProductionTable' => $ProductionTable, 'RapidFire' => $RapidFire, 'Level' => $CurrentBuildtLvl, 'FleetInfo' => $FleetInfo, 'GateFleetList' => $GateFleetList, 'in_jump_gate_jump' => $LNG['in_jump_gate_jump'], 'gate_ship_dispo' => $LNG['in_jump_gate_available'], 'in_level' => $LNG['in_level'], 'in_prod_p_hour' => $LNG['in_prod_p_hour'], 'in_difference' => $LNG['in_difference'], 'in_used_energy' => $LNG['in_used_energy'], 'in_prod_energy' => $LNG['in_prod_energy'], 'in_used_deuter' => $LNG['in_used_deuter'], 'in_rf_again' => $LNG['in_rf_again'], 'in_rf_from' => $LNG['in_rf_from'], 'in_jump_gate_select_ships' => $LNG['in_jump_gate_select_ships'], 'in_jump_gate_start_moon' => $LNG['in_jump_gate_start_moon'], 'in_jump_gate_finish_moon' => $LNG['in_jump_gate_finish_moon'], 'in_jump_gate_wait_time' => $LNG['in_jump_gate_wait_time'])); $template->show('info_overview.tpl'); }
function ShowBuildingInfoPage($CurrentUser, $CurrentPlanet, $BuildID) { global $dpath, $lang, $sn_data; $sn_groups =& $sn_data['groups']; $unit_data =& $sn_data[$BuildID]; lng_include('infos'); $GateTPL = ''; $DestroyTPL = ''; $TableHeadTPL = ''; $parse = $lang; // Données de base $parse['dpath'] = $dpath; $parse['name'] = $lang['tech'][$BuildID]; $parse['image'] = $BuildID; $parse['description'] = $lang['info'][$BuildID]['description']; if ($BuildID >= 1 && $BuildID <= 3) { // Cas des mines $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_p_hour}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID == 4) { // Centrale Solaire $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>"; } elseif ($BuildID == 12) { // Centrale Fusion $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_deuter}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID >= 14 && $BuildID <= 32) { // Batiments Generaux $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 33) { // Batiments Terraformer $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID == 34) { // Dépot d'alliance $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 35) { // nano $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 44) { // Silo de missiles $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 41) { // Batiments lunaires $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID == 42) { // Phalange $PageTPL = gettemplate('info_buildings_table'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_range}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>"; $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 43) { // Porte de Saut $PageTPL = gettemplate('info_buildings_general'); $GateTPL = gettemplate('gate_fleet_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif (in_array($BuildID, $sn_data['groups']['tech'])) { // Laboratoire $PageTPL = gettemplate('info_buildings_general'); } elseif (in_array($BuildID, $sn_data['groups']['fleet'])) { // Flotte $PageTPL = gettemplate('info_buildings_fleet'); $parse['element_typ'] = $lang['tech'][SHIP_FLEET]; $rapid_fire = eco_render_rapid_fire($BuildID); $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers $parse['rf_info_fr'] = $rapid_fire['from']; // Rapid Fire de $parse['hull_pt'] = pretty_number(($sn_data[$BuildID]['metal'] + $sn_data[$BuildID]['crystal']) / 10); // Points de Structure $parse['shield_pt'] = pretty_number($sn_data[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($sn_data[$BuildID]['attack']); // Points d'Attaque $parse['capacity_pt'] = pretty_number($sn_data[$BuildID]['capacity']); // Capacitée de fret $parse['base_speed'] = pretty_number($sn_data[$BuildID]['speed']); // Vitesse de base $parse['base_conso'] = pretty_number($sn_data[$BuildID]['consumption']); // Consommation de base if ($BuildID == SHIP_CARGO_SMALL) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($sn_data[$BuildID]['speed2']) . ")</font>"; // Vitesse rééquipée $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($sn_data[$BuildID]['consumption2']) . ")</font>"; // Consommation apres rééquipement } elseif ($BuildID == SHIP_BOMBER) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($sn_data[$BuildID]['speed2']) . ")</font>"; // Vitesse rééquipée } } elseif (in_array($BuildID, $sn_data['groups']['defense_active'])) { // Defenses $PageTPL = gettemplate('info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $rapid_fire = eco_render_rapid_fire($BuildID); $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers $parse['rf_info_fr'] = $rapid_fire['from']; // Rapid Fire de $parse['hull_pt'] = pretty_number(($sn_data[$BuildID]['metal'] + $sn_data[$BuildID]['crystal']) / 10); // Points de Structure $parse['shield_pt'] = pretty_number($sn_data[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($sn_data[$BuildID]['attack']); // Points d'Attaque } elseif ($BuildID >= 502 && $BuildID <= 503) { // Misilles $PageTPL = gettemplate('info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $parse['hull_pt'] = pretty_number($sn_data[$BuildID]['metal'] + $sn_data[$BuildID]['crystal']); // Points de Structure $parse['shield_pt'] = pretty_number($sn_data[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($sn_data[$BuildID]['attack']); // Points d'Attaque } elseif (in_array($BuildID, $sn_data['groups']['mercenaries'])) { // Officiers $PageTPL = gettemplate('info_officiers_general'); $mercenary = $sn_data[$BuildID]; $mercenary_bonus = $mercenary['bonus']; $mercenary_bonus = $mercenary_bonus >= 0 ? "+{$mercenary_bonus}" : "{$mercenary_bonus}"; switch ($mercenary['bonus_type']) { case BONUS_PERCENT: $mercenary_bonus = "{$mercenary_bonus}%"; break; case BONUS_ADD: break; case BONUS_ABILITY: $mercenary_bonus = ''; break; default: break; } $parse['EFFECT'] = $lang['info'][$BuildID]['effect']; $parse['mercenary_bonus'] = $mercenary_bonus; $parse['max_level'] = $mercenary['max']; } // ---- Tableau d'evolution if ($TableHeadTPL != '') { $parse['table_head'] = parsetemplate($TableHeadTPL, $lang); $parse['table_data'] = ShowProductionTable($CurrentUser, $CurrentPlanet, $BuildID, $TableTPL); } // La page principale $page = parsetemplate($PageTPL, $parse); if ($GateTPL != '') { if ($CurrentPlanet[$unit_data['name']] > 0) { $RestString = GetNextJumpWaitTime($CurrentPlanet); $parse['gate_start_link'] = uni_render_coordinates_href($CurrentPlanet, '', 3); if ($RestString['value'] != 0) { $parse['gate_time_script'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true); $parse['gate_wait_time'] = "<div id=\"bxx" . "Gate" . "1" . "\"></div>"; $parse['gate_script_go'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false); } else { $parse['gate_time_script'] = ""; $parse['gate_wait_time'] = ""; $parse['gate_script_go'] = ""; } $parse['gate_dest_moons'] = BuildJumpableMoonCombo($CurrentUser, $CurrentPlanet); $parse['gate_fleet_rows'] = BuildFleetListRows($CurrentPlanet); $page .= parsetemplate($GateTPL, $parse); } } if ($DestroyTPL != '') { if ($CurrentPlanet[$unit_data['name']] > 0) { // ---- Destruction $NeededRessources = GetBuildingPrice($CurrentUser, $CurrentPlanet, $BuildID, true, true); $DestroyTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $BuildID) / 2; $parse['destroyurl'] = "buildings.php?mode=" . QUE_STRUCTURES . "&action=destroy&unit_id={$BuildID}"; // Non balisé les balises sont dans le $parse['levelvalue'] = $CurrentPlanet[$unit_data['name']]; // Niveau du batiment a detruire $parse['nfo_metal'] = $lang['Metal']; $parse['nfo_crysta'] = $lang['Crystal']; $parse['nfo_deuter'] = $lang['Deuterium']; $parse['metal'] = pretty_number($NeededRessources['metal']); // Cout en metal de la destruction $parse['crystal'] = pretty_number($NeededRessources['crystal']); // Cout en cristal de la destruction $parse['deuterium'] = pretty_number($NeededRessources['deuterium']); // Cout en deuterium de la destruction $parse['destroytime'] = pretty_time($DestroyTime); // Durée de la destruction // L'insert de destruction $page .= parsetemplate($DestroyTPL, $parse); } } return $page; }
public function __construct() { global $USER, $PLANET, $dpath, $LNG, $resource, $pricelist, $reslist, $CombatCaps, $ProdGrid, $CONF; $BuildID = request_var('gid', 0); $template = new template(); $template->page_header(); $template->page_footer(); if (in_array($BuildID, $reslist['prod']) && $BuildID != 212) { $BuildLevelFactor = 10; $BuildTemp = $PLANET['temp_max']; $CurrentBuildtLvl = $PLANET[$resource[$BuildID]]; $BuildEnergy = $USER[$resource[113]]; $BuildLevel = $CurrentBuildtLvl > 0 ? $CurrentBuildtLvl : 1; $Prod[1] = floor(eval($ProdGrid[$BuildID]['formule']['metal']) * $CONF['resource_multiplier']) * (1 + $USER['rpg_geologue'] * GEOLOGUE); $Prod[2] = floor(eval($ProdGrid[$BuildID]['formule']['crystal']) * $CONF['resource_multiplier']) * (1 + $USER['rpg_geologue'] * GEOLOGUE); $Prod[3] = floor(eval($ProdGrid[$BuildID]['formule']['deuterium']) * $CONF['resource_multiplier']) * (1 + $USER['rpg_geologue'] * GEOLOGUE); $BuildStartLvl = max($CurrentBuildtLvl - 2, 1); if ($BuildID >= 4) { $Prod[4] = floor(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']) * (1 + $USER['rpg_ingenieur'] * INGENIEUR); } else { $Prod[4] = floor(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']); } $ActualProd = floor($Prod[$BuildID]); if ($BuildID != 12) { $ActualNeed = floor($Prod[4]); } else { $ActualNeed = floor($Prod[3]); } $ProdFirst = 0; for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 15; $BuildLevel++) { $Prod[1] = floor(eval($ProdGrid[$BuildID]['formule']['metal']) * $CONF['resource_multiplier']); $Prod[2] = floor(eval($ProdGrid[$BuildID]['formule']['crystal']) * $CONF['resource_multiplier']); $Prod[3] = floor(eval($ProdGrid[$BuildID]['formule']['deuterium']) * $CONF['resource_multiplier']); if ($BuildID >= 4) { $Prod[4] = floor(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']); } else { $Prod[4] = floor(eval($ProdGrid[$BuildID]['formule']['energy']) * $CONF['resource_multiplier']); } $bloc['build_lvl'] = $CurrentBuildtLvl == $BuildLevel ? "<font color=\"#ff0000\">" . $BuildLevel . "</font>" : $BuildLevel; if ($BuildID != 12) { $prod = pretty_number(floor($Prod[$BuildID])); $prod_diff = colorNumber(pretty_number(floor($Prod[$BuildID] - $ActualProd))); $need = colorNumber(pretty_number(floor($Prod[4]))); $need_diff = colorNumber(pretty_number(floor($Prod[4] - $ActualNeed))); } else { $prod = pretty_number(floor($Prod[4])); $prod_diff = colorNumber(pretty_number(floor($Prod[4] - $ActualProd))); $need = colorNumber(pretty_number(floor($Prod[3]))); $need_diff = colorNumber(pretty_number(floor($Prod[3] - $ActualNeed))); } if ($ProdFirst == 0) { if ($BuildID != 12) { $ProdFirst = floor($Prod[$BuildID]); } else { $ProdFirst = floor($Prod[4]); } } $ProductionTable[] = array('BuildLevel' => $BuildLevel, 'prod' => $prod, 'prod_diff' => $prod_diff, 'need' => $need, 'need_diff' => $need_diff); } } elseif (in_array($BuildID, $reslist['fleet'])) { for ($Type = 200; $Type < 500; $Type++) { if ($CombatCaps[$BuildID]['sd'][$Type] > 1) { $RapidFire['to'][$LNG['tech'][$Type]] = $CombatCaps[$BuildID]['sd'][$Type]; } if ($CombatCaps[$Type]['sd'][$BuildID] > 1) { $RapidFire['from'][$LNG['tech'][$Type]] = $CombatCaps[$Type]['sd'][$BuildID]; } } $FleetInfo[$LNG['in_struct_pt']] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); $FleetInfo[$LNG['in_shield_pt']] = pretty_number($CombatCaps[$BuildID]['shield']); $FleetInfo[$LNG['in_attack_pt']] = pretty_number($CombatCaps[$BuildID]['attack']); $FleetInfo[$LNG['in_capacity']] = pretty_number($pricelist[$BuildID]['capacity']); $FleetInfo[$LNG['in_base_speed']][] = pretty_number($pricelist[$BuildID]['speed']); $FleetInfo[$LNG['in_consumption']][] = pretty_number($pricelist[$BuildID]['consumption']); $FleetInfo[$LNG['in_base_speed']][] = pretty_number($pricelist[$BuildID]['speed2']); $FleetInfo[$LNG['in_consumption']][] = pretty_number($pricelist[$BuildID]['consumption2']); } elseif (in_array($BuildID, $reslist['defense'])) { for ($Type = 200; $Type < 500; $Type++) { if ($CombatCaps[$BuildID]['sd'][$Type] > 1) { $RapidFire['to'][$LNG['tech'][$Type]] = $CombatCaps[$BuildID]['sd'][$Type]; } if ($CombatCaps[$Type]['sd'][$BuildID] > 1) { $RapidFire['from'][$LNG['tech'][$Type]] = $CombatCaps[$Type]['sd'][$BuildID]; } } $FleetInfo[$LNG['in_struct_pt']] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); $FleetInfo[$LNG['in_shield_pt']] = pretty_number($CombatCaps[$BuildID]['shield']); $FleetInfo[$LNG['in_attack_pt']] = pretty_number($CombatCaps[$BuildID]['attack']); } elseif ($BuildID == 43 && $PLANET[$resource[43]] > 0) { $GateFleetList['jump'] = $this->DoFleetJump(); $RestString = $this->GetNextJumpWaitTime($PLANET); if ($RestString['value'] != 0) { include_once ROOT_PATH . 'includes/functions/InsertJavaScriptChronoApplet.' . PHP_EXT; $template->assign_vars(array('gate_time_script' => InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true), 'gate_script_go' => InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false))); } $GateFleetList['start_link'] = BuildPlanetAdressLink($PLANET); $GateFleetList['moons'] = $this->BuildJumpableMoonCombo($USER, $PLANET); $GateFleetList['fleets'] = $this->BuildFleetListRows($PLANET); } $template->assign_vars(array('id' => $BuildID, 'name' => $LNG['info'][$BuildID]['name'], 'image' => $BuildID, 'description' => $LNG['info'][$BuildID]['description'], 'ProductionTable' => $ProductionTable, 'RapidFire' => $RapidFire, 'Level' => $CurrentBuildtLvl, 'FleetInfo' => $FleetInfo, 'GateFleetList' => $GateFleetList, 'in_jump_gate_jump' => $LNG['in_jump_gate_jump'], 'gate_ship_dispo' => $LNG['in_jump_gate_available'], 'in_level' => $LNG['in_level'], 'in_prod_p_hour' => $LNG['in_prod_p_hour'], 'in_difference' => $LNG['in_difference'], 'in_used_energy' => $LNG['in_used_energy'], 'in_prod_energy' => $LNG['in_prod_energy'], 'in_used_deuter' => $LNG['in_used_deuter'], 'in_rf_again' => $LNG['in_rf_again'], 'in_rf_from' => $LNG['in_rf_from'], 'in_jump_gate_select_ships' => $LNG['in_jump_gate_select_ships'], 'in_jump_gate_start_moon' => $LNG['in_jump_gate_start_moon'], 'in_jump_gate_finish_moon' => $LNG['in_jump_gate_finish_moon'], 'in_jump_gate_wait_time' => $LNG['in_jump_gate_wait_time'])); $template->show('info_overview.tpl'); }
/** * BuildFleetEventTaple.php * @Licence GNU (GPL) * @version 3.0 * @copyright 2009 * @Team Space Beginner * **/ function BuildFleetEventTable($FleetRow, $Status, $Owner, $Label, $Record) { global $lang; $FleetStyle = array(1 => 'attack', 2 => 'federation', 3 => 'transport', 4 => 'deploy', 5 => 'hold', 6 => 'espionage', 7 => 'colony', 8 => 'harvest', 9 => 'destroy', 10 => 'missile', 15 => 'transport'); $FleetStatus = array(0 => 'flight', 1 => 'holding', 2 => 'return'); if ($Owner == true) { $FleetPrefix = 'own'; } else { $FleetPrefix = ''; } $RowsTPL = gettemplate('ubersicht/ubersicht_02'); $MissionType = $FleetRow['fleet_mission']; $FleetContent = CreateFleetPopupedFleetLink($FleetRow, $lang['over']['1022'], $FleetPrefix . $FleetStyle[$MissionType]); $FleetCapacity = CreateFleetPopupedMissionLink($FleetRow, $lang['type_mission'][$MissionType], $FleetPrefix . $FleetStyle[$MissionType]); $StartPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '" . $FleetRow['fleet_start_galaxy'] . "' AND `system` = '" . $FleetRow['fleet_start_system'] . "' AND `planet` = '" . $FleetRow['fleet_start_planet'] . "' AND `planet_type` = '" . $FleetRow['fleet_start_type'] . "';", 'planets', true); $StartType = $FleetRow['fleet_start_type']; $TargetPlanet = doquery("SELECT `name` FROM {{table}} WHERE `galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND `system` = '" . $FleetRow['fleet_end_system'] . "' AND `planet` = '" . $FleetRow['fleet_end_planet'] . "' AND `planet_type` = '" . $FleetRow['fleet_end_type'] . "';", 'planets', true); $TargetType = $FleetRow['fleet_end_type']; if ($Status != 2) { if ($StartType == 1) { $StartID = $lang['over']['1001']; } elseif ($StartType == 3) { $StartID = $lang['over']['1002']; } $StartID .= $StartPlanet['name'] . " "; $StartID .= GetStartAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); if ($MissionType != 15) { if ($TargetType == 1) { $TargetID = $lang['over']['1003']; } elseif ($TargetType == 2) { $TargetID = $lang['over']['1004']; } elseif ($TargetType == 3) { $TargetID = $lang['over']['1005']; } } else { $TargetID = $lang['over']['1006']; } $TargetID .= $TargetPlanet['name'] . " "; $TargetID .= GetTargetAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); } else { if ($StartType == 1) { $StartID = $lang['over']['1007']; } elseif ($StartType == 3) { $StartID = $lang['over']['1007']; } $StartID .= $StartPlanet['name'] . " "; $StartID .= GetStartAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); if ($MissionType != 15) { if ($TargetType == 1) { $TargetID = $lang['over']['1009']; } elseif ($TargetType == 2) { $TargetID = $lang['over']['1010']; } elseif ($TargetType == 3) { $TargetID = $lang['over']['1011']; } } else { $TargetID = $lang['over']['1012']; } $TargetID .= $TargetPlanet['name'] . " "; $TargetID .= GetTargetAdressLink($FleetRow, $FleetPrefix . $FleetStyle[$MissionType]); } if ($Owner == true) { $EventString = $lang['over']['1013']; $EventString .= $FleetContent; } elseif ($Owner == false and $MissionType == 5) { $EventString = $lang['ov_one_stranger']; $EventString .= $FleetContent; $EventString .= $lang['over']['1014']; $EventString .= BuildHostileFleetPlayerLink($FleetRow); } elseif ($Owner == false and $MissionType == 2) { $EventString = $lang['ov_one_stranger']; $EventString .= $FleetContent; $EventString .= $lang['over']['1014']; $EventString .= BuildHostileFleetPlayerLink($FleetRow); } else { $EventString = $lang['over']['1015']; $EventString .= $FleetContent; $EventString .= $lang['ov_hostile']; $EventString .= BuildHostileFleetPlayerLink($FleetRow); } if ($Status == 0) { $Time = $FleetRow['fleet_start_time']; $Rest = $Time - time(); $EventString .= $lang['over']['1016']; // ' venant ' $EventString .= $StartID; $EventString .= $lang['over']['1017']; // ' atteint ' $EventString .= $TargetID; $EventString .= $lang['over']['1021']; // '. Elle avait pour mission: ' } elseif ($Status == 1) { $Time = $FleetRow['fleet_end_stay']; $Rest = $Time - time(); $EventString .= $lang['over']['1016']; // ' venant ' $EventString .= $StartID; $EventString .= $lang['over']['1018']; // ' explore ' $EventString .= $TargetID; $EventString .= $lang['over']['1019']; // '. Elle a pour mission: ' } elseif ($Status == 2) { $Time = $FleetRow['fleet_end_time']; $Rest = $Time - time(); $EventString .= $lang['over']['1020']; // ' rentrant ' $EventString .= $TargetID; $EventString .= $StartID; $EventString .= $lang['over']['1021']; // '. Elle avait pour mission: ' } $EventString .= $FleetCapacity; $bloc['fleet_status'] = $FleetStatus[$Status]; $bloc['fleet_prefix'] = $FleetPrefix; $bloc['fleet_style'] = $FleetStyle[$MissionType]; $bloc['fleet_javai'] = InsertJavaScriptChronoApplet($Label, $Record, $Rest, true); $bloc['fleet_order'] = $Label . $Record; $bloc['fleet_time'] = date("H:i:s", $Time); $bloc['fleet_descr'] = $EventString; $bloc['fleet_javas'] = InsertJavaScriptChronoApplet($Label, $Record, $Rest, false); return parsetemplate($RowsTPL, $bloc); }
function ShowBuildingInfoPage($CurrentUser, $CurrentPlanet, $BuildID) { global $dpath, $lang, $resource, $pricelist, $CombatCaps; includeLang('infos'); $GateTPL = ''; $DestroyTPL = ''; $TableHeadTPL = ''; $parse = $lang; $parse['dpath'] = $dpath; $parse['name'] = $lang['info'][$BuildID]['name']; $parse['image'] = $BuildID; $parse['description'] = $lang['info'][$BuildID]['description']; if ($BuildID >= 1 && $BuildID <= 4) { $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_p_hour}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID == 5) { $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>"; } elseif ($BuildID == 12) { $PageTPL = gettemplate('info_buildings_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_deuter}</td><td class=\"c\">{nfo_difference}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; } elseif ($BuildID >= 14 && $BuildID <= 32) { $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 33) { $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID == 34) { $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 35) { $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 44) { $PageTPL = gettemplate('info_buildings_general'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 41) { $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID == 42) { $PageTPL = gettemplate('info_buildings_table'); $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_range}</td></tr>"; $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>"; $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID == 43) { $PageTPL = gettemplate('info_buildings_general'); $GateTPL = gettemplate('gate_fleet_table'); $DestroyTPL = gettemplate('info_buildings_destroy'); } elseif ($BuildID >= 106 && $BuildID <= 200) { $PageTPL = gettemplate('info_buildings_general'); } elseif ($BuildID >= 202 && $BuildID <= 250) { $PageTPL = gettemplate('info_buildings_fleet'); $parse['element_typ'] = $lang['tech'][201]; $parse['rf_info_to'] = ShowRapidFireTo($BuildID); // Rapid Fire vers $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID); // Rapid Fire de $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['mass']); // Points de Structure $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); // Points de Bouclier $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); // Points d'Attaque $parse['capacity_pt'] = pretty_number($pricelist[$BuildID]['capacity']); // Capacitée de fret $parse['base_speed'] = pretty_number($pricelist[$BuildID]['speed']); // Vitesse de base $parse['base_conso'] = pretty_number($pricelist[$BuildID]['consumption']); // Consommation de base if ($BuildID == 202) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['consumption2']) . ")</font>"; } elseif ($BuildID == 211) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; } } elseif ($BuildID >= 401 && $BuildID <= 410) { $PageTPL = gettemplate('info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $parse['rf_info_to'] = ShowRapidFireTo($BuildID); $parse['rf_info_fr'] = ShowRapidFireFrom($BuildID); $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['mass']); $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); } elseif ($BuildID >= 502 && $BuildID <= 503) { $PageTPL = gettemplate('info_buildings_defense'); $parse['element_typ'] = $lang['tech'][400]; $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['mass']); $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); } elseif ($BuildID >= 601 && $BuildID <= 619 || $Tech > 601) { $PageTPL = gettemplate('info_officiers_general'); } if ($TableHeadTPL != '') { $parse['table_head'] = parsetemplate($TableHeadTPL, $lang); $parse['table_data'] = ShowProductionTable($CurrentUser, $CurrentPlanet, $BuildID, $TableTPL); } $page = parsetemplate($PageTPL, $parse); if ($GateTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { $RestString = GetNextJumpWaitTime($CurrentPlanet); $parse['gate_start_link'] = BuildPlanetAdressLink($CurrentPlanet); if ($RestString['value'] != 0) { $parse['gate_time_script'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true); $parse['gate_wait_time'] = "<div id=\"bxx" . "Gate" . "1" . "\"></div>"; $parse['gate_script_go'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false); } else { $parse['gate_time_script'] = ""; $parse['gate_wait_time'] = ""; $parse['gate_script_go'] = ""; } $parse['gate_dest_moons'] = BuildJumpableMoonCombo($CurrentUser, $CurrentPlanet); $parse['gate_fleet_rows'] = BuildFleetListRows($CurrentPlanet); $page .= parsetemplate($GateTPL, $parse); } } if ($DestroyTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { $NeededRessources = GetBuildingPrice($CurrentUser, $CurrentPlanet, $BuildID, true, true); $DestroyTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $BuildID) / 2; $parse['destroyurl'] = "buildings.php?cmd=destroy&building=" . $BuildID; $parse['levelvalue'] = $CurrentPlanet[$resource[$BuildID]]; $parse['nfo_metal'] = $lang['Metal']; $parse['nfo_crysta'] = $lang['Crystal']; $parse['nfo_deuter'] = $lang['Deuterium']; $parse['nfo_tachyon'] = $lang['Tachyon']; $parse['metal'] = pretty_number($NeededRessources['metal']); $parse['crystal'] = pretty_number($NeededRessources['crystal']); $parse['deuterium'] = pretty_number($NeededRessources['deuterium']); $parse['tachyon'] = pretty_number($NeededRessources['tachyon']); $parse['destroytime'] = pretty_time($DestroyTime); $page .= parsetemplate($DestroyTPL, $parse); } } return $page; }
public function ShowInfosPage($CurrentUser, $CurrentPlanet, $BuildID) { global $dpath, $lang, $resource, $pricelist, $CombatCaps, $phpEx, $db, $svn_root, $displays; $displays->assignContent("infos/info"); $GateTPL = ''; $DestroyTPL = ''; $TableHeadTPL = ''; $parse['dpath'] = $dpath; $parse['name'] = $lang['info'][$BuildID]['name']; $parse['image'] = $BuildID; $parse['description'] = $lang['info'][$BuildID]['description']; if ($BuildID >= 1 && $BuildID <= 3) { $PageTPL = 'info_buildings'; $DestroyTPL = 'info_buildings_destroy'; $TableHeadTPL = TRUE; } elseif ($BuildID == 4) { $PageTPL = 'info_buildings'; $DestroyTPL = 'info_buildings_destroy'; $TableHeadTPL = TRUE; } elseif ($BuildID == 12) { $PageTPL = 'info_buildings'; $DestroyTPL = 'info_buildings_destroy'; $TableHeadTPL = TRUE; } elseif ($BuildID >= 14 && $BuildID <= 32) { $PageTPL = 'info_buildings'; $DestroyTPL = 'info_buildings_destroy'; } elseif ($BuildID == 33) { $PageTPL = 'info_buildings'; } elseif ($BuildID == 34) { $PageTPL = 'info_buildings'; $DestroyTPL = 'info_buildings_destroy'; } elseif ($BuildID == 44) { $PageTPL = 'info_buildings'; $DestroyTPL = 'info_buildings_destroy'; } elseif ($BuildID == 41) { $PageTPL = 'info_buildings'; } elseif ($BuildID == 42) { $PageTPL = 'info_buildings'; $DestroyTPL = 'info_buildings_destroy'; $TableHeadTPL = TRUE; } elseif ($BuildID == 43) { $GateTPL = 'info_gate_table'; $PageTPL = 'info_buildings'; $DestroyTPL = 'info_buildings_destroy'; } elseif ($BuildID >= 106 && $BuildID <= 199) { $PageTPL = 'info_buildings'; } elseif ($BuildID >= 202 && $BuildID <= 224) { $PageTPL = 'info_fleet'; $parse['element_typ'] = $lang['tech'][200]; $parse['rf_info_to'] = $this->ShowRapidFireTo($BuildID); $parse['rf_info_fr'] = $this->ShowRapidFireFrom($BuildID); $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); $parse['capacity_pt'] = pretty_number($pricelist[$BuildID]['capacity']); $parse['base_speed'] = pretty_number($pricelist[$BuildID]['speed']); $parse['base_conso'] = pretty_number($pricelist[$BuildID]['consumption']); if ($BuildID == 202) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['consumption2']) . ")</font>"; } elseif ($BuildID == 211) { $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($pricelist[$BuildID]['speed2']) . ")</font>"; } } elseif ($BuildID >= 401 && $BuildID <= 411) { $PageTPL = 'info_fleet'; $parse['element_typ'] = $lang['tech'][400]; $parse['rf_info_to'] = $this->ShowRapidFireTo($BuildID); $parse['rf_info_fr'] = $this->ShowRapidFireFrom($BuildID); $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); } elseif ($BuildID >= 502 && $BuildID <= 503) { $PageTPL = 'info_fleet'; $parse['element_typ'] = $lang['tech'][400]; $parse['hull_pt'] = pretty_number($pricelist[$BuildID]['metal'] + $pricelist[$BuildID]['crystal']); $parse['shield_pt'] = pretty_number($CombatCaps[$BuildID]['shield']); $parse['attack_pt'] = pretty_number($CombatCaps[$BuildID]['attack']); } elseif ($BuildID >= 601 && $BuildID <= 615) { $PageTPL = 'info_oficial'; } $displays->newblock($PageTPL); foreach ($parse as $key => $value) { $displays->assign($key, $value); } if ($TableHeadTPL) { $this->ShowProductionTable($CurrentUser, $CurrentPlanet, $BuildID); } if ($GateTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { $displays->newblock($GateTPL); $RestString = $this->GetNextJumpWaitTime($CurrentPlanet); $parse['gate_start_link'] = BuildPlanetAdressLink($CurrentPlanet); if ($RestString['value'] != 0) { include $svn_root . 'includes/functions/InsertJavaScriptChronoApplet.' . $phpEx; $parse['gate_time_script'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], true); $parse['gate_wait_time'] = "<div id=\"bxx" . "Gate" . "1" . "\"></div>"; $parse['gate_script_go'] = InsertJavaScriptChronoApplet("Gate", "1", $RestString['value'], false); } else { $parse['gate_time_script'] = ""; $parse['gate_wait_time'] = ""; $parse['gate_script_go'] = ""; } foreach ($parse as $key => $value) { $displays->assign($key, $value); } $parse['gate_dest_moons'] = $this->BuildJumpableMoonCombo($CurrentUser, $CurrentPlanet); $this->BuildFleetListRows($CurrentPlanet); } } if ($DestroyTPL != '') { if ($CurrentPlanet[$resource[$BuildID]] > 0) { $displays->newblock($DestroyTPL); $NeededRessources = GetBuildingPrice($CurrentUser, $CurrentPlanet, $BuildID, true, true); $DestroyTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $BuildID) / 2; $parse['destroyurl'] = "game.php?page=buildings&cmd=destroy&building=" . $BuildID; $parse['levelvalue'] = $CurrentPlanet[$resource[$BuildID]]; $parse['nfo_metal'] = $lang['Metal']; $parse['nfo_crysta'] = $lang['Crystal']; $parse['nfo_deuter'] = $lang['Deuterium']; $parse['metals'] = pretty_number($NeededRessources['metal']); $parse['crystals'] = pretty_number($NeededRessources['crystal']); $parse['deuteriums'] = pretty_number($NeededRessources['deuterium']); $parse['destroytime'] = pretty_time($DestroyTime); foreach ($parse as $key => $value) { $displays->assign($key, $value); } } } $displays->display(); }