Ejemplo n.º 1
0
 public void ClearPedistool()
 {
     currentItemType   = ItemType.Empty;
     currentArmourItem = null;
     currentWeaponItem = null;
     SetUIElements();
 }
Ejemplo n.º 2
0
 public void ClearPedistool()
 {
     currentItemType       = ItemType.Empty;
     currentArmourItem     = null;
     currentWeaponItem     = null;
     currentConsumableItem = null;
     SetUIElements();
     this.gameObject.GetComponent <BoxCollider2D>().enabled = false;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public void PurchaseNewWeapon(WeaponsSO newWeapon)
 {
     if (currentGold < newWeapon.cost)
     {
         return;
     }
     else
     {
         currentGold  -= newWeapon.cost;
         currentWeapon = newWeapon;
         UpdateWeaponStats();
     }
 }
Ejemplo n.º 5
0
    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;
        }
    }
Ejemplo n.º 6
0
 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);
 }