예제 #1
0
        public static void check_ggss(team squad)
        {
            uint golds    = 0;
            uint silvers  = 0;
            uint regulars = 0;

            foreach (player line in squad.team_players)
            {
                if (line.is_gold)
                {
                    golds++;
                }

                if (line.is_silver)
                {
                    silvers++;
                }

                if (line.is_regular)
                {
                    regulars++;
                }

                /*
                 * if(line.is_goalkeeper)
                 * {
                 *  regulars++;
                 * }*/
            }

            // GOLDS
            if (golds > constants.players_gold)
            {
                Console.WriteLine(squad.team_name + " has too many Gold Players (Has " + golds + ", should have " + constants.players_gold + ")");
                variables.errors++;
            }

            if (golds < constants.players_gold)
            {
                Console.WriteLine(squad.team_name + " has too few Gold Players (Has " + golds + ", should have " + constants.players_gold + ")");
                variables.errors++;
            }

            // SILVERS
            if (silvers > constants.players_silver)
            {
                Console.WriteLine(squad.team_name + " has too many Silver Players (Has " + silvers + ", should have " + constants.players_silver + ")");
                variables.errors++;
            }

            if (silvers < constants.players_silver)
            {
                Console.WriteLine(squad.team_name + " has too few Silver Players (Has " + silvers + ", should have " + constants.players_silver + ")");
                variables.errors++;
            }

            // REGULARS AND GOALKEEPERS
            if (regulars > constants.players_regular_and_gk)
            {
                Console.WriteLine(squad.team_name + " has too many Non-Medal Players (Has " + regulars + ", should have " + constants.players_regular_and_gk + ")");
                variables.errors++;
            }

            if (regulars < constants.players_regular_and_gk)
            {
                Console.WriteLine(squad.team_name + " has too few Non-Medal Players (Has " + regulars + ", should have " + constants.players_regular_and_gk + ")");
                variables.errors++;
            }
        }
예제 #2
0
        public static void compare_teams(team squad_1, team squad_2)
        {
            foreach (player player_1 in squad_1.team_players)
            {
                foreach (player player_2 in squad_2.team_players)
                {
                    if (player_1.id == player_2.id)
                    {
                        int i;

                        current_player_id   = player_1.id;
                        current_player_name = player_1.name;

                        Console.WriteLine("* Comparing " + current_player_name);

                        // Compare the player in either file
                        compare_value(player_1.nationality, player_2.nationality, "nationality");
                        compare_value(player_1.position, player_2.position, "position");

                        for (i = 0; i < 13; i++)
                        {
                            compare_value(player_1.PosRats[i], player_2.PosRats[i], "position_ratings");
                        }

                        compare_value(player_1.height, player_2.height, "height");
                        compare_value(player_1.weight, player_2.weight, "weight");
                        compare_value(player_1.age, player_2.age, "age");
                        compare_value(player_1.stronger_foot, player_2.stronger_foot, "stronger_foot");

                        compare_value(player_1.Attacking_Prowess, player_2.Attacking_Prowess, "Attacking_Prowess");
                        compare_value(player_1.Ball_Control, player_2.Ball_Control, "Ball_Control");
                        compare_value(player_1.Dribbling, player_2.Dribbling, "Dribbling");
                        compare_value(player_1.Low_Pass, player_2.Low_Pass, "Low_Pass");
                        compare_value(player_1.Lofted_Pass, player_2.Lofted_Pass, "Lofted_Pass");
                        compare_value(player_1.Finishing, player_2.Finishing, "Finishing");
                        compare_value(player_1.Place_Kicking, player_2.Place_Kicking, "Place_Kicking");
                        compare_value(player_1.Controlled_Spin, player_2.Controlled_Spin, "Controlled_Spin");
                        compare_value(player_1.Header, player_2.Header, "Header");
                        compare_value(player_1.Defensive_Prowess, player_2.Defensive_Prowess, "Defensive_Prowess");
                        compare_value(player_1.Ball_Winning, player_2.Ball_Winning, "Ball_Winning");
                        compare_value(player_1.Kicking_Power, player_2.Kicking_Power, "Kicking_Power");
                        compare_value(player_1.Speed, player_2.Speed, "Speed");
                        compare_value(player_1.Explosive_Power, player_2.Explosive_Power, "Explosive_Power");
                        compare_value(player_1.Body_Balance, player_2.Body_Balance, "Body_Balance");
                        compare_value(player_1.Jump, player_2.Jump, "Jump");
                        compare_value(player_1.Goalkeeping, player_2.Goalkeeping, "Goalkeeping");
                        compare_value(player_1.Saving, player_2.Saving, "Saving");
                        compare_value(player_1.Stamina, player_2.Stamina, "Stamina");
                        compare_value(player_1.Form, player_2.Form, "Form");

                        compare_value(player_1.Injury_Resistance, player_2.Injury_Resistance, "Injury_Resistance");

                        compare_value(player_1.Weak_Foot_Accuracy, player_2.Weak_Foot_Accuracy, "Weak_Foot_Accuracy");
                        compare_value(player_1.Weak_Foot_Usage, player_2.Weak_Foot_Usage, "Weak_Foot_Usage");

                        compare_value(player_1.playing_style, player_2.playing_style, "playing_style");

                        for (i = 0; i < 7; i++)
                        {
                            compare_value(player_1.Cards_Style[i], player_2.Cards_Style[i], "Style_Cards");
                        }

                        for (i = 0; i < 22; i++)
                        {
                            compare_value(player_1.Cards_Skills[i], player_2.Cards_Skills[i], "Skill_Cards");
                        }
                    }
                }
            }
        }
예제 #3
0
        public static void check_cards(player line, team squad)
        {
            int  total_cards = 0;
            bool captaincy   = false;

            // Count how many Style Cards the player has
            foreach (int i in line.Cards_Style)
            {
                if (i == 1)
                {
                    total_cards++;
                }
            }

            // Count how many Skill Cards the player has
            foreach (int i in line.Cards_Skills)
            {
                if (i == 1)
                {
                    total_cards++;
                }
            }

            // Captaincy Cards are excluded from the limit
            if (line.Cards_Skills[19] == 1)
            {
                captaincy = true;
            }

            // Check the card counts
            if ((line.is_regular) || (line.is_regular_system1))
            {
                if (total_cards > constants.cards_limit_regular)
                {
                    if ((total_cards == constants.cards_limit_regular + 1) && (captaincy))
                    {
                        Console.WriteLine(line.id + "\t" + line.name + " has CAPTAINCY");
                        squad.captains++;
                    }
                    else
                    {
                        Console.WriteLine(line.id + "\t" + line.name + " has too many Cards (Has " + total_cards + ", can only have " + constants.cards_limit_regular + " max)");
                        variables.errors++;
                    }
                }
            }
            else if ((line.is_silver) || (line.is_silver_system1))
            {
                if (total_cards > constants.cards_limit_silver)
                {
                    if ((total_cards == constants.cards_limit_silver + 1) && (captaincy))
                    {
                        Console.WriteLine(line.id + "\t" + line.name + " has CAPTAINCY");
                        squad.captains++;
                    }
                    else
                    {
                        Console.WriteLine(line.id + "\t" + line.name + " has too many Cards (Has " + total_cards + ", can only have " + constants.cards_limit_silver + " max)");
                        variables.errors++;
                    }
                }
            }
            else if ((line.is_gold) || (line.is_gold_system1))
            {
                if (total_cards > constants.cards_limit_gold)
                {
                    if ((total_cards == constants.cards_limit_gold + 1) && (captaincy))
                    {
                        Console.WriteLine(line.id + "\t" + line.name + " has CAPTAINCY");
                        squad.captains++;
                    }
                    else
                    {
                        Console.WriteLine(line.id + "\t" + line.name + " has too many Cards (Has " + total_cards + ", can only have " + constants.cards_limit_gold + " max)");
                        variables.errors++;
                    }
                }
            }
            else if ((line.is_goalkeeper) || (line.is_goalkeeper_system1))
            {
                if (total_cards > constants.cards_limit_goalkeeper)
                {
                    if ((total_cards == constants.cards_limit_goalkeeper + 1) && (captaincy))
                    {
                        Console.WriteLine(line.id + "\t" + line.name + " has CAPTAINCY");
                        squad.captains++;
                    }
                    else
                    {
                        Console.WriteLine(line.id + "\t" + line.name + " has too many Cards (Has " + total_cards + ", can only have " + constants.cards_limit_goalkeeper + " max)");
                        variables.errors++;
                    }
                }
            }
            else
            {
            }
        }
예제 #4
0
        static void Main(string[] args)
        {
            variables.errors = 0;

            bool ini_setup = false;

            Console.Title = "autoATF - PES 2015 - Autumn 2015 Edition - v2.1";

            // INI setup
            ini_setup = Parser.setup_switches();

            // Only continue if the ini setup was successful, otherwise there will be no input file and the csv parser will fall over
            if (ini_setup)
            {
                // Are we checking, or comparing?
                // The compare_file should be blank if we're checking, and have a file if we're comparing
                if (switches.compare_file == "")
                {
                    // *** Checking ***

                    Console.WriteLine("Entering Checker Mode...\n");

                    // Is it an edit.bin, or a texport.bin?
                    if (Importer.is_edit_bin(switches.input_file))
                    {
                        List <player> player_table = new List <player>();

                        // Parse the edit.bin
                        player_table = Importer.save_importer(switches.input_file);

                        while (true)
                        {
                            team squad = new team();

                            // What team to check?
                            checker.team_input(squad);

                            // Construct that team
                            checker.teambuilding(player_table, squad);

                            // Check that team
                            checker.check_em(squad);

                            // Reset the error count for the next team
                            variables.errors = 0;
                        }
                    }
                    else // Its a texport.bin
                    {
                        team squad = new team();

                        // Parse the texport.bin
                        squad = Importer.export_importer(switches.input_file);

                        Console.WriteLine("Team Export:\t" + squad.team_name);
                        Console.WriteLine();

                        // Check that the players are meant to be on that team
                        checker.check_squad_consistency(squad);

                        // Check that team
                        checker.check_em(squad);
                    }
                }
                else
                {
                    // *** Comparing ***

                    Console.WriteLine("Entering Compare Mode...\n");

                    // What team are we comparing?
                    // If one of the files is an export, we can assume that one

                    int type = -1; // 0 - Save/Save, 1 - Save/Export, 2 - Export/Save, 3 - Export/Export, -1 - ERROR

                    type = comparer.get_compare_type();

                    // So now we know what setup we have, lets start parsing the files
                    switch (type)
                    {
                    case 0:     // Save/Save

                        // This is the only type that can loop infinitely, as you can check a different team every time
                        while (true)
                        {
                            team t0_squad_save_1 = new team();
                            team t0_squad_save_2 = new team();

                            // Parse the saves
                            List <player> t0_player_table_1 = new List <player>();
                            List <player> t0_player_table_2 = new List <player>();

                            t0_player_table_1 = Importer.save_importer(switches.input_file);
                            t0_player_table_2 = Importer.save_importer(switches.compare_file);

                            // What team to check?
                            checker.team_input(t0_squad_save_1);

                            t0_squad_save_2.teamID    = t0_squad_save_1.teamID;
                            t0_squad_save_2.team_name = t0_squad_save_1.team_name;

                            // Construct the two teams
                            checker.teambuilding(t0_player_table_1, t0_squad_save_1);
                            checker.teambuilding(t0_player_table_2, t0_squad_save_2);

                            // Compare the teams
                            comparer.compare_teams(t0_squad_save_1, t0_squad_save_2);

                            Console.WriteLine();
                            Console.WriteLine("Differences: " + variables.errors);
                            Console.WriteLine("Compare completed!");
                            Console.WriteLine();
                        }
                        break;

                    case 1:     // Save/Export

                        team t1_squad_save   = new team();
                        team t1_squad_export = new team();

                        // Parse the texport.bin
                        t1_squad_export = Importer.export_importer(switches.compare_file);

                        Console.WriteLine();
                        Console.WriteLine("Comparing " + t1_squad_export.team_name);
                        Console.WriteLine();

                        // Now we know what team we're using, parse the edit.bin
                        List <player> t1_player_table = new List <player>();

                        t1_player_table = Importer.save_importer(switches.input_file);

                        t1_squad_save.teamID    = t1_squad_export.teamID;
                        t1_squad_save.team_name = t1_squad_export.team_name;

                        // Construct that team
                        checker.teambuilding(t1_player_table, t1_squad_save);

                        // Compare the teams
                        comparer.compare_teams(t1_squad_save, t1_squad_export);

                        break;

                    case 2:     // Export/Save

                        team t2_squad_save   = new team();
                        team t2_squad_export = new team();

                        // Parse the texport.bin
                        t2_squad_export = Importer.export_importer(switches.input_file);

                        Console.WriteLine();
                        Console.WriteLine("Comparing " + t2_squad_export.team_name);
                        Console.WriteLine();

                        // Now we know what team we're using, parse the edit.bin
                        List <player> t2_player_table = new List <player>();

                        t2_player_table = Importer.save_importer(switches.compare_file);

                        t2_squad_save.teamID    = t2_squad_export.teamID;
                        t2_squad_save.team_name = t2_squad_export.team_name;

                        // Construct that team
                        checker.teambuilding(t2_player_table, t2_squad_save);

                        // Compare the teams
                        comparer.compare_teams(t2_squad_save, t2_squad_export);

                        break;

                    case 3:     // Export/Export

                        team t3_squad_export_1 = new team();
                        team t3_squad_export_2 = new team();

                        // Parse the texport.bins
                        t3_squad_export_1 = Importer.export_importer(switches.input_file);
                        t3_squad_export_2 = Importer.export_importer(switches.compare_file);

                        // Are they exports for the same team?
                        if (t3_squad_export_1.teamID != t3_squad_export_2.teamID)
                        {
                            Console.WriteLine("\nThe two exports have different teams! Cancelling comparison");
                            Console.WriteLine("\t\t(" + t3_squad_export_1.team_name + " and " + t3_squad_export_2.team_name + ")");
                        }
                        else
                        {
                            Console.WriteLine();
                            Console.WriteLine("Comparing " + t3_squad_export_1.team_name);
                            Console.WriteLine();

                            // Compare the teams
                            comparer.compare_teams(t3_squad_export_1, t3_squad_export_2);
                        }

                        break;

                    default:
                        // Oh shit n***a what are you doing
                        Console.WriteLine();
                        Console.WriteLine("Invalid input files");
                        Console.WriteLine("You really shouldn't be seeing this error. If you are, you dun goof'd somehow");
                        Console.WriteLine("Check the ini is pointing at the correct files");
                        Console.WriteLine();
                        break;
                    }

                    Console.WriteLine();
                    Console.WriteLine("Differences: " + variables.errors);
                    Console.WriteLine("Compare completed!");
                    Console.WriteLine();
                }
            }

            Console.WriteLine("Press Enter to Exit...");
            Console.ReadLine();
        }
예제 #5
0
        public static team export_importer(string input_file)
        {
            // Create a new team
            team squad = new team();

            // Import the raw, encrypted texport.bin
            byte[] raw_texport;
            raw_texport = File.ReadAllBytes(input_file);

            // Decrypt it
            byte[] texport;
            texport = BinFileUtility.BinFile.decryptFile(raw_texport);

            // Go 128 bytes in to get the team name
            int team_name_offset = 128;

            byte[] texport_team_name = new byte[10];

            Array.Copy(texport, team_name_offset, texport_team_name, 0, 10);

            string team_name_str = System.Text.Encoding.Default.GetString(texport_team_name);

            // Setup teams
            Hashtable teams_4cc = new Hashtable();

            teams_4cc = Lookup.setup_teams_4cc();

            // Since we don't have access to the team table, we have it hardcoded
            Hashtable team_table = new Hashtable();

            team_table = Lookup.setup_team_table();

            squad.team_name = team_name_str.TrimEnd(chars_to_trim);

            // Get the teamID
            int team_ID_offset = 94524;

            byte[] texport_team_ID = new byte[2];

            Array.Copy(texport, team_ID_offset, texport_team_ID, 0, 2);

            squad.teamID = BitConverter.ToInt16(texport_team_ID, 0);

            // Go to the first player in the export
            int player1_offset = 5338532;

            // Set the pointer
            pointer = player1_offset;

            // Loop through all the players
            while (true)
            {
                // Now we have a pointer to the start of the first player
                int    chunk_size = 180;
                byte[] chunk      = new byte[chunk_size];
                Array.Copy(texport, pointer, chunk, 0, chunk_size);

                // Create a new Player
                player line = new player();

                line.id = readPlayerID(chunk);

                if (line.id == 0)
                {
                    break;
                }

                line.name       = texPlayerName(chunk);
                line.shirt_name = texShirtName(chunk);

                line.Team_id   = readTeamID(line.id, team_table);
                line.Team_name = readTeamName(line.Team_id, teams_4cc);

                line.position    = readMainPosition(chunk);
                line.PosRats     = readPositionRatings(chunk);
                line.nationality = readCountry(chunk);

                line.height = readHeight(chunk);
                line.weight = readWeight(chunk);
                line.age    = readAge(chunk);

                line.stronger_foot = readStrongerFoot(chunk);

                line.Attacking_Prowess = readAtkProw(chunk);
                line.Dribbling         = readDribbling(chunk);
                line.Ball_Control      = readBallControl(chunk);
                line.Low_Pass          = readLowPass(chunk);
                line.Lofted_Pass       = readLoftedPass(chunk);
                line.Finishing         = readFinishing(chunk);
                line.Place_Kicking     = readPlaceKicking(chunk);
                line.Controlled_Spin   = readControlledSpin(chunk);
                line.Header            = readHeader(chunk);
                line.Defensive_Prowess = readDefProw(chunk);
                line.Ball_Winning      = readBallWinning(chunk);
                line.Kicking_Power     = readKickingPower(chunk);
                line.Speed             = readSpeed(chunk);
                line.Explosive_Power   = readExplosivePower(chunk);
                line.Body_Balance      = readBodyBalance(chunk);
                line.Jump        = readJump(chunk);
                line.Goalkeeping = readGoalkeeping(chunk);
                line.Saving      = readSaving(chunk);
                line.Stamina     = readStamina(chunk);

                line.Form = readForm(chunk);
                line.Injury_Resistance  = readInjuryTol(chunk);
                line.Weak_Foot_Usage    = readWeakFootUsage(chunk);
                line.Weak_Foot_Accuracy = readWeakFootAccuracy(chunk);
                line.playing_style      = readPlayerStyle(chunk);
                line.Cards_Style        = readCardsPlayStyles(chunk);
                line.Cards_Skills       = readCardsPlaySkills(chunk);

                // Add to the global table
                squad.team_players.Add(line);

                // DEBUG - add to list of players
                squad.team_names.Add(line.name);

                pointer += chunk_size;
            }

            // Count how many players were in the export
            int num_of_players = squad.team_players.Count;

            if (num_of_players > constants.players_per_team)
            {
                Console.WriteLine("ERROR: Export has too many players!");
                Console.WriteLine("\t\t(Has " + num_of_players + ", should have " + constants.players_per_team + ")");
                Console.WriteLine();
                variables.errors++;
            }
            else if (num_of_players < constants.players_per_team)
            {
                Console.WriteLine("ERROR: Export has too few players!");
                Console.WriteLine("\t\t(Has " + num_of_players + ", should have " + constants.players_per_team + ")");
                Console.WriteLine();
                variables.errors++;
            }
            else
            {
                // Correct number of players
            }

            return(squad);
        }
예제 #6
0
        public static void check_height_abuse(team squad)
        {
            brackets heights;

            heights.bracket_1    = 0;
            heights.bracket_2    = 0;
            heights.bracket_3    = 0;
            heights.bracket_4    = 0;
            heights.bracket_5    = 0;
            heights.bracket_6    = 0;
            heights.bracket_7    = 0;
            heights.bracket_8    = 0;
            heights.height_total = 0;

            uint system1_stats = 0;
            int  system_type   = 0; // 0 = unknown, 1 = system1, 2 = system2

            // Check heights of all players in team
            foreach (player line in squad.team_players)
            {
                // Add height to running total for team
                heights.height_total += line.height;

                // Check for any System1 Stats Players
                if (line.is_gold_system1 == true || line.is_silver_system1 == true || line.is_regular_system1 == true || line.is_goalkeeper_system1 == true)
                {
                    system1_stats++;
                }

                // Check height against bracket boundaries, increment number of players in the bracket
                if (line.height > constants.height_maximum_pes)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + line.id + "\t" + line.name + " has a height of " + line.height + ", which is above the PES limit of " + constants.height_maximum_pes + "\nThis will probably crash the game. Good job.");
                    variables.errors++;
                }
                else if (line.height > constants.height_maximum_4cc)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + line.id + "\t" + line.name + " has a height above the 4cc limit of " + constants.height_maximum_4cc);
                    variables.errors++;
                }
                else if (line.height >= constants.height_bracket_1)
                {
                    heights.bracket_1++;
                }
                else if (line.height >= constants.height_bracket_2)
                {
                    heights.bracket_2++;
                }
                else if (line.height >= constants.height_bracket_3)
                {
                    heights.bracket_3++;
                }
                else if (line.height >= constants.height_bracket_4)
                {
                    heights.bracket_4++;
                }
                else if (line.height >= constants.height_bracket_5)
                {
                    heights.bracket_5++;
                }
                else if (line.height >= constants.height_bracket_6)
                {
                    heights.bracket_6++;
                }
                else if (line.height >= constants.height_bracket_7)
                {
                    heights.bracket_7++;
                }
                else if (line.height >= constants.height_bracket_8)
                {
                    heights.bracket_8++;
                }
                else if (line.height >= constants.height_minimum_pes)
                {
                    Console.WriteLine("MANLET ABUSE:\n" + line.id + "\t" + line.name + " has a height below the 4cc limit of " + constants.height_bracket_8);
                    variables.errors++;
                }
                else
                {
                    Console.WriteLine(line.id + "\t" + line.name + " has an invalid height and may crash the game\nYou must have seriously f****d up your export to trigger this");
                    variables.errors++;
                }
            }

            // For Brackets 1-4 there are two systems - System1 and System2
            // System1 is the original system, but all players above 189cm take a variable stat nerf depending on their medal (-5 for Golds, -4 for Silvers, -3 for Regulars and GKs)
            // System2 has no players above 189cm, and shifts those four players to the 185-189cm bracket for no stat nerf

            // Firstly, we need to determine what System the manager intended
            // To do this, first we check if any players have a stat nerf
            // If any players have this nerf, we can assume the manager intended to use System 1, because what are the chances they intended to use System2 but accidentally gave a player a perfect stats nerf for their medal?
            if (system1_stats > 0)
            {
                Console.WriteLine("Assuming Height Abuse System 1 (all players above 189cm have a variable stats nerf)\n");
                system_type = 1;

                // Lets do some error checking while we're here
                if (system1_stats < 4)
                {
                    // Looks like the team doesn't have enough players with the stats nerf
                    // So it could be a mistake with System1 or a badly mangled System2, either way its an error
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players with the variable stats nerf");
                    Console.WriteLine("\t\t (Has " + system1_stats + " should have 4)");
                    variables.errors++;
                }

                else if (system1_stats == 4)
                {
                    // Precisely 4, perfect
                }

                else // (system1_stats > 4)
                {
                    // Good job, you managed to nerf too many players
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too many players with the variable stats nerf");
                    Console.WriteLine("\t\t (Has " + system1_stats + " should have 4)");
                    variables.errors++;
                }
            }

            // If no players have the System1 Stats, it could still be System1 but the manager hasn't applied the stats nerf
            // We need to look at the brackets to be sure
            else
            {
                // Count up the number of 190cm+ players
                uint sixfootmasterrace = heights.bracket_1 + heights.bracket_2 + heights.bracket_3;

                if (sixfootmasterrace == 0)
                {
                    // If there are no 190cm+ players, assume System2
                    Console.WriteLine("Assuming Height Abuse System 2 (no players taller than 189cm)\n");
                    system_type = 2;
                }

                else if (sixfootmasterrace < 4)
                {
                    // This is sort of a grey area, it could be a System1 with too few giants, or a System2 with too many
                    // Considering there are no stats nerfs, and too few giants, its closer to System2 so lets go with that
                    Console.WriteLine("Assuming Height Abuse System 2 (no players taller than 189cm)\n");
                    system_type = 2;
                }

                else if (sixfootmasterrace == 4)
                {
                    // No stats nerfs but a perfect 4 players above 189cm, so assume System1
                    Console.WriteLine("Assuming Height Abuse System 1 (all players above 189cm have a variable stats nerf)\n");
                    system_type = 1;
                }

                else // (sixfootmasterrace > 4)
                {
                    // Nice try /wg/, but that's illegal even in System1, which we're going to assume you're using
                    // This is not the time for errors, that comes later
                    Console.WriteLine("Assuming Height Abuse System 1 (all players above 189cm have a variable stats nerf)\n");
                    system_type = 1;
                }
            }

            // So now we have some idea of what system is being used
            // It might be wrong though! But if it is then there are multiple things wrong with the save which the following checks should weed out
            if (system_type == 1)
            {
                // System1 Type Checks
                // Check for too many players in a height bracket
                if (heights.bracket_1 > constants.system1_height_bracket_1_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too many players in the " + constants.height_bracket_1 + "-" + constants.height_maximum_4cc + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_1 + " out of " + constants.system1_height_bracket_1_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_2 > constants.system1_height_bracket_2_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too many players in the " + constants.height_bracket_2 + "-" + (constants.height_bracket_1 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_2 + " out of " + constants.system1_height_bracket_2_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_3 > constants.system1_height_bracket_3_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too many players in the " + constants.height_bracket_3 + "-" + (constants.height_bracket_2 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_3 + " out of " + constants.system1_height_bracket_3_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_4 > constants.system1_height_bracket_4_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too many players in the " + constants.height_bracket_4 + "-" + (constants.height_bracket_3 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_4 + " out of " + constants.system1_height_bracket_4_limit + ")");
                    variables.errors++;
                }

                // Check for too few players in a height bracket
                if (heights.bracket_1 < constants.system1_height_bracket_1_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_1 + "-" + constants.height_maximum_4cc + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_1 + " out of " + constants.system1_height_bracket_1_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_2 < constants.system1_height_bracket_2_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_2 + "-" + (constants.height_bracket_1 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_2 + " out of " + constants.system1_height_bracket_2_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_3 < constants.system1_height_bracket_3_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_3 + "-" + (constants.height_bracket_2 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_3 + " out of " + constants.system1_height_bracket_3_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_4 < constants.system1_height_bracket_4_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_4 + "-" + (constants.height_bracket_3 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_4 + " out of " + constants.system1_height_bracket_4_limit + ")");
                    variables.errors++;
                }

                // Check total team height
                if (heights.height_total > constants.system1_height_limit_total)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has broken the total height limit of " + constants.system1_height_limit_total);
                    Console.WriteLine("\t\t (Has " + heights.height_total + " out of " + constants.system1_height_limit_total + ")");
                    variables.errors++;
                }

                // Check if all 190cm+ players have the variable stats nerf
                foreach (player line in squad.team_players)
                {
                    if (line.height >= 190)
                    {
                        if (line.is_gold_system1 == false && line.is_silver_system1 == false && line.is_regular_system1 == false && line.is_goalkeeper_system1 == false)
                        {
                            Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has not correctly nerfed " + line.name);
                            Console.WriteLine("\t\t (Is " + line.height + "cm but does not have an appropriate stats nerf)");
                            variables.errors++;
                        }
                    }
                }
            }
            else if (system_type == 2)
            {
                // System2 Type Checks
                // Check for too many players in a height bracket
                if (heights.bracket_1 > constants.system2_height_bracket_1_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too many players in the " + constants.height_bracket_1 + "-" + constants.height_maximum_4cc + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_1 + " out of " + constants.system2_height_bracket_1_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_2 > constants.system2_height_bracket_2_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too many players in the " + constants.height_bracket_2 + "-" + (constants.height_bracket_1 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_2 + " out of " + constants.system2_height_bracket_2_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_3 > constants.system2_height_bracket_3_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too many players in the " + constants.height_bracket_3 + "-" + (constants.height_bracket_2 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_3 + " out of " + constants.system2_height_bracket_3_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_4 > constants.system2_height_bracket_4_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too many players in the " + constants.height_bracket_4 + "-" + (constants.height_bracket_3 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_4 + " out of " + constants.system2_height_bracket_4_limit + ")");
                    variables.errors++;
                }

                // Check for too few players in a height bracket
                if (heights.bracket_1 < constants.system2_height_bracket_1_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_1 + "-" + constants.height_maximum_4cc + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_1 + " out of " + constants.system2_height_bracket_1_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_2 < constants.system2_height_bracket_2_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_2 + "-" + (constants.height_bracket_1 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_2 + " out of " + constants.system2_height_bracket_2_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_3 < constants.system2_height_bracket_3_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_3 + "-" + (constants.height_bracket_2 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_3 + " out of " + constants.system2_height_bracket_3_limit + ")");
                    variables.errors++;
                }

                if (heights.bracket_4 < constants.system2_height_bracket_4_limit)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_4 + "-" + (constants.height_bracket_3 - 1) + " bracket");
                    Console.WriteLine("\t\t (Has " + heights.bracket_4 + " out of " + constants.system2_height_bracket_4_limit + ")");
                    variables.errors++;
                }

                // Check total team height
                if (heights.height_total > constants.system2_height_limit_total)
                {
                    Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has broken the total height limit of " + constants.system2_height_limit_total);
                    Console.WriteLine("\t\t (Has " + heights.height_total + " out of " + constants.system2_height_limit_total + ")");
                    variables.errors++;
                }
            }

            else
            {
                // This should never trigger
                Console.WriteLine("HEIGHT ABUSE:\n" + "Cannot determine the Height Abuse System used by " + squad.team_name);
                Console.WriteLine("This should never trigger, so if it has, this team is properly f****d");
                variables.errors++;
            }

            // Regardless of what height abuse system is used, 184 and below is the same
            if (heights.bracket_5 < constants.height_bracket_5_limit)
            {
                Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_5 + "-" + (constants.height_bracket_4 - 1) + " bracket");
                Console.WriteLine("\t\t (Has " + heights.bracket_5 + " out of " + constants.height_bracket_5_limit + ")");
                variables.errors++;
            }

            if (heights.bracket_6 < constants.height_bracket_6_limit)
            {
                Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_6 + "-" + (constants.height_bracket_5 - 1) + " bracket");
                Console.WriteLine("\t\t (Has " + heights.bracket_6 + " out of " + constants.height_bracket_6_limit + ")");
                variables.errors++;
            }

            if (heights.bracket_7 < constants.height_bracket_7_limit)
            {
                Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_7 + "-" + (constants.height_bracket_6 - 1) + " bracket");
                Console.WriteLine("\t\t (Has " + heights.bracket_7 + " out of " + constants.height_bracket_7_limit + ")");
                variables.errors++;
            }

            if (heights.bracket_8 < constants.height_bracket_8_limit)
            {
                Console.WriteLine("HEIGHT ABUSE:\n" + squad.team_name + " has too few players in the " + constants.height_bracket_8 + "-" + (constants.height_bracket_7 - 1) + " bracket");
                Console.WriteLine("\t\t (Has " + heights.bracket_8 + " out of " + constants.height_bracket_8_limit + ")");
                variables.errors++;
            }
        }
예제 #7
0
        public static void check_em(team squad)
        {
            // If you've triggered an error already, just stop
            if (variables.errors == 0)
            {
                // Player-specific checks

                // Loop through every player in the player table
                foreach (player line in squad.team_players)
                {
                    Console.WriteLine("* Checking " + line.name);

                    // Check Stats and set Gold/Silver/Regular/Goalkeeper marker
                    // This MUST be done first, as subsequent checks may need to use the markers
                    // NOTE: If a player fails this, they will not have a type marker set and so will fall through type checks
                    Check_Stats.check_stats(line);

                    // Check Attacking/Defensive Prowess
                    Check_Stats.check_prowess(line);

                    // Check Form against the player type
                    Check_Form.check_form(line);

                    // Check if manlets have correctly augmented weakfoot stats
                    // Check all other player have correct weakfoot stats
                    Check_Weakfoot.check_manlet_weakfoot(line);

                    // Check if players have the correct proficiency in their registered position
                    // Check that this is the only position they have proficiency in
                    Check_Position.check_player_positions(line);

                    // Check if players have the correct Injury Tolerance
                    Check_InjuryTolerance.check_injurytolerance(line);

                    // Check if players have the right number of cards for their type
                    // Verify there is only one Captain
                    Check_Cards.check_cards(line, squad);

                    // Check other miscellaneous abuses
                    Check_Basics.check_basics(line);
                }

                // Team-wide checks

                // Check GGSS allocation
                Check_Stats.check_ggss(squad);

                // Check the position allocations
                Check_Position.check_team_positions(squad);

                // Check Height Abuse
                Height_Abuse.check_height_abuse(squad);

                // Check Captaincy
                Check_Cards.check_captaincy(squad);

                // Checking finished
                // Are there any errors?
                Console.WriteLine();

                // Print the number of errors that were detected for that team
                Console.WriteLine("Errors: " + variables.errors);

                // #bantz
                if (variables.errors != 0)
                {
                    if (squad.team_name.Equals("/mlp/"))
                    {
                        Console.WriteLine("HORSEFUCKERS OUT");
                    }
                    else if (squad.team_name.Equals("/k/"))
                    {
                        Console.WriteLine(pasta.navyseals);
                    }
                    else if (squad.team_name.Equals("/tv/"))
                    {
                        Console.WriteLine("Well congratulations, you got yourself rigged! Now what's the next step of you master plan?");
                    }
                    else
                    {
                        Console.WriteLine(squad.team_name + " manager should kill themselves");
                    }
                }
                else
                {
                    Console.WriteLine("Perfect, Blaze!");
                }

                // Check Complete
                Console.WriteLine();
                Console.WriteLine("Team check complete!");
                Console.WriteLine();
            }
        }