Beispiel #1
0
 /**
  * Constructor: Shows unit selection.
  *
  * @return Bengine_Game_Controller_Shipyard
  */
 protected function init()
 {
     $this->canBuildUnits = Game::getEH()->canBuildUnits();
     switch (Core::getRequest()->getGET("controller")) {
         case "Shipyard":
             $this->mode = self::FLEET_CONSTRUCTION_TYPE;
             break;
         case "Defense":
             $this->mode = self::DEFENSE_CONSTRUCTION_TYPE;
             break;
     }
     if (Game::getPlanet()->getBuilding("ROCKET_STATION") > 0 && $this->mode == self::DEFENSE_CONSTRUCTION_TYPE) {
         $_result = Core::getQuery()->select("unit2shipyard", "quantity", "", Core::getDB()->quoteInto("unitid = '51' AND planetid = ?", Core::getUser()->get("curplanet")));
         $_row = $_result->fetchRow();
         $this->existingRockets = $_row["quantity"];
         $_result = Core::getQuery()->select("unit2shipyard", "quantity", "", Core::getDB()->quoteInto("unitid = '52' AND planetid = ?", Core::getUser()->get("curplanet")));
         $_row = $_result->fetchRow();
         $this->existingRockets += $_row["quantity"] * 2;
         $this->existingRockets += Game::getEH()->getWorkingRockets();
         $maxsize = Game::getRocketStationSize();
         // Check max. size
         if ($this->existingRockets >= $maxsize) {
             $this->canBuildRockets = false;
         }
     }
     return parent::init();
 }
 /**
  * Displays list of available buildings.
  *
  * @return Bengine_Game_Controller_Constructions
  */
 protected function init()
 {
     // Get construction
     $this->event = Game::getEH()->getCurPlanetBuildingEvent();
     return parent::init();
 }
Beispiel #3
0
 /**
  * Displays list of available researches.
  *
  * @return Bengine_Game_Controller_Research
  */
 protected function init()
 {
     // Get event
     $this->event = Game::getEH()->getResearchEvent();
     return parent::init();
 }