CSCommon: MMatchFormula.h 소스 파일

MAIET

MMatchFormula.h

00001 #ifndef _MMATCHFORMULA_H
00002 #define _MMATCHFORMULA_H
00003 
00004 #include "winsock2.h"
00005 #include "MXml.h"
00006 #include <vector>
00007 using namespace std;
00008 
00009 #define FILENAME_MATCH_FORMULA      "formula.xml"
00010 
00011 #define MAX_LEVEL                   99      
00012 
00013 class MMatchFormula
00014 {
00015 private:
00016     static float                m_fNeedExpLMTable[MAX_LEVEL+1];
00017     static float                m_fGettingExpLMTable[MAX_LEVEL+1];
00018     static float                m_fGettingBountyLMTable[MAX_LEVEL+1];
00019 
00020     static unsigned long int    m_nNeedExp[MAX_LEVEL+1];
00021     static unsigned long int    m_nGettingExp[MAX_LEVEL+1];
00022     static unsigned long int    m_nGettingBounty[MAX_LEVEL+1];
00023 
00024     static bool ReadXml(const char* szXmlFileName);
00025     static void ParseNeedExpLM(MXmlElement& element);
00026     static void ParseGettingExpLM(MXmlElement& element);
00027     static void ParseGettingBountyLM(MXmlElement& element);
00028 
00029     static void PreCalcGettingBounty();
00030     static void PreCalcNeedExp();
00031     static void PreCalcGettingExp();
00032 public:
00033     static bool Create(void);
00034     static unsigned long int CalcPanaltyEXP(int nAttackerLevel, int nVictimLevel);
00035     static unsigned long int GetSuicidePanaltyEXP(int nLevel);
00036     static unsigned long int GetGettingExp(int nAttackerLevel, int nVictimLevel);
00037     static unsigned long int GetGettingBounty(int nAttackerLevel, int nVictimLevel);
00038     static unsigned long int GetNeedExp(int nLevel) { if (nLevel<0) nLevel=0; if (nLevel>MAX_LEVEL) nLevel=MAX_LEVEL; return m_nNeedExp[nLevel]; }
00039     static int GetLevelFromExp(unsigned long int nExp);
00040 
00041     // 경험치를 다음 레벨 습득까지의 퍼센트로 반환
00042     static int GetLevelPercent(unsigned long int nExp, int nNowLevel);
00043     static int GetClanBattlePoint(int nWinnerClanPoint, int nLoserClanPoint, int nOneTeamMemberCount);
00044 };
00045 
00046 
00047 #endif


MAIET entertainment