Files
2026-06-01 12:46:52 +02:00

64 lines
2.8 KiB
Objective-C

// sonador 10.2.1 팻 시스템 구현
#pragma once
#include "SGameAvatarEx.h"
/**------------------------------------------------------------------
@class SGamePet
@brief node class for pet
@author sonador
@warning Don't instantiate this by itself
-------------------------------------------------------------------*/
class SGamePet : public SGameAvatarEx
{
public:
SGamePet( ENC_INT nPetID = 0 );
virtual ~SGamePet();
virtual bool Process( DWORD time, unsigned long procBitSet = 0 ); ///< process pet
virtual void OnChangeState( SObjectState::ID stateID, const SStateInfo& info ); ///< process stuffs on changing state
virtual void OnNetInput( struct SGameMessage* msg ); ///< process user response about server inputs...
// animation method
virtual void Default( bool force = false ); ///< set default animation
virtual void Walk( bool loop = false ); ///< set walk animation
virtual void Run( bool autorun = false, int aniType = ANI_RUN ); ///< set run animation
virtual void SetPlayRate( float playRate ) { m_fPlayRate = playRate; } ///< set play rate of animation
// complex motion method
virtual bool MotionCancel(); ///< cancel current motion
// contents method
virtual bool IsUseSkill_complete() { return m_bIsUseSkill_complete; } ///< was action which use skills completed?
virtual void SetViewVectorStateIdle( const K3DVector& position ); ///< set rotation of pet
virtual void SetMaster( AR_HANDLE handle, SGameAvatarEx* master ); ///< set master handle and avatar
virtual AR_HANDLE GetMaster() { return m_hMasterHandle; } ///< get master handle
virtual void RefreshTextureGroup( vec_cobset* pCobSet );
virtual AR_UNIT GetSize();
protected:
// internal method
virtual const char* getClassName() { return "SGamePet"; } ///< for type identification
void SetWalkPlayRateBy( float speed ); ///< set play rate of walking animation by speed
void SetRunPlayRateBy( float speed ); ///< set play rate of running animation by speed
// sonador 1.8.13 아바타 IDLE 모션 동작 구현
void _processIdle(); ///< process idle motion
void _resetIdleTime() { m_dwIdleTime = m_dwTime; } ///< reset idle timer
// member variables
class SGameAvatarEx* m_pMasterPlayer; ///< master player
AR_HANDLE m_hMasterHandle; ///< master player's handle
bool m_bIsUseSkill_complete; ///< which skill was completed
float m_fRdbScale; ///< scale factor
float m_fWalkSpeed; ///< walking speed
float m_fPlayRate; ///< playing rate of animation
float m_fStandardWalkPlayRate; ///< standard playing rate of animation on walking
float m_fStandardRunPlayRate; ///< standard playing rate of animation on running
DWORD m_dwIdleTime; ///< idle timer
AR_UNIT m_fObjSize;
};