1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Corrected monster agressiveness #2034

This commit is contained in:
DjWarmonger 2015-01-10 10:23:58 +01:00
parent c22c3cdd80
commit 9f05f53e65
2 changed files with 6 additions and 2 deletions

View File

@ -32,11 +32,15 @@ public:
class DLL_LINKAGE CGCreature : public CArmedInstance //creatures on map
{
public:
enum Action {
FIGHT = -2, FLEE = -1, JOIN_FOR_FREE = 0 //values > 0 mean gold price
};
public:
enum Character {
COMPLIANT = 0, FRIENDLY = 1, AGRESSIVE = 2, HOSTILE = 3, SAVAGE = 4
};
ui32 identifier; //unique code for this monster (used in missions)
si8 character; //character of this set of creatures (0 - the most friendly, 4 - the most hostile) => on init changed to -4 (compliant) ... 10 value (savage)
std::string message; //message printed for attacking hero

View File

@ -681,7 +681,7 @@ bool CRmgTemplateZone::addMonster(CMapGenerator* gen, int3 &pos, si32 strength,
auto guard = new CGCreature();
guard->ID = Obj::MONSTER;
guard->subID = creId;
guard->character = 1; //MUST be initialized or switch will diverge
guard->character = CGCreature::HOSTILE;
auto hlp = new CStackInstance(creId, amount);
//will be set during initialization
guard->putStack(SlotID(0), hlp);