/*
Veidoja: Sofiia Kucherenko
Grupa: 110
Darbs: RPG spēle
Izmantotais Compiler: onecompiler.com
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

class Speletajs
{
    public string vards;
    public double hp;
    public double mana;
    private double def;
    public double dmg;

    public Speletajs(string v, double h, double m, double d, double de)
    {
        vards = v;
        hp = h;
        mana = m;
        dmg = d;
        def = de;
    }

    public void CastMagic(Magija magija, Speletajs pretinieks)
    {
        if (mana >= magija.cena)
        {
            mana -= magija.cena;
            double efekt = dmg + magija.bojajums - pretinieks.def;
            if (efekt < 0) efekt = 0;
            pretinieks.hp -= efekt;
        }
    }
}

class Magija
{
    public string nosaukums;
    public double bojajums;
    public double cena;

    public Magija(string n, double b, double c)
    {
        nosaukums = n;
        bojajums = b;
        cena = c;
    }
}

class Program
{
    static void Main()
    {
        Speletajs meimei = new Speletajs("meimei", 200, 60, 20, 10);
        Speletajs viviein = new Speletajs("viviein", 189, 60, 25, 12);

        Magija dziedesana = new Magija("Dziedinošais Strauts", -50, 10);
        Magija dashstrike = new Magija("DashStrike", 50, 15);

        Console.WriteLine($"meimei: HP {meimei.hp}, Mana {meimei.mana}");
        Console.WriteLine($"viviein: HP {viviein.hp}, Mana {viviein.mana}");
    }
}