コード例 #1
0
        public void TakeDamage(int damage)
        {
            if (!isServer || IsDead)
            {
                return;
            }

            int formerHealth = CurrentHealth;

            damage -= Armor.GetValue();
            damage  = Math.Max(0, damage);

            CurrentHealth -= damage;

            Debug.Log(name + " took " + damage + " damage. Former health: " + formerHealth);

            Debug.Log("Invoking callbacks...");

            if (BloodManager != null)
            {
                BloodManager.Play();
            }

            if (SoundManagerZombie != null)
            {
                SoundManagerZombie.play_hitting();
            }

            if (CurrentHealth <= 0)
            {
                Die();
            }
        }
コード例 #2
0
 public float GetCarriableWeight()
 {
     return((float)(0.01 * Strength.GetValue() * inventory.maximumWeight));
 }