From 422f2c12951896b69a3d6b6544ab2215ebab232b Mon Sep 17 00:00:00 2001 From: Gregory PLANCHAT Date: Sun, 25 Mar 2012 18:35:28 +0200 Subject: [PATCH] Fixed minor bugs Signed-off-by: Gregory PLANCHAT --- .../Block/Planet/ResearchLab/Queue/Item.php | 11 ++--- .../Legacies/Empire/Block/Planet/Shipyard.php | 6 ++- .../Block/Planet/Shipyard/Queue/Item.php | 22 +++++++-- .../Empire/Controller/DefenseController.php | 6 +++ .../Controller/ResearchLabController.php | 6 +++ .../Empire/Controller/ShipyardController.php | 6 +++ .../Model/Planet/Building/NaniteFactory.php | 17 ++++--- .../Planet/Building/ResearchLab/Builder.php | 23 +++++++++- .../Model/Planet/Building/RoboticFactory.php | 17 ++++--- .../Planet/Building/Shipyard/Builder.php | 26 +++++++++-- .../IntergalacticResearchNetwork.php | 46 +++++++++++++++++++ .../Core/Database/Statement/Pdo/Mysql.php | 2 +- .../Core/Database/Statement/Statement.php | 2 +- .../Wootook/Core/Mvc/Controller/Front.php | 5 +- .../Core/Mvc/Controller/Response/Http.php | 18 ++++---- .../Empire/Model/Planet/Builder/Builder.php | 22 ++++++++- .../Model/Player/TechnologyInterface.php | 5 ++ .../code/core/Wootook/Player/Model/Entity.php | 3 ++ src/application/configs/system.php | 3 +- .../empire/planet/shipyard/queue.phtml | 7 ++- .../empire/planet/shipyard/queue/item.phtml | 8 ++++ .../gamedata/legacies/default/events.php | 17 ++++--- src/install/index.php | 8 ---- 23 files changed, 223 insertions(+), 63 deletions(-) create mode 100644 src/application/code/core/Legacies/Empire/Model/Player/Technology/IntergalacticResearchNetwork.php create mode 100644 src/application/code/core/Wootook/Empire/Model/Player/TechnologyInterface.php create mode 100644 src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue/item.phtml diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php b/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php index 8040955..a825cfa 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php +++ b/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php @@ -37,7 +37,7 @@ class Legacies_Empire_Block_Planet_ResearchLab_Queue_Item extends Wootook_Empire_Block_Planet_Builder_Queue_ItemAbstract { - protected $_itemIdField = 'research_id'; + protected $_itemIdField = 'technology_id'; public function getLevel() { @@ -49,11 +49,6 @@ class Legacies_Empire_Block_Planet_ResearchLab_Queue_Item return $this->getPlanet()->getResearchLab()->getResourcesNeeded($this->getItemId(), $this->getQueuedLevel() + 1); } - public function getItemQueuedLevel() - { - return $this->getItem()->getData('level'); - } - public function getQueuedLevel() { return $this->getPlanet()->getResearchLab()->getResearchLevelQueued($this->getItemId()); @@ -70,7 +65,7 @@ class Legacies_Empire_Block_Planet_ResearchLab_Queue_Item ->getResearchTime($this->getItemId(), $this->getItemQueuedLevel()); $item = $this->getItem(); - return $item->getData('created_at') - $item->getData('updated_at') + $totalTime; + return $totalTime - ($item->getData('created_at') - $item->getData('updated_at')); } public function getResourcesConfigForLevel($level) @@ -103,4 +98,4 @@ class Legacies_Empire_Block_Planet_ResearchLab_Queue_Item { return $this->getBuildingTime($this->getNextLevel()); } -} \ No newline at end of file +} diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard.php b/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard.php index 038c99e..c33a6e4 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard.php +++ b/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard.php @@ -99,6 +99,10 @@ class Legacies_Empire_Block_Planet_Shipyard { $types = Wootook_Empire_Helper_Config_Types::getSingleton(); + if (!$this->getPlanet() || !$this->getPlanet()->getShipyard()) { + return $this; + } + /** @var Wootook_Core_Block_Concat $parentBlock */ $parentBlock = $this->getLayout()->getBlock('item-list.items'); foreach ($types->getData($this->getType()) as $itemId) { @@ -112,4 +116,4 @@ class Legacies_Empire_Block_Planet_Shipyard return $this; } -} \ No newline at end of file +} diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php b/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php index 14e2174..64eec1d 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php +++ b/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php @@ -37,9 +37,9 @@ class Legacies_Empire_Block_Planet_Shipyard_Queue_Item extends Wootook_Empire_Block_Planet_Builder_Queue_ItemAbstract { - protected $_itemIdField = 'research_id'; + protected $_itemIdField = 'ship_id'; - public function getLevel() + public function getQty() { return $this->getPlanet()->getElement($this->getItemId()); } @@ -49,12 +49,26 @@ class Legacies_Empire_Block_Planet_Shipyard_Queue_Item return $this->getPlanet()->getShipyard()->getResourcesNeeded($this->getItemId(), 1); } + public function getItemQueuedQty() + { + return $this->getItem()->getData('qty'); + } + public function getBuildingTime($qty) { return $this->getPlanet()->getShipyard()->getBuildingTime($this->getItemId(), $qty); } - public function getResourcesConfigForLevel($qty) + public function getBuildingRemainingTime() + { + $totalTime = $this->getPlanet()->getShipyard() + ->getBuildingTime($this->getItemId(), $this->getItemQueuedQty()); + $item = $this->getItem(); + + return $totalTime - ($item->getData('created_at') - $item->getData('updated_at')); + } + + public function getResourcesConfigForQty($qty) { $resources = $this->getResourcesNeeded($qty); @@ -84,4 +98,4 @@ class Legacies_Empire_Block_Planet_Shipyard_Queue_Item { return $this->getBuildingTime($this->getNextLevel()); } -} \ No newline at end of file +} diff --git a/src/application/code/core/Legacies/Empire/Controller/DefenseController.php b/src/application/code/core/Legacies/Empire/Controller/DefenseController.php index e6a1f87..8f3e7d0 100644 --- a/src/application/code/core/Legacies/Empire/Controller/DefenseController.php +++ b/src/application/code/core/Legacies/Empire/Controller/DefenseController.php @@ -11,6 +11,12 @@ class Legacies_Empire_Controller_DefenseController { public function preDispatch() { + parent::preDispatch(); + + if ($this->getResponse()->isDispatched()) { + return; + } + $planet = $this->getCurrentPlanet(); if ($planet->getElement(Legacies_Empire::ID_BUILDING_SHIPYARD) < 1) { diff --git a/src/application/code/core/Legacies/Empire/Controller/ResearchLabController.php b/src/application/code/core/Legacies/Empire/Controller/ResearchLabController.php index 40e05f7..06f78af 100644 --- a/src/application/code/core/Legacies/Empire/Controller/ResearchLabController.php +++ b/src/application/code/core/Legacies/Empire/Controller/ResearchLabController.php @@ -11,6 +11,12 @@ class Legacies_Empire_Controller_ResearchLabController { public function preDispatch() { + parent::preDispatch(); + + if ($this->getResponse()->isDispatched()) { + return; + } + $planet = $this->getCurrentPlanet(); if ($planet->getElement(Legacies_Empire::ID_BUILDING_SHIPYARD) < 1) { diff --git a/src/application/code/core/Legacies/Empire/Controller/ShipyardController.php b/src/application/code/core/Legacies/Empire/Controller/ShipyardController.php index 1af2ed7..20d8724 100644 --- a/src/application/code/core/Legacies/Empire/Controller/ShipyardController.php +++ b/src/application/code/core/Legacies/Empire/Controller/ShipyardController.php @@ -11,6 +11,12 @@ class Legacies_Empire_Controller_ShipyardController { public function preDispatch() { + parent::preDispatch(); + + if ($this->getResponse()->isDispatched() || $this->getResponse()->isRedirect()) { + return; + } + $planet = $this->getCurrentPlanet(); if ($planet->getElement(Legacies_Empire::ID_BUILDING_SHIPYARD) < 1) { diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php b/src/application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php index a0ba02a..05f1163 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php +++ b/src/application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php @@ -36,17 +36,16 @@ class Legacies_Empire_Model_Planet_Building_NaniteFactory implements Wootook_Empire_Model_Planet_BuildingInterface { - public static function buildingTimeListener($event) + public static function buildingEnhancementListener(Wootook_Core_Event $event) { + /** @var float $enhancement */ + $enhancement = $event->getData('enhancement'); + + /** @var Wootook_Empire_Model_Planet $planet */ $planet = $event->getData('planet'); - if (!$planet->getId() || ($level = $planet->getElement(Legacies_Empire::ID_BUILDING_NANITE_FACTORY)) <= 0) { - return; - } + $level = $planet->getElement(Legacies_Empire::ID_BUILDING_NANITE_FACTORY); - $time = $event->getData('time'); - - $speedFactor = pow(2, $level); - $event->setData('time', $time / $speedFactor); + $event->setData('enhancement', $enhancement * pow(.5, $level)); } -} \ No newline at end of file +} diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php b/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php index 41be71d..467dcde 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php +++ b/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php @@ -45,6 +45,11 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder */ protected $_maxLength = 0; + /** + * @var float + */ + protected $_speedEnhancement = null; + public function init() { $this->_unserializeQueue($this->_currentPlanet->getData(self::FIELD_SERIALIZED)); @@ -91,6 +96,21 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder )); } + public function getSpeedEnhancement() + { + if ($this->_speedEnhancement === null) { + $event = Wootook::dispatchEvent('planet.research-lab.technology.speed-enhancement', array( + 'player' => $this->_currentPlanet, + 'planet' => $this->_currentPlanet, + 'enhancement' => 1 + )); + + $this->_speedEnhancement = $event->getData('enhancement'); + } + + return $this->_speedEnhancement; + } + /** * Check if a technology type is actually buildable on the current * planet, depending on the technology and buildings requirements. @@ -128,7 +148,8 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder if ($speedFactor == null) { $speedFactor = 1; } - $baseTime = $levelTime / ($speedFactor * 3600); + + $baseTime = ($levelTime * 3600 / $speedFactor) / $this->getSpeedEnhancement(); Math::setPrecision(); diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php b/src/application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php index c231409..5e6b3c8 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php +++ b/src/application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php @@ -36,17 +36,16 @@ class Legacies_Empire_Model_Planet_Building_RoboticFactory implements Wootook_Empire_Model_Planet_BuildingInterface { - public static function buildingTimeListener($event) + public static function buildingEnhancementListener(Wootook_Core_Event $event) { + /** @var float $enhancement */ + $enhancement = $event->getData('enhancement'); + + /** @var Wootook_Empire_Model_Planet $planet */ $planet = $event->getData('planet'); - if (!$planet->getId() || ($level = $planet->getElement(Legacies_Empire::ID_BUILDING_ROBOTIC_FACTORY)) <= 0) { - return; - } + $level = $planet->getElement(Legacies_Empire::ID_BUILDING_ROBOTIC_FACTORY); - $time = $event->getData('time'); - - $speedFactor = 1 + $level; - $event->setData('time', $time / $speedFactor); + $event->setData('enhancement', $enhancement * (2 / (1 + $level))); } -} \ No newline at end of file +} diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php b/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php index 4d4f80a..8fb9808 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php +++ b/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php @@ -42,6 +42,11 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder */ protected $_maxLength = 0; + /** + * @var float + */ + protected $_speedEnhancement = null; + public function init() { $this->_unserializeQueue($this->_currentPlanet->getData('b_hangar_id')); @@ -79,6 +84,21 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder )); } + public function getSpeedEnhancement() + { + if ($this->_speedEnhancement === null) { + $event = Wootook::dispatchEvent('planet.shipyard.speed-enhancement', array( + 'player' => $this->_currentPlanet, + 'planet' => $this->_currentPlanet, + 'enhancement' => 1 + )); + + $this->_speedEnhancement = $event->getData('enhancement'); + } + + return $this->_speedEnhancement; + } + /** * Check if a ship or defense type is actually buildable on the current * planet, depending on the technology and buildings requirements. @@ -187,8 +207,8 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder Math::setPrecision(50); $buildingTime = Math::mul($prices[$shipId][Legacies_Empire::BASE_BUILDING_TIME], $qty); - $speedFactor = Wootook::getGameConfig('game/speed/general'); - $baseTime = Math::div($buildingTime, $speedFactor); + $speedFactor = Wootook::getGameConfig('game/speed/ships') / 1000; + $baseTime = ($buildingTime / 5000) * 3600 / $speedFactor / $this->getSpeedEnhancement(); Math::setPrecision(); @@ -336,4 +356,4 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder return $this; } -} \ No newline at end of file +} diff --git a/src/application/code/core/Legacies/Empire/Model/Player/Technology/IntergalacticResearchNetwork.php b/src/application/code/core/Legacies/Empire/Model/Player/Technology/IntergalacticResearchNetwork.php new file mode 100644 index 0000000..3e5507f --- /dev/null +++ b/src/application/code/core/Legacies/Empire/Model/Player/Technology/IntergalacticResearchNetwork.php @@ -0,0 +1,46 @@ +getData('enhancement'); + + /** @var Wootook_Empire_Model_Planet $planet */ + $planet = $event->getData('planet'); + + /** @var Wootook_Player_Model_Entity $player */ + $player = $event->getData('player'); + + + $virtualLevel = 1 + $planet->getElement(Legacies_Empire::ID_BUILDING_RESEARCH_LAB); + + if (($network = $player->getElement(Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK)) > 0) { + $planetCollection = $player->getPlanetCollection(Wootook_Empire_Model_Planet::TYPE_PLANET); + + $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); + $planetCollection->addFieldToFilter('id', array(array('nin' => $planet->getId()))) + ->addOrderBy($fields[Legacies_Empire::ID_BUILDING_RESEARCH_LAB], 'DESC') + ->setPageSize($network) + ; + + $select = $planetCollection->getSelect(); + $select->reset(Wootook_Core_Database_Sql_Select::COLUMNS); + $select->column(array('count' => new Wootook_Core_Database_Sql_Placeholder_Expression( + "COUNT({$select->quote($fields[Legacies_Empire::ID_BUILDING_RESEARCH_LAB])})"))); + + $statement = $select->prepare(); + $virtualLevel += $statement->fetchColumn(); + } + + $event->setData('enhancement', $enhancement * $virtualLevel); + } +} diff --git a/src/application/code/core/Wootook/Core/Database/Statement/Pdo/Mysql.php b/src/application/code/core/Wootook/Core/Database/Statement/Pdo/Mysql.php index 2ce2e0d..675fa7e 100644 --- a/src/application/code/core/Wootook/Core/Database/Statement/Pdo/Mysql.php +++ b/src/application/code/core/Wootook/Core/Database/Statement/Pdo/Mysql.php @@ -123,7 +123,7 @@ class Wootook_Core_Database_Statement_Pdo_Mysql * @param int $col * @return mixed */ - public function fetchColumn($col) + public function fetchColumn($col = 0) { try { return $this->_handler->fetchColumn($col); diff --git a/src/application/code/core/Wootook/Core/Database/Statement/Statement.php b/src/application/code/core/Wootook/Core/Database/Statement/Statement.php index 0b55565..a9b2fef 100644 --- a/src/application/code/core/Wootook/Core/Database/Statement/Statement.php +++ b/src/application/code/core/Wootook/Core/Database/Statement/Statement.php @@ -74,7 +74,7 @@ abstract class Wootook_Core_Database_Statement_Statement * @param int $col * @return mixed */ - abstract public function fetchColumn($col); + abstract public function fetchColumn($col = 0); /** * diff --git a/src/application/code/core/Wootook/Core/Mvc/Controller/Front.php b/src/application/code/core/Wootook/Core/Mvc/Controller/Front.php index 28c3e28..7823ea3 100644 --- a/src/application/code/core/Wootook/Core/Mvc/Controller/Front.php +++ b/src/application/code/core/Wootook/Core/Mvc/Controller/Front.php @@ -201,6 +201,9 @@ class Wootook_Core_Mvc_Controller_Front if (!$this->_response->isDispatched()) { continue; } + if ($this->_response->isRedirect()) { + break; + } $controller->$actionMethod(); @@ -210,7 +213,7 @@ class Wootook_Core_Mvc_Controller_Front $controller->postDispatch(); - if ($this->_response->isDispatched()) { + if ($this->_response->isDispatched() || $this->_response->isRedirect()) { break; } } diff --git a/src/application/code/core/Wootook/Core/Mvc/Controller/Response/Http.php b/src/application/code/core/Wootook/Core/Mvc/Controller/Response/Http.php index 5809f09..3025249 100644 --- a/src/application/code/core/Wootook/Core/Mvc/Controller/Response/Http.php +++ b/src/application/code/core/Wootook/Core/Mvc/Controller/Response/Http.php @@ -3,6 +3,8 @@ class Wootook_Core_Mvc_Controller_Response_Http extends Wootook_Core_Mvc_Controller_Response_Response { + const STATUS_OK = 200; + const REDIRECT_MOVED_PERMANENTLY = 301; const REDIRECT_FOUND = 302; const REDIRECT_SEE_OTHER = 303; @@ -15,6 +17,8 @@ class Wootook_Core_Mvc_Controller_Response_Http self::REDIRECT_TEMPORARY => 'Temporary Redirect' ); + protected $_returnCode = self::STATUS_OK; + public function setBody($data) { $this->clearBody(); @@ -106,12 +110,9 @@ class Wootook_Core_Mvc_Controller_Response_Http return $this; } - public function setIsRedirect($value = null) + public function isRedirect() { - if (is_bool($value)) { - $this->_data['is_redirect'] = $value; - } - return $this->_data['is_redirect']; + return $this->_returnCode >= 300 && $this->_returnCode < 400; } public function setCookie($name, $value, $lifetime = null, $path = null, $domain = null) @@ -139,10 +140,11 @@ class Wootook_Core_Mvc_Controller_Response_Http $code = self::REDIRECT_FOUND; } + $this->_returnCode = $code; + $statusText = self::$_redirectCodes[$code]; $this->setRawHeader("HTTP/1.1 {$code} {$statusText}") - ->setHeader('Location', $url) - ->setIsRedirect(true); + ->setHeader('Location', $url); return $this; } @@ -156,4 +158,4 @@ class Wootook_Core_Mvc_Controller_Response_Http return $this->sendBody(); } } -} \ No newline at end of file +} diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php b/src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php index 38aaa62..eddf545 100644 --- a/src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php +++ b/src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php @@ -44,6 +44,11 @@ class Wootook_Empire_Model_Planet_Builder_Builder */ protected $_maxLength = 0; + /** + * @var float + */ + protected $_speedEnhancement = null; + public function init() { $this->_unserializeQueue($this->_currentPlanet->getData(self::FIELD_SERIALIZED)); @@ -90,6 +95,21 @@ class Wootook_Empire_Model_Planet_Builder_Builder )); } + public function getSpeedEnhancement() + { + if ($this->_speedEnhancement === null) { + $event = Wootook::dispatchEvent('planet.building.speed-enhancement', array( + 'player' => $this->_currentPlanet, + 'planet' => $this->_currentPlanet, + 'enhancement' => 1 + )); + + $this->_speedEnhancement = $event->getData('enhancement'); + } + + return $this->_speedEnhancement; + } + /** * Check if a building is actually buildable on the current planet, * depending on the technology and buildings requirements. @@ -128,7 +148,7 @@ class Wootook_Empire_Model_Planet_Builder_Builder if ($speedFactor == null) { $speedFactor = 1; } - $baseTime = $levelTime / $speedFactor * 3600; + $baseTime = Math::div($levelTime, 3600 / ($speedFactor * $this->getSpeedEnhancement())); Math::setPrecision(); diff --git a/src/application/code/core/Wootook/Empire/Model/Player/TechnologyInterface.php b/src/application/code/core/Wootook/Empire/Model/Player/TechnologyInterface.php new file mode 100644 index 0000000..589914b --- /dev/null +++ b/src/application/code/core/Wootook/Empire/Model/Player/TechnologyInterface.php @@ -0,0 +1,5 @@ +_currentPlanet = $this->getHomePlanet(); + if ($this->_currentPlanet === null) { + return null; + } $this->setData('current_planet', $this->_currentPlanet->getId())->save(); return $this->_currentPlanet; diff --git a/src/application/configs/system.php b/src/application/configs/system.php index f1c17e0..8246cb4 100644 --- a/src/application/configs/system.php +++ b/src/application/configs/system.php @@ -47,7 +47,8 @@ ), 'game' => array( 'speed' => array( - 'general' => 1000 + 'general' => 1000, + 'ships' => 1000 ), 'home' => array( 'title' => 'Welcome on Wootook!', diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue.phtml index b3d9bbc..c63a203 100644 --- a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue.phtml +++ b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue.phtml @@ -1 +1,6 @@ -isEmpty()):?> +
+

__('Work in progress')?>

+getPartial('item-list')->render() ?> +
+ diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue/item.phtml new file mode 100644 index 0000000..5592945 --- /dev/null +++ b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue/item.phtml @@ -0,0 +1,8 @@ + +
+

+ + escape($this->getName())?> (renderNumber($this->getItemQueuedQty())?>) +

+

__('Lasts %s', $this->renderTime($this->getBuildingRemainingTime()))?>

+
diff --git a/src/application/gamedata/legacies/default/events.php b/src/application/gamedata/legacies/default/events.php index c3d2af0..0f1c78c 100644 --- a/src/application/gamedata/legacies/default/events.php +++ b/src/application/gamedata/legacies/default/events.php @@ -23,12 +23,17 @@ 'planet.shipyard.update-queue.after' => array(), 'planet.shipyard.append-queue.before' => array(), 'planet.shipyard.append-queue.after' => array(), - 'planet.building.building-time' => array( - array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingTimeListener'), - array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingTimeListener') + 'planet.building.building-time' => array(), + 'planet.shipyard.building-time' => array(), + 'planet.building.speed-enhancement' => array( + array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingEnhancementListener'), + array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingEnhancementListener') ), - 'planet.shipyard.building-time' => array( - array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingTimeListener'), - array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingTimeListener') + 'planet.shipyard.speed-enhancement' => array( + array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingEnhancementListener'), + array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingEnhancementListener') + ), + 'planet.research-lab.technology.speed-enhancement' => array( + array('Legacies_Empire_Model_Player_Technology_IntergalacticResearchNetwork', 'researchTechnologyEnhancementListener') ) ); diff --git a/src/install/index.php b/src/install/index.php index eb52443..66b2422 100644 --- a/src/install/index.php +++ b/src/install/index.php @@ -82,15 +82,7 @@ function __autoload($class) { } Wootook::$isInstalled = false; -/* -$website = new Wootook_Core_Model_Website(); -$website->setId(1)->setData('code', Wootook_Core_Model_Website::DEFAULT_CODE); -Wootook::setWebsite(1, $website); -$game = new Wootook_Core_Model_Game(); -$game->setId(1)->setData('website_id', $website->getId())->setData('code', Wootook_Core_Model_Game::DEFAULT_CODE); -Wootook::setGame(1, $game); -*/ include ROOT_PATH . 'includes' . DIRECTORY_SEPARATOR . 'constants.php'; Wootook_Core_ErrorProfiler::register();