/
katlavr
/
AutoBattler
Обзор
Документация
Войти
/
katlavr
/
AutoBattler
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Structs.cs
86 строк
3 KB
Екатерина
upload files
08 сен 2025, 16:21
08 сен 2025, 16:21
647f3ba
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LavrGame { struct Character { public int strenght; public int agility; public int stamina; public int weapon; //id оружия public int robLvl; //уровень класса "Разбойник" public int warLvl; //уровень класса "Воин" public int barLvl; //уровень класса "Варвар" public int health; public Character(int classId) { Random rand = new Random(); strenght = rand.Next(1, 4); agility = rand.Next(1, 4); stamina = rand.Next(1, 4); weapon = classId - 1; robLvl = 0; warLvl = 0; barLvl = 0; switch (classId) { case 1: robLvl++; break; case 2: warLvl++; break; case 3: barLvl++; break; } health = stamina + robLvl * 4 + warLvl * 5 + barLvl * 6; } } struct Weapon { public string name; public int damage; public int typeOfDamage; //1 - рубящий, 2 - дробящий, 3 - колющий public Weapon(string name, int damage, int typeOfDamage) { this.name = name; this.damage = damage; this.typeOfDamage = typeOfDamage; } } struct Enemy { public string name; public int health; public int damageOfWeapon; public int strenght; public int agility; public int stamina; public int ability; public int rewardWeapon; public Enemy(string name, int health, int damage, int str, int agl, int stm, int abil, int reward) { this.name = name; this.health = health; this.damageOfWeapon = damage; this.strenght = str; this.agility = agl; this.stamina = stm; this.ability = abil; this.rewardWeapon = reward; } } struct Ability { public int type; // 1 - прибавка к характеристикам, 2 - пассивная способность public int id; // id характеристики или способности public int num; // количество очков, прибавляемых выбранной характеристике или количество ходов, которое действует способность public string description; public Ability(int type, int id, int num, string description) { this.type = type; this.id = id; this.num = num; this.description = description; } } }