/* ==================================================================== * ÆÄ ÀÏ : BaseObject.h * ¸ñ Àû : °ü¸®¸¦ À§ÇÑ ±âº» °ÔÀÓ °´Ã¼ * ÀÛ ¼º ÀÚ : Á¤¼º´ë * ÀÛ ¼º ÀÏ : 2006.08.29 * * Ãß°¡³»¿ë : * Ãß°¡³¯Â¥ ÀÛ¾÷ÀÚ Ãß°¡³»¿ë * 2006.08.29 Á¤¼º´ë »ý¼º * * ÁÖÀÇ»çÇ× : * =================================================================== */ #pragma once #include "BaseObject_Common.h" class cEffectSceneNode; class cSoundSceneNode; class cDynamicSceneNode; class cInfluenceObject; struct sTrailInfo; class cBaseObject { public: virtual ~cBaseObject(); public: /// °»½ÅºÎ virtual void Update( unsigned long deltaTime, unsigned long accumTime ) = 0; virtual void UpdateAnimationSpeed(float val); virtual float GetAnimationSpeed(); /// skillObject¿¡¼­¸¸ »ç¿ëµÇ´Â ÇÔ¼ö virtual void UpdateSkillAnimation( unsigned int aniIdx, bool checkWeapon = false ); virtual void ApplyDamageDrama( int damage, unsigned int damageType, cBaseObject* pAttacker = 0 ); /// ´Ù¸¥ ½ºÅ³À» »ç¿ëÇÒ¼ö ÀÖ´Â »óÅ /// ÇöÀç AnimationÀ» Á¾·áÇϱâ Àü±îÁö ¾î¶°ÇÑ º¯È­µµ ÁÙ ¼ö ¾ø´Â °æ¿ì inline bool IsReadyUseSkill() { return mReadyUseSkill; } virtual void SetReadyUseSkill( bool used ) { if( mReadyUseSkill != used ) mReadyUseSkill = used; } inline virtual unsigned long GetObjectID() = 0; float GetXPos(); float GetYPos(); float GetZPos(); NiPoint3 GetPos(); void SetPos( float x, float y, float z ); void SetPos( const NiPoint3& pos ); void SetWorldPos( const NiPoint3& pos ); NiMatrix3 GetModelRot(); float GetModelScale(); virtual void SetState( unsigned char, bool) {} virtual unsigned int GetState() { return 0; } /// ¿ÜºÎ¿¡¼­ °´Ã¼ÀÇ ºÎºÐ À§Ä¡¸¦ ¾ò¾î ¿Ã¶§ »ç¿ëÇÑ´Ù. virtual bool GetDummyPos( unsigned int dummyId, NiPoint3& pos ); /// 070808 PKH ÁÂÇ¥º¸°£ void FixPos( float x, float y, bool resetCamera = false ); inline virtual cDynamicSceneNode* GetSceneNode() { return mpObjectSceneNode; } /// °´Ã¼ÀÇ ±×·¡ÇÈ µ¥ÀÌÅÍ¿¡ ´ëÇÑ Á¦°Å virtual void RemoveObjectSceneNode(); /// 061127 PKH ÁöÁ¤Çϰí Àִ Ÿ°ÙÀÇ index·Î objectÆ÷ÀÎÅ͸¦ ¾ò¾î³¿ cBaseObject* GetTargetObject(); inline const sObject* GetTargetInfo() { return &mTarget; } /// 061127 PKH ¸ñÇ¥(°ø°Ý,ÃßÀûµî)ÀÇ À妽º¿Í objectÁ¾·ù¸¦ ¼³Á¤ÇÑ´Ù. virtual void SetTargetObject( unsigned char type, unsigned long idx ); /// 061211 PKH ÁöÁ¤Çϰí Àִ Ÿ°ÙÀÇ Á¾·ù¸¦ ¾Ë¾Æ³¿ inline unsigned char GetTargetType() { return mTarget.type; } inline unsigned char GetObjectType() { return mObjectType; } /// Å×½ºÆ® - »óÅÂÇ¥½Ãâ Ãâ·ÂÀ»À§ÇØ ¸¸µë virtual inline LPTSTR GetName() = 0; /// 061205 PKH virtual unsigned long GetHP() { return 0; } virtual unsigned long GetMaxHP() { return 0; } virtual unsigned long GetMP() { return 0; } virtual unsigned long GetMaxMP() { return 0; } virtual void HPChange( unsigned long /*objectHP*/, unsigned long /*objectMaxHP*/ ){} virtual void HPChangeDie( unsigned long /*objectMaxHP*/, cBaseObject* /*pAttacker*/, unsigned char /*attackType*/ ){} virtual void MPChange( unsigned long /*objectMP*/, unsigned long /*objectMaxMP*/ ){} /// virtual unsigned char GetLevel() { return 0; } /// 061213 wonju virtual unsigned int SetLinkdObject( unsigned int /*num*/, char* /*nif*/ ) { return 0xffffffff; } virtual void UnLinkdObject( unsigned int /*num*/ ) {} /// ÀÌÆåÆ®¸¦ °´Ã¼¿¡ ¸µÅ© ½Ã۱â. virtual cEffectSceneNode* SetLinkdEffect( unsigned int num, const char* nif, NiTransform* trans, bool bLoop=false, bool bFollow=true ); virtual cSoundSceneNode* SetLinkdSound( unsigned long soundIdx, bool bLoop=false ); virtual cSoundSceneNode* SetStepSound( unsigned long soundIdx ); virtual cEffectSceneNode* SetLinkdDamage( unsigned int num, const char* nif, NiTransform* trans, bool IsMiss, bool zFalse ); virtual sTrailInfo* CreateTrailEffect( cString str, unsigned long lifeTime, unsigned int link1, unsigned int link2, float lenPer, float factor ); void DeleteTrailEffect( sTrailInfo* pInfo ); /// virtual void AddBuff( unsigned long uniqueIdx, cInfluenceObject* p ); virtual void DelBuff( unsigned long uniqueIdx ); virtual void AddDeBuff( unsigned long uniqueIdx, cInfluenceObject* p ); virtual void DelDeBuff( unsigned long uniqueIdx ); virtual void BlinkBuffIcon( unsigned long /*uniqueIdx*/, unsigned long /*influenceIdx*/ ) {} virtual void BlinkDeBuffIcon( unsigned long /*uniqueIdx*/, unsigned long /*influenceIdx*/ ) {} bool IsBuffHave( unsigned long influenceIdx ); bool IsHaveApplyBuffType( unsigned short applyValueType ); bool IsHaveApplyDeBuffType( unsigned short applyValueType ); /// 071023 PKH ¹öÇÁ µð¹öÇÁ ÂüÁ¶ tPointerHashMap* GetBufMap() { return &mBuffMap; } tPointerHashMap* GetDeBufMap() { return &mDeBuffMap; } /// ¿ÀºêÁ§Æ®ÀÇ °Å¸® üũ ¼öÁ¤ °Å¸® - Àû¿ë ¹üÀ§ virtual float GetFixedObjectSize() { return 0.0f; } float GetStatureValue(); /// void SetOverFlag( bool over ); virtual bool IsDie() { return false; } virtual void FadeOutObject(); virtual void SetSkillPushPull( float /*posX*/, float /*posY*/ ) { assert(NULL); } protected: virtual void ResetState() {} // virtual void ClearAllBuff(); // virtual void ClearAllDeBuff(); /// 090302 PKH °´Ã¼ »ç¸Á½Ã ¾ÈÁö¿öÁö´Â È¿°ú ó¸® Ãß°¡ virtual void ClearAllBuff( bool delDieInf ); virtual void ClearAllDeBuff( bool delDieInf ); protected: cBaseObject( unsigned char type ); virtual void Interpret( float /*fTime*/ ) {} enum eANIEVENT { eANIEVENT_GATHER_MINING, eANIEVENT_RUN_RIGHT, eANIEVENT_RUN_LEFT, eANIEVENT_JUMP_START, eANIEVENT_JUMP_END, eANIEVENT_MAX, }; /// type unsigned char mObjectType; /// ±×·¡ÇÈ µ¥ÀÌÅÍ °´Ã¼ ÂüÁ¶ cDynamicSceneNode* mpObjectSceneNode; /// 061127 PKH Ÿ°Ù À妽º°ª ÁöÁ¤ sObject mTarget; bool mReadyUseSkill; /// Àû¿ë È¿°ú(¹öÇÁ/µð¹öÇÁ)¿¡ ´ëÇÑ ÂüÁ¶ typedef tPointerHashMap cInfluenceMap; cInfluenceMap mBuffMap; cInfluenceMap mDeBuffMap; /// // float mStatureValue; unsigned long mIdleTime; float mRevisionEventTime[eANIEVENT_MAX]; };