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

C++ GetRatingMod函数代码示例

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

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



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

示例1: GetRatingMod

void ArenaTeam::MemberLost(Player* player, uint32 ownMMRating, uint32 againstMatchmakerRating, int32 matchmakerRatingChange)
{
    // Called for each participant of a match after losing
    for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
    {
        if (itr->Guid == player->GetGUID())
        {
            // Update personal rating
            int32 mod = GetRatingMod(itr->PersonalRating, ownMMRating, againstMatchmakerRating, false);
            itr->ModifyPersonalRating(player, mod, GetType());

            // Update matchmaker rating
            itr->ModifyMatchmakerRating(matchmakerRatingChange, GetSlot());

            // Update personal played stats
            itr->WeekGames +=1;
            itr->SeasonGames +=1;

            // update the unit fields
            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_WEEK,  itr->WeekGames);
            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_SEASON,  itr->SeasonGames);
            return;
        }
    }
}
开发者ID:Faydz,项目名称:TrinityCore,代码行数:25,代码来源:ArenaTeam.cpp


示例2: GetRatingMod

void ArenaTeam::MemberWon(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
{
    // called for each participant after winning a match
    for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
    {
        if (itr->Guid == player->GetGUID())
        {
            // update personal rating
            int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, true);
            itr->ModifyPersonalRating(player, mod, GetType());

            // update matchmaker rating
            itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot());

            // update personal stats
            itr->WeekGames +=1;
            itr->SeasonGames +=1;
            itr->SeasonWins += 1;
            itr->WeekWins += 1;
            // update unit fields
            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_WEEK, itr->WeekGames);
            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_SEASON, itr->SeasonGames);
            return;
        }
    }
}
开发者ID:Anbush,项目名称:TrinityCore,代码行数:26,代码来源:ArenaTeam.cpp


示例3: GetPersonalRatingMod

void ArenaTeam::MemberWon(Player * plr, uint32 againstMatchmakerRating, int32 teamratingchange)
{
    // called for each participant after winning a match
    for (MemberList::iterator itr = m_members.begin(); itr !=  m_members.end(); ++itr)
    {
        if (itr->guid == plr->GetGUID())
        {
            // update personal rating
            int32 mod = GetPersonalRatingMod(teamratingchange, (m_stats.rating - teamratingchange), itr->personal_rating);
            itr->ModifyPersonalRating(plr, mod, GetSlot());

            // update matchmaker rating
            mod = GetRatingMod(itr->matchmaker_rating, againstMatchmakerRating, true, true);
            itr->ModifyMatchmakerRating(mod, GetSlot());

            // update personal stats
            itr->games_week +=1;
            itr->games_season +=1;
            itr->wins_season += 1;
            itr->wins_week += 1;
            // update unit fields
            plr->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_WEEK, itr->games_week);
            plr->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_SEASON, itr->games_season);
            return;
        }
    }
}
开发者ID:ArcterusEmu,项目名称:core,代码行数:27,代码来源:ArenaTeam.cpp


示例4: GetRatingMod

void ArenaTeam::MemberWon(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
{
    // called for each participant after winning a match
    for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
    {
        if (itr->Guid == player->GetGUID())
        {
            // update personal rating
            int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, true);
            itr->ModifyPersonalRating(player, mod, GetType());
	     if(player->GetSession()->IsPremium())
	        player->ModifyArenaPoints(20);
	     else
		 player->ModifyArenaPoints(10);

            // update matchmaker rating
            itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot());

            // update personal stats
            itr->WeekGames +=1;
            itr->SeasonGames +=1;
            itr->SeasonWins += 1;
            itr->WeekWins += 1;
            // update unit fields
            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_WEEK, itr->WeekGames);
            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_SEASON, itr->SeasonGames);
	     player->AddItem(19182, 1);
	     player->AddItem(29437, 5);
	     player->AddItem(29438, 10);
	     player->AddItem(29435, 5);
	     ChatHandler(player).PSendSysMessage("You won an Arena Match, therefor you have been awarded with a huge amount of prices!");
            return;
        }
    }
}
开发者ID:BlackWolfsDen,项目名称:Justicar-WoW,代码行数:35,代码来源:ArenaTeam.cpp


示例5: GetRatingMod

int32 ArenaTeam::LostAgainst(uint32 againstRating)
{
    // called when the team has lost
    int32 mod = GetRatingMod(m_stats.rating, againstRating, false);

    // modify the team stats accordingly
    FinishGame(mod);

    // return the rating change, used to display it on the results screen
    return mod;
}
开发者ID:sensibob,项目名称:tempestcore,代码行数:11,代码来源:ArenaTeam.cpp


示例6: GetMatchmakerRatingMod

int32 ArenaTeam::LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change)
{
    // Called when the team has lost
    // Change in Matchmaker Rating
    int32 mod = GetMatchmakerRatingMod(Own_MMRating, Opponent_MMRating, false);

    // Change in Team Rating
    rating_change = GetRatingMod(Stats.Rating, Opponent_MMRating, false);

    // Modify the team stats accordingly
    FinishGame(rating_change);

    // return the rating change, used to display it on the results screen
    return mod;
}
开发者ID:Crash911,项目名称:RaptoredSkyFire,代码行数:15,代码来源:ArenaTeam.cpp


示例7: GetRatingMod

int32 ArenaTeam::CalculateRatingChange(uint32 winningRating, uint32 lostRating, bool won)
{
    // Own team rating versus opponents matchmaker rating
    int32 mod = GetRatingMod(winningRating, lostRating, won);

    // Modify the team stats accordingly
    FinishGame(mod);

    // Update number of wins per season and week
    if (won)
    {
        Stats.WeekWins += 1;
        Stats.SeasonWins += 1;
    }

    // Return the rating change, used to display it on the results screen
    return mod;
}
开发者ID:sk3tche,项目名称:TrinityCore,代码行数:18,代码来源:ArenaTeam.cpp


示例8: GetRatingMod

void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
{
    // Called for offline player after ending rated arena match!
    for (MemberList::iterator itr = Members.begin(); itr !=  Members.end(); ++itr)
    {
        if (itr->Guid == guid)
        {
            // update personal rating
            int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, false);
            itr->ModifyPersonalRating(NULL, mod, GetType());

            // update matchmaker rating
            itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot());

            // update personal played stats
            itr->WeekGames += 1;
            itr->SeasonGames += 1;
            return;
        }
    }
}
开发者ID:Crash911,项目名称:RaptoredSkyFire,代码行数:21,代码来源:ArenaTeam.cpp


示例9: GetPersonalRatingMod

void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 teamratingchange)
{
    // called for offline player after ending rated arena match!
    for (MemberList::iterator itr = m_members.begin(); itr !=  m_members.end(); ++itr)
    {
        if (itr->guid == guid)
        {
            // update personal rating
            int32 mod = GetPersonalRatingMod(teamratingchange, itr->personal_rating, (m_stats.rating - teamratingchange));
            itr->ModifyPersonalRating(NULL, mod, GetSlot());

            // update matchmaker rating
            mod = GetRatingMod(itr->matchmaker_rating, againstMatchmakerRating, false, true);
            itr->ModifyMatchmakerRating(mod, GetSlot());

            // update personal played stats
            itr->games_week +=1;
            itr->games_season +=1;
            return;
        }
    }
}
开发者ID:Ballwinkle,项目名称:SkyFireEMU,代码行数:22,代码来源:ArenaTeam.cpp


示例10: GetRatingMod

void ArenaTeam::MemberWon(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
{
    // called for each participant after winning a match
    for (MemberList::iterator itr = Members.begin(); itr !=  Members.end(); ++itr)
    {
        if (itr->Guid == player->GetGUID())
        {
            // update personal rating
            int32 mod = GetRatingMod(itr->PersonalRating, againstMatchmakerRating, true);
            itr->ModifyPersonalRating(player, mod, GetSlot());

            // update matchmaker rating
            itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot());

            // update personal stats
            itr->WeekGames +=1;
            itr->SeasonGames +=1;
            itr->SeasonWins += 1;
            itr->WeekWins += 1;
            // update unit fields
            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_WEEK, itr->WeekGames);
            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_SEASON, itr->SeasonGames);
            return;

            //////////////////////////////////////////////////////
            //                                                  //
            //               CATACLYSM ARENA SYSTEM             //
            //  Winners receive fixed amount of Conquest Points //
            //                                                  //
            //                Losers, only Shame                //
            //                                                  //
            //////////////////////////////////////////////////////

            bool CapReached;

            switch (player->GetCurrency(390))     // Checks if Soft Cap has been reached, if yes, do not earn anymore points.
            {
                case 1343:
                case 1940:
                case 2533:
                case 2849:
                case 2964:
                case 3000:
                    CapReached = true;
                default:
                    CapReached = false;
            }

            if (CapReached == false)       // if not go ahead.
            {
                player->ModifyCurrency(390, 268.6f);

                // Conquest Point Soft Cap System - based on Personal Rating
                uint32 OldPoints = player->GetCurrency(390);
                uint32 OldRating = player->GetArenaPersonalRating(GetSlot());
                uint32 NewPoints = OldPoints;
                uint32 NewRating = OldRating;

                // First Check, points - Total Conquest Points cannot exceed the Soft Cap, So:
                if (OldRating <=1500 && OldPoints >= 1343)         // If this happens..
                {
                    NewPoints = 1343;                              // ..set points = Soft Cap, and set CapReached=1,
                                                                   // so player cannot earn anymore points until next week

                    // Second Check, rating - Rating has to remain the same
                    // for all the week, when a new week starts, rating can raise
                    // THIS IS TO AVOID RATING RAISING IN THE SAME WEEK.
                    // TODO: RATING RAISE WITHOUT EARNING POINTS.
                    if (Stats.WeekGames != 0 && OldRating > 1500)
                        NewRating = 1500;
                }

                // The same happens for all other brackets
                if ((OldRating > 1500 && OldRating < 1800) && OldPoints > 1940)
                {
                    NewPoints=1940;

                    if (Stats.WeekGames != 0 && OldRating > 1800)
                        NewRating = 1800;
                }

                if ((OldRating > 1800 && OldRating < 2100) && OldPoints > 2533)
                {
                    NewPoints = 2533;

                    if (Stats.WeekGames != 0 && OldRating > 2100)
                        NewRating = 2100;
                }
                if ((OldRating > 2100 && OldRating < 2400) && OldPoints > 2849)
                {
                    NewPoints = 2849;

                    if (Stats.WeekGames != 0 && OldRating > 2400)
                        NewRating = 2400;
                }
                if ((OldRating > 2400 && OldRating < 2700) && OldPoints > 2964)
                {
                    NewPoints = 2964;

                    if (Stats.WeekGames != 0 && OldRating > 3000)
//.........这里部分代码省略.........
开发者ID:Bootz,项目名称:TrilliumEMU-1,代码行数:101,代码来源:ArenaTeam.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetRawInputData函数代码示例发布时间:2022-05-30
下一篇:
C++ GetRatingBonusValue函数代码示例发布时间: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