My Project
 
Loading...
Searching...
No Matches
hero.h
Go to the documentation of this file.
1#pragma once
2
3#include "gamesinprogress.h"
4#include "bundle.h"
5#include "char.h"
6#include "heroclass.h"
7#include "armor.h"
8#include "typedefine.h"
9#include "heroaction.h"
10#include <string>
11
12class Belongings;
13class HeroAction;
14class Mob;
15class HeroActionMove;
16class MissileWeapon;
17
18class Hero:public Char{
19private:
20 static const std::string TXT_LEAVE;
21
22 static const std::string TXT_LEVEL_UP;
23 static const std::string TXT_NEW_LEVEL;
24
25 static const std::string TXT_SOMETHING_ELSE;
26 static const std::string TXT_LOCKED_CHEST;
27 static const std::string TXT_LOCKED_DOOR;
28 static const std::string TXT_NOTICED_SMTH;
29
30 static const std::string TXT_WAIT;
31 static const std::string TXT_SEARCH;
32 static const float TIME_TO_REST;
33 static const float TIME_TO_SEARCH;
34
35private:
36 static const std::string ATTACK;
37 static const std::string DEFENSE;
38 static const std::string STRENGTH;
39 static const std::string LEVEL;
40 static const std::string EXPERIENCE;
41
42 int _attackSkill;
43 int _defenseSkill;
44
45 Item* theKey;
46 Char* enemy;
47
48 void Ready();
49 bool actMove(HeroActionMove* action);
50 bool getCloser(int target);
51 void checkVisibleMobs();
52 boolean actInteract(HeroActionInteract* action);
53 boolean actBuy(HeroActionBuy* action);
54 boolean actPickUp(HeroActionPickUp* action);
55 boolean actOpenChest(HeroActionOpenChest* action);
56 boolean actUnlock(HeroActionUnlock* action);
57 boolean actDescend(HeroActionDescend* action);
58 boolean actAscend(HeroActionAscend* action);
59 boolean actAttack(HeroActionAttack* action);
60 boolean actCook(HeroActionCook* action);
61public:
63
64 static const std::string TXT_YOU_NOW_HAVE;
65 static const int STARTING_STR = 10;
66public:
67 static void preview(GamesInProgress::Info& info, Bundle* bundle);
68 int tier();
69 boolean shoot(Char* enemy, MissileWeapon* wep);
70 void live();
72 void updateAwareness();
73 boolean isStarving();
74
75 Hero();
76 int sTR() {
77 return weakened ? STR - 2 : STR;
78 }
81
84
85 int STR;
86 boolean weakened;
87
88 int lvl;
89 int exp;
90
92 bool ready;
95 float awareness;
96
98public:
99 void resurrect(int resetLevel);
100 virtual bool act();
101 bool handle(int cell);
102
103 virtual std::string getClassName() { return "Hero"; }
104 int VisibleEnemies();
105 Mob* visibleEnemy(int index);
106
107 void resume();
108 int maxExp() { return 5 + lvl * 5; }
109 void spendAndNext(float time);
110 void busy() { ready = false; }
111 virtual void move(int step);
112 void interrupt();
113 bool search(bool intentional);
114 void earnExp(int exp);
115 void rest(boolean tillHealthy);
116
117 float attackDelay();
118
119 virtual void spend(float time);
120 virtual int attackSkill(Char* target);
121};
Definition armor.h:9
Definition typedefine.h:59
Definition belongings.h:14
Definition char.h:9
Char()
Definition char.cpp:34
Definition heroaction.h:68
Definition heroaction.h:85
Definition heroaction.h:33
Definition heroaction.h:76
Definition heroaction.h:60
Definition heroaction.h:3
Definition heroaction.h:42
Definition heroaction.h:9
Definition heroaction.h:25
Definition heroaction.h:17
Definition heroaction.h:52
Definition heroclass.h:10
int STR
Definition hero.h:85
int VisibleEnemies()
Definition hero.cpp:382
HeroClass heroClass
Definition hero.h:79
boolean shoot(Char *enemy, MissileWeapon *wep)
Definition hero.cpp:64
virtual void move(int step)
Definition hero.cpp:414
Mob * visibleEnemy(int index)
Definition hero.cpp:387
int sTR()
Definition hero.h:76
bool search(bool intentional)
Definition hero.cpp:441
bool restoreHealth
Definition hero.h:91
int tier()
Definition hero.cpp:59
ArrayList< Mob * > visibleEnemies
Definition hero.h:62
float awareness
Definition hero.h:95
bool ready
Definition hero.h:92
static void preview(GamesInProgress::Info &info, Bundle *bundle)
Definition hero.cpp:54
float attackDelay()
Definition hero.cpp:985
virtual std::string getClassName()
Definition hero.h:103
String className()
Definition hero.cpp:79
int maxExp()
Definition hero.h:108
boolean weakened
Definition hero.h:86
void busy()
Definition hero.h:110
static const int STARTING_STR
Definition hero.h:65
virtual int attackSkill(Char *target)
Definition hero.cpp:621
int lvl
Definition hero.h:88
Armor::Glyph * killerGlyph
Definition hero.h:97
void spendAndNext(float time)
Definition hero.cpp:407
MissileWeapon * rangedWeapon
Definition hero.h:82
Belongings * belongings
Definition hero.h:83
void resume()
Definition hero.cpp:400
HeroAction * lastAction
Definition hero.h:94
void rest(boolean tillHealthy)
Definition hero.cpp:598
int exp
Definition hero.h:89
Hero()
Definition hero.cpp:92
void earnExp(int exp)
Definition hero.cpp:556
bool handle(int cell)
Definition hero.cpp:311
boolean isStarving()
Definition hero.cpp:646
virtual void spend(float time)
Definition hero.cpp:607
static const std::string TXT_YOU_NOW_HAVE
Definition hero.h:64
void updateAwareness()
Definition hero.cpp:84
void live()
Definition hero.cpp:73
HeroAction * curAction
Definition hero.h:93
void interrupt()
Definition hero.cpp:432
virtual bool act()
Definition hero.cpp:212
void resurrect(int resetLevel)
Definition hero.cpp:119
HeroSubClass subClass
Definition hero.h:80
Definition heroclass.h:70
Definition item.h:15
Definition weapon.h:448
Definition mob.h:9
Definition gamesinprogress.h:8
std::string String
Definition typedefine.h:8