$fpage .= "</th>"; } /* Cuando un jugador tiene mas de un planeta, se muestra una lista de ellos a la derecha. */ $planets_query = doquery("SELECT * FROM {{table}} WHERE id_owner='{$user['id']}'", "planets"); $c = 1; while ($p = mysql_fetch_array($planets_query)) { if ($p["id"] != $user["current_planet"]) { $ap .= "<th>{$p['name']}<br>\n\t\t\t<a href=\"?cp={$p['id']}&re=0\" title=\"{$p['name']}\"><img src=\"{$dpath}planeten/small/s_{$p['image']}.jpg\" height=\"50\" width=\"50\"></a><br>\n\t\t\t<center>"; /* Gracias al 'b_building_id' y al 'b_building' podemos mostrar en el overview si se esta construyendo algo en algun planeta. */ if ($p['b_building_id'] != 0) { if (check_building_progress($p)) { $ap .= $lang['tech'][$p['b_building_id']]; $time = pretty_time($p['b_building'] - time()); $ap .= "<br><font color=\"#7f7f7f\">({$time})</font>"; } else { $ap .= $lang['Free']; } } else { $ap .= $lang['Free']; } $ap .= "<center></center></center></th>"; //Para ajustar a dos columnas if ($c <= 1) { $c++; } else { $ap .= "</tr><tr>";
// old /* en este lugar se calculan los agregados de cada edificio, por ejemplo. cuanto afecta un edificio a la produccion de recursos, y cuanta energia consume el mismo. */ $planetrow[$resource[$planetrow["b_building_id"]]]++; //$cost_metal = floor($pricelist[$planetrow["b_building_id"]]['metal'] * pow($pricelist[$planetrow["b_building_id"]]['factor'],$planetrow[$resource[$planetrow["b_building_id"]]]+1)); //$cost_crystal = floor($pricelist[$planetrow["b_building_id"]]['crystal'] * pow($pricelist[$planetrow["b_building_id"]]['factor'],$planetrow[$resource[$planetrow["b_building_id"]]]+1)); doquery("UPDATE {{table}} SET\n\t\t\t`{$resource[$planetrow["b_building_id"]]}`='{$planetrow[$resource[$planetrow["b_building_id"]]]}',\n\t\t\tb_building_id=0\n\t\t\tWHERE id='{$planetrow["id"]}'", 'planets'); LWCore::getPlanet()->b_building = $planetrow["b_building"]; LWCore::getPlanet()->b_building_id = $planetrow["b_building_id"]; BuildingOvent::check(LWCore::getPlanet()->planetID); $moreBuildings = unserialize($planetrow['moreBuildings']); while (@isset($moreBuildings[0])) { if (is_tech_available($user, $planetrow, $moreBuildings[0]) && is_buyable($user, $planetrow, $moreBuildings[0])) { if (!check_building_progress($planetrow)) { $nextBuildingID = $moreBuildings[0]; $costs = get_building_price($user, $planetrow, $nextBuildingID); $planetrow['metal'] -= $costs['metal']; $planetrow['crystal'] -= $costs['crystal']; $planetrow['deuterium'] -= $costs['deuterium']; LWCore::getPlanet()->metal = $planetrow['metal']; LWCore::getPlanet()->crystal = $planetrow['crystal']; LWCore::getPlanet()->deuterium = $planetrow['deuterium']; unset($moreBuildings[0]); if (isset($moreBuildings[1])) { $moreBuildings[0] = $moreBuildings[1]; unset($moreBuildings[1]); if (isset($moreBuildings[2])) { $moreBuildings[1] = $moreBuildings[2]; unset($moreBuildings[2]);