Ejemplo n.º 1
0
 public void OnDamageThresholdPassed(object obj, DamageThresholdPassedEventArgs e)
 {
     if (e.Passed && e.DamageThreshold == Threshold && broken == false)
     {
         broken = true;
         _actSystem.HandleBreakage(Owner);
     }
 }
Ejemplo n.º 2
0
 /// <inheritdoc />
 void IOnDamageBehavior.OnDamageThresholdPassed(object obj, DamageThresholdPassedEventArgs e)
 {
     if (e.Passed && e.DamageThreshold == Threshold && destroyed == false)
     {
         destroyed = true;
         _actSystem.HandleDestruction(Owner, true);
     }
 }
 /// <inheritdoc />
 void IOnDamageBehavior.OnDamageThresholdPassed(object obj, DamageThresholdPassedEventArgs e)
 {
     if (e.Passed && e.DamageThreshold == Threshold && destroyed == false)
     {
         destroyed = true;
         var wreck = Owner.EntityManager.SpawnEntity(spawnOnDestroy);
         wreck.Transform.GridPosition = Owner.Transform.GridPosition;
         Owner.EntityManager.DeleteEntity(Owner);
     }
 }
Ejemplo n.º 4
0
 /// <inheritdoc />
 void IOnDamageBehavior.OnDamageThresholdPassed(object obj, DamageThresholdPassedEventArgs e)
 {
     if (e.Passed && e.DamageThreshold == Threshold && destroyed == false)
     {
         destroyed = true;
         _actSystem.HandleDestruction(Owner, true);
         if (destroySound != string.Empty)
         {
             _entitySystemManager.GetEntitySystem <AudioSystem>().Play(destroySound, Owner);
         }
     }
 }
 /// <inheritdoc />
 void IOnDamageBehavior.OnDamageThresholdPassed(object obj, DamageThresholdPassedEventArgs e)
 {
     if (e.Passed && e.DamageThreshold == Threshold && destroyed == false)
     {
         destroyed = true;
         var pos = Owner.Transform.GridPosition;
         _actSystem.HandleDestruction(Owner, true);
         if (destroySound != string.Empty)
         {
             EntitySystem.Get <AudioSystem>().Play(destroySound, pos);
         }
     }
 }
Ejemplo n.º 6
0
        private void DeathHandle(object sender, DamageThresholdPassedEventArgs eventArgs)
        {
            if (eventArgs.DamageThreshold.ThresholdType == ThresholdType.Death)
            {
                _isDead = true;
            }

            // TODO: If we get healed - double-check what it should be
            if (eventArgs.DamageThreshold.ThresholdType == ThresholdType.None)
            {
                _isDead = false;
            }
        }
Ejemplo n.º 7
0
        private void DamageThresholdHandle(object sender, DamageThresholdPassedEventArgs eventArgs)
        {
            if (!SelfEntity.TryGetComponent(out SpeciesComponent speciesComponent))
            {
                return;
            }

            if (speciesComponent.CurrentDamageState is DeadState)
            {
                _isDead = true;
            }
            else
            {
                _isDead = false;
            }
        }