public void GetItem(AttackProps chosen) { for (int i = 0; i < list.Length; i++) { if (list[i].Equals(chosen)) { itemCount[i]++; } } }
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); } } }
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); }