Exemplo n.º 1
0
 /// <inheritdoc />
 void IOnDamageBehavior.OnDamageThresholdPassed(object obj, DamageThresholdPassedEventArgs e)
 {
     if (e.Passed && e.DamageThreshold == Threshold && destroyed == false)
     {
         destroyed = true;
         _actSystem.HandleDestruction(Owner, true);
     }
 }
Exemplo 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);
         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);
         }
     }
 }
Exemplo n.º 4
0
        private void DoActs(IEntity owner, ActSystem acts)
        {
            if ((Acts & (int)ThresholdActs.Breakage) != 0)
            {
                acts.HandleBreakage(owner);
            }

            if ((Acts & (int)ThresholdActs.Destruction) != 0)
            {
                acts.HandleDestruction(owner);
            }
        }
Exemplo n.º 5
0
 protected override void DestructionBehavior()
 {
     if (!Owner.Deleted)
     {
         var pos = Owner.Transform.GridPosition;
         ActSystem.HandleDestruction(Owner,
                                     true); //This will call IDestroyAct.OnDestroy on this component (and all other components on this entity)
         if (DestroySound != string.Empty)
         {
             EntitySystem.Get <AudioSystem>().PlayAtCoords(DestroySound, pos);
         }
     }
 }