using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RPGspele_st.db
{
    internal class Player
    {
        public string nameplayer;
        public int MPplayer;
        public int HPplayer;
        public int DMGplayer;
        public float WSplayer; // WS-Walkspeed

        public Player(string nicknameplayer,int manapl,int healthpl, int damagepl, float walkspeedpl)
        {
            //pl - player
            nameplayer = nicknameplayer;
            MPplayer = manapl;
            HPplayer = healthpl;
            DMGplayer = damagepl;
            WSplayer = walkspeedpl;
        }
        public static void Main(string[] args)
        {
            // speletaju parametru piešķiršana
            Player player1 = new Player ("kokorng",150,150,75,0.5f);
            Player player2 = new Player("Miguzins", 200, 100, 50, 1.5f);

            // magiju parametru piešķiršana
            Magic magic1 = new Magic("toxicsplash", 25, 3f, 12.5f, 36);
            Magic magic2 = new Magic("lightingstrike", 37, 4.5f, 15f, 50);

            speletajauzbrukums(player1, player2, magic1);
            Console.WriteLine("Player2 HP: "+player2.HPplayer+" Player1 mana:"+ player1.MPplayer);

            speletaja2uzbrukums(player1, player2, magic2 );
            Console.WriteLine("Player1 HP: " + player1.HPplayer + " Player2 mana:" + player2.MPplayer);
        }

        // 1.metode   1.speletaja uzbrukums uz otru speletaju
        static void speletajauzbrukums(Player player1,Player player2, Magic magic1)
        {
            if (player1.MPplayer >= magic1.magicCost)
            {
                player2.HPplayer = player2.HPplayer - magic1.magicDMG;
                player1.MPplayer = player1.MPplayer - magic1.magicCost;
            }
        }

        // 2.metode 2.speletaja uzbrukums uz pirmo speletaju
        static void speletaja2uzbrukums(Player player1,Player player2, Magic magic2)
        {
            if (player2.MPplayer >= magic2.magicCost)
            {
                player1.HPplayer = player1.HPplayer - magic2.magicDMG;
                player1.MPplayer = player1.MPplayer - magic2.magicCost;
            }
        }

        static void SpecialEffect(Player player1, Player player2, Magic magic1, Magic magic2)
        {

        }
    }
    internal class Magic
    {
        public string magicname;
        public int magicDMG;
        public float magicCD;
        public float magicR;
        public int magicCost;

        public Magic(string magicname, int magicDMG, float magicCD, float magicR, int magicCost)
        {
            this.magicname = magicname;
            this.magicDMG = magicDMG;
            this.magicCD = magicCD;
            this.magicR = magicR;
            this.magicCost = magicCost;
        }
    }
}