Example #1
0
 public void GetItem(AttackProps chosen)
 {
     for (int i = 0; i < list.Length; i++)
     {
         if (list[i].Equals(chosen))
         {
             itemCount[i]++;
         }
     }
 }
Example #2
0
    public void OnTriggerEnter(Collider other)
    {
        AttackProps attackProps = other.gameObject.GetComponent <AttackProps>();

        Debug.Log("hit");
        if (attackProps)
        {
            health -= CalculateDamage(attackProps);
            if (!isStunned && attackProps.isStunning)
            {
                OnStunStart();
                attackProps.Proliferate(this);
            }
        }
    }
Example #3
0
    float CalculateDamage(AttackProps attackType)
    {
        float elementModifier = (attackType.element == element) ? 0.5f : 1f;
        float armorModifier   = 1f;

        if (heavy)
        {
            if (attackType.isPiercing)
            {
                armorModifier = 1f;
            }
            else
            {
                armorModifier = .5f;
            }
        }
        return(attackType.baseDamage * elementModifier * armorModifier);
    }