您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Difficulty函数代码示例

51自学网 2021-06-01 20:27:47
  C++
这篇教程C++ Difficulty函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中Difficulty函数的典型用法代码示例。如果您正苦于以下问题:C++ Difficulty函数的具体用法?C++ Difficulty怎么用?C++ Difficulty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了Difficulty函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CreatureAI

ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature),    me(pCreature),    IsFleeing(false),    m_bCombatMovement(true),    m_uiEvadeCheckCooldown(2500){    m_heroicMode = me->GetMap()->IsHeroic();    m_difficulty = Difficulty(me->GetMap()->GetSpawnMode());}
开发者ID:AwkwardDev,项目名称:StrawberryCore,代码行数:9,


示例2: CreatureAI

ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature),    me(pCreature),    IsFleeing(false),    _evadeCheckCooldown(2500),    _isCombatMovementAllowed(true){    _isHeroic = me->GetMap()->IsHeroic();    _difficulty = Difficulty(me->GetMap()->GetSpawnMode());}
开发者ID:Akenyshka,项目名称:MythCore,代码行数:9,


示例3: SetDifficulties

void DifficultyDisplay::SetDifficulties( const Song* pSong, StepsType curType ){	for( int diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff )	{		if( pSong->HasStepsTypeAndDifficulty( curType, Difficulty(diff) ) )			m_difficulty[diff].Command( ICONONCOMMAND );		else			m_difficulty[diff].Command( ICONOFFCOMMAND );	}}
开发者ID:Fighter19,项目名称:PSPMania,代码行数:10,


示例4: HandleInstanceUnbindSelfCommand

    static bool HandleInstanceUnbindSelfCommand(ChatHandler* handler, char const* args)    {        if (!*args)            return false;        Player* player = handler->GetSession()->GetPlayer();        char* pMap = strtok((char*)args, " ");        char* pDiff = strtok(NULL, " ");        int8 diff = -1;        if (pDiff)            diff = atoi(pDiff);        uint16 counter = 0;        uint16 MapId = 0;        if (strcmp(pMap, "all"))        {            MapId = uint16(atoi(pMap));            if (!MapId)                return false;        }        for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)        {            Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));            for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)            {                InstanceSave *save = itr->second.save;                if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))                {                    std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));                    handler->PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());                    player->UnbindInstance(itr, Difficulty(i));                    counter++;                }                else                    ++itr;            }        }        handler->PSendSysMessage("instances unbound: %d", counter);        return true;    }
开发者ID:redlaine,项目名称:TrinityCore,代码行数:42,


示例5: CheckAchievementCriteriaMeet

 bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* source, Unit const* target = NULL, uint32 miscvalue1 = 0) {     switch(criteria_id)     {         case 12564:  // Criteria for achievement 4402: More Dots! (10 player) 5min kill             if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL && (uiOnyxiaKillTimer > 0))                 return true;             return false;         case 12565:  // Criteria for achievement 4403: Many Whelps! Handle It! (10 player) Hatch 50 eggs in 10s             if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL && (bAchievManyWhelpsHandleIt))                 return true;             return false;         case 12566:  // Criteria for achievement 4404: She Deep Breaths More (10 player) Everybody evade Deep Breath             if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL && (bAchievSheDeepBreathMore))                 return true;             return false;         case 12567:  // Criteria for achievement 4405: More Dots! (25 player) 5min kill             if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_25MAN_NORMAL && (uiOnyxiaKillTimer > 0))                 return true;             return false;         case 12568:  // Criteria for achievement 4406: Many Whelps! Handle It! (25 player) Hatch 50 eggs in 10s             if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_25MAN_NORMAL && (bAchievManyWhelpsHandleIt))                 return true;             return false;         case 12569:  // Criteria for achievement 4407: She Deep Breaths More (25 player) Everybody evade Deep Breath             if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_25MAN_NORMAL && (bAchievSheDeepBreathMore))                 return true;             return false;     }     return false; }
开发者ID:Asandru,项目名称:Script-Land,代码行数:31,


示例6: HandleInstanceListBindsCommand

    static bool HandleInstanceListBindsCommand(ChatHandler* handler, char const* /*args*/)    {        Player* player = handler->getSelectedPlayer();        if (!player)            player = handler->GetSession()->GetPlayer();        uint32 counter = 0;        for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)        {            Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));            for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)            {                InstanceSave* save = itr->second.save;                std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));                handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no",  save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());                counter++;            }        }        handler->PSendSysMessage("player binds: %d", counter);        counter = 0;        if (Group* group = player->GetGroup())        {            for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)            {                Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i));                for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)                {                    InstanceSave* save = itr->second.save;                    std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));                    handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no",  save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());                    counter++;                }            }        }        handler->PSendSysMessage("group binds: %d", counter);        return true;    }
开发者ID:AtVirus,项目名称:SkyFireEMU,代码行数:39,


示例7: GetDownscaledMapDifficultyData

MapDifficultyEntry const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty){    DifficultyEntry const* diffEntry = sDifficultyStore.LookupEntry(difficulty);    if (!diffEntry)        return GetDefaultMapDifficulty(mapId, &difficulty);    uint32 tmpDiff = difficulty;    MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));    while (!mapDiff)    {        tmpDiff = diffEntry->FallbackDifficultyID;        diffEntry = sDifficultyStore.LookupEntry(tmpDiff);        if (!diffEntry)            return GetDefaultMapDifficulty(mapId, &difficulty);        // pull new data        mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal    }    difficulty = Difficulty(tmpDiff);    return mapDiff;}
开发者ID:gearsofdeath,项目名称:DeathCore_6.x-1,代码行数:22,


示例8: ObjectGuid

bool Group::LoadGroupFromDB(Field* fields){    //                                          0         1              2           3           4              5      6      7      8      9      10     11     12     13         14          15              16          17    // result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty, leaderGuid, groupId FROM groups");    m_Id = fields[17].GetUInt32();    m_leaderGuid = ObjectGuid(HIGHGUID_PLAYER, fields[16].GetUInt32());    // group leader not exist    if (!sObjectMgr.GetPlayerNameByGUID(m_leaderGuid, m_leaderName))        return false;    m_groupType  = GroupType(fields[13].GetUInt8());    if (m_groupType & GROUPTYPE_RAID)        _initRaidSubGroupsCounter();    uint32 diff = fields[14].GetUInt8();    if (diff >= MAX_DUNGEON_DIFFICULTY)        diff = DUNGEON_DIFFICULTY_NORMAL;    m_dungeonDifficulty = Difficulty(diff);    uint32 r_diff = fields[15].GetUInt8();    if (r_diff >= MAX_RAID_DIFFICULTY)        r_diff = RAID_DIFFICULTY_10MAN_NORMAL;    m_raidDifficulty = Difficulty(r_diff);    m_mainTankGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32());    m_mainAssistantGuid = ObjectGuid(HIGHGUID_PLAYER, fields[1].GetUInt32());    m_lootMethod = LootMethod(fields[2].GetUInt8());    m_masterLooterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[3].GetUInt32());    m_lootThreshold = ItemQualities(fields[4].GetUInt16());    for (int i = 0; i < TARGET_ICON_COUNT; ++i)        m_targetIcons[i] = ObjectGuid(fields[5 + i].GetUInt64());    m_currentLooterGuid = m_masterLooterGuid;    return true;}
开发者ID:HerrTrigger,项目名称:mangos-wotlk,代码行数:39,


示例9: CheckAchievementCriteriaMeet

 bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target = NULL*/, uint32 /*miscvalue1 = 0*/) {     switch (criteria_id)     {         case 7600:  // Criteria for achievement 2176: And They Would All Go Down Together 15sec of each other 10-man             if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL && (maxHorsemenDiedTime - minHorsemenDiedTime) < 15)                 return true;             return false;         case 7601:  // Criteria for achievement 2177: And They Would All Go Down Together 15sec of each other 25-man             if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_25MAN_NORMAL && (maxHorsemenDiedTime - minHorsemenDiedTime) < 15)                 return true;             return false;         // Difficulty checks are done on DB.         // Criteria for achievement 2186: The Immortal (25-man)         case 13233: // The Four Horsemen         case 13234: // Maexxna         case 13235: // Thaddius         case 13236: // Loatheb         case 7616:  // Kel'Thuzad         // Criteria for achievement 2187: The Undying (10-man)         case 13237: // The Four Horsemen         case 13238: // Maexxna         case 13239: // Loatheb         case 13240: // Thaddius         case 7617:  // Kel'Thuzad             if (AreAllEncoutersDone() && !playerDied)                 return true;             return false;         // Criteria for achievement 2178: Shocking! (10-man)         case 7604:         // Criteria for achievement 2179: Shocking! (25-man)         case 7605:             if (!PolaritySwitch)                 return true;             return false;     }     return false; }
开发者ID:lijinglue,项目名称:TrinityCore,代码行数:38,


示例10: GetDownscaledMapDifficultyData

MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty){    uint32 tmpDiff = difficulty;    MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));    if (!mapDiff)    {        if (tmpDiff > RAID_DIFFICULTY_25MAN_NORMAL) // heroic, downscale to normal            tmpDiff -= 2;        else            tmpDiff -= 1;   // any non-normal mode for raids like tbc (only one mode)        // pull new data        mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal        if (!mapDiff)        {            tmpDiff -= 1;            mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // 10 normal        }    }    difficulty = Difficulty(tmpDiff);    return mapDiff;}
开发者ID:lasyan3,项目名称:TrinityCore,代码行数:23,


示例11: OnUse

	bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& scTargets)	{						if (pPlayer->HasItemCount(pItem->GetEntry(), 1))			pPlayer->DestroyItemCount(pItem->GetEntry(), 1, true);			for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)			{				Player::BoundInstancesMap &binds = pPlayer->GetBoundInstances(Difficulty(i));				for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)				{					InstanceSave* save = itr->second.save;					if (itr->first != pPlayer->GetMapId())					{						pPlayer->UnbindInstance(itr, Difficulty(i));					}					else						++itr;				}			}			pPlayer->Say("
C++ Dim函数代码示例
C++ DifferentialChecksum函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。