Esempio n. 1
0
 public function getIncome($since = NOW, $now = NOW)
 {
     $profiler = Neuron_Profiler_Profiler::getInstance();
     $profiler->start('Calculating income for this ' . $this->getClassName());
     $o = array($this->RESOURCE => $this->calculateIncome());
     $profiler->start('Processing bonus effects');
     $o = Neuron_Core_Tools::floor_array($this->getVillage()->procBonusses('procIncome', array($o, $this), $now, $since));
     $profiler->stop();
     $profiler->stop();
     return $o;
 }
Esempio n. 2
0
 private function calculateCapacity($l = null)
 {
     $o = array();
     if (!isset($l)) {
         $l = $this->getLevel();
     }
     $c = 8000;
     // Percentage that the capacity "grows" per level
     $g = 10;
     $capacity = $l * $c + $l * $c / 100 * ($l - 1) * $g;
     $o['gold'] = $capacity;
     $o['grain'] = $capacity;
     $o['wood'] = $capacity;
     $o['stone'] = $capacity;
     $o['iron'] = $capacity;
     $o['gems'] = floor($capacity / 10);
     return Neuron_Core_Tools::floor_array($this->getVillage()->procBonusses('procCapacity', array($o, $this)));
 }