11
16
// You should have received a copy of the GNU General Public License
12
17
// along with this program; if not, write to the Free Software
13
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15
#ifndef __QUEST_KILL_HERO_H
16
#define __QUEST_KILL_HERO_H
21
#ifndef QUEST_KILL_HERO_H
22
#define QUEST_KILL_HERO_H
18
24
#include <sigc++/trackable.h>
23
29
#include "playerlist.h"
28
* This specific quest demands a certain hero to be killed.
32
//! A Quest to kill another Player's Hero.
34
* A hero that receives this quest has to kill a particular Hero. The Quest
35
* is completed when this happens, or the quest is expired if enemy Hero dies.
31
37
class QuestKillHero : public Quest, public sigc::trackable
41
//! Default constructor.
43
* Make a new kill-hero quest.
45
* @param q_mgr The quests manager to associate this quest with.
46
* @param hero The Id of the Hero who is responsible for the quest.
35
48
QuestKillHero(QuestsManager& q_mgr, Uint32 hero);
37
/** \brief Constructor - create a new quest from
50
//! Loading constructor.
52
* @param q_mgr The quests manager to associate this quest with.
53
* @param helper The opened saved-game file to load this quest from.
39
55
QuestKillHero(QuestsManager& q_mgr, XML_Helper* helper);
57
// Construct from remote action.
58
QuestKillHero(QuestsManager& q_mgr, Uint32 hero, Uint32 victim);
60
//! Returns whether or not this quest is impossible.
42
* \brief Return whether quest is possible at all
62
* Checks to see if any Players have a Hero to target.
64
* @param heroId The Id of the Hero responsible for the kill-hero
67
* @return Whether or not the quest is possible.
44
69
static bool isFeasible(Uint32 heroId);
71
//! Saves the kill-hero quest data to an opened saved-game file.
47
72
bool save(XML_Helper* helper) const;
50
* \brief Get progress information
52
* \param s here we append the progress information
74
//! Return a description of how well the quest to kill a hero is going.
54
75
std::string getProgress() const;
57
* \brief Provide the lines of the message describing
77
//! Return a queue of strings to show when the quest is compeleted.
60
78
void getSuccessMsg(std::queue<std::string>& msgs) const;
63
* \brief Provide the lines of the message describing
66
void getExpiredMsg(std::queue<std::string>& msgs) const;
68
//! Returns the hunted hero
69
Uint32 getVictim() const {return d_victim;}
80
//! Return a queue of strings to show when the quest has expired.
81
void getExpiredMsg(std::queue<std::string>& msgs) const;
83
//! Returns the Id of the hunted hero object.
84
Uint32 getVictim() const {return d_victim;}
86
//! Callback for when an Army object is killed.
88
* This method is used to check when the Hero responsible for the
89
* quest kills the Hero that is the target of this quest.
91
* @param army A pointer to the Army object that has been
93
* @param heroIsCulprit Whether or not the Hero object responsible for
94
* this Quest was involved with the killing of
95
* the given Army object.
71
97
void armyDied(Army *a, bool heroIsCulprit);
99
//! Callback for when a City is defeated.
101
* @note This method is not used.
73
103
void cityAction(City *c, CityDefeatedAction action,
74
104
bool heroIsCulprit, int gold);
77
//! Initializes the description string
107
//! Generate a description of the Quest.
78
108
void initDescription();
80
/** \brief Choose a hero to be killed */
110
//! Choose a hero to be killed.
112
* @return A pointer to the Hero object to be the target for this
81
115
static Hero* chooseToKill();
83
/** hero id (the target) to be searched by the hero */
117
//! The Id of the Hero object to be hunted and killed.