private void DisableThrusting(AppearanceComponent component, SpriteComponent spriteComponent)
        {
            if (spriteComponent.LayerMapTryGet(ThrusterVisualLayers.Thrusting, out _))
            {
                spriteComponent.LayerSetVisible(ThrusterVisualLayers.Thrusting, false);
            }

            if (spriteComponent.LayerMapTryGet(ThrusterVisualLayers.ThrustingUnshaded, out _))
            {
                spriteComponent.LayerSetVisible(ThrusterVisualLayers.ThrustingUnshaded, false);
            }
        }
Exemple #2
0
    private void TurnOff(
        AppearanceComponent component,
        EnergySwordStatus status,
        IEntityManager entManager,
        SpriteComponent?spriteComponent = null)
    {
        if (entManager.TryGetComponent(component.Owner, out SharedItemComponent? itemComponent))
        {
            itemComponent.EquippedPrefix = "off";
        }

        if ((status & EnergySwordStatus.Hacked) != 0x0)
        {
            spriteComponent?.LayerSetState(0, "e_sword");
        }
        else
        {
            spriteComponent?.LayerSetVisible(1, false);
        }

        if (entManager.TryGetComponent(component.Owner, out PointLightComponent? pointLightComponent))
        {
            pointLightComponent.Enabled = false;
        }
    }
 private void SetState(bool on)
 {
     _spriteComponent.LayerSetVisible(1, on);
     _pointLight.Enabled = on;
     if (_clothingComponent != null)
     {
         _clothingComponent.ClothingEquippedPrefix = on ? "On" : "Off";
     }
 }
Exemple #4
0
 private void SetState(LightState newState)
 {
     _spriteComponent.LayerSetVisible(1, newState == LightState.On);
     _pointLight.State = newState;
     if (_clothingComponent != null)
     {
         _clothingComponent.ClothingEquippedPrefix = newState.ToString();
     }
 }
Exemple #5
0
 /// <summary>
 /// Deactivates welding tool if active, activates welding tool if possible
 /// </summary>
 /// <returns></returns>
 public bool ToggleStatus()
 {
     if (Activated)
     {
         Activated = false;
         // Layer 1 is the flame.
         spriteComponent.LayerSetVisible(1, false);
         return(true);
     }
     else if (CanActivate())
     {
         Activated = true;
         spriteComponent.LayerSetVisible(1, true);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #6
0
    private void TurnOn(
        AppearanceComponent component,
        EnergySwordStatus status,
        Color color,
        IEntityManager entManager,
        SpriteComponent?spriteComponent = null)
    {
        if ((status & EnergySwordStatus.Hacked) != 0x0)
        {
            if (entManager.TryGetComponent(component.Owner, out SharedItemComponent? itemComponent))
            {
                itemComponent.EquippedPrefix = "on-rainbow";
            }

            //todo: figure out how to use the RGBLightControllerSystem to phase out the rainbow sprite AND add lights.
            spriteComponent?.LayerSetColor(1, Color.White);
            spriteComponent?.LayerSetVisible(1, false);
            spriteComponent?.LayerSetState(0, "e_sword_rainbow_on");
        }
        else
        {
            if (entManager.TryGetComponent(component.Owner, out SharedItemComponent? itemComponent))
            {
                itemComponent.EquippedPrefix = "on";
                itemComponent.Color          = color;
            }

            spriteComponent?.LayerSetColor(1, color);
            spriteComponent?.LayerSetVisible(1, true);

            if (entManager.TryGetComponent(component.Owner, out PointLightComponent? pointLightComponent))
            {
                pointLightComponent.Color   = color;
                pointLightComponent.Enabled = true;
            }
        }
    }
        public void ToggleMarkingVisibility(EntityUid uid, SpriteComponent body, HumanoidVisualLayers layer, bool toggle)
        {
            if (!EntityManager.TryGetComponent(uid, out MarkingsComponent? markings))
            {
                return;
            }

            if (markings.ActiveMarkings.TryGetValue(layer, out List <Marking>?layerMarkings))
            {
                foreach (Marking activeMarking in layerMarkings)
                {
                    body.LayerSetVisible(activeMarking.MarkingId, toggle);
                }
            }
        }
Exemple #8
0
    private void SetOnFire(SpriteComponent sprite, AppearanceComponent appearance, FireVisualsComponent component, bool onFire, float fireStacks)
    {
        if (component.Sprite != null)
        {
            sprite.LayerSetRSI(FireVisualLayers.Fire, component.Sprite);
        }

        sprite.LayerSetVisible(FireVisualLayers.Fire, onFire);

        if (fireStacks > component.FireStackAlternateState && !string.IsNullOrEmpty(component.AlternateState))
        {
            sprite.LayerSetState(FireVisualLayers.Fire, component.AlternateState);
        }
        else
        {
            sprite.LayerSetState(FireVisualLayers.Fire, component.NormalState);
        }
    }
        protected override void OnRemove()
        {
            base.OnRemove();

            _spriteComponent?.LayerSetVisible(HumanoidVisualLayers.Handcuffs, false);
        }
Exemple #10
0
 private void MakeBroken()
 {
     _status = GravityGeneratorStatus.Broken;
     _sprite.LayerSetState(0, "broken");
     _sprite.LayerSetVisible(1, false);
 }