本文整理汇总了C++中GetLevel函数的典型用法代码示例。如果您正苦于以下问题:C++ GetLevel函数的具体用法?C++ GetLevel怎么用?C++ GetLevel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetLevel函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: switch
int CItemEnhancement::GetDamageAdj (const DamageDesc &Damage) const
// GetDamageAdj
//
// Returns the damage adjustment confered by this mod
{
switch (GetType())
{
case etResist:
return Level2DamageAdj(GetLevel(), IsDisadvantage());
case etResistEnergy:
return (Damage.IsEnergyDamage() ? Level2DamageAdj(GetLevel(), IsDisadvantage()) : 100);
case etResistMatter:
return (Damage.IsMatterDamage() ? Level2DamageAdj(GetLevel(), IsDisadvantage()) : 100);
case etResistByLevel:
{
if (Damage.GetDamageType() == GetDamageType()
|| Damage.GetDamageType() == GetDamageType() + 1)
return Level2DamageAdj(GetLevel(), IsDisadvantage());
else
return 100;
}
case etResistByDamage:
return (Damage.GetDamageType() == GetDamageType() ? Level2DamageAdj(GetLevel(), IsDisadvantage()) : 100);
case etResistByDamage2:
{
if (Damage.GetDamageType() == GetDamageType())
// 0 = 100 100
// 1 = 90 111
// 2 = 80 125
// 3 = 70 143
return Level2DamageAdj(GetLevel(), IsDisadvantage());
else if (Damage.GetDamageType() == GetDamageType() + 2)
// 0 = 100 100
// 1 = 95 105
// 2 = 90 112
// 3 = 85 121
return 100 + ((Level2DamageAdj(GetLevel(), IsDisadvantage()) - 100) / 2);
else
return 100;
}
default:
return 100;
}
}
开发者ID:Sdw195,项目名称:Transcendence,代码行数:52,代码来源:CItemEnhancement.cpp
示例2: GetLevel
int GetLevel(int v, const ClusterStructure& clusterStructure, std::vector<int>& levels) {
if (levels[v] != -1)
return levels[v];
auto vCluster = clusterStructure.GetVertexInfos()[v].clusterIndex;
auto pivotVertex = clusterStructure.GetClusterInfos()[vCluster].cycleStates.front();
int level = 0;
if (v == pivotVertex)
level = 0;
else
level = GetLevel(clusterStructure.GetSingleLetterGraph()[v], clusterStructure, levels) + 1;
levels[v] = level;
return level;
}
开发者ID:birneAgeev,项目名称:AutomataSynchronizationChecker,代码行数:15,代码来源:ClusterGraph.cpp
示例3: GetLevel
int32 Client::GetACMit() {
int mitigation = 0;
if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) {
mitigation = (GetSkill(SkillDefense))/4 + (itembonuses.AC+1);
mitigation -= 4;
}
else {
mitigation = (GetSkill(SkillDefense))/3 + ((itembonuses.AC*4)/3);
if(m_pp.class_ == MONK)
mitigation += GetLevel() * 13/10; //the 13/10 might be wrong, but it is close...
}
return(mitigation*1000/847);
}
开发者ID:jcon321,项目名称:Server,代码行数:15,代码来源:client_mods.cpp
示例4: File
void Game::SaveMap(string PathToMap)
{
ofstream File(PathToMap + "Enemies.txt");
File.clear();
for(auto itr = Enemies.begin(); itr != Enemies.end(); ++itr)
{
File << itr->ID << " " << itr->GetAttack() << " " << itr->GetDefense()
<< " " << itr->GetHealth() << " " << itr->GetLevel() << " "
<< RemoveSpaces(itr->GetName()) << " " << itr->GetWealth() << " " << itr->GetX() << " "
<< itr->GetY() << " " << itr->MapTextureFileName << " " << itr->Combat << endl;
}
File.close();
File.open(PathToMap + "RandomEncounters.txt");
File.clear();
for(auto itr = RandomEncounters.begin(); itr != RandomEncounters.end(); ++itr)
{
File << itr->ID << " " << itr->GetAttack() << " " << itr->GetDefense()
<< " " << itr->GetHealth() << " " << itr->GetLevel() << " "
<< RemoveSpaces(itr->GetName()) << " " << itr->GetWealth() << " " << itr->Combat << endl;
}
File.close();
File.open(PathToMap + "QuestGivers.txt");
File.clear();
for(auto itr = QuestGivers.begin(); itr != QuestGivers.end(); ++itr)
{
File << itr->ID << " " << itr->x << " " << itr->y << " " << itr->TextureFileName << " " << itr->Quests.size();
for(auto iitr = itr->Quests.begin(); iitr != itr->Quests.end(); ++iitr)
{
File << " " << iitr->ID;
}
File << endl;
}
File.close();
}
开发者ID:ne555,项目名称:Dreaming-Warrior,代码行数:36,代码来源:SaveLoadGame.cpp
示例5: Parse
void qCtx::Parse(qStr *in, qStr *out)
{
if (GetLevel() > myEnv->GetMaxLevels()) {
CStr s;
while (!(s = in->GetS()).IsEmpty()) {
out->PutS(s);
}
Throw(out, 99, "Maximum nesting level reached.");
} else {
char c;
while ( (c = in->GetC()) != EOF ) {
ParseC(in, out, c);
}
}
}
开发者ID:earonesty,项目名称:smx,代码行数:15,代码来源:qctx.cpp
示例6: switch
int StoneMine::GameMsg(int msg, int par1, void * par2, uint npar2)
{
#ifndef BECHER_EDITOR
switch (msg)
{
case BMSG_Select:
GetLevel()->GetPanel()->SetObjectHud("scripts/mine.menu",this);
GetLua()->func("s_stonemine");
break;
case BMSG_GetSur:
return -1;
}
#endif
return SourceBuilding::GameMsg(msg, par1, par2, npar2);
}
开发者ID:HeimdallTeam,项目名称:Alcominance,代码行数:15,代码来源:obj_stonemine.cpp
示例7: GetLevel
bool Conditional::Elif(bool b)
{
Level *l = GetLevel();
if (!l->fElseAllowed) return false;
if (l->fState == Level::kPending)
{
l->fState = (b ? Level::kActive : Level::kPending);
}
else
l->fState = Level::kInactive;
return true;
}
开发者ID:jverne,项目名称:nqc,代码行数:15,代码来源:Conditional.cpp
示例8: CanDisban
//! 判断当前能否解散
eFactionOptErrInfo GameFaction::CanDisban(void)
{
LONG lNeedLevel = COrganizingParam::getInstance().GetFacPurviewNeedLevel(eFPI_Disband);
if (lNeedLevel > GetLevel(eUT_FactionLevel))
{
return eFOEI_Err_Level_Noenough;
}
if(NULL_GUID != m_FacBaseData.SuperiorGuid)
{
return eFOEI_Err_HadUnion;
}
return eFOEI_NotErr;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:17,代码来源:GameFaction.cpp
示例9: GetLevel
int32 Client::CalcBaseManaRegen()
{
uint8 clevel = GetLevel();
int32 regen = 0;
if (IsSitting() || (GetHorseId() != 0))
{
if(HasSkill(SkillMeditate))
regen = (((GetSkill(SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
else
regen = 2;
}
else {
regen = 2;
}
return regen;
}
开发者ID:surlyone,项目名称:Server,代码行数:16,代码来源:client_mods.cpp
示例10: ASSERT
int CGridTreeCellBase::GetTreeIndent()
// returns: device units to indent within a cell for a tree at this level
{
ASSERT( m_pTreeColumn != NULL);
CGridCtrl* pGridCtrl = GetGrid();
ASSERT( pGridCtrl != NULL);
unsigned char ucLevel = GetLevel();
if( ucLevel == 0)
return 0;
if( !m_pTreeColumn->GetTreeLines() )
ucLevel--;
return (m_pTreeColumn->GetDefTreeIndent() * ucLevel) + (pGridCtrl->GetDefCellMargin() * 2);
}
开发者ID:ClowReed32,项目名称:Cthugha-Engine-Demos,代码行数:16,代码来源:GridTreeCellBase.cpp
示例11: return
bool Client::UseDiscipline(uint8 disc_id)
{
// Dont let client waste a reuse timer if they can't use the disc
if (IsStunned() || IsFeared() || IsMezzed() || IsAmnesiad() || IsPet())
{
return(false);
}
//Check the disc timer
uint32 remain = p_timers.GetRemainingTime(pTimerDisciplineReuseStart);
if(remain > 0 && !GetGM())
{
char val1[20]= {0};
char val2[20]= {0};
Message_StringID(CC_User_Disciplines, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2));
return(false);
}
bool active = disc_ability_timer.Enabled();
if(active)
{
Message(CC_User_Disciplines, "You must wait before using this discipline."); //find correct message
return(false);
}
//can we use the disc? the client checks this for us, but we should also confirm server side.
uint8 level_to_use = DisciplineUseLevel(disc_id);
if(level_to_use > GetLevel() || level_to_use == 0) {
Message_StringID(CC_User_Disciplines, DISC_LEVEL_USE_ERROR);
return(false);
}
// Disciplines with no ability timer (ashenhand, silentfist, thunderkick, and unholyaura) will remain on the player until they either
// use the skill the disc affects successfully, camp/zone, or attempt to use another disc. If we're here, clear that disc so they can
// cast a new one.
if(GetActiveDisc() != 0)
{
Log.Out(Logs::General, Logs::Discs, "Clearing disc %d so that disc %d can be cast.", GetActiveDisc(), disc_id);
FadeDisc();
}
//cast the disc
if(CastDiscipline(disc_id, level_to_use))
return(true);
else
return(false);
}
开发者ID:jcon321,项目名称:Server,代码行数:47,代码来源:effects.cpp
示例12: switch
RealFde CFormulaNode::getAscent( const SizeFde &sz )
{
RealFde vc = sz.height() / 2.0;
switch( getAlignmentType() )
{
case FBtnChildPos::TableCenter2Baseline:
if( (getAlignmentValue() - 1) >= 0 && (getAlignmentValue() - 1) < GetChildCount() )
{
CNode *pNode = GetChild( getAlignmentValue() - 1 );
if( pNode != NULL )
vc = pNode->GetPosition().y() + pNode->GetSize().height() / 2.0;
}
break;
case FBtnChildPos::TableTop2Baseline:
if( (getAlignmentValue() - 1) >= 0 && (getAlignmentValue() - 1) < GetChildCount() )
{
CNode *pNode = GetChild( getAlignmentValue() - 1 );
if( pNode != NULL )
vc = pNode->GetPosition().y();
else
vc = 0.0;
}
else
vc = 0.0;
break;
case FBtnChildPos::TableBottom2Baseline:
if( (getAlignmentValue() - 1) >= 0 && (getAlignmentValue() - 1) < GetChildCount() )
{
CNode *pNode = GetChild( getAlignmentValue() - 1 );
if( pNode != NULL )
vc = pNode->GetPosition().y() + pNode->GetSize().height();
else
vc = sz.height();
}
else
vc = sz.height();
break;
default:
vc = sz.height() - ::calculateCurrentTextDescent( GetLevel() );
break;
}
return vc;
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:47,代码来源:ni_formula.cpp
示例13: CanUse
bool IRCCmd::CanUse(std::string USER, int nLevel)
{
if(IsLoggedIn(USER))
{
if(GetLevel(USER) >= nLevel)
return true;
else
return false;
}
else if(nLevel == 0)
{
return true;
}
else
sIRC.Send_IRC_Channel(USER, "\0034[ERROR] : You Are Not Logged In!", true, "ERROR");
return false;
}
开发者ID:conan513,项目名称:Infinity_MaNGOS-1,代码行数:17,代码来源:IRCCmd.cpp
示例14: ValidName
TError TContainerHolder::Create(TScopedLock &holder_lock, const std::string &name, const TCred &cred, std::shared_ptr<TContainer> &container) {
TError error;
error = ValidName(name);
if (error)
return error;
if (Containers.find(name) != Containers.end())
return TError(EError::ContainerAlreadyExists, "container " + name + " already exists");
if (Containers.size() + 1 > config().container().max_total())
return TError(EError::ResourceNotAvailable, "number of created containers exceeds limit");
auto parent = GetParent(name);
if (!parent && name != ROOT_CONTAINER)
return TError(EError::InvalidValue, "invalid parent container");
if (parent && parent->GetLevel() == CONTAINER_LEVEL_MAX)
return TError(EError::InvalidValue, "You shall not go deeper!");
if (parent && !parent->IsRoot() && !parent->IsPortoRoot()) {
error = parent->CheckPermission(cred);
if (error)
return error;
}
int id;
error = IdMap.Get(id);
if (error)
return error;
auto c = std::make_shared<TContainer>(shared_from_this(), Storage, name, parent, id);
error = c->Create(cred);
if (error)
return error;
Containers[name] = c;
Statistics->Created++;
if (parent)
parent->AddChild(c);
container = c;
return TError::Success();
}
开发者ID:darkk,项目名称:porto,代码行数:46,代码来源:holder.cpp
示例15: ShowClassMenu
void CRPGPlayer::ShowSkillMenu()
{
if (GetCurrentClass() == RPG_CLASS_NONE )
{
ShowClassMenu( GetPlayerInfo()->GetTeamIndex());
return;
}
if (GetFreeSkills() < 0)
{
ResetAccount();
gamehelpers->TextMsg(GetIndex(), HUD_PRINTTALK, "[ZPS-RPG] Your skills have been reset because of an error.\n");
}
IMenuStyle *style = menus->GetDefaultStyle();
IBaseMenu *menu = style->CreateMenu(&g_RPGPlugin, myself->GetIdentity());
menu->SetDefaultTitle(MENU_SKILL_TITLE);
char skillname[64];
unsigned int menustyle = ITEMDRAW_DEFAULT;
for (int i = 0; i < MAX_SKILLS; i++)
{
sprintf(skillname, "%s (Level %d)", SkillNames[skills[i].iIndex], skills[i].iLevel);
menustyle = ITEMDRAW_DEFAULT;
if ((skills[i].iLevel >= 3) || (GetFreeSkills() == 0))
menustyle = ITEMDRAW_DISABLED;
if( i == 3 ) // ULTIMATE
{
if ((skills[i].iLevel >= 1) || (GetLevel() < 6) || (GetFreeSkills() == 0))
{
menustyle = ITEMDRAW_DISABLED;
}
}
menu->AppendItem(SkillNames[skills[i].iIndex], ItemDrawInfo(skillname, menustyle));
}
menu->AppendItem(MENU_ITEM_RESET, ItemDrawInfo("Reset Skills"));
menu->InsertItem(6, MENU_ITEM_RETURN, ItemDrawInfo(MENU_ITEM_RETURN));
menu->SetMenuOptionFlags( menu->GetMenuOptionFlags() | MENUFLAG_BUTTON_EXIT );
menu->Display(this->GetIndex(), MENU_TIME_FOREVER);
}
开发者ID:blaisebaileyfinnegan,项目名称:ZPS-RPG,代码行数:45,代码来源:rpgplayer.cpp
示例16: LOG_D
void Level1::Update()
{
LOG_D("[Level1] Updating");
auto cells = Engine::GetInstance().GetAllEntitiesWithComponentOfClass("GrowthComponent");
for (int i = cells.size(); i < CFG_GETI("LEVEL_1_INITIAL_NUM_CELLS"); ++i)
{
Random r;
float x = r.GenerateFloat(CFG_GETF("LEVEL_1_MIN_X"), CFG_GETF("LEVEL_1_MAX_X"));
float y = r.GenerateFloat(CFG_GETF("LEVEL_1_MIN_Y"), CFG_GETF("LEVEL_1_MAX_Y"));
auto cell = EntityFactory::CreateCell(Vector(x, y));
auto growthComponent = std::static_pointer_cast<GrowthComponent>(Engine::GetInstance().GetEntityManager()->GetSingleComponentOfClass(cell, "GrowthComponent"));
if (r.GenerateFloat() < 0.1)
growthComponent->SetLevel(2);
Engine::GetInstance().AddComponent(
std::make_shared<AIComponent>("EatableComponent"), cell);
}
if (finished)
{
ZoomOutEffect();
}
else
{
if (!Engine::GetInstance().HasEntityWithComponentOfClass("PlayerComponent"))
{
Engine::GetInstance().SetNextLevel(std::make_shared<LoseLevel>());
SetFinished();
}
else
{
auto playerEntity = Engine::GetInstance().GetEntityWithComponentOfClass("PlayerComponent");
auto growthComponent = std::static_pointer_cast<GrowthComponent>(Engine::GetInstance().GetEntityManager()->GetSingleComponentOfClass(playerEntity, "GrowthComponent"));
if (growthComponent->GetLevel() == CFG_GETI("LEVEL_1_GOAL_SIZE"))
{
finished = true;
Engine::GetInstance().DeleteSystem("GrowthSystem");
}
}
}
}
开发者ID:matheusportela,项目名称:Poiesis,代码行数:45,代码来源:Level1.cpp
示例17: CalcAlcoholPhysicalEffect
int16 Client::CalcSTR() {
int16 val = m_pp.STR + itembonuses.STR + spellbonuses.STR + CalcAlcoholPhysicalEffect();
int16 mod = aabonuses.STR;
if(val>255 && GetLevel() <= 60)
val = 255;
STR = val + mod;
if(STR < 1)
STR = 1;
int m = GetMaxSTR();
if(STR > m)
STR = m;
return(STR);
}
开发者ID:Zamthos,项目名称:Server,代码行数:18,代码来源:client_mods.cpp
示例18: GetProtoID
/**
* @brief Gets NPC information for use in various NPC packets.
*
* @param pkt The packet the information will be stored in.
*/
void CNpc::GetNpcInfo(Packet & pkt)
{
pkt << GetProtoID()
<< uint8(isMonster() ? 1 : 2) // Monster = 1, NPC = 2 (need to use a better flag)
<< m_sPid
<< GetType()
<< m_iSellingGroup
<< m_sSize
<< m_iWeapon_1 << m_iWeapon_2
// Monsters require 0 regardless, otherwise they'll act as NPCs.
<< uint8(isMonster() ? 0 : GetNation())
<< GetLevel()
<< GetSPosX() << GetSPosZ() << GetSPosY()
<< uint32(isGateOpen())
<< m_byObjectType
<< uint16(0) << uint16(0) // unknown
<< int16(m_byDirection);
}
开发者ID:ZeusAFK,项目名称:KODarknessProject,代码行数:23,代码来源:Npc.cpp
示例19: CalcCHA
int16 Client::CalcCHA() {
int16 val = m_pp.CHA + itembonuses.CHA + spellbonuses.CHA;
int16 mod = aabonuses.CHA;
if(val>255 && GetLevel() <= 60)
val = 255;
CHA = val + mod;
if(CHA < 1)
CHA = 1;
int m = GetMaxCHA();
if(CHA > m)
CHA = m;
return(CHA);
}
开发者ID:Zamthos,项目名称:Server,代码行数:18,代码来源:client_mods.cpp
示例20: sizeof
void cPlayer::Send_PlayerInfo()
{
MyPlayerInfoAq* pInfo = (MyPlayerInfoAq*)PrepareSendPacket( sizeof( MyPlayerInfoAq ) );
if( NULL == pInfo )
return;
pInfo->s_sType = MyPlayerInfo_Aq;
pInfo->s_byDur = GetDur();
pInfo->s_byLevel = GetLevel();
pInfo->s_byStr = GetStr();
pInfo->s_dwExp = GetExp();
pInfo->s_dwHp = GetHp();
pInfo->s_dwPKey = GetPKey();
pInfo->s_dwPos = GetPos();
strncpy( pInfo->s_szId , GetId() , MAX_ID_LENGTH );
strncpy( pInfo->s_szName , GetName() , MAX_NAME_LENGTH );
strncpy( pInfo->s_szNickName , GetNickName() , MAX_NICKNAME_LENGTH );
SendPost( sizeof( MyPlayerInfoAq ) );
}
开发者ID:jangchan,项目名称:TR2,代码行数:18,代码来源:cPlayer.cpp
注:本文中的GetLevel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论