Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
#include "stdafx.h"
|
||||
#include "CastleBlessMgr.h"
|
||||
|
||||
#include <Castle/CastleConstants.h>
|
||||
#include "GMMemory.h"
|
||||
|
||||
using namespace Castle;
|
||||
|
||||
CCastleBlessMgr::sCastleBlessInfo CCastleBlessMgr::m_CastleBlessInfo[ MAX_BLESS_INFO_NUM ] =
|
||||
{
|
||||
sCastleBlessInfo(0, 0, 5, 320.0f, Castle::TITLE_NEW),
|
||||
sCastleBlessInfo(1, 1, 10, 320.0f, Castle::TITLE_NEW),
|
||||
sCastleBlessInfo(2, 1, 20, 400.0f, Castle::TITLE_SETTLED),
|
||||
sCastleBlessInfo(3, 2, 30, 480.0f, Castle::TITLE_FLOURISHED),
|
||||
sCastleBlessInfo(4, 2, 40, 560.0f, Castle::TITLE_HONORABLE),
|
||||
sCastleBlessInfo(5, 3, 50, 640.0f, Castle::TITLE_GLORIOUS)
|
||||
};
|
||||
|
||||
CCastleBlessMgr::CCastleBlessMgr()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
CCastleBlessMgr::~CCastleBlessMgr()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
CCastleBlessMgr& CCastleBlessMgr::GetInstance()
|
||||
{
|
||||
static CCastleBlessMgr ms_this;
|
||||
return ms_this;
|
||||
}
|
||||
|
||||
bool CCastleBlessMgr::Initialize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CCastleBlessMgr::Destroy()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned char CCastleBlessMgr::GetTitle(unsigned short wGainTaxCount, unsigned char cUpgradeStep) const
|
||||
{
|
||||
int iIndex = FindProperIndex(wGainTaxCount, cUpgradeStep);
|
||||
return m_CastleBlessInfo[ iIndex ].m_cTitle;
|
||||
}
|
||||
|
||||
unsigned char CCastleBlessMgr::GetBonusPercent(unsigned short wGainTaxCount, unsigned char cUpgradeStep) const
|
||||
{
|
||||
int iIndex = FindProperIndex(wGainTaxCount, cUpgradeStep);
|
||||
return m_CastleBlessInfo[ iIndex ].m_cBonusPercent;
|
||||
}
|
||||
|
||||
float CCastleBlessMgr::GetBlessArea(unsigned short wGainTaxCount, unsigned char cUpgradeStep) const
|
||||
{
|
||||
int iIndex = FindProperIndex(wGainTaxCount, cUpgradeStep);
|
||||
return m_CastleBlessInfo[ iIndex ].m_fArea;
|
||||
}
|
||||
|
||||
int CCastleBlessMgr::FindProperIndex(unsigned short wGainTaxCount, unsigned char cUpgradeStep) const
|
||||
{
|
||||
int iIndex = 0;
|
||||
for (; iIndex<MAX_BLESS_INFO_NUM; ++iIndex)
|
||||
{
|
||||
if (m_CastleBlessInfo[ iIndex ].m_wGainTaxCount > wGainTaxCount ||
|
||||
m_CastleBlessInfo[ iIndex ].m_cUpgradeStep > cUpgradeStep)
|
||||
{
|
||||
return (iIndex - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return (iIndex - 1);
|
||||
}
|
||||
Reference in New Issue
Block a user