Exemple #1
0
        public static int ConsortiaFight(int consortiaWin, int consortiaLose, Dictionary <int, Player> players, eRoomType roomType, eGameType gameClass, int totalKillHealth, int playercount)
        {
            if (roomType != eRoomType.Match)
            {
                return(0);
            }
            int num   = playercount / 2;
            int num2  = 0;
            int state = 2;
            int num3  = 1;
            int num4  = 3;

            if (gameClass == eGameType.Guild)
            {
                num4 = 10;
                num3 = (int)RateMgr.GetRate(eRateType.Offer_Rate);
            }
            float rate = RateMgr.GetRate(eRateType.Riches_Rate);

            using (ConsortiaBussiness consortiaBussiness = new ConsortiaBussiness())
            {
                if (gameClass == eGameType.Free)
                {
                    num = 0;
                }
                else
                {
                    consortiaBussiness.ConsortiaFight(consortiaWin, consortiaLose, num, out num2, state, totalKillHealth, rate);
                }
                foreach (KeyValuePair <int, Player> current in players)
                {
                    if (current.Value != null)
                    {
                        if (current.Value.PlayerDetail.PlayerCharacter.ConsortiaID == consortiaWin)
                        {
                            current.Value.PlayerDetail.AddOffer((num + num4) * num3);
                            current.Value.PlayerDetail.PlayerCharacter.RichesRob += num2;
                        }
                        else
                        {
                            if (current.Value.PlayerDetail.PlayerCharacter.ConsortiaID == consortiaLose)
                            {
                                current.Value.PlayerDetail.AddOffer((int)Math.Round((double)num * 0.5) * num3);
                                current.Value.PlayerDetail.RemoveOffer(num4);
                            }
                        }
                    }
                }
            }
            return(num2);
        }
Exemple #2
0
        public static int ConsortiaFight(GamePlayer player, int consortiaWin, int consortiaLose, eRoomType roomType, eGameType gameClass, int totalKillHealth, int playercount)
        {
            int result;

            if (roomType != eRoomType.Match)
            {
                result = 0;
            }
            else
            {
                int   playerCount = playercount / 2;
                int   riches      = 0;
                int   state       = 2;
                float richesRate  = player.GMRichesRate * player.AuncherRichesRate;
                using (ConsortiaBussiness db = new ConsortiaBussiness())
                {
                    if (gameClass == eGameType.Free)
                    {
                        playerCount = 0;
                    }
                    else
                    {
                        db.ConsortiaFight(consortiaWin, consortiaLose, playerCount, out riches, state, totalKillHealth, richesRate);
                    }
                }
                if (riches > 10000)
                {
                    ConsortiaMgr.log.Error(string.Format("player.nickname : {0}, gameClass : {1}, GMRichesRate : {2}, auncherRichesRate : {3}, consortiaWin : {4}, consortiaLose : {5}, playerCount : {6}, totalKillHealth : {7}", new object[]
                    {
                        player.PlayerCharacter.NickName,
                        gameClass,
                        player.GMRichesRate,
                        player.AuncherRichesRate,
                        consortiaWin,
                        consortiaLose,
                        playerCount,
                        totalKillHealth
                    }));
                }
                result = riches;
            }
            return(result);
        }
Exemple #3
0
        public static int ConsortiaFight(int consortiaWin, int consortiaLose, Dictionary <int, Player> players, eRoomType roomType, eGameType gameClass, int totalKillHealth, int playercount)
        {
            if (roomType != eRoomType.Match)
            {
                return(0);
            }

            int playerCount = playercount / 2;



            int riches = 0;
            int state  = 2;
            int rate   = 1;
            int value  = 3;

            if (gameClass == eGameType.Guild)
            {
                value = 10;
                rate  = (int)RateMgr.GetRate(eRateType.Offer_Rate);
            }

            float richesRate = RateMgr.GetRate(eRateType.Riches_Rate);

            using (ConsortiaBussiness db = new ConsortiaBussiness())
            {
                if (gameClass == eGameType.Free)
                {
                    playerCount = 0;
                }
                else
                {
                    db.ConsortiaFight(consortiaWin, consortiaLose, playerCount, out riches, state, totalKillHealth, richesRate);
                }
                //(对方公会等级-3)*50*对方玩家人数(对方玩家人数是指进入战斗时的人数,中途退出或者掉线的玩家不改变这个数值)
                //玩家增加掠夺财富
                foreach (KeyValuePair <int, Player> p in players)
                {
                    //if (p.Value.State == TankGameState.LOSE)
                    //    continue;
                    if (p.Value == null)
                    {
                        continue;
                    }

                    if (p.Value.PlayerDetail.PlayerCharacter.ConsortiaID == consortiaWin)
                    {
                        p.Value.PlayerDetail.AddOffer((playerCount + value) * rate);

                        p.Value.PlayerDetail.PlayerCharacter.RichesRob += riches;
                    }
                    else if (p.Value.PlayerDetail.PlayerCharacter.ConsortiaID == consortiaLose)
                    {
                        p.Value.PlayerDetail.AddOffer((int)Math.Round(playerCount * 0.5) * rate);
                        p.Value.PlayerDetail.RemoveOffer(value);
                    }
                }
            }

            return(riches);
        }