This commit is contained in:
Swept
2021-03-01 20:54:06 +00:00
committed by GitHub
parent 1217eb9402
commit 25e3cf667d
8 changed files with 54 additions and 53 deletions

View File

@@ -43,14 +43,14 @@ namespace Content.Server.GameObjects.Components.Cargo
if (args.Powered && _currentState == CargoTelepadState.Unpowered) {
_currentState = CargoTelepadState.Idle;
if(Owner.TryGetComponent<SpriteComponent>(out var spriteComponent))
spriteComponent.LayerSetState(0, "pad-idle");
spriteComponent.LayerSetState(0, "idle");
TeleportLoop();
}
else if (!args.Powered)
{
_currentState = CargoTelepadState.Unpowered;
if (Owner.TryGetComponent<SpriteComponent>(out var spriteComponent))
spriteComponent.LayerSetState(0, "pad-offline");
spriteComponent.LayerSetState(0, "offline");
}
}
private void TeleportLoop()
@@ -59,14 +59,14 @@ namespace Content.Server.GameObjects.Components.Cargo
{
_currentState = CargoTelepadState.Charging;
if (Owner.TryGetComponent<SpriteComponent>(out var spriteComponent))
spriteComponent.LayerSetState(0, "pad-idle");
spriteComponent.LayerSetState(0, "idle");
Owner.SpawnTimer((int) (TeleportDelay * 1000), () =>
{
if (!Deleted && !Owner.Deleted && _currentState == CargoTelepadState.Charging && _teleportQueue.Count > 0)
{
_currentState = CargoTelepadState.Teleporting;
if (Owner.TryGetComponent<SpriteComponent>(out var spriteComponent))
spriteComponent.LayerSetState(0, "pad-beam");
spriteComponent.LayerSetState(0, "beam");
Owner.SpawnTimer((int) (TeleportDuration * 1000), () =>
{
if (!Deleted && !Owner.Deleted && _currentState == CargoTelepadState.Teleporting && _teleportQueue.Count > 0)
@@ -75,7 +75,7 @@ namespace Content.Server.GameObjects.Components.Cargo
Owner.EntityManager.SpawnEntity(_teleportQueue[0].Product, Owner.Transform.Coordinates);
_teleportQueue.RemoveAt(0);
if (Owner.TryGetComponent<SpriteComponent>(out var spriteComponent))
spriteComponent.LayerSetState(0, "pad-idle");
spriteComponent.LayerSetState(0, "idle");
_currentState = CargoTelepadState.Idle;
TeleportLoop();
}

View File

@@ -5237,6 +5237,8 @@ entities:
pos: 21.5,11.5
rot: 4.371139006309477E-08 rad
type: Transform
- anchored: True
type: Physics
- uid: 566
type: AirlockCargoGlassLocked
components:

View File

@@ -9,14 +9,15 @@
- type: InteractionOutline
- type: Physics
mass: 25
anchored: true
anchored: false
shapes:
- !type:PhysShapeAabb
bounds: "-0.45, -0.45, 0.00, 0.45"
layer: [ Passable ]
- type: Sprite
sprite: Constructible/Power/cargo_teleporter.rsi
state: pad-offline
sprite: Constructible/Specific/Cargo/teleporter.rsi
state: offline
drawdepth: FloorObjects
- type: Damageable
resistances: metallicResistances
- type: Destructible
@@ -25,9 +26,15 @@
!type:DamageTrigger
damage: 75
behaviors:
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
min: 1
max: 1
- !type:DoActsBehavior
acts: ["Destruction"]
- type: Anchorable
snap: true
- type: Pullable
- type: PowerReceiver
- type: CargoTelepad

View File

@@ -1,45 +0,0 @@
{
"version":1,
"size":{
"x":32,
"y":32
},
"license":"CC-BY-SA-3.0",
"copyright":"Taken from /vg/station at commit 5c50dee8fb2a55d6be3b3c9c90a782a618a5506e",
"states":[
{
"name":"pad-beam",
"directions":1,
"delays":[
[
0.1,
0.1,
0.1,
0.1,
0.1
]
]
},
{
"name":"pad-idle",
"directions":1,
"delays":[
[
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name":"pad-offline",
"directions":1,
"delays":[
[
1.0
]
]
}
]
}

View File

@@ -0,0 +1,37 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from /vg/station at commit 5c50dee8fb2a55d6be3b3c9c90a782a618a5506e",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "beam",
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1
]
]
},
{
"name": "idle",
"delays": [
[
0.2,
0.2,
0.2,
0.2
]
]
},
{
"name": "offline"
}
]
}