// Andrejs, Ċ orecs, 110, cs go spele konsole (prototips), spele cs go 2 kuru var kaut cik spelet konsole, 14-05-2026, Visual Studio 2022. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace atzimes_darbs { public class Player { // speletaji public string name; public int HP; public Player(string name, int HP) { this.name = name; this.HP = HP; } } public class Gun { // Abstrakta klase ieroci public int ammo; public string name; public int dmg; public Gun(string name, int dmg, int ammo) { this.name = name; this.dmg = dmg; this.ammo = ammo; } public static void GunAcction(Player speletaji,Gun gun) { Random rnd = new Random(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 12; j++) { int shot = rnd.Next(1, 3); if (shot == 1) { Console.WriteLine("Trapijaa!!!"); speletaji.HP -= gun.dmg; Console.WriteLine($"{speletaji.name} HP:{speletaji.HP} - {gun.dmg} = {speletaji.name} HP:{speletaji.HP}"); Console.WriteLine(); System.Threading.Thread.Sleep(500); } else { Console.WriteLine("miss!!!"); System.Threading.Thread.Sleep(500); continue; } } } } } public class Program { static void Main(string[] args) { // speletaju masivs Player[] speletaji = { new Player("player1",100), new Player("player2",100), }; // ierocu masivs Gun[] ieroci = { new Gun("Desert_eagle",53,21) ,new Gun("AK-47",35,90) ,new Gun("M4A4",33,120) ,new Gun("AWP",115,15) ,new Gun("SSG08",88,30) ,new Gun("glock_18",24,80) ,new Gun("USP-S",35,36) }; for (int i = 0; i < ieroci.Length; i++) { Console.WriteLine($"{ieroci[i]} {i}"); } ieroci[6].GunAcction(speletaji[0], Gun); Console.ReadKey(); } } }