CSCommon: MMatchRuleBaseQuest.h 소스 파일

MAIET

MMatchRuleBaseQuest.h

00001 #ifndef _MMATCHRULE_BASEQUEST_H
00002 #define _MMATCHRULE_BASEQUEST_H
00003 
00004 #include "MMatchRule.h"
00005 #include "MMatchNPCObject.h"
00006 #include "MQuestPlayer.h"
00007 #include "MMatchQuestRound.h"
00008 
00009 #define MAX_SACRIFICE_SLOT_COUNT 2  // 희생 아이템을 올려놓을수 있는 슬롯의 최대 수.
00010 
00011 #define SLOT_ALREADY_USED   -1
00012 
00013 typedef pair< MUID, unsigned long int > SacrificeSlot;
00014 
00016 class MMatchRuleBaseQuest : public MMatchRule {
00017 protected:
00018     MMatchNPCManager            m_NPCManager;               
00019     MQuestPlayerManager         m_PlayerManager;            
00020     bool                        m_bQuestCompleted;          
00021 
00022     unsigned long int           m_nLastNPCSpawnTime;        // for test
00023     int                         m_nNPCSpawnCount;           
00024     unsigned long int           m_nSpawnTime;               
00025     int                         m_nFirstPlayerCount;        
00026 
00027     SacrificeSlot               m_SacrificeSlot[ MAX_SACRIFICE_SLOT_COUNT ];
00028 
00029 protected:
00030     virtual void OnBegin();                             
00031     virtual void OnEnd();                               
00032     virtual bool OnRun();                               
00033     virtual void OnRoundBegin();                        
00034     virtual void OnRoundEnd();                          
00035     virtual bool OnCheckRoundFinish();                  
00036     virtual void OnRoundTimeOut();                      
00037     virtual bool RoundCount();                          
00038     virtual bool OnCheckEnableBattleCondition();        
00039 
00040     virtual void OnCommand(MCommand* pCommand);         
00041 protected:
00046     void CheckRewards(MUID& uidPlayer, MQuestDropItem* pDropItem, MVector& pos);
00047     bool CheckPlayersAlive();                               
00048     virtual void ProcessNPCSpawn() = 0;                     
00049     virtual bool CheckNPCSpawnEnable() = 0;                 
00050     virtual void RouteGameInfo() = 0;                       
00051 
00055     MMatchNPCObject* SpawnNPC(MQUEST_NPC nNPC, int nPosIndex);
00056 
00057     virtual void OnCompleted();                 
00058     virtual void OnFailed();                    
00059     virtual void RouteCompleted() = 0;          
00060     virtual void RouteFailed() = 0;             
00061     virtual void DistributeReward() = 0;        
00062 public:
00063     // 커맨드 처리 관련 함수
00064 
00070     virtual void OnRequestNPCDead(MUID& uidSender, MUID& uidKiller, MUID& uidNPC, MVector& pos);
00071 
00074     virtual void OnRequestPlayerDead(const MUID& uidVictim);
00075     virtual void OnRequestTestNPCSpawn(int nNPCType, int nNPCCount);
00076     virtual void OnRequestTestClearNPC();
00077 
00079     void RefreshPlayerStatus();
00081     void ClearAllNPC();
00082     
00083 public:
00084     MMatchRuleBaseQuest(MMatchStage* pStage);           
00085     virtual ~MMatchRuleBaseQuest();                     
00086     virtual void OnEnterBattle(MUID& uidChar);          
00087     virtual void OnLeaveBattle(MUID& uidChar);          
00088 
00089 public :
00090     virtual void OnRequestDropSacrificeItemOnSlot( MCommand* pCmd );
00091     virtual void OnResponseDropSacrificeItemOnSlot( MCommand* pCmd );
00092     
00093 };
00094 
00095 
00096 
00097 
00098 
00099 
00100 #endif


MAIET entertainment