/* ===================================================================== * ÆÄ ÀÏ : DramaturgyInfo.h , DramaturgyInfo.cpp * ¸ñ Àû : ¿¬ÃâÁ¤º¸ Ŭ·¡½º * ÀÛ ¼º ÀÚ : Á¤¿øÁÖ * ÀÛ ¼º ÀÏ : 2006³â 10¿ù 16ÀÏ * * Ãß°¡³»¿ë : * Ãß°¡³¯Â¥ ÀÛ¾÷ÀÚ Ãß°¡³»¿ë * * ÁÖÀÇ»çÇ× : . * =======================================================================*/ #pragma once class cParser; enum eDRAMA_TYPE { eDRAMA_SKILL = 0, /// ½ºÅ³ eDRAMA_INFULUENCE, /// È¿°ú(Áö¼Ó) }; enum eDRAMAOBJ_KIND { eDRAMAOBJ_EFFECT = 0, /// ÀÌÆåÆ® °´Ã¼(nif) eDRAMAOBJ_SOUND, /// »ç¿îµå °´Ã¼ eDRAMAOBJ_TRAILTEX, /// ±ËÀû¿ë ÅØ½ºÃÄ }; enum eDRAMAACTION { eDRAMA_ACTION = 0, eDRAMA_ACTIVE, eDRAMA_DAMAGE, eDRAMA_CHANNELING, eDRAMA_BULLET, eDRAMA_TRAIL, eDRAMA_SHAKE, eDRAMA_FADEOUT, }; enum eDRAMASTATE { eDRAMASTATE_NONE = 0, eDRAMASTATE_CASTING, /// ij½ºÆÃ eDRAMASTATE_ACTIVITY, /// ¹ßµ¿ eDRAMASTATE_APPLY, /// Àû¿ë (ÀÌ »óÅ¿£ ¹ßµ¿ + Àû¿ë 󸮸¦ ÇÑ´Ù.) eDRAMASTATE_MAX, eDRAMASTATE_CANCEL_WAIT, }; struct sDramaObj { eDRAMAOBJ_KIND kind; cString file; /// effectÀÎ °æ¿ì »ç¿ë NiMatrix3 rot; float scale; /// soundÀÎ °æ¿ì »ç¿ë unsigned long soundListIndex; sDramaObj() { rot = NiMatrix3::IDENTITY; scale = 1.0f; } }; struct sDramaActionBase { eDRAMAACTION actionType; unsigned long time; sDramaActionBase* pNext; sDramaActionBase() : pNext(0) { } }; struct sDramaAction : public sDramaActionBase { unsigned long lifeTime; bool bLoop; bool bFollow; unsigned short objIdx; unsigned int linkPos; NiPoint3 var; unsigned char weaponType; sDramaAction() { var = NiPoint3::ZERO; weaponType = 0; } }; struct sDamageAction : public sDramaActionBase { float percent; }; struct sCrashInfo { unsigned short crashEffectIdx; unsigned int crashLinkPos; NiPoint3 crashVar; }; struct sBulletAction : public sDramaActionBase { unsigned short bulletID; float speed; unsigned short bulletEffectIdx; unsigned int linkPos; unsigned int targetLinkPos; NiPoint3 bulletVar; bool existCrash; unsigned int crashCount; sCrashInfo crashInfo[5]; sBulletAction() : existCrash(false) { crashCount = 0; } }; struct sTrailAction : public sDramaActionBase { unsigned long lifeTime; unsigned short texIdx; unsigned int linkStart; unsigned int linkEnd; float lengthPer; float speedFactor; sTrailAction() { speedFactor = 1.0f; lengthPer = 100; } }; /// ¿¬Ãâ »óÅ Á¤º¸ class cDramaState { public: cDramaState() { mAnimationIdx = UINT_MAX; mActionCount = 0; mpBegin = mpEnd = 0; } ~cDramaState() { sDramaActionBase* pAction = mpBegin; sDramaActionBase* pNext; for( unsigned int i=0;ipNext; delete pAction; pAction = pNext; } mActionCount = 0; } void Push( sDramaActionBase* p ) { p->pNext = 0; if( mpBegin == 0 ) { mpBegin = mpEnd = p; } else { /// if( mpBegin->time > p->time ) { p->pNext = mpBegin; mpBegin = p; } else { sDramaActionBase* cur = mpBegin; sDramaActionBase* next = cur->pNext; for( unsigned int i = 0;itime <= p->time ) { if( next == 0 ) { cur->pNext = mpEnd = p; break; } if( next->time >= p->time ) { cur->pNext = p; p->pNext = next; break; } } else { assert(0); } cur = cur->pNext; next = cur->pNext; } } } mActionCount++; } /* void PushFront( sDramaActionBase* p ) { p->pNext = 0; if( mpBegin == 0 ) { mpBegin = mpEnd = p; } else { p->pNext = mpBegin; mpBegin = p; } mActionCount++; } void PushBack( sDramaActionBase* p ) { p->pNext = 0; if( mpBegin == 0 ) { mpBegin = mpEnd = p; } else { mpEnd->pNext = p; mpEnd = p; } mActionCount++; } */ sDramaActionBase* GetStart() { return mpBegin; } unsigned int mAnimationIdx; protected: unsigned int mActionCount; sDramaActionBase* mpBegin; sDramaActionBase* mpEnd; }; /// skill ¹× È¿°ú¿Í x:1¸ÅĪ class cDramaturgyInfo { public: cDramaturgyInfo( const char* pName ); ~cDramaturgyInfo(); /// dramaobj »ý¼º ÇÊ¿ä!! void LoadDramaObj(); void LoadThreadDramaObj(); bool LoadFile(); sDramaActionBase* GetStartAction( eDRAMASTATE state ); unsigned int GetAnimation( eDRAMASTATE state ); sDramaObj* GetDramaObj( unsigned short idx ); protected: /// list »ó¼¼ ·Îµù bool LoadHeader( cParser& parser ); bool LoadContents( eDRAMASTATE state, cParser& parser ); unsigned int GetLinkIndex( cString str ); protected: cString mFileName; /// ¿¬Ãâ °øÅë Á¤º¸ eDRAMA_TYPE mType; /// »ç¿ë °´Ã¼ Á¤º¸ typedef tPointerHashMap cDramaObjMap; cDramaObjMap mDramaObjMap; /// ¹ß»çü¿¡ ´ëÇÑ ÂüÁ¶ Á¤º¸ typedef cDramaObjMap cBulletMap; cBulletMap mBulletMap; /// ij½ºÆÃ, ¹ßµ¿, Àû¿ë »ó¼¼ Á¤º¸ cDramaState* mpDramaState[eDRAMASTATE_MAX]; };