diff --git a/Content.Client/GameObjects/Components/RadiatingLightComponent.cs b/Content.Client/GameObjects/Components/RadiatingLightComponent.cs new file mode 100644 index 0000000000..76b57f2fb4 --- /dev/null +++ b/Content.Client/GameObjects/Components/RadiatingLightComponent.cs @@ -0,0 +1,46 @@ +using System; +using Robust.Client.Animations; +using Robust.Client.GameObjects; +using Robust.Client.GameObjects.Components.Animations; +using Robust.Shared.Animations; +using Robust.Shared.GameObjects; +using Robust.Shared.Maths; + +namespace Content.Client.GameObjects.Components +{ + [RegisterComponent] + public class RadiatingLightComponent : Component + { + public override string Name => "RadiatingLight"; + + protected override void Startup() + { + base.Startup(); + + var animation = new Animation + { + Length = TimeSpan.FromSeconds(4), + AnimationTracks = + { + new AnimationTrackComponentProperty + { + ComponentType = typeof(PointLightComponent), + InterpolationMode = AnimationInterpolationMode.Linear, + Property = nameof(PointLightComponent.Radius), + KeyFrames = + { + new AnimationTrackProperty.KeyFrame(3.0f, 0), + new AnimationTrackProperty.KeyFrame(2.0f, 1), + new AnimationTrackProperty.KeyFrame(3.0f, 2) + } + } + } + }; + + var playerComponent = Owner.EnsureComponent(); + playerComponent.Play(animation, "emergency"); + + playerComponent.AnimationCompleted += s => playerComponent.Play(animation, s); + } + } +} diff --git a/Resources/Prototypes/Entities/Objects/Tools/lantern.yml b/Resources/Prototypes/Entities/Objects/Tools/lantern.yml new file mode 100644 index 0000000000..e1346cac53 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Tools/lantern.yml @@ -0,0 +1,27 @@ +- type: entity + name: lantern + parent: BaseItem + id: lantern + description: The holy light guides the way + components: + - type: HandheldLight + - type: Sprite + sprite: Objects/Tools/lantern.rsi + layers: + - state: lantern + - state: lantern-on + shader: unshaded + visible: false + - type: Icon + sprite: Objects/Tools/lantern.rsi + state: lantern + - type: Item + sprite: Objects/Tools/lantern.rsi + HeldPrefix: off + - type: PointLight + enabled: false + radius: 3 + energy: 2.5 + color: "#FFC458" + - type: RadiatingLight + - type: LoopingSound diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/lantern-on.png b/Resources/Textures/Objects/Tools/lantern.rsi/lantern-on.png new file mode 100644 index 0000000000..7573695619 Binary files /dev/null and b/Resources/Textures/Objects/Tools/lantern.rsi/lantern-on.png differ diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/lantern.png b/Resources/Textures/Objects/Tools/lantern.rsi/lantern.png new file mode 100644 index 0000000000..d9f5bd0bbb Binary files /dev/null and b/Resources/Textures/Objects/Tools/lantern.rsi/lantern.png differ diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/meta.json b/Resources/Textures/Objects/Tools/lantern.rsi/meta.json new file mode 100644 index 0000000000..2205be15d5 --- /dev/null +++ b/Resources/Textures/Objects/Tools/lantern.rsi/meta.json @@ -0,0 +1,101 @@ +{ + "version": 1, + "license": "CC BY-SA 3.0", + "copyright": "Taken from https://github.com/tgstation/tgstation at commit 9bebd81ae0b0a7f952b59886a765c681205de31f", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "lantern", + "directions": 1, + "delays": [ + [ + 1.0 + ] + ] + }, + { + "name": "lantern-on", + "directions": 1, + "delays": [ + [ + 1.0 + ] + ] + }, + { + "name": "off-inhand-left", + "directions": 4, + "delays": [ + [ + 1 + ], + [ + 1 + ], + [ + 1 + ], + [ + 1 + ] + ] + }, + { + "name": "off-inhand-right", + "directions": 4, + "delays": [ + [ + 1 + ], + [ + 1 + ], + [ + 1 + ], + [ + 1 + ] + ] + }, + { + "name": "on-inhand-left", + "directions": 4, + "delays": [ + [ + 1 + ], + [ + 1 + ], + [ + 1 + ], + [ + 1 + ] + ] + }, + { + "name": "on-inhand-right", + "directions": 4, + "delays": [ + [ + 1 + ], + [ + 1 + ], + [ + 1 + ], + [ + 1 + ] + ] + } + ] +} diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-left.png b/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-left.png new file mode 100644 index 0000000000..d38b5e8c64 Binary files /dev/null and b/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-left.png differ diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-right.png b/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-right.png new file mode 100644 index 0000000000..de8ce0ad50 Binary files /dev/null and b/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-right.png differ diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-left.png b/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-left.png new file mode 100644 index 0000000000..d38b5e8c64 Binary files /dev/null and b/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-left.png differ diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-right.png b/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-right.png new file mode 100644 index 0000000000..de8ce0ad50 Binary files /dev/null and b/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-right.png differ