private void EquipWeapon(WeaponPattern weapon) { if (currentWeapon != null) { inventory.Add(currentWeapon); } currentWeapon = weapon; inventory.Remove(weapon); }
public static WeaponPattern GetWeaponPattern(WeaponType weaponType) { WeaponPattern weaponPattern = null; switch (weaponType) { case WeaponType.Melee: weaponPattern = new MeleePattern(); break; case WeaponType.SingleShot: weaponPattern = new SingleShotPattern(); break; case WeaponType.MultipleShot: weaponPattern = new MultipleShotPattern(); break; default: throw new ArgumentOutOfRangeException(nameof(weaponType), weaponType, null); } return(weaponPattern); }
private void SetWeaponInfo(WeaponPattern item, PlayerController player) { firstTextEq.text = firstText.text = "Dps:"; // item info float percent = (item.damage * (item.damageFactor / 100f)); float minDps = (item.damage - percent) / item.attackSpeed; float maxDps = (item.damage + percent) / item.attackSpeed; firstAmount.text = Mathf.Round(minDps).ToString() + " - " + Mathf.Round(maxDps).ToString(); // equipped info if (player.data.equipment.currentWeapon != null) { eqWindow.gameObject.SetActive(true); percent = (player.data.equipment.currentWeapon.damage * (player.data.equipment.currentWeapon.damageFactor / 100f)); minDps = (player.data.equipment.currentWeapon.damage - percent) / player.data.equipment.currentWeapon.attackSpeed; maxDps = (player.data.equipment.currentWeapon.damage + percent) / player.data.equipment.currentWeapon.attackSpeed; firstAmountEq.text = Mathf.Round(minDps).ToString() + " - " + Mathf.Round(maxDps).ToString(); } else { eqWindow.gameObject.SetActive(false); } }
private void SetWeaponPattern(WeaponPattern weaponPattern) { _weaponPattern = weaponPattern; }