// Возвращает массив из строк - характеристики всего оружия определенного типа public string[] GetCharacteristicsOfWeapons(Weapons.WeaponsType type) { switch (type) { case Weapons.WeaponsType.Bow: return(this.Bow.GetCharacteristics()); case Weapons.WeaponsType.Sword: List <string> result = new List <string>(); foreach (var t in this.Swords) { result.AddRange(t.GetCharacteristics().ToList()); } return(result.ToArray()); case Weapons.WeaponsType.Spell: List <string> res = new List <string>(); foreach (var t in this.Spells) { res.AddRange(t.GetCharacteristics().ToList()); } return(res.ToArray()); } return(null); }
public int GetDamage(Weapons.WeaponsType type) { foreach (var weapon in Weaponses) { if (weapon.weaponsType == type) { return(weapon.damage); } } return(0); }
public float getWeapontDistanceAttack(Weapons.WeaponsType type) { foreach (var weapon in Weaponses) { if (weapon.weaponsType == type) { return(weapon.distanceToAttack); } } return(0); }
public bool isWeapontDistanceAttack(Weapons.WeaponsType type) { foreach (var weapon in Weaponses) { if (weapon.weaponsType == type) { return(weapon.isDistanceAttack); } } return(false); }
public GameObject GetMeshWeapont(Weapons.WeaponsType type) { foreach (var weapon in Weaponses) { if (weapon.weaponsType == type) { return(weapon.meshObject); } } return(null); }
public void PlayWeaponFX(Weapons.WeaponsType weaponsType) { foreach (var weapon in Weaponses) { if (weapon.weaponsType == weaponsType) { if (weapon.hasWeaponFx) { weapon.meshObject.GetComponentInChildren <WeaponFX>().Play(); } break; } } }
// Выводит изношенность определенного вида оружия private void PrintWeaponsHealth(Weapons.WeaponsType type) { if (type == Weapons.WeaponsType.Spell) { Console.WriteLine("Заклинания не изнашиваются со временем"); } if (type == Weapons.WeaponsType.Bow) { PrintHPofOneThing(this.Bow.Name, this.Bow.MaxHealth, this.Bow.CurrentHelth); } if (type == Weapons.WeaponsType.Sword) { foreach (var sword in this.Swords) { PrintHPofOneThing(sword.Name, sword.MaxHealth, sword.CurrentHelth); } } }
/// <summary> /// Нанесение атаки врагу, в зависимости от выбранного оружия увеличиваем навык владения /// </summary> /// <param name="countEnemy"> Количество противников </param> /// <param name="weapons"> Тип оружия </param> /// <param name="bow"> Лук, при наличии </param> /// <param name="spell"> Заклинание, при наличии </param> /// <param name="sword"> Меч, при наличии </param> /// <param name="nums">индексы противников, которых надо атаковать</param> /// <returns>Массив с уроном для противников</returns> public int[] Attack(int countEnemy, Weapons.WeaponsType weapons, Bow bow = null, Spell spell = null, Sword sword = null, params int[] nums) { switch (weapons) { case Weapons.WeaponsType.Bow: this.BowSkill += 0.0001f; return(SimpleBowAttack(countEnemy, bow)); case Weapons.WeaponsType.Spell: this.MagicSkill += 0.0001f; return(SimpleSpellAttack(countEnemy, spell, nums)); case Weapons.WeaponsType.Sword: this.SwordSkill += 0.0001f; return(SimpleSwordAttack(countEnemy, sword, nums)); } return(new int[0]); }