Exemplo n.º 1
0
 public void OnDamageThresholdPassed(object obj, DamageThresholdPassedEventArgs e)
 {
     if (e.Passed && e.DamageThreshold == Threshold && broken == false)
     {
         broken = true;
         _actSystem.HandleBreakage(Owner);
     }
 }
Exemplo n.º 2
0
 protected override void DestructionBehavior()
 {
     _actSystem.HandleBreakage(Owner);
     if (!Owner.Deleted && DestroySound != string.Empty)
     {
         var pos = Owner.Transform.Coordinates;
         EntitySystem.Get<AudioSystem>().PlayAtCoords(DestroySound, pos);
     }
 }
        protected override async void DestructionBehavior()
        {
            if (Owner.Deleted || !Owner.TryGetComponent(out ConstructionComponent? construction) || string.IsNullOrEmpty(Node))
            {
                return;
            }

            _actSystem.HandleBreakage(Owner);

            await construction.ChangeNode(Node);
        }
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()
 {
     _actSystem.HandleBreakage(Owner);
 }