public function action_run() { $character = $this->character; $battle = $character->battle; $monster = $battle->monster; // Check if the player and enemy can fight, if not end the battle. if (!Battle::can_fight($character) or !Battle::can_fight($battle)) { $this->request->redirect('battle/end'); } // TODO: Write a math system that calculates the chances of escaping. Battle::end($battle); $this->template->content = View::factory('battle/run/success')->set('character', $character)->set('monster', $monster); }