Example #1
0
 private function getChooseTarget()
 {
     $structure = new Neuron_Structure_ChooseTarget($this->getInputData(), $this->village, false, true);
     return $structure->getHTML();
 }
Example #2
0
 protected function getChooseTarget($spell, $error = null)
 {
     $structure = new Neuron_Structure_ChooseTarget($this->getInputData(), $this->village, true, true);
     return $structure->getHTML($error);
 }
Example #3
0
 private function getChooseTarget($messages = array())
 {
     $structure = new Neuron_Structure_ChooseTarget($this->aInput, $this->getVillage(), false);
     $page = new Neuron_Core_Template();
     $page->set('messages', $messages);
     $page->set('choosetarget', $structure->getHTML());
     return $page->parse('buildings/market_target.phpt');
 }
Example #4
0
 private function commandMoveUnit($building, $unit)
 {
     $input = $this->getInputData();
     $id = isset($input['target']) ? intval($input['target']) : null;
     if ($id > 0 && $id != $unit->getLocation()->getId()) {
         // Calculate distance & duration
         $target = Dolumar_Players_Village::getVillage($id);
         if (!$target) {
             return '<p>Invalid input: target village not found.</p>';
         }
         if (isset($input['confirm'])) {
             $page = new Neuron_Core_Template();
             $page->setTextSection('moveUnit', 'thievery');
             $page->set('input', array('building' => $building->getId()));
             // Move the bloody unit
             $unit->moveUnit($target);
             return $page->parse('thieves/doneMoving.phpt');
         } else {
             $page = new Neuron_Core_Template();
             $page->setTextSection('moveUnit', 'thievery');
             $distance = Dolumar_Map_Map::getDistanceBetweenVillages($unit->getLocation(), $target);
             // Calculate duration
             $duration = $unit->getTravelDuration($distance);
             $page->set('input', array_merge($input, array('confirm' => 'true')));
             $page->set('distance', Neuron_Core_Tools::output_distance($distance));
             $page->set('duration', Neuron_Core_Tools::getDuration($duration));
             return $page->parse('thieves/moveThief.phpt');
         }
     } else {
         $structure = new Neuron_Structure_ChooseTarget($this->getInputData(), $this->village, true, true);
         $structure->setReturnData(array('building' => $building->getId()));
         return $structure->getHTML();
     }
 }