private static int GetFlag(RainbowBattleTeam RainbowBattleTeam, RainbowNpcType type) { if (RainbowBattleTeam == null) { return(0); } return(RainbowBattleTeam.TotalFlag.FindAll(s => s.Item2 == type).Count()); }
public static void RemoveFlag(RainbowBattleTeam RainbowBattle, RainbowNpcType type, int NpcId) { if (RainbowBattle == null) { return; } RainbowBattle.TotalFlag.RemoveAll(s => s.Item1 == NpcId && s.Item2 == type); }
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); }
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(); }
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(); }