using System;

namespace RPGSpele
{
    public class Prasme
    {
        public string SkillName { get; private set; }
        public int BaseDamage { get; private set; }
        public int EnergyCost { get; private set; }
        public string EffectType { get; private set; }
        
        public Prasme(string name, int damage, int cost, string effect)
        {
            SkillName = name;
            BaseDamage = damage;
            EnergyCost = cost;
            EffectType = effect;
        }
    }

    public class Cinitajs
    {
        public string Name { get; private set; }
        public int Health { get; set; }
        public int Energy { get; set; }
        public int Armor { get; private set; }
        public int AttackPower { get; private set; }

        public Cinitajs(string name, int health, int energy, int armor, int atk)
        {
            Name = name;
            Health = health;
            Energy = energy;
            Armor = armor;
            AttackPower = atk;
        }

        public void CastMagic(Cinitajs target, Prasme skill)
        {
            Console.WriteLine($"\n{this.Name} mēģina izmantot {skill.SkillName} pret {target.Name}...");

            if (this.Energy >= skill.EnergyCost)
            {
                int totalDamage = (skill.BaseDamage + this.AttackPower) - target.Armor;
                
                if (totalDamage < 0) totalDamage = 0;

                target.Health -= totalDamage;
                this.Energy -= skill.EnergyCost;

                Console.WriteLine($"Uzbrukums veiksmīgs! Nodarīti {totalDamage} bojājumi.");
                Console.WriteLine($"{target.Name} atlikušie HP: {target.Health}. {this.Name} MP: {this.Energy}");

                SpecialEffect(this, target, skill);
            }
            else
            {
                Console.WriteLine("Kļūda: Nepietiek enerģijas!");
            }
        }

        private void SpecialEffect(Cinitajs caster, Cinitajs enemy, Prasme skill)
        {
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            Cinitajs v1 = new Cinitajs("Zibens Šamanis", 120, 80, 5, 15);
            Cinitajs v2 = new Cinitajs("Akmens Sargs", 200, 40, 20, 5);

            Prasme s1 = new Prasme("Zibens Spēriens", 40, 25, "Shock");
            Prasme s2 = new Prasme("Zemes Grūdiens", 25, 15, "Stun");

            Console.WriteLine("--- RPG Cīņas Simulācija Sākas ---");
            Console.WriteLine($"{v1.Name} pret {v2.Name}");

            v1.CastMagic(v2, s1);
            v2.CastMagic(v1, s2);
            
            v1.CastMagic(v2, s1);

            Console.WriteLine("\n--- Cīņas Beigas ---");
            Console.ReadLine();
        }
    }
}