using System;
using System.Collections.Generic;

class HelloWorld {
    // Darba autori: Eriks Bruveris, Rudolfs Cabuts.
    
    static void Main() {
        int izvele = 0;
        do {
            Console.WriteLine("╔══════════════════╗");
            Console.WriteLine("║      MAIN MENU   ║");
            Console.WriteLine("╠══════════════════╣");
            Console.WriteLine("║ 1 - Begin        ║");
            Console.WriteLine("║ 2 - Exit         ║");
            Console.WriteLine("╚══════════════════╝");
            Console.Write("Izvēle: ");
            
            // Droša skaitļu ievade
            if (!int.TryParse(Console.ReadLine(), out izvele)) continue;

            switch (izvele) {
                case 1: Game(); break;
                case 2: 
                    Console.WriteLine("╔══════════════════╗");
                    Console.WriteLine("║     GAME END     ║");
                    Console.WriteLine("╚══════════════════╝");
                    break;
            }
        } while (izvele != 2);
    }

    static void Game() {
        // Mainīgie, kuros glabāsim izvēlētos varoņus
        Characters p1 = null;
        Characters p2 = null;

        // Player 1 izvēle
        p1 = CharacterSelection(1);
        // Player 2 izvēle
        p2 = CharacterSelection(2);
        

        Console.WriteLine($"\n--- THE FIGHT BEGINS: {p1.NAME} VS {p2.NAME} ---");
        Console.WriteLine($"{p1.NAME} stats: HP:{p1.HP}, ATK:{p1.ATK}, MP:{p1.MP}");
        Console.WriteLine($"{p2.NAME} stats: HP:{p2.HP}, ATK:{p2.ATK}, MP:{p2.MP}");
        Console.WriteLine("------------------------------------------\n");
        
        if(p1.ATKSPD>p2.ATKSPD) Player1Move();
        else Player2Move();
        
        static void Player1Move(){
            Console.WriteLine("Player 1 is attacking.\n Pick your magic:");
            
        }
        
    }

    // Funkcija, kas apstrādā varoņa izvēli un izmanto konstruktoru
    static Characters CharacterSelection(int playerNum) {
        while (true) {
            Console.WriteLine($"\n╔══════════════════╗");
            Console.WriteLine($"║     Player {playerNum}     ║");
            Console.WriteLine($"║Choose a character║");
            Console.WriteLine($"╠══════════════════╣");
            Console.WriteLine($"║ 1 - Musclehead   ║");
            Console.WriteLine($"║ 2 - Weasel       ║");
            Console.WriteLine($"╚══════════════════╝");
            Console.Write("Choice: ");
            
            string choice = Console.ReadLine();

            // basically izsauc konstruktoru ar statiem
            if (choice == "1") {
                return new Characters("Musclehead", 11, 240, 8, 1, 600, 13, 100);
            } else if (choice == "2") {
                return new Characters("Weasel", 6, 200, 12, 0, 750, 15, 140);
            }
            
            Console.WriteLine("Choose between the given characters, idiot");
        }
    }
}

class Characters {
    public string NAME;
    public int ATK;
    public double HP;
    public int SPD;
    public int DEF;
    public int MP;
    public int ATKSPD;
    public int INTEL;

    // KONSTRUKTORS - piešķir visas vērtības vienā piegājienā
    public Characters(string name, int atk, double hp, int spd, int def, int mp, int atkSpd, int intel) {
        NAME = name;
        ATK = atk;
        HP = hp;
        SPD = spd;
        DEF = def;
        MP = mp;
        ATKSPD = atkSpd;
        INTEL = intel;
        
        Console.WriteLine($"{NAME} is ready to fight");
    }
}

class Magic {
    public string NAME;
    public int DMG;
    public int RADIUS;
    public int INTREQ;
    public int MPCOST;
    public double CASTTIME;

    // Konstruktors maģijai
    public Magic(string name, int dmg, int radius, int intReq, int mpCost, double castTime) {
        NAME = name;
        DMG = dmg;
        RADIUS = radius;
        INTREQ = intReq;
        MPCOST = mpCost;
        CASTTIME = castTime;
    }
}