GameLib/RaceMotionData.h İçeriği gizle 1.1.) EMotionEventType enum'u aşağıdakilerle genişletin: #ifdef ENABLE_WOLFMAN_CHARACTER MOTION_EVENT_TYPE_RELATIVE_MOVE_ON, MOTION_EVENT_TYPE_RELATIVE_MOVE_OFF, #endif 1.2.) Biraz aşağıda yeni türleri bildirin: #ifdef ENABLE_WOLFMAN_CHARACTER typedef struct NMotionEvent::SMotionEventDataRelativeMoveOn TMotionRelativeMoveOn; typedef struct NMotionEvent::SMotionEventDataRelativeMoveOff TMotionRelativeMoveOff; #endif GameLib/RaceMotionDataEvent.h İçeriği gizle 1.1.) NMotionEvent ad alanının altına aşağıdakileri ekleyin: #ifdef ENABLE_WOLFMAN_CHARACTER // RelativeMoveOn typedef struct SMotionEventDataRelativeMoveOn : public SMotionEventData { int baseVelocity; SMotionEventDataRelativeMoveOn() : baseVelocity(0) {} virtual ~SMotionEventDataRelativeMoveOn() {} void Save(FILE* File, int iTabs){} bool Load(CTextFileLoader& rTextFileLoader) { if (!rTextFileLoader.GetTokenInteger("basevelocity", &baseVelocity)) { return false; } return true; } } TMotionEventDataRelativeMoveOn; // RelativeMoveOff typedef struct SMotionEventDataRelativeMoveOff : public SMotionEventData { SMotionEventDataRelativeMoveOff() {} virtual ~SMotionEventDataRelativeMoveOff() {} void Save(FILE* File, int iTabs) {} bool Load(CTextFileLoader& rTextFileLoader) { return true; } } TMotionEventDataRelativeMoveOff; #endif GameLib/RaceMotionData.cpp İçeriği gizle 1.1.) CRaceMotionData::LoadMotionData işlevi aşağıdakilerle hareket olay türlerinin geçişini genişletir: #ifdef ENABLE_WOLFMAN_CHARACTER case MOTION_EVENT_TYPE_RELATIVE_MOVE_ON: pData = new TMotionRelativeMoveOn; break; case MOTION_EVENT_TYPE_RELATIVE_MOVE_OFF: pData = new TMotionRelativeMoveOff; break; #endif GameLib/ActorInstanceMotionEvent.cpp İçeriği gizle 1.1.) CActorInstance::MotionEventProcess işlevi aşağıdakilerle anahtarı genişletin: #ifdef ENABLE_WOLFMAN_CHARACTER case CRaceMotionData::MOTION_EVENT_TYPE_RELATIVE_MOVE_ON: ProcessMotionEventRelativeMoveOn(c_pData); break; case CRaceMotionData::MOTION_EVENT_TYPE_RELATIVE_MOVE_OFF: ProcessMotionEventRelativeMoveOff(c_pData); break; #endif 1.2.) Aşağıdaki işlevleri istediğiniz yere ekleyin: #ifdef ENABLE_WOLFMAN_CHARACTER void CActorInstance::ProcessMotionEventRelativeMoveOn(const CRaceMotionData::TMotionEventData * c_pData) { if (CRaceMotionData::MOTION_EVENT_TYPE_RELATIVE_MOVE_ON != c_pData->iType) return; const CRaceMotionData::TMotionRelativeMoveOn * c_pRelativeMoveOnData = (const CRaceMotionData::TMotionRelativeMoveOn *)c_pData; static const float sc_fDistanceFromTarget = 270.0f; if (m_kFlyTarget.IsValidTarget()) { D3DXVECTOR3 v3MainPosition(m_x, m_y, m_z); const D3DXVECTOR3 & c_rv3TargetPosition = __GetFlyTargetPosition(); D3DXVECTOR3 v3Distance = c_rv3TargetPosition - v3MainPosition; D3DXVECTOR3 v3DistanceNormal(0.0f, 0.0f, 0.0f); D3DXVec3Normalize(&v3DistanceNormal, &v3Distance); float fDot = D3DXVec3Dot(&v3DistanceNormal, &v3Distance); m_fRelativeMoveMul = (fDot - sc_fDistanceFromTarget) / static_cast(c_pRelativeMoveOnData->baseVelocity); m_bIsRelativeMoveMode = true; } } void CActorInstance::ProcessMotionEventRelativeMoveOff(const CRaceMotionData::TMotionEventData * c_pData) { if (CRaceMotionData::MOTION_EVENT_TYPE_RELATIVE_MOVE_OFF != c_pData->iType) return; m_bIsRelativeMoveMode = false; } #endif GameLib/ActorInstanceMotion.cpp İçeriği gizle 1.1.) CActorInstance::__IsNeedFlyTargetMotion fonksiyonu için döngüsüne aşağıdakileri ekleyin: #ifdef ENABLE_WOLFMAN_CHARACTER if (c_pData->iType == CRaceMotionData::MOTION_EVENT_TYPE_RELATIVE_MOVE_ON) return true; #endif 1.2.) CActorInstance aynı yapın::__HasMotionFlyEvent bu: #ifdef ENABLE_WOLFMAN_CHARACTER if (c_pData->iType == CRaceMotionData::MOTION_EVENT_TYPE_RELATIVE_MOVE_ON) return true; #endif 1.3.) CActorInstance değişiklikleri yapın::__MotionEventProcess fonksiyonu aşağıdaki gibi: void CActorInstance::__MotionEventProcess(BOOL isPC) { if (isAttacking()) { // [...] } else { #ifdef ENABLE_WOLFMAN_CHARACTER m_bIsRelativeMoveMode = false; #endif // [...] } } GameLib/ActorInstance.h İçeriği gizle 1.1.) CActorInstance sınıfının alt kısmında aşağıdaki bildirimleri ekleyin: #ifdef ENABLE_WOLFMAN_CHARACTER protected: bool m_bIsRelativeMoveMode; float m_fRelativeMoveMul; protected: void ProcessMotionEventRelativeMoveOn(const CRaceMotionData::TMotionEventData* c_pData); void ProcessMotionEventRelativeMoveOff(const CRaceMotionData::TMotionEventData* c_pData); #endif GameLib/ActorInstance.cpp İçeriği gizle 1.1.) CActorInstance'daki değişiklikleri yapın::__AccumulationMovement işlevi aşağıdaki şekilde: void CActorInstance::__AccumulationMovement(float fRot) { // [...] #ifdef ENABLE_WOLFMAN_CHARACTER if (m_bIsRelativeMoveMode) AddMovement(m_fRelativeMoveMul * s_matRotationZ._41, m_fRelativeMoveMul * s_matRotationZ._42, m_fRelativeMoveMul * s_matRotationZ._43); else #endif AddMovement(s_matRotationZ._41, s_matRotationZ._42, s_matRotationZ._43); } 1.2.) CActorInstance'a aşağıdakileri ekleyin::__InitializeMotionData fonksiyonu: #ifdef ENABLE_WOLFMAN_CHARACTER m_fRelativeMoveMul = 0.0f; m_bIsRelativeMoveMode = false; #endif