public void ClearPedistool() { currentItemType = ItemType.Empty; currentArmourItem = null; currentWeaponItem = null; SetUIElements(); }
public void ClearPedistool() { currentItemType = ItemType.Empty; currentArmourItem = null; currentWeaponItem = null; currentConsumableItem = null; SetUIElements(); this.gameObject.GetComponent <BoxCollider2D>().enabled = false; }
public PlayerClass(float healthInput, float resistanceInput, float lightDamageInput, float heavyDamageInput, float attackRangeInput, float movementSpeedInput, int goldInput, WeaponsSO weaponInput, ArmourSO armourInput) { currentHealth = healthInput; currentLightDamage = lightDamageInput; currentHeavyDamage = heavyDamageInput; currentAttackRange = attackRangeInput; currentMovementSpeed = movementSpeedInput; currentGold = goldInput; currentWeapon = weaponInput; currentArmour = armourInput; }
public void PurchaseNewWeapon(WeaponsSO newWeapon) { if (currentGold < newWeapon.cost) { return; } else { currentGold -= newWeapon.cost; currentWeapon = newWeapon; UpdateWeaponStats(); } }
private void ChooseRandomItem() { switch (currentItemType) { case ItemType.Weapon: int chosenWeaponIndex = Random.Range(0, itemManager.allWeaponsArray.Length); currentWeaponItem = itemManager.allWeaponsArray[chosenWeaponIndex]; break; case ItemType.Armour: int chosenArmourIndex = Random.Range(0, itemManager.allArmourArray.Length); currentArmourItem = itemManager.allArmourArray[chosenArmourIndex]; break; default: break; } }
public bool CheckWeaponType(WeaponsSO weapon) { foreach (var item in ValidWeapons) { if (item == WeaponsSO.weaponType.melee) { if (weapon == null) { return(true); } } if (weapon?._weaponType == item) { return(true); } } return(false); }