示例#1
0
        private static int GetFlag(RainbowBattleTeam RainbowBattleTeam, RainbowNpcType type)
        {
            if (RainbowBattleTeam == null)
            {
                return(0);
            }

            return(RainbowBattleTeam.TotalFlag.FindAll(s => s.Item2 == type).Count());
        }
示例#2
0
        public static void RemoveFlag(RainbowBattleTeam RainbowBattle, RainbowNpcType type, int NpcId)
        {
            if (RainbowBattle == null)
            {
                return;
            }

            RainbowBattle.TotalFlag.RemoveAll(s => s.Item1 == NpcId && s.Item2 == type);
        }
示例#3
0
        public static bool AlreadyHaveFlag(RainbowBattleTeam RainbowBattleTeam, RainbowNpcType type, int NpcId)
        {
            if (RainbowBattleTeam == null)
            {
                return(false);
            }

            var a = RainbowBattleTeam.TotalFlag.FindAll(s => s.Item1 == NpcId && s.Item2 == type).Count();

            return(a == 0 ? false : true);
        }
示例#4
0
        public static void GenerateScore(RainbowBattleTeam RainbowBattle)
        {
            var first  = GetFlag(RainbowBattle, RainbowNpcType.First);
            var Second = GetFlag(RainbowBattle, RainbowNpcType.Second);
            var Last   = GetFlag(RainbowBattle, RainbowNpcType.Last);

            var total = first + (Second * 2) + (Last * 5);

            RainbowBattle.Score += total;

            SendFbs();
        }
示例#5
0
        public static void AddFlag(RainbowBattleTeam RainbowBattle, RainbowNpcType type, int npcId)
        {
            if (RainbowBattle == null)
            {
                return;
            }


            RainbowBattle.TotalFlag.Add(new Tuple <int, RainbowNpcType>(npcId, type));

            var RainbowTeam2 = ServerManager.Instance.RainbowBattleMembers.First(s => s != RainbowBattle);

            if (RainbowTeam2 == null)
            {
                return;
            }

            if (AlreadyHaveFlag(RainbowTeam2, type, npcId))
            {
                RemoveFlag(RainbowTeam2, type, npcId);
            }

            SendFbs();
        }