Пример #1
0
 internal static void FlagGrabbed(C3Player who, string gametype)
 {
     FlagGrabbedArgs e = new FlagGrabbedArgs();
     e.Who = who;
     e.GameType = gametype;
     if (OnFlagGrabed != null)
         OnFlagGrabed(e);
 }
Пример #2
0
        internal static void VoteEvent(C3Player player, bool vote, bool join, string gametype)
        {
            VoteArgs e = new VoteArgs();

            e.GameType      = gametype;
            e.IsCallingVote = vote;
            e.IsJoiningVote = join;
            e.Player        = player;
        }
Пример #3
0
 internal static void Death(C3Player killer, C3Player killed, string gametype, bool pvpkill)
 {
     DeathArgs e = new DeathArgs();
     e.Killer = killer;
     e.Killed = killed;
     e.GameType = gametype;
     e.PvPKill = pvpkill;
     if (OnPvPDeath != null)
         OnPvPDeath(e);
 }
Пример #4
0
        internal static void FlagGrabbed(C3Player who, string gametype)
        {
            FlagGrabbedArgs e = new FlagGrabbedArgs();

            e.Who      = who;
            e.GameType = gametype;
            if (OnFlagGrabed != null)
            {
                OnFlagGrabed(e);
            }
        }
Пример #5
0
 internal static void FlagCapture(C3Player who, string gametype, string whoscored, int capturedteamscore, int otherteamscore)
 {
     FlagCaptureArgs e = new FlagCaptureArgs();
     e.Who = who;
     e.GameType = gametype;
     e.WhoScored = whoscored;
     e.CapturedTeamScore = capturedteamscore;
     e.OtherTeamScore = otherteamscore;
     if (OnFlagCapture != null)
         OnFlagCapture(e);
 }
Пример #6
0
        internal static void Death(C3Player killer, C3Player killed, string gametype, bool pvpkill)
        {
            DeathArgs e = new DeathArgs();

            e.Killer   = killer;
            e.Killed   = killed;
            e.GameType = gametype;
            e.PvPKill  = pvpkill;
            if (OnPvPDeath != null)
            {
                OnPvPDeath(e);
            }
        }
Пример #7
0
        internal static void FlagCapture(C3Player who, string gametype, string whoscored, int capturedteamscore, int otherteamscore)
        {
            FlagCaptureArgs e = new FlagCaptureArgs();

            e.Who               = who;
            e.GameType          = gametype;
            e.WhoScored         = whoscored;
            e.CapturedTeamScore = capturedteamscore;
            e.OtherTeamScore    = otherteamscore;
            if (OnFlagCapture != null)
            {
                OnFlagCapture(e);
            }
        }
Пример #8
0
        //Converted v2.2
        internal static string AssignTeam(C3Player who, string gametype)
        {
            switch (gametype)
            {
                //Converted v2.2
                #region CTF
                case "ctf":
                    {
                        if (who.Team != 1 || who.Team != 2)
                        {
                            int playerteam1 = 0;
                            int playerteam2 = 0;

                            foreach (C3Player player in C3Mod.C3Players)
                            {
                                if (player.Team == 1)
                                    playerteam1++;
                                else if (player.Team == 2)
                                    playerteam2++;
                            }

                            if (playerteam1 > playerteam2)
                            {
                                who.GameType = "ctf";
                                who.Team = 2;
                                switch (C3Mod.C3Config.TeamColor2)
                                {
                                    case 1:
                                        {
                                            return "Blue";
                                        }
                                    case 2:
                                        {
                                            return "Green";
                                        }
                                    case 3:
                                        {
                                            return "Blue";
                                        }
                                    case 4:
                                        {
                                            return "Yellow";
                                        }
                                }
                            }
                            else if (playerteam2 > playerteam1)
                            {
                                who.Team = 1;
                                who.GameType = "ctf";

                                switch (C3Mod.C3Config.TeamColor2)
                                {
                                    case 1:
                                        {
                                            return "Blue";
                                        }
                                    case 2:
                                        {
                                            return "Green";
                                        }
                                    case 3:
                                        {
                                            return "Blue";
                                        }
                                    case 4:
                                        {
                                            return "Yellow";
                                        }
                                }
                            }

                            else
                            {
                                Random r = new Random();

                                switch (r.Next(2) + 1)
                                {
                                    case 1:
                                        {
                                            who.Team = 1;
                                            who.GameType = "ctf";
                                            switch (C3Mod.C3Config.TeamColor1)
                                            {
                                                case 1:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 2:
                                                    {
                                                        return "Green";
                                                    }
                                                case 3:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 4:
                                                    {
                                                        return "Yellow";
                                                    }
                                            }
                                            break;
                                        }
                                    case 2:
                                        {
                                            who.Team = 2;
                                            who.GameType = "ctf";
                                            switch (C3Mod.C3Config.TeamColor2)
                                            {
                                                case 1:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 2:
                                                    {
                                                        return "Green";
                                                    }
                                                case 3:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 4:
                                                    {
                                                        return "Yellow";
                                                    }
                                            }
                                            break;
                                        }
                                }
                            }
                        }
                        break;
                    }
                #endregion
                //Converted v2.2
                #region OneFlag

                case "oneflag":
                    {
                        if (who.Team != 5 || who.Team != 6)
                        {
                            int redteamplayers = 0;
                            int blueteamplayers = 0;

                            foreach (C3Player player in C3Mod.C3Players)
                            {
                                if (player.Team == 5)
                                    redteamplayers++;
                                else if (player.Team == 6)
                                    blueteamplayers++;
                            }

                            if (redteamplayers > blueteamplayers)
                            {
                                who.Team = 6;
                                who.GameType = "oneflag";
                                switch (C3Mod.C3Config.TeamColor2)
                                {
                                    case 1:
                                        {
                                            return "Blue";
                                        }
                                    case 2:
                                        {
                                            return "Green";
                                        }
                                    case 3:
                                        {
                                            return "Blue";
                                        }
                                    case 4:
                                        {
                                            return "Yellow";
                                        }
                                }
                            }
                            else if (blueteamplayers > redteamplayers)
                            {
                                who.Team = 5;
                                who.GameType = "oneflag";
                                switch (C3Mod.C3Config.TeamColor2)
                                {
                                    case 1:
                                        {
                                            return "Blue";
                                        }
                                    case 2:
                                        {
                                            return "Green";
                                        }
                                    case 3:
                                        {
                                            return "Blue";
                                        }
                                    case 4:
                                        {
                                            return "Yellow";
                                        }
                                }
                            }

                            else
                            {
                                Random r = new Random();

                                switch (r.Next(2) + 1)
                                {
                                    case 1:
                                        {
                                            who.Team = 5;
                                            who.GameType = "oneflag";
                                            switch (C3Mod.C3Config.TeamColor1)
                                            {
                                                case 1:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 2:
                                                    {
                                                        return "Green";
                                                    }
                                                case 3:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 4:
                                                    {
                                                        return "Yellow";
                                                    }
                                            }
                                            break;
                                        }
                                    case 2:
                                        {
                                            who.Team = 6;
                                            who.GameType = "oneflag";
                                            switch (C3Mod.C3Config.TeamColor2)
                                            {
                                                case 1:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 2:
                                                    {
                                                        return "Green";
                                                    }
                                                case 3:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 4:
                                                    {
                                                        return "Yellow";
                                                    }
                                            }
                                            break;
                                        }
                                }
                            }
                        }
                        break;
                    }
                #endregion
                //Converted v2.2
                #region TDM
                case "tdm":
                    {
                        if (who.Team != 7 || who.Team != 8)
                        {
                            int redteamplayers = 0;
                            int blueteamplayers = 0;

                            foreach (C3Player player in C3Mod.C3Players)
                            {
                                if (player.Team == 7)
                                    redteamplayers++;
                                else if (player.Team == 8)
                                    blueteamplayers++;
                            }

                            if (redteamplayers > blueteamplayers)
                            {
                                who.Team = 8;
                                who.GameType = "tdm";
                                switch (C3Mod.C3Config.TeamColor2)
                                {
                                    case 1:
                                        {
                                            return "Blue";
                                        }
                                    case 2:
                                        {
                                            return "Green";
                                        }
                                    case 3:
                                        {
                                            return "Blue";
                                        }
                                    case 4:
                                        {
                                            return "Yellow";
                                        }
                                }
                            }
                            else if (blueteamplayers > redteamplayers)
                            {
                                who.Team = 7;
                                who.GameType = "tdm";
                                switch (C3Mod.C3Config.TeamColor1)
                                {
                                    case 1:
                                        {
                                            return "Blue";
                                        }
                                    case 2:
                                        {
                                            return "Green";
                                        }
                                    case 3:
                                        {
                                            return "Blue";
                                        }
                                    case 4:
                                        {
                                            return "Yellow";
                                        }
                                }
                            }

                            else
                            {
                                Random r = new Random();

                                switch (r.Next(2) + 1)
                                {
                                    case 1:
                                        {
                                            who.Team = 7;
                                            who.GameType = "tdm";
                                            switch (C3Mod.C3Config.TeamColor1)
                                            {
                                                case 1:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 2:
                                                    {
                                                        return "Green";
                                                    }
                                                case 3:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 4:
                                                    {
                                                        return "Yellow";
                                                    }
                                            }
                                            break;
                                        }
                                    case 2:
                                        {
                                            who.Team = 8;
                                            who.GameType = "tdm";
                                            switch (C3Mod.C3Config.TeamColor2)
                                            {
                                                case 1:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 2:
                                                    {
                                                        return "Green";
                                                    }
                                                case 3:
                                                    {
                                                        return "Blue";
                                                    }
                                                case 4:
                                                    {
                                                        return "Yellow";
                                                    }
                                            }
                                            break;
                                        }
                                }
                            }
                        }
                        break;
                    }
                #endregion
            }
            return "";
        }
Пример #9
0
        public static string AssignTeam(C3Player who, string gametype)
        {
            switch (gametype)
            {
                case "ctf":
                    {
                        if (who.Team != 1 || who.Team != 2)
                        {
                            int redteamplayers = 0;
                            int blueteamplayers = 0;

                            foreach (C3Player player in C3Mod.C3Players)
                            {
                                if (player.Team == 1)
                                    redteamplayers++;
                                else if (player.Team == 2)
                                    blueteamplayers++;
                            }

                            if (redteamplayers > blueteamplayers)
                            {
                                who.Team = 2;
                                who.GameType = "ctf";
                                return "Blue";
                            }
                            else if (blueteamplayers > redteamplayers)
                            {
                                who.Team = 1;
                                who.GameType = "ctf";
                                return "Red";
                            }

                            else
                            {
                                Random r = new Random();

                                switch (r.Next(2) + 1)
                                {
                                    case 1:
                                        {
                                            who.Team = 1;
                                            who.GameType = "ctf";
                                            return "Red";
                                        }
                                    case 2:
                                        {
                                            who.Team = 2;
                                            who.GameType = "ctf";
                                            return "Blue";
                                        }
                                }
                            }
                        }
                        break;
                    }
                case "oneflag":
                    {
                        if (who.Team != 5 || who.Team != 6)
                        {
                            int redteamplayers = 0;
                            int blueteamplayers = 0;

                            foreach (C3Player player in C3Mod.C3Players)
                            {
                                if (player.Team == 5)
                                    redteamplayers++;
                                else if (player.Team == 6)
                                    blueteamplayers++;
                            }

                            if (redteamplayers > blueteamplayers)
                            {
                                who.Team = 6;
                                who.GameType = "oneflag";
                                return "Blue";
                            }
                            else if (blueteamplayers > redteamplayers)
                            {
                                who.Team = 5;
                                who.GameType = "oneflag";
                                return "Red";
                            }

                            else
                            {
                                Random r = new Random();

                                switch (r.Next(2) + 1)
                                {
                                    case 1:
                                        {
                                            who.Team = 5;
                                            who.GameType = "oneflag";
                                            return "Red";
                                        }
                                    case 2:
                                        {
                                            who.Team = 6;
                                            who.GameType = "oneflag";
                                            return "Blue";
                                        }
                                }
                            }
                        }
                        break;
                    }
                case "tdm":
                    {
                        if (who.Team != 7 || who.Team != 8)
                        {
                            int redteamplayers = 0;
                            int blueteamplayers = 0;

                            foreach (C3Player player in C3Mod.C3Players)
                            {
                                if (player.Team == 7)
                                    redteamplayers++;
                                else if (player.Team == 8)
                                    blueteamplayers++;
                            }

                            if (redteamplayers > blueteamplayers)
                            {
                                who.Team = 8;
                                who.GameType = "tdm";
                                return "Blue";
                            }
                            else if (blueteamplayers > redteamplayers)
                            {
                                who.Team = 7;
                                who.GameType = "tdm";
                                return "Red";
                            }

                            else
                            {
                                Random r = new Random();

                                switch (r.Next(2) + 1)
                                {
                                    case 1:
                                        {
                                            who.Team = 7;
                                            who.GameType = "tdm";
                                            return "Red";
                                        }
                                    case 2:
                                        {
                                            who.Team = 8;
                                            who.GameType = "tdm";
                                            return "Blue";
                                        }
                                }
                            }
                        }
                        break;
                    }
            }
            return "";
        }
Пример #10
0
        //Converted v2.2
        internal static string AssignTeam(C3Player who, string gametype)
        {
            switch (gametype)
            {
                //Converted v2.2
                #region CTF
            case "ctf":
            {
                if (who.Team != 1 || who.Team != 2)
                {
                    int playerteam1 = 0;
                    int playerteam2 = 0;

                    foreach (C3Player player in C3Mod.C3Players)
                    {
                        if (player.Team == 1)
                        {
                            playerteam1++;
                        }
                        else if (player.Team == 2)
                        {
                            playerteam2++;
                        }
                    }

                    if (playerteam1 > playerteam2)
                    {
                        who.GameType = "ctf";
                        who.Team     = 2;
                        switch (C3Mod.C3Config.TeamColor2)
                        {
                        case 1:
                        {
                            return("Red");
                        }

                        case 2:
                        {
                            return("Green");
                        }

                        case 3:
                        {
                            return("Blue");
                        }

                        case 4:
                        {
                            return("Yellow");
                        }
                        }
                    }
                    else if (playerteam2 > playerteam1)
                    {
                        who.Team     = 1;
                        who.GameType = "ctf";

                        switch (C3Mod.C3Config.TeamColor2)
                        {
                        case 1:
                        {
                            return("Red");
                        }

                        case 2:
                        {
                            return("Green");
                        }

                        case 3:
                        {
                            return("Blue");
                        }

                        case 4:
                        {
                            return("Yellow");
                        }
                        }
                    }

                    else
                    {
                        Random r = new Random();

                        switch (r.Next(2) + 1)
                        {
                        case 1:
                        {
                            who.Team     = 1;
                            who.GameType = "ctf";
                            switch (C3Mod.C3Config.TeamColor1)
                            {
                            case 1:
                            {
                                return("Red");
                            }

                            case 2:
                            {
                                return("Green");
                            }

                            case 3:
                            {
                                return("Blue");
                            }

                            case 4:
                            {
                                return("Yellow");
                            }
                            }
                            break;
                        }

                        case 2:
                        {
                            who.Team     = 2;
                            who.GameType = "ctf";
                            switch (C3Mod.C3Config.TeamColor2)
                            {
                            case 1:
                            {
                                return("Red");
                            }

                            case 2:
                            {
                                return("Green");
                            }

                            case 3:
                            {
                                return("Blue");
                            }

                            case 4:
                            {
                                return("Yellow");
                            }
                            }
                            break;
                        }
                        }
                    }
                }
                break;
            }
                #endregion
                //Converted v2.2
                #region OneFlag

            case "oneflag":
            {
                if (who.Team != 5 || who.Team != 6)
                {
                    int redteamplayers  = 0;
                    int blueteamplayers = 0;

                    foreach (C3Player player in C3Mod.C3Players)
                    {
                        if (player.Team == 5)
                        {
                            redteamplayers++;
                        }
                        else if (player.Team == 6)
                        {
                            blueteamplayers++;
                        }
                    }

                    if (redteamplayers > blueteamplayers)
                    {
                        who.Team     = 6;
                        who.GameType = "oneflag";
                        switch (C3Mod.C3Config.TeamColor2)
                        {
                        case 1:
                        {
                            return("Red");
                        }

                        case 2:
                        {
                            return("Green");
                        }

                        case 3:
                        {
                            return("Blue");
                        }

                        case 4:
                        {
                            return("Yellow");
                        }
                        }
                    }
                    else if (blueteamplayers > redteamplayers)
                    {
                        who.Team     = 5;
                        who.GameType = "oneflag";
                        switch (C3Mod.C3Config.TeamColor2)
                        {
                        case 1:
                        {
                            return("Red");
                        }

                        case 2:
                        {
                            return("Green");
                        }

                        case 3:
                        {
                            return("Blue");
                        }

                        case 4:
                        {
                            return("Yellow");
                        }
                        }
                    }

                    else
                    {
                        Random r = new Random();

                        switch (r.Next(2) + 1)
                        {
                        case 1:
                        {
                            who.Team     = 5;
                            who.GameType = "oneflag";
                            switch (C3Mod.C3Config.TeamColor1)
                            {
                            case 1:
                            {
                                return("Red");
                            }

                            case 2:
                            {
                                return("Green");
                            }

                            case 3:
                            {
                                return("Blue");
                            }

                            case 4:
                            {
                                return("Yellow");
                            }
                            }
                            break;
                        }

                        case 2:
                        {
                            who.Team     = 6;
                            who.GameType = "oneflag";
                            switch (C3Mod.C3Config.TeamColor2)
                            {
                            case 1:
                            {
                                return("Red");
                            }

                            case 2:
                            {
                                return("Green");
                            }

                            case 3:
                            {
                                return("Blue");
                            }

                            case 4:
                            {
                                return("Yellow");
                            }
                            }
                            break;
                        }
                        }
                    }
                }
                break;
            }

                #endregion
                //Converted v2.2
                #region TDM
            case "tdm":
            {
                if (who.Team != 7 || who.Team != 8)
                {
                    int redteamplayers  = 0;
                    int blueteamplayers = 0;

                    foreach (C3Player player in C3Mod.C3Players)
                    {
                        if (player.Team == 7)
                        {
                            redteamplayers++;
                        }
                        else if (player.Team == 8)
                        {
                            blueteamplayers++;
                        }
                    }

                    if (redteamplayers > blueteamplayers)
                    {
                        who.Team     = 8;
                        who.GameType = "tdm";
                        switch (C3Mod.C3Config.TeamColor2)
                        {
                        case 1:
                        {
                            return("Red");
                        }

                        case 2:
                        {
                            return("Green");
                        }

                        case 3:
                        {
                            return("Blue");
                        }

                        case 4:
                        {
                            return("Yellow");
                        }
                        }
                    }
                    else if (blueteamplayers > redteamplayers)
                    {
                        who.Team     = 7;
                        who.GameType = "tdm";
                        switch (C3Mod.C3Config.TeamColor1)
                        {
                        case 1:
                        {
                            return("Red");
                        }

                        case 2:
                        {
                            return("Green");
                        }

                        case 3:
                        {
                            return("Blue");
                        }

                        case 4:
                        {
                            return("Yellow");
                        }
                        }
                    }

                    else
                    {
                        Random r = new Random();

                        switch (r.Next(2) + 1)
                        {
                        case 1:
                        {
                            who.Team     = 7;
                            who.GameType = "tdm";
                            switch (C3Mod.C3Config.TeamColor1)
                            {
                            case 1:
                            {
                                return("Red");
                            }

                            case 2:
                            {
                                return("Green");
                            }

                            case 3:
                            {
                                return("Blue");
                            }

                            case 4:
                            {
                                return("Yellow");
                            }
                            }
                            break;
                        }

                        case 2:
                        {
                            who.Team     = 8;
                            who.GameType = "tdm";
                            switch (C3Mod.C3Config.TeamColor2)
                            {
                            case 1:
                            {
                                return("Red");
                            }

                            case 2:
                            {
                                return("Green");
                            }

                            case 3:
                            {
                                return("Blue");
                            }

                            case 4:
                            {
                                return("Yellow");
                            }
                            }
                            break;
                        }
                        }
                    }
                }
                break;
            }
                #endregion
            }
            return("");
        }
Пример #11
0
 internal static void VoteEvent(C3Player player, bool vote, bool join, string gametype)
 {
     VoteArgs e = new VoteArgs();
     e.GameType = gametype;
     e.IsCallingVote = vote;
     e.IsJoiningVote = join;
     e.Player = player;
 }