Пример #1
0
        // You really shouldn't call this directly (TODO Change that when ExplosionHelper gets changed).
        public void Explode(EntityUid uid, ExplosiveComponent component)
        {
            if (component.Exploding)
            {
                return;
            }

            component.Exploding = true;
            component.Owner.SpawnExplosion(component.DevastationRange, component.HeavyImpactRange, component.LightImpactRange, component.FlashRange);
            EntityManager.QueueDeleteEntity(uid);
        }
Пример #2
0
        // You really shouldn't call this directly (TODO Change that when ExplosionHelper gets changed).
        public void Explode(EntityUid uid, ExplosiveComponent component, EntityUid?user = null)
        {
            if (component.Exploding)
            {
                return;
            }

            component.Exploding = true;
            _explosions.SpawnExplosion(uid,
                                       component.DevastationRange,
                                       component.HeavyImpactRange,
                                       component.LightImpactRange,
                                       component.FlashRange,
                                       user);
            EntityManager.QueueDeleteEntity(uid);
        }
Пример #3
0
        public static Entity CreateBomb(Vector2 location, Entity user)
        {
            var entity = new Entity();

            var rangeModifier = (RangeModifierComponent)user.GetComponent(typeof(RangeModifierComponent));

            var transformComponent = new TransformComponent(location, new Vector2(32, 32));
            var skinComponent      = new SkinComponent("BombSprite");
            var explosiveComponent = new ExplosiveComponent(3f, rangeModifier.Amount, user.ID);

            entity.AddComponent(transformComponent);
            entity.AddComponent(skinComponent);
            entity.AddComponent(explosiveComponent);

            return(entity);
        }
Пример #4
0
 private void HandleDestruction(EntityUid uid, ExplosiveComponent component, DestructionEventArgs args)
 {
     Explode(uid, component);
 }