瀏覽代碼

Corrected monster agressiveness #2034

DjWarmonger 10 年之前
父節點
當前提交
9f05f53e65
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 5 1
      lib/mapObjects/MiscObjects.h
  2. 1 1
      lib/rmg/CRmgTemplateZone.cpp

+ 5 - 1
lib/mapObjects/MiscObjects.h

@@ -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

+ 1 - 1
lib/rmg/CRmgTemplateZone.cpp

@@ -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);