XGProyect / XG-Proyect-v3.x.x

XG Proyect is an OGame clone open-source web application framework designed for creating game clones, particularly those inspired by the popular game OGame, set in a vast and captivating space-themed universe.
https://xgproyect.org
GNU General Public License v3.0
142 stars 97 forks source link

[Feature] Energy info in the building #474

Open jonamix-ar opened 2 years ago

jonamix-ar commented 2 years ago

Energía que necesitan las minas y las plantas de energía que producen

Mina de Metal image

Mina de Cristal image

Sintetizador de deuterio image

Planta de energia solar image

Planta de fusion image

Satelite solar image

Taladrador image

Esto lo hicimos hace mucho tiempo para la 2.9. pero no se como adaptarlo ahora a la 3.x

Codigo antiguo

// ENERGIA AL LADO DEL NIVEL
  $BuildLevelFactor         = 10;
  $BuildTemp                = $CurrentPlanet[ 'temp_max' ];
  $CurrentBuildtLvl         = $BuildingLevel;
  $BuildLevel               = ($CurrentBuildtLvl > 0) ? $CurrentBuildtLvl : 1;
  $EnergyTechLevel          = $CurrentUser["energy_tech"];
  $engineer_boost              = 1 + ( $CurrentUser['rpg_ingenieur'] * ENGINEER_ENERGY );

  $Prod[4]                  = (floor(eval($ProdGrid[$Element]['formule']['energy']) * read_config ( 'resource_multiplier' )) * $engineer_boost);
  $ActualNeed               =  floor($Prod[4]);
  $BuildLevel++;
  $Prod[4]                  = (floor(eval($ProdGrid[$Element]['formule']['energy']) * read_config ( 'resource_multiplier' )) * $engineer_boost);
  $EnergyNeed               = Format::color_number( Format::pretty_number(floor($Prod[4] - $ActualNeed)) );

  if ($Element >= 1 && $Element <= 3) {
       $parse['energia'] = "("."<font color=#FF0000>". $EnergyNeed." ".$lang['Energy']."</font>".")";
       $BuildLevel = 0;
  }elseif ($Element == 4 || $Element == 12) {
       $parse['energia'] = "("."<font color=#00FF00>+". $EnergyNeed." ".$lang['Energy']."</font>".")";
       $BuildLevel = 0;
  }
  // FIN ENERGIA AL LADO DEL NIVEL 
jonamix-ar commented 2 years ago

Lenguaje español Energía necesaria: %s

Lenguaje ingles Energy needed: %s

LucasKovacs commented 2 years ago

This must wait, the whole production system is chaotic and old, add the plasma resource calculation was a pain in the ass and also a bit messy.

So infos, resources, updateplanetresources they all need a refactor. Once that done, implementing this things will be easier.

jonamix-ar commented 2 years ago

This must wait, the whole production system is chaotic and old, add the plasma resource calculation was a pain in the ass and also a bit messy.

So infos, resources, updateplanetresources they all need a refactor. Once that done, implementing this things will be easier.

Jajaja XD Por que crees que no pude adaptarlo xD igual yo, no quise poner todavía el si la construcción es posible o cuanto te falta para completar los recursos por que dijiste q ibas a refactorizar todo el sistema de edificios.