예제 #1
0
        public override void ReceiveAttack(TowerType damageType, float rawDamage,
                                           float typeInteraction = 1.0f)
        {
            if (!IsActive)
            {
                return;
            }
            UpdateDamageState(damageType);
            SpawnHitSparks(damageType);
            var   interactionEffect = State.GetVulnerabilityValue(damageType);
            float resistance        = State.Enfeeble
                                ? GetStatValue("Resistance") * 0.5f : GetStatValue("Resistance");
            var damage = CalculateDamage(rawDamage, resistance, interactionEffect * typeInteraction);

            AdjustStat(new StatAdjustment("Hp", "", -damage));
            if (HealthBar != null)
            {
                RecalculateHitpointBar();
            }
            if (GetStatValue("Hp") <= 0.0f)
            {
                CreepDyingSoundSelector.PlayDestroyedSound(Type);
                Die();
            }
        }
 public void PlayClothCreepDestroyedSound(CreepType type)
 {
     CreepDyingSoundSelector.PlayDestroyedSound(type);
 }