Started interface redesign

Minor bug fixes

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
Gregory PLANCHAT 2012-04-29 22:36:00 +02:00
commit fa9fa5d3a5
73 changed files with 174 additions and 180 deletions

View file

@ -0,0 +1,36 @@
<?php
/**
* Created by JetBrains PhpStorm.
* User: Greg
* Date: 20/03/12
* Time: 21:48
* To change this template use File | Settings | File Templates.
*/
interface Legacies_Core_Unit
{
const TYPE_BUILDING = 'building';
const TYPE_BUILDING_MOON = 'building_moon';
const TYPE_BUILDING_PLANET = 'building_planet';
const TYPE_RESEARCH = 'technology';
const TYPE_SHIP = 'ship';
const TYPE_DEFENSE = 'defense';
const TYPE_SPECIAL = 'special';
const TYPE_PRODUCTION = 'production';
const TYPE_FLEET_MISSION = 'mission';
const RESOURCE_TITANIUM = 'titanium';
const RESOURCE_SILICIUM = 'silicium';
const RESOURCE_HYDROGEN = 'hydrogen';
const RESOURCE_ANTIMATTER = 'antimatter';
const RESOURCE_ENERGY = 'energy';
const ID_BUILDING_TITANIUM_MINE = 'titanium-mine';
const ID_BUILDING_SILICIUM_MINE = 'silicium-mine';
const ID_BUILDING_HYDROGEN_PUMP = 'hydrogen-pump';
const ID_BUILDING_SOLAR_PLANT = 'solar-plant';
const ID_BUILDING_ATOMIC_FUSION_PLANT = 'atomic-fusion-plant';
const ID_BUILDING_SHIPYARD = 'shipyard';
const ID_BUILDING_TITANIUM_STORAGE = 'titanium-storage';
const ID_BUILDING_SILICIUM_STORAGE = 'silicium-storage';
const ID_BUILDING_HYDROGEN_TANK = 'hydrogen-tank';
}

View file

@ -281,7 +281,6 @@ class Wootook
$preferredLocale = $locale; $preferredLocale = $locale;
} }
} }
var_dump($preferredLocale);
Wootook_Player_Model_Session::getSingleton()->setData('locale', $preferredLocale); Wootook_Player_Model_Session::getSingleton()->setData('locale', $preferredLocale);

View file

@ -70,7 +70,7 @@ abstract class Wootook_Empire_Block_Planet_Builder_ItemAbstract
public function getItemImageUrl() public function getItemImageUrl()
{ {
return $this->getSkinUrl($this->getLabel('image')); return $this->getStaticUrl($this->getLabel('image'));
} }
public function getName() public function getName()

View file

@ -61,16 +61,14 @@ class Wootook_Player_Model_Session
is_array($cookieData)) { is_array($cookieData)) {
$adapter = $this->_player->getReadConnection(); $adapter = $this->_player->getReadConnection();
$select = $adapter->select(array('user' => 'users')); $select = $adapter->select(array('user' => $adapter->getTable('users')));
$cookieData = array(
'id' => (isset($cookieData['id']) ? intval($cookieData['id']) : 0),
'key' => (isset($cookieData['key']) ? $adapter->quote($cookieData['key']) : null)
);
$select $select
->column('id') ->column('id')
->where('user.id=:id') ->where('id', isset($cookieData['id']) ? intval($cookieData['id']) : 0)
->where(':key=CONCAT((@salt:=MID(:key, 0, 4)), SHA1(CONCAT(user.username, user.password, @salt)))') ->where(new Wootook_Core_Database_Sql_Placeholder_Expression(
':key=CONCAT((@salt:=MID(:key, 0, 4)), SHA1(CONCAT(user.username, user.password, @salt)))',
array('key' => isset($cookieData['key']) ? $adapter->quote($cookieData['key']) : null)))
; ;
try { try {
$statement = $adapter->prepare($select); $statement = $adapter->prepare($select);

View file

@ -5,91 +5,91 @@
Legacies_Empire::ID_BUILDING_METAL_MINE => array( Legacies_Empire::ID_BUILDING_METAL_MINE => array(
'name' => 'Mine de métal', 'name' => 'Mine de métal',
'description' => "<p>La <strong>mine de métal</strong> exploite les profondeurs géologiques à la recherche de ressources riches en métaux, puis les raffine et crée ensuite les alliages les plus solides.</p><p>Principales matières premières pour la construction de structures planétaires et de vaisseaux, les métaux permettent d'asseoir votre domination sur l'univers.</p>", 'description' => "<p>La <strong>mine de métal</strong> exploite les profondeurs géologiques à la recherche de ressources riches en métaux, puis les raffine et crée ensuite les alliages les plus solides.</p><p>Principales matières premières pour la construction de structures planétaires et de vaisseaux, les métaux permettent d'asseoir votre domination sur l'univers.</p>",
'image' => 'graphics/buildings/metal-mine.png' 'image' => 'medias/klore/images/building/metal-mine.jpg'
), ),
Legacies_Empire::ID_BUILDING_CRISTAL_MINE => array( Legacies_Empire::ID_BUILDING_CRISTAL_MINE => array(
'name' => 'Mine de cristal', 'name' => 'Mine de cristal',
'description' => "<p>La <strong>mine de cristal</strong> développe l'exploitation des minéraux entrant dans la comosition des systèmes électroniques.</p><p>Ces matériaux vous permettront d'augmenter la capacité de calculs de vos laboratoires ainsi que de ceux de vos systèmes de combat.</p>", 'description' => "<p>La <strong>mine de cristal</strong> développe l'exploitation des minéraux entrant dans la comosition des systèmes électroniques.</p><p>Ces matériaux vous permettront d'augmenter la capacité de calculs de vos laboratoires ainsi que de ceux de vos systèmes de combat.</p>",
'image' => 'graphics/buildings/cristal-mine.png' 'image' => 'medias/klore/images/building/cristal-mine.jpg'
), ),
Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => array( Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => array(
'name' => "Synthétiseur de deutérium", 'name' => "Synthétiseur de deutérium",
'description' => "<p>Le <strong>synthétiseur de deutérium</strong> permet d'exploiter les sources d'hydrogène lourd. Disponible en faible quantité sur les planètes telluriques et plus répandu sur les planètes géantes gazeuses, le deutérium et tritium composent votre principale source d'hydrogène lourd.</p>", 'description' => "<p>Le <strong>synthétiseur de deutérium</strong> permet d'exploiter les sources d'hydrogène lourd. Disponible en faible quantité sur les planètes telluriques et plus répandu sur les planètes géantes gazeuses, le deutérium et tritium composent votre principale source d'hydrogène lourd.</p>",
'image' => 'graphics/buildings/deuterium-syntherizer.png' 'image' => 'medias/klore/images/building/deuterium-syntherizer.jpg'
), ),
Legacies_Empire::ID_BUILDING_SOLAR_PLANT => array( Legacies_Empire::ID_BUILDING_SOLAR_PLANT => array(
'name' => 'Centrale électrique solaire', 'name' => 'Centrale électrique solaire',
'description' => '', 'description' => "<p>La <strong>centrale électrique solaire</strong> est la source d'énergie la plus abordable.</p><p></p>",
'image' => 'graphics/buildings/solar-plant.png' 'image' => 'medias/klore/images/building/solar-plant.jpg'
), ),
Legacies_Empire::ID_BUILDING_FUSION_REACTOR => array( Legacies_Empire::ID_BUILDING_FUSION_REACTOR => array(
'name' => 'Réacteur à fusion nucléaire', 'name' => 'Réacteur à fusion nucléaire',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/fusion-reactor.png' 'image' => 'medias/klore/images/building/fusion-reactor.jpg'
), ),
Legacies_Empire::ID_BUILDING_ROBOTIC_FACTORY => array( Legacies_Empire::ID_BUILDING_ROBOTIC_FACTORY => array(
'name' => 'Usine de robots', 'name' => 'Usine de robots',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/robotic-factory.png' 'image' => 'medias/klore/images/building/robotic-factory.jpg'
), ),
Legacies_Empire::ID_BUILDING_NANITE_FACTORY => array( Legacies_Empire::ID_BUILDING_NANITE_FACTORY => array(
'name' => 'Usine de nanites', 'name' => 'Usine de nanites',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/nanite-factory.png' 'image' => 'medias/klore/images/building/nanite-factory.jpg'
), ),
Legacies_Empire::ID_BUILDING_SHIPYARD => array( Legacies_Empire::ID_BUILDING_SHIPYARD => array(
'name' => 'Chantier spatial', 'name' => 'Chantier spatial',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/shipyard.png' 'image' => 'medias/klore/images/building/shipyard.jpg'
), ),
Legacies_Empire::ID_BUILDING_METAL_STORAGE => array( Legacies_Empire::ID_BUILDING_METAL_STORAGE => array(
'name' => 'Hangar de métal', 'name' => 'Hangar de métal',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/metal-storage.png' 'image' => 'medias/klore/images/building/metal-storage.jpg'
), ),
Legacies_Empire::ID_BUILDING_CRISTAL_STORAGE => array( Legacies_Empire::ID_BUILDING_CRISTAL_STORAGE => array(
'name' => 'Hangar de cristal', 'name' => 'Hangar de cristal',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/cristal-storage.png' 'image' => 'medias/klore/images/building/cristal-storage.jpg'
), ),
Legacies_Empire::ID_BUILDING_DEUTERIUM_TANK => array( Legacies_Empire::ID_BUILDING_DEUTERIUM_TANK => array(
'name' => 'Réservoir de deutérium', 'name' => 'Réservoir de deutérium',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/deuterium-tank.png' 'image' => 'medias/klore/images/building/deuterium-tank.jpg'
), ),
Legacies_Empire::ID_BUILDING_RESEARCH_LAB => array( Legacies_Empire::ID_BUILDING_RESEARCH_LAB => array(
'name' => 'Laboratoire de recherche', 'name' => 'Laboratoire de recherche',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/research-lab.png' 'image' => 'medias/klore/images/building/research-lab.jpg'
), ),
Legacies_Empire::ID_BUILDING_TERRAFORMER => array( Legacies_Empire::ID_BUILDING_TERRAFORMER => array(
'name' => 'Terraformeur', 'name' => 'Terraformeur',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/terraformer.png' 'image' => 'medias/klore/images/building/terraformer.jpg'
), ),
Legacies_Empire::ID_BUILDING_ALLIANCE_DEPOT => array( Legacies_Empire::ID_BUILDING_ALLIANCE_DEPOT => array(
'name' => 'Dépôt de ravitaillement', 'name' => 'Dépôt de ravitaillement',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/alliance-depot.png' 'image' => 'medias/klore/images/building/alliance-depot.jpg'
), ),
Legacies_Empire::ID_BUILDING_MISSILE_SILO => array( Legacies_Empire::ID_BUILDING_MISSILE_SILO => array(
'name' => 'Silo de missiles', 'name' => 'Silo de missiles',
'description' => '', 'description' => '',
'image' => 'graphics/buildings/missile-silo.png' 'image' => 'medias/klore/images/building/missile-silo.jpg'
), ),
// }}} // }}}
@ -99,19 +99,19 @@
Legacies_Empire::ID_BUILDING_LUNAR_BASE => array( Legacies_Empire::ID_BUILDING_LUNAR_BASE => array(
'name' => 'Base lunaire', 'name' => 'Base lunaire',
'description' => '', 'description' => '',
'image' => 'graphics/units/lunar-base.png' 'image' => 'medias/klore/images/units/lunar-base.jpg'
), ),
Legacies_Empire::ID_BUILDING_SENSOR_PHALANX => array( Legacies_Empire::ID_BUILDING_SENSOR_PHALANX => array(
'name' => 'Phalange de capteur', 'name' => 'Phalange de capteur',
'description' => '', 'description' => '',
'image' => 'graphics/units/sensor-phalanx.png' 'image' => 'medias/klore/images/units/sensor-phalanx.jpg'
), ),
Legacies_Empire::ID_BUILDING_JUMP_GATE => array( Legacies_Empire::ID_BUILDING_JUMP_GATE => array(
'name' => 'Porte de saut spatial', 'name' => 'Porte de saut spatial',
'description' => '', 'description' => '',
'image' => 'graphics/units/jump-gate.png' 'image' => 'medias/klore/images/units/jump-gate.jpg'
), ),
// }}} // }}}
@ -121,103 +121,103 @@
Legacies_Empire::ID_RESEARCH_ESPIONAGE_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_ESPIONAGE_TECHNOLOGY => array(
'name' => 'Techniques d\'espionnage', 'name' => 'Techniques d\'espionnage',
'description' => '', 'description' => '',
'image' => 'graphics/technology/espionnage.png' 'image' => 'medias/klore/images/technology/espionnage.jpg'
), ),
Legacies_Empire::ID_RESEARCH_COMPUTER_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_COMPUTER_TECHNOLOGY => array(
'name' => 'Recherche informatique', 'name' => 'Recherche informatique',
'description' => '', 'description' => '',
'image' => 'graphics/technology/computer.png' 'image' => 'medias/klore/images/technology/computer.jpg'
), ),
Legacies_Empire::ID_RESEARCH_WEAPON_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_WEAPON_TECHNOLOGY => array(
'name' => 'Technologies d\'armements', 'name' => 'Technologies d\'armements',
'description' => '', 'description' => '',
'image' => 'graphics/technology/weaponry.png' 'image' => 'medias/klore/images/technology/weaponry.jpg'
), ),
Legacies_Empire::ID_RESEARCH_SHIELDING_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_SHIELDING_TECHNOLOGY => array(
'name' => 'Boucliers énergétiques', 'name' => 'Boucliers énergétiques',
'description' => '', 'description' => '',
'image' => 'graphics/technology/shielding.png' 'image' => 'medias/klore/images/technology/shielding.jpg'
), ),
Legacies_Empire::ID_RESEARCH_ARMOUR_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_ARMOUR_TECHNOLOGY => array(
'name' => 'Structures spatiales', 'name' => 'Structures spatiales',
'description' => '', 'description' => '',
'image' => 'graphics/technology/armour.png' 'image' => 'medias/klore/images/technology/armour.jpg'
), ),
Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY => array(
'name' => 'Nouvelles énergies', 'name' => 'Nouvelles énergies',
'description' => '', 'description' => '',
'image' => 'graphics/technology/energy.png' 'image' => 'medias/klore/images/technology/energy.jpg'
), ),
Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY => array(
'name' => 'Technologie hyperespace', 'name' => 'Technologie hyperespace',
'description' => '', 'description' => '',
'image' => 'graphics/technology/hyperspace-technology.png' 'image' => 'medias/klore/images/technology/hyperspace-technology.jpg'
), ),
Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE => array( Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE => array(
'name' => 'Propulsion à combustion', 'name' => 'Propulsion à combustion',
'description' => '', 'description' => '',
'image' => 'graphics/technology/combustion-drive.png' 'image' => 'medias/klore/images/technology/combustion-drive.jpg'
), ),
Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE => array( Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE => array(
'name' => 'Propulsion à impulsion', 'name' => 'Propulsion à impulsion',
'description' => '', 'description' => '',
'image' => 'graphics/technology/impulse-drive.png' 'image' => 'medias/klore/images/technology/impulse-drive.jpg'
), ),
Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE => array( Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE => array(
'name' => 'Propulsion hyperespace', 'name' => 'Propulsion hyperespace',
'description' => '', 'description' => '',
'image' => 'graphics/technology/hyperspace-drive.png' 'image' => 'medias/klore/images/technology/hyperspace-drive.jpg'
), ),
Legacies_Empire::ID_RESEARCH_LASER_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_LASER_TECHNOLOGY => array(
'name' => 'Propriétés laser', 'name' => 'Propriétés laser',
'description' => '', 'description' => '',
'image' => 'graphics/technology/laser.png' 'image' => 'medias/klore/images/technology/laser.jpg'
), ),
Legacies_Empire::ID_RESEARCH_ION_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_ION_TECHNOLOGY => array(
'name' => 'Propriétés des ions', 'name' => 'Propriétés des ions',
'description' => '', 'description' => '',
'image' => 'graphics/technology/ion.png' 'image' => 'medias/klore/images/technology/ion.jpg'
), ),
Legacies_Empire::ID_RESEARCH_PLASMA_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_PLASMA_TECHNOLOGY => array(
'name' => 'Propriétés des plasma', 'name' => 'Propriétés des plasma',
'description' => '', 'description' => '',
'image' => 'graphics/technology/plasma.png' 'image' => 'medias/klore/images/technology/plasma.jpg'
), ),
Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK => array( Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK => array(
'name' => 'Réseau de recherche intergalactique', 'name' => 'Réseau de recherche intergalactique',
'description' => '', 'description' => '',
'image' => 'graphics/technology/intergalactic-research-network.png' 'image' => 'medias/klore/images/technology/intergalactic-research-network.jpg'
), ),
Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY => array(
'name' => 'Technologie expéditions', 'name' => 'Technologie expéditions',
'description' => '', 'description' => '',
'image' => 'graphics/technology/expedition.png' 'image' => 'medias/klore/images/technology/expedition.jpg'
), ),
Legacies_Empire::ID_RESEARCH_ORE_MINING => array( Legacies_Empire::ID_RESEARCH_ORE_MINING => array(
'name' => 'Exploitation minière', 'name' => 'Exploitation minière',
'description' => '', 'description' => '',
'image' => 'graphics/technology/ore-mining.png' 'image' => 'medias/klore/images/technology/ore-mining.jpg'
), ),
Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => array( Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => array(
'name' => 'Graviton', 'name' => 'Graviton',
'description' => '', 'description' => '',
'image' => 'graphics/technology/graviton.png' 'image' => 'medias/klore/images/technology/graviton.jpg'
), ),
// }}} // }}}
@ -228,112 +228,112 @@
'name' => 'Transporteur T5', 'name' => 'Transporteur T5',
'class' => 'Etalon', 'class' => 'Etalon',
'description' => '', 'description' => '',
'image' => 'graphics/units/light-transport.png' 'image' => 'medias/klore/images/units/light-transport.jpg'
), ),
Legacies_Empire::ID_SHIP_LARGE_TRANSPORT => array( Legacies_Empire::ID_SHIP_LARGE_TRANSPORT => array(
'name' => 'Transporteur T25', 'name' => 'Transporteur T25',
'class' => 'Buffle', 'class' => 'Buffle',
'description' => '', 'description' => '',
'image' => 'graphics/units/large-transport.png' 'image' => 'medias/klore/images/units/large-transport.jpg'
), ),
Legacies_Empire::ID_SHIP_LIGHT_FIGHTER => array( Legacies_Empire::ID_SHIP_LIGHT_FIGHTER => array(
'name' => 'Chasseur C50', 'name' => 'Chasseur C50',
'class' => 'Guêpe', 'class' => 'Guêpe',
'description' => '', 'description' => '',
'image' => 'graphics/units/light-fighter.png' 'image' => 'medias/klore/images/units/light-fighter.jpg'
), ),
Legacies_Empire::ID_SHIP_HEAVY_FIGHTER => array( Legacies_Empire::ID_SHIP_HEAVY_FIGHTER => array(
'name' => 'Chasseur C150', 'name' => 'Chasseur C150',
'class' => 'Frelon', 'class' => 'Frelon',
'description' => '', 'description' => '',
'image' => 'graphics/units/heavy-fighter.png' 'image' => 'medias/klore/images/units/heavy-fighter.jpg'
), ),
Legacies_Empire::ID_SHIP_CRUISER => array( Legacies_Empire::ID_SHIP_CRUISER => array(
'name' => 'Croiseur V400', 'name' => 'Croiseur V400',
'class' => 'Aigle', 'class' => 'Aigle',
'description' => '', 'description' => '',
'image' => 'graphics/units/cruiser.png' 'image' => 'medias/klore/images/units/cruiser.jpg'
), ),
Legacies_Empire::ID_SHIP_BATTLESHIP => array( Legacies_Empire::ID_SHIP_BATTLESHIP => array(
'name' => 'Vaisseau de bataille V1000', 'name' => 'Vaisseau de bataille V1000',
'class' => 'Faucon', 'class' => 'Faucon',
'description' => '', 'description' => '',
'image' => 'graphics/units/battleship.png' 'image' => 'medias/klore/images/units/battleship.jpg'
), ),
Legacies_Empire::ID_SHIP_COLONY_SHIP => array( Legacies_Empire::ID_SHIP_COLONY_SHIP => array(
'name' => 'Vaisseau de colonisation', 'name' => 'Vaisseau de colonisation',
'class' => 'Romulus', 'class' => 'Romulus',
'description' => '', 'description' => '',
'image' => 'graphics/units/colony-ship.png' 'image' => 'medias/klore/images/units/colony-ship.jpg'
), ),
Legacies_Empire::ID_SHIP_RECYCLER => array( Legacies_Empire::ID_SHIP_RECYCLER => array(
'name' => 'Recycleur', 'name' => 'Recycleur',
'class' => 'Goule', 'class' => 'Goule',
'description' => '', 'description' => '',
'image' => 'graphics/units/recycler.png' 'image' => 'medias/klore/images/units/recycler.jpg'
), ),
Legacies_Empire::ID_SHIP_SPY_DRONE => array( Legacies_Empire::ID_SHIP_SPY_DRONE => array(
'name' => 'Sonde d\'espionnage', 'name' => 'Sonde d\'espionnage',
'class' => 'Moustique', 'class' => 'Moustique',
'description' => '', 'description' => '',
'image' => 'graphics/units/spy-drone.png' 'image' => 'medias/klore/images/units/spy-drone.jpg'
), ),
Legacies_Empire::ID_SHIP_BOMBER => array( Legacies_Empire::ID_SHIP_BOMBER => array(
'name' => 'Bombarider', 'name' => 'Bombarider',
'class' => 'Vengeur', 'class' => 'Vengeur',
'description' => '', 'description' => '',
'image' => 'graphics/units/terraformer.png' 'image' => 'medias/klore/images/units/terraformer.jpg'
), ),
Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => array( Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => array(
'name' => 'Satellite solaire', 'name' => 'Satellite solaire',
'class' => 'Râ', 'class' => 'Râ',
'description' => '', 'description' => '',
'image' => 'graphics/units/terraformer.png' 'image' => 'medias/klore/images/units/terraformer.jpg'
), ),
Legacies_Empire::ID_SHIP_DESTRUCTOR => array( Legacies_Empire::ID_SHIP_DESTRUCTOR => array(
'name' => 'Vaisseau de bataille V2000', 'name' => 'Vaisseau de bataille V2000',
'class' => 'Destructeur', 'class' => 'Destructeur',
'description' => '', 'description' => '',
'image' => 'graphics/units/terraformer.png' 'image' => 'medias/klore/images/units/terraformer.jpg'
), ),
Legacies_Empire::ID_SHIP_DEATH_STAR => array( Legacies_Empire::ID_SHIP_DEATH_STAR => array(
'name' => 'Vaisseau mère M1', 'name' => 'Vaisseau mère M1',
'class' => 'Vengeur', 'class' => 'Vengeur',
'description' => '', 'description' => '',
'image' => 'graphics/units/terraformer.png' 'image' => 'medias/klore/images/units/terraformer.jpg'
), ),
Legacies_Empire::ID_SHIP_BATTLECRUISER => array( Legacies_Empire::ID_SHIP_BATTLECRUISER => array(
'name' => 'Vaisseau de bataille V700', 'name' => 'Vaisseau de bataille V700',
'class' => 'Dagon', 'class' => 'Dagon',
'description' => '', 'description' => '',
'image' => 'graphics/units/terraformer.png' 'image' => 'medias/klore/images/units/terraformer.jpg'
), ),
Legacies_Empire::ID_SHIP_SUPERNOVA => array( Legacies_Empire::ID_SHIP_SUPERNOVA => array(
'name' => 'Vaisseau mère M5', 'name' => 'Vaisseau mère M5',
'class' => 'Annihilateur', 'class' => 'Annihilateur',
'description' => '', 'description' => '',
'image' => 'graphics/units/terraformer.png' 'image' => 'medias/klore/images/units/terraformer.jpg'
), ),
Legacies_Empire::ID_SHIP_ORE_MININER => array( Legacies_Empire::ID_SHIP_ORE_MININER => array(
'name' => 'Vaisseau d\'exploitation', 'name' => 'Vaisseau d\'exploitation',
'class' => 'Onyx', 'class' => 'Onyx',
'description' => '', 'description' => '',
'image' => 'graphics/units/terraformer.png' 'image' => 'medias/klore/images/units/terraformer.jpg'
), ),
// }}} // }}}
@ -342,66 +342,74 @@
// {{{ // {{{
Legacies_Empire::ID_DEFENSE_ROCKET_LAUNCHER => array( Legacies_Empire::ID_DEFENSE_ROCKET_LAUNCHER => array(
'name' => 'Lance-missiles balistiques', 'name' => 'Lance-missiles balistiques',
'class' => 'Défenseur',
'description' => '', 'description' => '',
'image' => 'graphics/defenses/rocket-launcher.png' 'image' => 'medias/klore/images/defense/rocket-launcher.jpg'
), ),
Legacies_Empire::ID_DEFENSE_LIGHT_LASER => array( Legacies_Empire::ID_DEFENSE_LIGHT_LASER => array(
'name' => 'Artillerie laser légère', 'name' => 'Artillerie laser légère',
'class' => 'Lux',
'description' => '', 'description' => '',
'image' => 'graphics/defenses/light-laser.png' 'image' => 'medias/klore/images/defense/light-laser.jpg'
), ),
Legacies_Empire::ID_DEFENSE_HEAVY_LASER => array( Legacies_Empire::ID_DEFENSE_HEAVY_LASER => array(
'name' => 'Artillerie laser lourde', 'name' => 'Artillerie laser lourde',
'class' => 'Seraphin',
'description' => '', 'description' => '',
'image' => 'graphics/defenses/heavy-laser.png' 'image' => 'medias/klore/images/defense/heavy-laser.jpg'
), ),
Legacies_Empire::ID_DEFENSE_ION_CANNON => array( Legacies_Empire::ID_DEFENSE_ION_CANNON => array(
'name' => 'Canon à ions', 'name' => 'Canon à ions',
'class' => 'Découpeur',
'description' => '', 'description' => '',
'image' => 'graphics/defenses/ion-canon.png' 'image' => 'medias/klore/images/defense/ion-canon.jpg'
), ),
Legacies_Empire::ID_DEFENSE_GAUSS_CANNON => array( Legacies_Empire::ID_DEFENSE_GAUSS_CANNON => array(
'name' => 'Canon à effet Gauss', 'name' => 'Canon à effet Gauss',
'class' => 'Polaris',
'description' => '', 'description' => '',
'image' => 'graphics/defenses/gauss-canon.png' 'image' => 'medias/klore/images/defense/gauss-canon.jpg'
), ),
Legacies_Empire::ID_DEFENSE_PLASMA_TURRET => array( Legacies_Empire::ID_DEFENSE_PLASMA_TURRET => array(
'name' => 'Canon à plasma', 'name' => 'Canon à plasma',
'class' => 'Infernal',
'description' => '', 'description' => '',
'image' => 'graphics/defenses/plasma-turret.png' 'image' => 'medias/klore/images/defense/plasma-turret.jpg'
), ),
Legacies_Empire::ID_DEFENSE_SMALL_SHIELD_DOME => array( Legacies_Empire::ID_DEFENSE_SMALL_SHIELD_DOME => array(
'name' => 'Dôme bouclier', 'name' => 'Dôme bouclier',
'class' => 'Sphere',
'description' => '', 'description' => '',
'image' => 'graphics/defenses/small-shield-dome.png' 'image' => 'medias/klore/images/defense/small-shield-dome.jpg'
), ),
Legacies_Empire::ID_DEFENSE_LARGE_SHIELD_DOME => array( Legacies_Empire::ID_DEFENSE_LARGE_SHIELD_DOME => array(
'name' => 'Grand bouclier planétaire', 'name' => 'Grand bouclier planétaire',
'class' => 'Protecteur',
'description' => '', 'description' => '',
'image' => 'graphics/defenses/large-shield-dome.png' 'image' => 'medias/klore/images/defense/large-shield-dome.jpg'
),
Legacies_Empire::ID_SPECIAL_ANTIBALLISTIC_MISSILE => array(
'name' => 'Missile anti-balistique',
'description' => '',
'image' => 'graphics/defenses/antiballistic-missile.png'
), ),
// }}} // }}}
// //
// Special labels // Special defenses labels
// {{{ // {{{
Legacies_Empire::ID_SPECIAL_ANTIBALLISTIC_MISSILE => array(
'name' => 'Missile anti-balistique',
'description' => '',
'image' => 'medias/klore/images/defense/antiballistic-missile.jpg'
),
Legacies_Empire::ID_SPECIAL_INTERPLANETARY_MISSILE => array( Legacies_Empire::ID_SPECIAL_INTERPLANETARY_MISSILE => array(
'name' => 'Missile stratégique', 'name' => 'Missile stratégique',
'description' => '', 'description' => '',
'image' => 'graphics/defenses/interplanetary-missile.png' 'image' => 'medias/klore/images/defense/interplanetary-missile.jpg'
) )
// }}} // }}}
); );

View file

@ -31,6 +31,7 @@
define('INSIDE' , true); define('INSIDE' , true);
define('INSTALL' , false); define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php'; require_once dirname(__FILE__) .'/application/bootstrap.php';
$labels = Wootook_Empire_Helper_Config_Labels::getSingleton();
//Compteur de flotte en expéditions et nombre d'expédition maximum //Compteur de flotte en expéditions et nombre d'expédition maximum
$maxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY); $maxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY);
@ -230,11 +231,11 @@ $ShipData = "";
$have_ships = false; $have_ships = false;
foreach ($reslist['fleet'] as $n => $i) { foreach ($reslist['fleet'] as $n => $i) {
if ($planet[$resource[$i]] > 0) { if ($planet->getElement($i) > 0) {
$page .= "<tr height=\"20\">"; $page .= "<tr height=\"20\">";
$page .= "<th><a title=\"". $lang['fl_fleetspeed'] /*. $CurrentShipSpeed*/ ."\">" . $lang['tech'][$i] . "</a></th>"; $page .= "<th><a title=\"". $lang['fl_fleetspeed'] /*. $CurrentShipSpeed*/ ."\">" . $labels[$i]['name'] . "</a></th>";
$page .= "<th>". pretty_number ($planet[$resource[$i]]); $page .= "<th>". pretty_number ($planet->getElement($i));
$ShipData .= "<input type=\"hidden\" name=\"maxship[". $i ."]\" value=\"". $planet[$resource[$i]] ."\" />"; $ShipData .= "<input type=\"hidden\" name=\"maxship[". $i ."]\" value=\"". $planet->getElement($i) ."\" />";
$ShipData .= "<input type=\"hidden\" name=\"consumption[". $i ."]\" value=\"". GetShipConsumption ( $i, $user ) ."\" />"; $ShipData .= "<input type=\"hidden\" name=\"consumption[". $i ."]\" value=\"". GetShipConsumption ( $i, $user ) ."\" />";
$ShipData .= "<input type=\"hidden\" name=\"speed[" .$i ."]\" value=\"" . GetFleetMaxSpeed ("", $i, $user) . "\" />"; $ShipData .= "<input type=\"hidden\" name=\"speed[" .$i ."]\" value=\"" . GetFleetMaxSpeed ("", $i, $user) . "\" />";
$ShipData .= "<input type=\"hidden\" name=\"capacity[". $i ."]\" value=\"". $pricelist[$i]['capacity'] ."\" />"; $ShipData .= "<input type=\"hidden\" name=\"capacity[". $i ."]\" value=\"". $pricelist[$i]['capacity'] ."\" />";
@ -244,7 +245,7 @@ foreach ($reslist['fleet'] as $n => $i) {
$page .= "<th></th><th></th>"; $page .= "<th></th><th></th>";
} else { } else {
$page .= "<th><a href=\"javascript:maxShip('ship[". $i ."]'); shortInfo();\">".$lang['fl_selmax']."</a> </th>"; $page .= "<th><a href=\"javascript:maxShip('ship[". $i ."]'); shortInfo();\">".$lang['fl_selmax']."</a> </th>";
$page .= "<th><input name=\"ship[". $i ."]\" size=\"10\" value=\"0\" onfocus=\"javascript:if(this.value == '0') this.value='';\" onblur=\"javascript:if(this.value == '') this.value='0';\" alt=\"". $lang['tech'][$i] . $planet[$resource[$i]] ."\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" /></th>"; $page .= "<th><input name=\"ship[". $i ."]\" size=\"10\" value=\"0\" onfocus=\"javascript:if(this.value == '0') this.value='';\" onblur=\"javascript:if(this.value == '') this.value='0';\" alt=\"". $labels[$i]['name'] . $planet->getElement($i) ."\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" /></th>";
} }
$page .= "</tr>"; $page .= "</tr>";
$have_ships = true; $have_ships = true;

View file

@ -258,7 +258,7 @@ $page .= "</tr>";
$kolonien = $user->getPlanetCollection(); $kolonien = $user->getPlanetCollection();
$currentplanet = $user->getCurrentPlanet(); $currentplanet = $user->getCurrentPlanet();
if ($kolonien->rowCount() > 1) { if ($kolonien->getSize() > 1) {
$i = 0; $i = 0;
$w = 0; $w = 0;
$tr = true; $tr = true;
@ -312,6 +312,7 @@ $maxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHN
$ExpeditionEnCours = 0; $ExpeditionEnCours = 0;
$EnvoiMaxExpedition = 0; $EnvoiMaxExpedition = 0;
if ($maxExpedition >= 1) { if ($maxExpedition >= 1) {
$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read');
$ExpeditionEnCours = $readAdapter->select() $ExpeditionEnCours = $readAdapter->select()
->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)')) ->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)'))
->from(array('fleet' => $readAdapter->getTable('fleets'))) ->from(array('fleet' => $readAdapter->getTable('fleets')))

View file

@ -37,20 +37,20 @@ $session = Wootook::getSession('fleet');
$galaxy = isset($_POST['galaxy']) ? intval($_POST['galaxy']) : 0; $galaxy = isset($_POST['galaxy']) ? intval($_POST['galaxy']) : 0;
$system = isset($_POST['system']) ? intval($_POST['system']) : 0; $system = isset($_POST['system']) ? intval($_POST['system']) : 0;
$planet = isset($_POST['planet']) ? intval($_POST['planet']) : 0; $position = isset($_POST['planet']) ? intval($_POST['planet']) : 0;
$planettype = isset($_POST['planettype']) ? intval($_POST['planettype']) : 0; $planetType = isset($_POST['planettype']) ? intval($_POST['planettype']) : 0;
$speed = isset($_POST['speed']) ? intval($_POST['speed']) : 10; $speed = isset($_POST['speed']) ? intval($_POST['speed']) : 10;
$coords = array( $coords = array(
'galaxy' => $galaxy, 'galaxy' => $galaxy,
'system' => $system, 'system' => $system,
'position' => $planet 'position' => $position
); );
$destination = Wootook_Empire_Model_Planet::factoryFromCoords($coords, $planettype); $destination = Wootook_Empire_Model_Planet::factoryFromCoords($coords, $planetType);
$session['planet_destination'] = $destination->getId(); $session['planet_destination'] = $destination->getId();
$user = Wootook_Player_Model_Session::getSingleton()->getPlayer(); $user = Wootook_Player_Model_Session::getSingleton()->getPlayer();
$planetrow = $user->getCurrentPlanet(); $planet = $user->getCurrentPlanet();
$YourPlanet = false; $YourPlanet = false;
if ($destination->getUserId() == $user->getId()) { if ($destination->getUserId() == $user->getId()) {
@ -75,15 +75,15 @@ $missionTypes = array();
if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) { if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) {
$missionTypes[Legacies_Empire::ID_MISSION_EXPEDITION] = $lang['type_mission'][Legacies_Empire::ID_MISSION_EXPEDITION]; $missionTypes[Legacies_Empire::ID_MISSION_EXPEDITION] = $lang['type_mission'][Legacies_Empire::ID_MISSION_EXPEDITION];
} else { } else {
if ($planettype == Wootook_Empire_Model_Planet::TYPE_DEBRIS) { if ($planetType == Wootook_Empire_Model_Planet::TYPE_DEBRIS) {
if (isset($fleetArray[Legacies_Empire::ID_SHIP_RECYCLER]) && $fleetArray[Legacies_Empire::ID_SHIP_RECYCLER] > 0) { if (isset($fleetArray[Legacies_Empire::ID_SHIP_RECYCLER]) && $fleetArray[Legacies_Empire::ID_SHIP_RECYCLER] > 0) {
$missionTypes[Legacies_Empire::ID_MISSION_RECYCLE] = $lang['type_mission'][Legacies_Empire::ID_MISSION_RECYCLE]; $missionTypes[Legacies_Empire::ID_MISSION_RECYCLE] = $lang['type_mission'][Legacies_Empire::ID_MISSION_RECYCLE];
} }
} else if ($planettype == Wootook_Empire_Model_Planet::TYPE_PLANET) { } else if ($planetType == Wootook_Empire_Model_Planet::TYPE_PLANET) {
if (isset($fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP] > 0 && !$UsedPlanet) { if (isset($fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP] > 0 && !$UsedPlanet) {
$missionTypes[Legacies_Empire::ID_MISSION_SETTLE_COLONY] = $lang['type_mission'][7]; $missionTypes[Legacies_Empire::ID_MISSION_SETTLE_COLONY] = $lang['type_mission'][7];
} }
} else if ($planettype == Wootook_Empire_Model_Planet::TYPE_MOON) { } else if ($planetType == Wootook_Empire_Model_Planet::TYPE_MOON) {
if (((isset($fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR]) && $fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR] > 0) || if (((isset($fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR]) && $fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR] > 0) ||
(isset($fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA]) && $fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA] > 0)) && (isset($fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA]) && $fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA] > 0)) &&
!$YourPlanet && $UsedPlanet) { !$YourPlanet && $UsedPlanet) {
@ -91,7 +91,7 @@ if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) {
} }
} }
if (in_array($planettype, array(Wootook_Empire_Model_Planet::TYPE_MOON, Wootook_Empire_Model_Planet::TYPE_PLANET))) { if (in_array($planetType, array(Wootook_Empire_Model_Planet::TYPE_MOON, Wootook_Empire_Model_Planet::TYPE_PLANET))) {
if (isset($fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE]) && $fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE] > 0 && !$YourPlanet) { if (isset($fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE]) && $fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE] > 0 && !$YourPlanet) {
$missionTypes[Legacies_Empire::ID_MISSION_SPY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_SPY]; $missionTypes[Legacies_Empire::ID_MISSION_SPY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_SPY];
} }
@ -130,11 +130,11 @@ if (isset($fleetArray[Legacies_Empire::ID_SHIP_SOLAR_SATELLITE])) {
$mission = isset($_POST['target_mission']) ? $_POST['target_mission'] : 0; $mission = isset($_POST['target_mission']) ? $_POST['target_mission'] : 0;
$SpeedFactor = GetGameSpeedFactor(); $SpeedFactor = Wootook::getGameConfig('game/speed/general');
$AllFleetSpeed = GetFleetMaxSpeed($fleetArray, 0, $user); $AllFleetSpeed = GetFleetMaxSpeed($fleetArray, 0, $user);
$MaxFleetSpeed = min($AllFleetSpeed); $MaxFleetSpeed = min($AllFleetSpeed);
$distance = GetTargetDistance($planetrow->getGalaxy(), $galaxy, $planetrow->getSystem(), $system, $planetrow->getPosition(), $planet); $distance = GetTargetDistance($planet->getGalaxy(), $galaxy, $planet->getSystem(), $system, $planet->getPosition(), $position);
$duration = GetMissionDuration($speed, $MaxFleetSpeed, $distance, $SpeedFactor); $duration = GetMissionDuration($speed, $MaxFleetSpeed, $distance, $SpeedFactor);
$consumption = GetFleetConsumption($fleetArray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user ); $consumption = GetFleetConsumption($fleetArray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user );
@ -144,12 +144,12 @@ $session['consumption'] = $consumption;
$session['speed'] = $speed; $session['speed'] = $speed;
$session['galaxy'] = $galaxy; $session['galaxy'] = $galaxy;
$session['system'] = $system; $session['system'] = $system;
$session['position'] = $planet; $session['position'] = $position;
$session['type'] = $planettype; $session['type'] = $planetType;
$MissionSelector = ""; $MissionSelector = "";
if (count($missionTypes) > 0) { if (count($missionTypes) > 0) {
if ($planet == (Wootook::getGameConfig('engine/universe/positions') + 1)) { if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) {
$MissionSelector .= "<tr height=\"20\">"; $MissionSelector .= "<tr height=\"20\">";
$MissionSelector .= "<th>"; $MissionSelector .= "<th>";
$MissionSelector .= "<input type=\"radio\" name=\"mission\" value=\"15\" checked=\"checked\">". $lang['type_mission'][Legacies_Empire::ID_MISSION_EXPEDITION] ."<br /><br />"; $MissionSelector .= "<input type=\"radio\" name=\"mission\" value=\"15\" checked=\"checked\">". $lang['type_mission'][Legacies_Empire::ID_MISSION_EXPEDITION] ."<br /><br />";
@ -176,10 +176,10 @@ if (count($missionTypes) > 0) {
$MissionSelector .= "</tr>"; $MissionSelector .= "</tr>";
} }
if ($planetrow->isPlanet()) { if ($planet->isPlanet()) {
$TableTitle = "{$planetrow->getCoords()} - {$lang['fl_planet']}"; $TableTitle = "{$planet->getCoords()} - {$lang['fl_planet']}";
} elseif ($planetrow->isMoon()) { } elseif ($planet->isMoon()) {
$TableTitle = "{$planetrow->getCoords()} - {$lang['fl_moon']}"; $TableTitle = "{$planet->getCoords()} - {$lang['fl_moon']}";
} }
$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read'); $readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read');
@ -218,14 +218,14 @@ $page .= "<form action=\"floten3.php\" method=\"post\">\n";
$page .= "<input type=\"hidden\" name=\"consumption\" value=\"". $consumption ."\" />\n"; $page .= "<input type=\"hidden\" name=\"consumption\" value=\"". $consumption ."\" />\n";
$page .= "<input type=\"hidden\" name=\"dist\" value=\"". $distance ."\" />\n"; $page .= "<input type=\"hidden\" name=\"dist\" value=\"". $distance ."\" />\n";
$page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". $SpeedFactor ."\" />\n"; $page .= "<input type=\"hidden\" name=\"speedfactor\" value=\"". $SpeedFactor ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thisgalaxy\" value=\"". $planetrow->getGalaxy() ."\" />\n"; $page .= "<input type=\"hidden\" name=\"thisgalaxy\" value=\"". $planet->getGalaxy() ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thissystem\" value=\"". $planetrow->getSystem() ."\" />\n"; $page .= "<input type=\"hidden\" name=\"thissystem\" value=\"". $planet->getSystem() ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thisplanet\" value=\"". $planetrow->getPosition() ."\" />\n"; $page .= "<input type=\"hidden\" name=\"thisplanet\" value=\"". $planet->getPosition() ."\" />\n";
$page .= "<input type=\"hidden\" name=\"galaxy\" value=\"". $galaxy ."\" />\n"; $page .= "<input type=\"hidden\" name=\"galaxy\" value=\"". $galaxy ."\" />\n";
$page .= "<input type=\"hidden\" name=\"system\" value=\"". $system ."\" />\n"; $page .= "<input type=\"hidden\" name=\"system\" value=\"". $system ."\" />\n";
$page .= "<input type=\"hidden\" name=\"planet\" value=\"". $planet ."\" />\n"; $page .= "<input type=\"hidden\" name=\"planet\" value=\"". $position ."\" />\n";
$page .= "<input type=\"hidden\" name=\"thisplanettype\" value=\"". $planetrow->getType() ."\" />\n"; $page .= "<input type=\"hidden\" name=\"thisplanettype\" value=\"". $planet->getType() ."\" />\n";
$page .= "<input type=\"hidden\" name=\"planettype\" value=\"". $planettype ."\" />\n"; $page .= "<input type=\"hidden\" name=\"planettype\" value=\"". $planetType ."\" />\n";
$page .= "<input type=\"hidden\" name=\"speedallsmin\" value=\"". $session['speedallsmin'] ."\" />\n"; $page .= "<input type=\"hidden\" name=\"speedallsmin\" value=\"". $session['speedallsmin'] ."\" />\n";
$page .= "<input type=\"hidden\" name=\"speed\" value=\"". $speed ."\" />\n"; $page .= "<input type=\"hidden\" name=\"speed\" value=\"". $speed ."\" />\n";
$page .= "<input type=\"hidden\" name=\"usedfleet\" value=\"". $MaxFlyingFleets ."\" />\n"; $page .= "<input type=\"hidden\" name=\"usedfleet\" value=\"". $MaxFlyingFleets ."\" />\n";
@ -262,15 +262,15 @@ $page .= "<td colspan=\"3\" class=\"c\">". $lang['fl_ressources'] ."</td>\n";
$page .= "</tr><tr height=\"20\">\n"; $page .= "</tr><tr height=\"20\">\n";
$page .= "<th>". $lang['Metal'] ."</th>\n"; $page .= "<th>". $lang['Metal'] ."</th>\n";
$page .= "<th><a href=\"javascript:maxResource('1');\">". $lang['fl_selmax'] ."</a></th>\n"; $page .= "<th><a href=\"javascript:maxResource('1');\">". $lang['fl_selmax'] ."</a></th>\n";
$page .= "<th><input name=\"resource1\" alt=\"". $lang['Metal'] ." ". floor($planetrow["metal"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n"; $page .= "<th><input name=\"resource1\" alt=\"". $lang['Metal'] ." ". floor($planet["metal"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n";
$page .= "</tr><tr height=\"20\">\n"; $page .= "</tr><tr height=\"20\">\n";
$page .= "<th>". $lang['Crystal'] ."</th>\n"; $page .= "<th>". $lang['Crystal'] ."</th>\n";
$page .= "<th><a href=\"javascript:maxResource('2');\">". $lang['fl_selmax'] ."</a></th>\n"; $page .= "<th><a href=\"javascript:maxResource('2');\">". $lang['fl_selmax'] ."</a></th>\n";
$page .= "<th><input name=\"resource2\" alt=\"". $lang['Crystal'] ." ". floor($planetrow["crystal"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n"; $page .= "<th><input name=\"resource2\" alt=\"". $lang['Crystal'] ." ". floor($planet["crystal"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n";
$page .= "</tr><tr height=\"20\">\n"; $page .= "</tr><tr height=\"20\">\n";
$page .= "<th>". $lang['Deuterium'] ."</th>\n"; $page .= "<th>". $lang['Deuterium'] ."</th>\n";
$page .= "<th><a href=\"javascript:maxResource('3');\">". $lang['fl_selmax'] ."</a></th>\n"; $page .= "<th><a href=\"javascript:maxResource('3');\">". $lang['fl_selmax'] ."</a></th>\n";
$page .= "<th><input name=\"resource3\" alt=\"". $lang['Deuterium'] ." ". floor($planetrow["deuterium"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n"; $page .= "<th><input name=\"resource3\" alt=\"". $lang['Deuterium'] ." ". floor($planet["deuterium"]) ."\" size=\"10\" onchange=\"calculateTransportCapacity();\" type=\"text\"></th>\n";
$page .= "</tr><tr height=\"20\">\n"; $page .= "</tr><tr height=\"20\">\n";
$page .= "<th>". $lang['fl_space_left'] ."</th>\n"; $page .= "<th>". $lang['fl_space_left'] ."</th>\n";
$page .= "<th colspan=\"2\"><div id=\"remainingresources\">-</div></th>\n"; $page .= "<th colspan=\"2\"><div id=\"remainingresources\">-</div></th>\n";
@ -279,7 +279,7 @@ $page .= "<th colspan=\"3\"><a href=\"javascript:maxResources()\">". $lang['fl_a
$page .= "</tr><tr height=\"20\">\n"; $page .= "</tr><tr height=\"20\">\n";
$page .= "<th colspan=\"3\">&nbsp;</th>\n"; $page .= "<th colspan=\"3\">&nbsp;</th>\n";
$page .= "</tr>\n"; $page .= "</tr>\n";
if ($planet == (Wootook::getGameConfig('engine/universe/positions') + 1)) { if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) {
$page .= "<tr height=\"20\">"; $page .= "<tr height=\"20\">";
$page .= "<td class=\"c\" colspan=\"3\">". $lang['fl_expe_staytime'] ."</td>"; $page .= "<td class=\"c\" colspan=\"3\">". $lang['fl_expe_staytime'] ."</td>";
$page .= "</tr>"; $page .= "</tr>";

View file

@ -310,7 +310,7 @@ if ($mission != Legacies_Empire::ID_MISSION_EXPEDITION) {
$possibleSpeeds = array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1); $possibleSpeeds = array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
$AllFleetSpeed = GetFleetMaxSpeed($fleetArray, 0, $user); $AllFleetSpeed = GetFleetMaxSpeed($fleetArray, 0, $user);
$SpeedFactor = GetGameSpeedFactor(); $SpeedFactor = Wootook::getGameConfig('game/speed/general');
$MaxFleetSpeed = min($AllFleetSpeed); $MaxFleetSpeed = min($AllFleetSpeed);
if (!in_array($speed, $possibleSpeeds)) { if (!in_array($speed, $possibleSpeeds)) {
@ -349,7 +349,7 @@ if ($mission == Legacies_Empire::ID_MISSION_EXPEDITION && isset($_POST['expediti
&& ($expeditionTime = intval($_POST['expeditiontime'])) >= 1 && $expeditionTime <= 10) { && ($expeditionTime = intval($_POST['expeditiontime'])) >= 1 && $expeditionTime <= 10) {
$StayDuration = $expeditionTime * 3600; $StayDuration = $expeditionTime * 3600;
$StayTime = $startTime + $expeditionTime * 3600; $StayTime = $startTime + $expeditionTime * 3600;
} elseif ($mission == Legacies_Empire::ID_MISSION_STATION_ALLY || $mission == Legacies_Empire::ID_MISSION_EXPLOIT && is_int($_POST['holdingtime']) } elseif ($mission == Legacies_Empire::ID_MISSION_STATION_ALLY || $mission == Legacies_Empire::ID_MISSION_ORE_MINING && is_int($_POST['holdingtime'])
&& ($holdingTime = intval($_POST['holdingtime'])) >= 1 && $holdingTime <= 10) { && ($holdingTime = intval($_POST['holdingtime'])) >= 1 && $holdingTime <= 10) {
$StayDuration = $holdingTime * 3600; $StayDuration = $holdingTime * 3600;
$StayTime = $startTime + $holdingTime * 3600; $StayTime = $startTime + $holdingTime * 3600;
@ -361,7 +361,7 @@ if ($mission == Legacies_Empire::ID_MISSION_EXPEDITION && isset($_POST['expediti
/* END Refactoring */ /* END Refactoring */
$endTime = $StayDuration + (2 * $duration) + time(); $endTime = $StayDuration + (2 * $duration) + time();
$FleetStorage = 0; $FleetStorage = 0;
$FleetShipCount = sum($fleetArray); $FleetShipCount = array_sum($fleetArray);
$serializedFleetArray = ''; $serializedFleetArray = '';
foreach ($fleetArray as $shipId => $count) { foreach ($fleetArray as $shipId => $count) {
@ -380,28 +380,28 @@ if (!isset($_POST['resource1']) || intval($_POST['resource1']) < 1) {
$TransMetal = 0; $TransMetal = 0;
} else { } else {
$TransMetal = intval($_POST['resource1']); $TransMetal = intval($_POST['resource1']);
if ($StockMetal < $TransMetal) { if (Math::comp($StockMetal, $TransMetal) < 0) {
$TransMetal = $StockMetal; $TransMetal = $StockMetal;
} }
$StorageNeeded += $TransMetal; $StorageNeeded = Math::add($TransMetal, $StorageNeeded);
} }
if (!isset($_POST['resource2']) || intval($_POST['resource2']) < 1) { if (!isset($_POST['resource2']) || intval($_POST['resource2']) < 1) {
$TransCrystal = 0; $TransCrystal = 0;
} else { } else {
$TransCrystal = intval($_POST['resource2']); $TransCrystal = intval($_POST['resource2']);
if ($StockCrystal < $TransCrystal) { if (Math::comp($StockCrystal, $TransCrystal) < 0) {
$TransCrystal = $StockCrystal; $TransCrystal = $StockCrystal;
} }
$StorageNeeded += $TransCrystal; $StorageNeeded = Math::add($TransCrystal, $StorageNeeded);
} }
if (!isset($_POST['resource3']) || intval($_POST['resource3']) < 1) { if (!isset($_POST['resource3']) || intval($_POST['resource3']) < 1) {
$TransDeuterium = 0; $TransDeuterium = 0;
} else { } else {
$TransDeuterium = intval($_POST['resource3']); $TransDeuterium = intval($_POST['resource3']);
if ($StockDeuterium < $TransDeuterium) { if (Math::comp($StockDeuterium, $TransDeuterium) < 0) {
$TransDeuterium = $StockDeuterium; $TransDeuterium = $StockDeuterium;
} }
$StorageNeeded += $TransDeuterium; $StorageNeeded = Math::add($TransDeuterium, $StorageNeeded);
} }
if ($StorageNeeded > $FleetStorage) { if ($StorageNeeded > $FleetStorage) {
@ -430,21 +430,20 @@ try {
->set('fleet_owner', $user->getId()) ->set('fleet_owner', $user->getId())
->set('fleet_mission', $mission) ->set('fleet_mission', $mission)
->set('fleet_amount', $FleetShipCount) ->set('fleet_amount', $FleetShipCount)
->set('fleet_array', $fleet_array) ->set('fleet_array', $serializedFleetArray)
->set('fleet_start_time', $startTime) ->set('fleet_start_time', $startTime)
->set('fleet_start_galaxy', $planet->getGalaxy()) ->set('fleet_start_galaxy', $planet->getGalaxy())
->set('fleet_start_system', $planet->getSystem()) ->set('fleet_start_system', $planet->getSystem())
->set('fleet_start_planet', $planet->getPosition()) ->set('fleet_start_planet', $planet->getPosition())
->set('fleet_start_type', $planet->getType()) ->set('fleet_start_type', $planet->getType())
->set('fleet_end_time', $endTime) ->set('fleet_end_time', $endTime)
->set('fleet_end_stay', $user->getId()) ->set('fleet_end_stay', $StayDuration)
->set('fleet_end_stay', $user->getId())
->set('fleet_end_galaxy', $galaxy) ->set('fleet_end_galaxy', $galaxy)
->set('fleet_end_system', $system) ->set('fleet_end_system', $system)
->set('fleet_end_planet', $planet) ->set('fleet_end_planet', $position)
->set('fleet_end_type', $type) ->set('fleet_end_type', $type)
->set('fleet_resource_metal', intval($TransMetal)) ->set('fleet_resource_metal', intval($TransMetal))
->set('fleet_resource_cristal', intval($TransCrystal)) ->set('fleet_resource_crystal', intval($TransCrystal)) // FIXME: refactor field name
->set('fleet_resource_deuterium', intval($TransDeuterium)) ->set('fleet_resource_deuterium', intval($TransDeuterium))
->set('fleet_target_owner', $destination['id_owner']) ->set('fleet_target_owner', $destination['id_owner'])
->set('start_time', time()) ->set('start_time', time())

View file

@ -46,7 +46,6 @@ function GetTargetDistance($OrigGalaxy, $DestGalaxy, $OrigSystem, $DestSystem, $
// Calcul de la durée de vol d'une flotte par rapport a sa vitesse max // Calcul de la durée de vol d'une flotte par rapport a sa vitesse max
function GetMissionDuration ($GameSpeed, $MaxFleetSpeed, $Distance, $SpeedFactor) { function GetMissionDuration ($GameSpeed, $MaxFleetSpeed, $Distance, $SpeedFactor) {
$Duration = 0;
$Duration = round(((35000 / $GameSpeed * sqrt($Distance * 10 / $MaxFleetSpeed) + 10) / $SpeedFactor)); $Duration = round(((35000 / $GameSpeed * sqrt($Distance * 10 / $MaxFleetSpeed) + 10) / $SpeedFactor));
return $Duration; return $Duration;
@ -115,12 +114,13 @@ function GetFleetMaxSpeed($FleetArray, $Fleet, $Player) {
// ---------------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------
// Calcul de la consommation de base d'un vaisseau au regard des technologies // Calcul de la consommation de base d'un vaisseau au regard des technologies
function GetShipConsumption ( $Ship, $Player ) { function GetShipConsumption($shipId, $player)
global $pricelist; {
if ($Player['impulse_motor_tech'] >= 5) { $pricelist = Wootook_Empire_Helper_Config_Prices::getSingleton();
$Consumption = $pricelist[$Ship]['consumption2']; if ($shipId == Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT && $player->getElement(Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE) >= 5) {
$Consumption = $pricelist[$shipId]['consumption2'];
} else { } else {
$Consumption = $pricelist[$Ship]['consumption']; $Consumption = $pricelist[$shipId]['consumption'];
} }
return $Consumption; return $Consumption;
@ -133,6 +133,8 @@ function GetFleetConsumption ($FleetArray, $SpeedFactor, $MissionDuration, $Miss
$consumption = 0; $consumption = 0;
$basicConsumption = 0; $basicConsumption = 0;
var_dump($FleetArray, $SpeedFactor, $MissionDuration, $MissionDistance, $FleetMaxSpeed);
foreach ($FleetArray as $Ship => $Count) { foreach ($FleetArray as $Ship => $Count) {
if ($Ship > 0) { if ($Ship > 0) {
$ShipSpeed = GetFleetMaxSpeed ( "", $Ship, $Player ); $ShipSpeed = GetFleetMaxSpeed ( "", $Ship, $Player );

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View file

@ -35,56 +35,6 @@ $user = Wootook_Player_Model_Session::getSingleton()->getPlayer();
$planet = $user->getCurrentPlanet(); $planet = $user->getCurrentPlanet();
$moon = $planet->getMoon(); $moon = $planet->getMoon();
$action = isset($_GET['action']) ? $_GET['action'] : null;
if (isset($_POST) && !empty($_POST)) {/*
die('a');
$action = isset($_POST['action']) && !empty($_POST['action']) ? $_POST['action'] : $action;
$formKey = isset($_POST['form_key']) && !empty($_POST['form_key']) ? $_POST['form_key'] : null;
if ($formKey == Wootook::getSession('security')->getData('form_key')) {
if ($action == 'rename' && isset($_POST['name']) && !empty($_POST['name'])) {
$planet->setData('name', $_POST['name'])->save();
} else if ($action == 'destroy' && isset($_POST['password']) && !empty($_POST['password']) && isset($_POST['confirm'])) {
if (!$user->checkPassword($_POST['password'])) {
Wootook::getSession('user')
->addError(Wootook::__('Password was not correct.'));
}
try {
$user->getCurrentPlanet()->destroy();
Wootook::getSession('user')
->addSucces(Wootook::__('Planet has been successfully destroyed.'));
} catch (Wootook_Empire_Model_Planet_Exception $e) {
Wootook::getSession('user')
->addError($e->getMessage());
}
}
} else {
Wootook::getSession('user')
->addError(Wootook::__('Invalid security key.'));
}
header('HTTP/1.1 302 Found');
header('Location: ' . Wootook::getStaticUrl(basename(__FILE__)));
exit(0);*/
} else if ($action == 'rename') {/*
die('a');
$layout = new Wootook_Core_Model_Layout();
$layout->load('overview.rename-planet');
echo $layout->render();
exit(0);*/
} else if ($action == 'destroy') {/*
die('a');
$layout = new Wootook_Core_Model_Layout();
$layout->load('overview.destroy-planet');
echo $layout->render();
exit(0);*/
}
includeLang('resources'); includeLang('resources');
includeLang('overview'); includeLang('overview');
@ -195,7 +145,7 @@ if ($user->getId()) {
$fleetList->setPartial($id, $block); $fleetList->setPartial($id, $block);
} }
$messageCollection = $user->getNewMessagesCount() $messageCollection = $user->getNewMessagesCount();
$newMessages = $layout->createBlock('core/deprecated', 'overview.messages'); $newMessages = $layout->createBlock('core/deprecated', 'overview.messages');
$newMessages->setTemplate('empire/overview/messages.phtml'); $newMessages->setTemplate('empire/overview/messages.phtml');