• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IsFlagPickedup函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SetFlagPicker

void BattlegroundEY::EventPlayerDroppedFlag(Player *Source)
{
    if (GetStatus() != STATUS_IN_PROGRESS)
    {
        // if not running, do not cast things at the dropper player, neither send unnecessary messages
        // just take off the aura
        if (IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
        {
            SetFlagPicker(0);
            Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
        }
        return;
    }

    if (!IsFlagPickedup())
        return;

    if (GetFlagPickerGUID() != Source->GetGUID())
        return;

    SetFlagPicker(0);
    Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
    m_FlagState = BG_EY_FLAG_STATE_ON_GROUND;
    m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
    Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
    Source->CastSpell(Source, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true);
    //this does not work correctly :((it should remove flag carrier name)
    UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
    UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN);

    if (Source->GetTeam() == ALLIANCE)
        SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL);
    else
        SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL);
}
开发者ID:Gamerzon94,项目名称:wowrean-emu,代码行数:35,代码来源:BattlegroundEY.cpp


示例2: EventPlayerClickedOnFlag

void BattlegroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
{
    if (GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10))
        return;

    if (Source->GetTeam() == ALLIANCE)
    {
        UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_ON_PLAYER);
        PlaySoundToAll(BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE);
    }
    else
    {
        UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_ON_PLAYER);
        PlaySoundToAll(BG_EY_SOUND_FLAG_PICKED_UP_HORDE);
    }

    if (m_FlagState == BG_EY_FLAG_STATE_ON_BASE)
        UpdateWorldState(NETHERSTORM_FLAG, 0);
    m_FlagState = BG_EY_FLAG_STATE_ON_PLAYER;

    SpawnBGObject(BG_EY_OBJECT_FLAG_NETHERSTORM, RESPAWN_ONE_DAY);
    SetFlagPicker(Source->GetGUID());
    //get flag aura on player
    Source->CastSpell(Source, BG_EY_NETHERSTORM_FLAG_SPELL, true);
    Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);

    if (Source->GetTeam() == ALLIANCE)
        PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, Source->GetName());
    else
        PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL, Source->GetName());
}
开发者ID:Gamerzon94,项目名称:wowrean-emu,代码行数:31,代码来源:BattlegroundEY.cpp


示例3: EventPlayerClickedOnFlag

void BattleGroundAC::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
{
    if (GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10))
        return;

    if (Source->GetTeam() == ALLIANCE)
    {
        UpdateWorldState(FLAG_1_FLAG_STATE_ALLIANCE, BG_AC_FLAG_STATE_ON_PLAYER);
        PlaySoundToAll(BG_AC_SOUND_FLAG_PICKED_UP_ALLIANCE);
    }
    else
    {
        UpdateWorldState(FLAG_1_FLAG_STATE_HORDE, BG_AC_FLAG_STATE_ON_PLAYER);
        PlaySoundToAll(BG_AC_SOUND_FLAG_PICKED_UP_HORDE);
    }

    if (m_FlagState == BG_AC_FLAG_STATE_ON_BASE)
        UpdateWorldState(FLAG_1_FLAG, 0);
    m_FlagState = BG_AC_FLAG_STATE_ON_PLAYER;

    // despawn center-flag
    SpawnEvent(BG_AC_EVENT_CAPTURE_FLAG, BG_AC_EVENT2_FLAG_CENTER, false);

    SetFlagPicker(Source->GetObjectGuid());
    //get flag aura on player
    Source->CastSpell(Source, BG_AC_FLAG_1_FLAG_SPELL, true);
    Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);

    if (Source->GetTeam() == ALLIANCE)
        PSendMessageToAll(LANG_BG_AC_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, Source->GetName());
    else
        PSendMessageToAll(LANG_BG_AC_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL, Source->GetName());
}
开发者ID:hodobaj,项目名称:DTD-Edition,代码行数:33,代码来源:BattleGroundAC.cpp


示例4: RemovePlayer

void BattlegroundEY::RemovePlayer(Player* plr, uint64 guid, uint32 /*team*/)
{
    // sometimes flag aura not removed :(
    for(int j = EY_POINTS_MAX; j >= 0; --j)
    {
        for(size_t i = 0; i < m_PlayersNearPoint[j].size(); ++i)
            if(m_PlayersNearPoint[j][i] == guid)
            {
                m_PlayersNearPoint[j].erase(m_PlayersNearPoint[j].begin() + i);
                break;
            }
    }
    if(IsFlagPickedup())
    {
        if(m_FlagKeeper == guid)
        {
            if(plr)
                EventPlayerDroppedFlag(plr);
            else
            {
                SetFlagPicker(0);
                RespawnFlag(true);
            }
        }
    }
}
开发者ID:Darkelmo,项目名称:MythCore,代码行数:26,代码来源:BattlegroundEY.cpp


示例5: SetFlagPicker

void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
{
    if(GetStatus() != STATUS_IN_PROGRESS)
    {
        // if not running, do not cast things at the dropper player, neither send unnecessary messages
        // just take off the aura
        if(IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
        {
            SetFlagPicker(0);
            Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
        }
        return;
    }

    if(!IsFlagPickedup())
        return;

    if(GetFlagPickerGUID() != Source->GetGUID())
        return;

    const char *message = "";
    uint8 type = 0;

    SetFlagPicker(0);
    Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
    m_FlagState = BG_EY_FLAG_STATE_ON_GROUND;
    m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
    Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
    Source->CastSpell(Source, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true);
    if(Source->GetTeam() == ALLIANCE)
    {
        message = GetMangosString(LANG_BG_EY_DROPPED_FLAG);
        type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
    }
    else
    {
        message = GetMangosString(LANG_BG_EY_DROPPED_FLAG);
        type = CHAT_MSG_BG_SYSTEM_HORDE;
    }
    //this does not work correctly :( (it should remove flag carrier name)
    UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
    UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN);

    WorldPacket data;
    ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
    SendPacketToAll(&data);
}
开发者ID:jendeanlone,项目名称:mangos,代码行数:47,代码来源:BattleGroundEY.cpp


示例6: while

void BattlegroundEY::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
{
    if (!player)
        return;

    for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
    {
        if (!m_PlayersNearPoint[i].empty())
        {
            uint8 j = 0;
            while (j < m_PlayersNearPoint[i].size())
            {
                Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[i][j]);
                if (!player)
                {
                    ++j;
                    continue;
                }

                if (player->GetGUID() == guid)
				{
                    m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
                    break;
				}
                else ++j;
            }
        }
    }

    if (IsFlagPickedup())
    {
        if (m_FlagKeeper == guid)
        {
            if (player)
                EventPlayerDroppedFlag(player);
            else
            {
                SetFlagPicker(0);
                RespawnFlag(true);
            }
        }
    }
}
开发者ID:Expery,项目名称:Core,代码行数:43,代码来源:BattlegroundEY.cpp


示例7: RemovePlayer

void BattleGroundAC::RemovePlayer(Player *plr, ObjectGuid guid)
{
    // sometimes flag aura not removed :(
    for (int j = BG_AC_NODES_MAX; j >= 0; --j)
    {
        for(size_t i = 0; i < m_PlayersNearPoint[j].size(); ++i)
            if (m_PlayersNearPoint[j][i] == guid)
                m_PlayersNearPoint[j].erase(m_PlayersNearPoint[j].begin() + i);
    }
    if (IsFlagPickedup())
    {
        if (m_FlagKeeper == guid)
        {
            if (plr)
                EventPlayerDroppedFlag(plr);
            else
            {
                ClearFlagPicker();
                RespawnFlag(true);
            }
        }
    }
}
开发者ID:hodobaj,项目名称:DTD-Edition,代码行数:23,代码来源:BattleGroundAC.cpp


示例8: EventPlayerClickedOnFlag

void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
{
    if(GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10))
        return;

    const char *message;
    uint8 type = 0;
    message = GetMangosString(LANG_BG_EY_HAS_TAKEN_FLAG);

    if(Source->GetTeam() == ALLIANCE)
    {
        UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_ON_PLAYER);
        type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
        PlaySoundToAll(BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE);
    }
    else
    {
        UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_ON_PLAYER);
        type = CHAT_MSG_BG_SYSTEM_HORDE;
        PlaySoundToAll(BG_EY_SOUND_FLAG_PICKED_UP_HORDE);
    }

    if (m_FlagState == BG_EY_FLAG_STATE_ON_BASE)
        UpdateWorldState(NETHERSTORM_FLAG, 0);
    m_FlagState = BG_EY_FLAG_STATE_ON_PLAYER;

    SpawnBGObject(BG_EY_OBJECT_FLAG_NETHERSTORM, RESPAWN_ONE_DAY);
    SetFlagPicker(Source->GetGUID());
    //get flag aura on player
    Source->CastSpell(Source, BG_EY_NETHERSTORM_FLAG_SPELL, true);
    Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);

    WorldPacket data;
    ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
    SendPacketToAll(&data);
}
开发者ID:jendeanlone,项目名称:mangos,代码行数:36,代码来源:BattleGroundEY.cpp



注:本文中的IsFlagPickedup函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IsFlagSet函数代码示例发布时间:2022-05-30
下一篇:
C++ IsFlagOn函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap