📄 monsterai.h
字号:
//////////////////////////////////////////////////////////////////////////////// Filename : MonsterAI.h// Written By : 辫己刮// Description : // 阁胶磐狼 青悼阑 搬沥窍绰 锄狼 开且阑 秦林绰 AI 努贰胶捞寸.//////////////////////////////////////////////////////////////////////////////#ifndef __MONSTERAI_H__#define __MONSTERAI_H__#include "Creature.h"#include "Zone.h"#include "Assert.h"#include "Timeval.h"#include "Directive.h"//////////////////////////////////////////////////////////////////////////////// 扁贱 角菩 包访 惑荐//////////////////////////////////////////////////////////////////////////////enum{ SKILL_FAILED_RANGE = 1, SKILL_FAILED_RATIO = 2, SKILL_FAILED_STATUS = 3, SKILL_FAILED_MAX};//////////////////////////////////////////////////////////////////////////////// 掉饭捞 包访 惑荐//////////////////////////////////////////////////////////////////////////////enum{ LAST_ACTION_NONE, LAST_ACTION_MOVE, LAST_ACTION_SKILL, LAST_ACTION_SKILL_MAX};//////////////////////////////////////////////////////////////////////////////// 掉饭捞 包访 惑荐//////////////////////////////////////////////////////////////////////////////enum MoveRule{ MOVE_RULE_NORMAL, MOVE_RULE_LEFTWALL, MOVE_RULE_RIGHTWALL, MOVE_RULE_MAX,};//////////////////////////////////////////////////////////////////////////////// class MonsterAI//////////////////////////////////////////////////////////////////////////////class Monster;typedef bool (*ConditionCheckFunction)(Monster* pMonster, Creature* pEnemy);class MonsterAI{public:public: MonsterAI(Monster* pMonster, uint type) throw(); virtual ~MonsterAI() throw();public: // 单捞磐 窃荐 bool getDamaged(void) const throw() { return m_bDamaged; } void setDamaged(bool value) throw() { m_bDamaged = value; } // 促捞泛萍宏 包访 窃荐 void addDirective(Directive* pDirective) throw(); // 炼扒 窃荐 bool checkCondition(int condition, Creature* pEnemy) throw(); bool checkDirective(Directive* pDirective, Creature* pEnemy) throw(); // 青悼 窃荐 bool move(ZoneCoord_t ex, ZoneCoord_t ey) throw(); bool move(Creature* pEnemy, bool bRetreat=false) throw(); bool approach(Creature* pEnemy) throw() { return move(pEnemy, false); } bool flee(Creature* pEnemy) throw(); int useSkill(Creature* pEnemy, SkillType_t SkillType, int ratio) throw(); // 捞悼 窃荐 bool moveNormal(ZoneCoord_t ex, ZoneCoord_t ey, ZoneCoord_t& nx, ZoneCoord_t& ny, Dir_t& ndir) throw(); bool moveWall(ZoneCoord_t ex, ZoneCoord_t ey, ZoneCoord_t& nx, ZoneCoord_t& ny, Dir_t& ndir, bool bLeft) throw(); void setMoveRule(MoveRule mr) { m_MoveRule = mr; m_WallCount = 0; } // 寒鸥扁 -- MoveRule getMoveRule() const { return m_MoveRule; } int getWallCount() const { return m_WallCount; } // 青悼 菩畔 急琶 窃荐 void deal(Creature* pEnemy, const Timeval& currentTime) throw(); void actDeadAction(Creature* pEnemy) throw(); // 掉饭捞 包访 窃荐 void setDelay(const Timeval& currentTime) throw(); void setAttackDelay(const Timeval& currentTime) throw(); bool canAttackAir() const { return m_pDirectiveSet->canAttackAir(); } bool canSeeSafeZone() const { return m_pDirectiveSet->canSeeSafeZone(); }private: // 捞 AI啊 炼沥窍绰 夯眉 Monster* m_pBody; // AI狼 己氢 鸥涝 uint m_AIType; // 炼扒苞 疙飞 笼钦 DirectiveSet* m_pDirectiveSet; // 档噶摹绰 畔 冉荐 墨款磐 int m_Panic; // 档噶摹绰 弥措 畔 冉荐 int m_PanicMax; // 档噶摹促啊 肛苗脊阑 版快, // 救 档噶摹绊 傍拜窍绰 冉荐 墨款磐 int m_Courage; // 救 档噶摹绊 傍拜窍绰 弥措 畔 冉荐 int m_CourageMax; // 瘤抄 畔俊 嘎疽促, 救 嘎疽促 敲贰弊... bool m_bDamaged; // 捞锅 畔俊 公均阑 沁促绰 敲贰弊 int m_LastAction; // 捞悼窍绰 规过 MoveRule m_MoveRule; // 寒俊 狼秦 block等 规氢==促澜俊 怖 哎 荐 乐绢具窍绰 规氢 Dir_t m_BlockedDir; // 寒鸥绊 埃 雀荐 int m_WallCount; // 窃荐 器牢磐甸... ConditionCheckFunction m_pCondChecker[DIRECTIVE_COND_MAX];};bool checkEnemyRangeMelee(Monster* pMonster, Creature* pEnemy);bool checkEnemyRangeMissile(Monster* pMonster, Creature* pEnemy);bool checkEnemyRangeClose(Monster* pMonster, Creature* pEnemy);bool checkEnemyRangeOutOfSight(Monster* pMonster, Creature* pEnemy);bool checkEnemyDying(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotBloodDrained(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotGreenPoisoned(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotYellowPoisoned(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotDarkbluePoisoned(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotGreenStalkered(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotParalyzed(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotDoomed(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotBlinded(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotInDarkness(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotSeduction(Monster* pMonster, Creature* pEnemy);bool checkImOK(Monster* pMonster, Creature* pEnemy);bool checkImDying(Monster* pMonster, Creature* pEnemy);bool checkImDamaged(Monster* pMonster, Creature* pEnemy);bool checkImHiding(Monster* pMonster, Creature* pEnemy);bool checkImWolf(Monster* pMonster, Creature* pEnemy);bool checkImBat(Monster* pMonster, Creature* pEnemy);bool checkImInvisible(Monster* pMonster, Creature* pEnemy);bool checkImWalkingWall(Monster* pMonster, Creature* pEnemy);bool checkTimingBloodDrain(Monster* pMonster, Creature* pEnemy);// by sigi. 2002.9.4bool checkMasterSummonTiming(Monster* pMonster, Creature* pEnemy);bool checkMasterNotReady(Monster* pMonster, Creature* pEnemy);bool checkImInBadPosition(Monster* pMonster, Creature* pEnemy);bool checkFindWeakEnemy(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotDeath(Monster* pMonster, Creature* pEnemy);bool checkEnemyNotHallucination(Monster* pMonster, Creature* pEnemy);// by sigi. 2002.9.16bool checkTimingMasterBloodDrain(Monster* pMonster, Creature* pEnemy);// by sigi. 2002.9.23bool checkTimingDuplicateSelf(Monster* pMonster, Creature* pEnemy);// by sigi. 2002.9.24bool checkEnemyRangeInMissile(Monster* pMonster, Creature* pEnemy);// by sigi. 2002.10.1bool checkPossibleSummonMonsters(Monster* pMonster, Creature* pEnemy);// by Sequoia. 2003.4.14bool checkEnemyTileNotAcidSwamp(Monster* pMonster, Creature* pEnemy);bool checkEnemyOnAir(Monster* pMonster, Creature* pEnemy);bool checkEnemyOnSafeZone(Monster* pMonster, Creature* pEnemy);#endif // __MONSTER_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -