Главная » Статьи » Xnova MoD

Энергорасход при постройке здания

Смысл : перед постройкой здания мы видим сколько оно добавит или отнимет энергии от общего количества производимого Удобно однако  

редактируем файлы :

-includes/functions/BatimentBuildingPage.php
-templates/OpenGame/buildings_builds_row.tpl

1) Открываем BatimentBuildingPage.php примерно на 11 строке

Ищем - global $lang, $resource, $reslist, $phpEx, $dpath, $game_config, $_GET;
Заменяем на - global $ProdGrid,$lang, $resource, $reslist, $phpEx, $dpath, $game_config, $_GET;

1.1) идем примерно на 92 строку

ищем - $parse['nivel'] = ($BuildingLevel == 0) ? "" : " (". $lang['level'] ." ". $BuildingLevel .")";
после нее добавляем - 
Вот это добавляем  
// show energy on BuildingPage
//================================
$BuildLevelFactor = $CurrentPlanet[ $resource[$Element]."_porcent" ];
$BuildTemp = $CurrentPlanet[ 'temp_max' ];
$CurrentBuildtLvl = $BuildingLevel;
$BuildLevel = ($CurrentBuildtLvl > 0) ? $CurrentBuildtLvl : 1;

$Prod[3] = (floor(eval($ProdGrid[$Element]['formule']['deuterium']) * $game_config['resource_multiplier']) * (1 + ($CurrentUser['rpg_geologue'] * 0.05)));
$Prod[4] = (floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + ($CurrentUser['rpg_ingenieur'] * 0.05)));

if ($Element != 12) {
$ActualNeed = floor($Prod[4]);
} else {
$ActualNeed = floor($Prod[3]);
}

$BuildLevel++;

$Prod[3] = (floor(eval($ProdGrid[$Element]['formule']['deuterium']) * $game_config['resource_multiplier']) * (1 + ($CurrentUser['rpg_geologue'] * 0.05)));
$Prod[4] = (floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + ($CurrentUser['rpg_ingenieur'] * 0.05)));
if ($Element != 12) {

//$bloc['build_prod'] = pretty_number(floor($Prod[$BuildID]));
//$bloc['build_prod_diff'] = colorNumber( pretty_number(floor($Prod[$BuildID] - $ActualProd)) );
//$bloc['build_need'] = colorNumber( pretty_number(floor($Prod[4])) );
$EnergyNeed = colorNumber( pretty_number(floor($Prod[4] - $ActualNeed)) );
} else {

//$bloc['build_prod'] = pretty_number(floor($Prod[4]));
//$bloc['build_prod_diff'] = colorNumber( pretty_number(floor($Prod[4] - $ActualProd)) );
//$bloc['build_need'] = colorNumber( pretty_number(floor($Prod[3])) );
$EnergyNeed = colorNumber( pretty_number(floor($Prod[3] - $ActualNeed)) );
}

if ($Element >= 1 && $Element <= 3) {
$parse['build_need_diff'] = "("."<font color=#FF0000>". $EnergyNeed." ".$lang['Energy']."</font>".")";
$BuildLevel = 0;
}elseif ($Element == 4 || $Element == 12) {
$parse['build_need_diff'] = "("."<font color=#00FF00>+". $EnergyNeed." ".$lang['Energy']."</font>".")";
$BuildLevel = 0;
}

//================================ 


2) открываем buildings_builds_row.tpl

находим - <a href="infos.php?gid={i}">{n}</a>{nivel}<br>
заменяем на - <a href="infos.php?gid={i}">{n}</a>{nivel} {build_need_diff}<br>

Категория: Xnova MoD | Добавил: Cerberus (30.11.2009)
Просмотров: 745 | Теги: mod, Xnova MoD | Рейтинг: 0.0/0