Toolboxes Update (#985)

This commit is contained in:
Swept
2020-05-24 16:56:19 +00:00
committed by GitHub
parent 78a9cc640a
commit 67143b1371
42 changed files with 581 additions and 13 deletions

View File

@@ -68,6 +68,9 @@ namespace Content.Client
"Explosive", "Explosive",
"OnUseTimerTrigger", "OnUseTimerTrigger",
"ToolboxElectricalFill", "ToolboxElectricalFill",
"ToolboxEmergencyFill",
"WarpPoint",
"ToolboxGoldFill",
"ToolLockerFill", "ToolLockerFill",
"EmitSoundOnUse", "EmitSoundOnUse",
"FootstepModifier", "FootstepModifier",

View File

@@ -1,4 +1,4 @@
using System; using System;
using Content.Shared.GameObjects.Components.Power; using Content.Shared.GameObjects.Components.Power;
using Robust.Client.Animations; using Robust.Client.Animations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
@@ -16,6 +16,7 @@ namespace Content.Client.GameObjects.Components.Power
private Animation _buildingAnimation; private Animation _buildingAnimation;
private Animation _insertingMetalAnimation; private Animation _insertingMetalAnimation;
private Animation _insertingGlassAnimation; private Animation _insertingGlassAnimation;
private Animation _insertingGoldAnimation;
public override void LoadData(YamlMappingNode node) public override void LoadData(YamlMappingNode node)
{ {
@@ -24,6 +25,7 @@ namespace Content.Client.GameObjects.Components.Power
_buildingAnimation = PopulateAnimation("autolathe_building", "autolathe_building_unlit", 0.5f); _buildingAnimation = PopulateAnimation("autolathe_building", "autolathe_building_unlit", 0.5f);
_insertingMetalAnimation = PopulateAnimation("autolathe_inserting_metal_plate", "autolathe_inserting_unlit", 0.9f); _insertingMetalAnimation = PopulateAnimation("autolathe_inserting_metal_plate", "autolathe_inserting_unlit", 0.9f);
_insertingGlassAnimation = PopulateAnimation("autolathe_inserting_glass_plate", "autolathe_inserting_unlit", 0.9f); _insertingGlassAnimation = PopulateAnimation("autolathe_inserting_glass_plate", "autolathe_inserting_unlit", 0.9f);
_insertingGoldAnimation = PopulateAnimation("autolathe_inserting_gold_plate", "autolathe_inserting_unlit", 0.9f);
} }
private Animation PopulateAnimation(string sprite, string spriteUnlit, float length) private Animation PopulateAnimation(string sprite, string spriteUnlit, float length)
@@ -91,6 +93,12 @@ namespace Content.Client.GameObjects.Components.Power
animPlayer.Play(_insertingGlassAnimation, AnimationKey); animPlayer.Play(_insertingGlassAnimation, AnimationKey);
} }
break; break;
case LatheVisualState.InsertingGold:
if (!animPlayer.HasRunningAnimation(AnimationKey))
{
animPlayer.Play(_insertingGoldAnimation, AnimationKey);
}
break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using Content.Shared.GameObjects.Components.Power; using Content.Shared.GameObjects.Components.Power;
using Robust.Client.Animations; using Robust.Client.Animations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
@@ -16,6 +16,7 @@ namespace Content.Client.GameObjects.Components.Power
private Animation _buildingAnimation; private Animation _buildingAnimation;
private Animation _insertingMetalAnimation; private Animation _insertingMetalAnimation;
private Animation _insertingGlassAnimation; private Animation _insertingGlassAnimation;
private Animation _insertingGoldAnimation;
public override void LoadData(YamlMappingNode node) public override void LoadData(YamlMappingNode node)
{ {
@@ -24,6 +25,7 @@ namespace Content.Client.GameObjects.Components.Power
_buildingAnimation = PopulateAnimation("protolathe_building", 0.9f); _buildingAnimation = PopulateAnimation("protolathe_building", 0.9f);
_insertingMetalAnimation = PopulateAnimation("protolathe_metal", 0.9f); _insertingMetalAnimation = PopulateAnimation("protolathe_metal", 0.9f);
_insertingGlassAnimation = PopulateAnimation("protolathe_glass", 0.9f); _insertingGlassAnimation = PopulateAnimation("protolathe_glass", 0.9f);
_insertingGoldAnimation = PopulateAnimation("protolathe_gold", 0.9f);
} }
private Animation PopulateAnimation(string sprite, float length) private Animation PopulateAnimation(string sprite, float length)
@@ -87,6 +89,12 @@ namespace Content.Client.GameObjects.Components.Power
animPlayer.Play(_insertingGlassAnimation, AnimationKey); animPlayer.Play(_insertingGlassAnimation, AnimationKey);
} }
break; break;
case LatheVisualState.InsertingGold:
if (!animPlayer.HasRunningAnimation(AnimationKey))
{
animPlayer.Play(_insertingGoldAnimation, AnimationKey);
}
break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }

View File

@@ -163,6 +163,7 @@ namespace Content.Server.GameObjects.Components.Construction
= new Dictionary<StackType, MaterialType> = new Dictionary<StackType, MaterialType>
{ {
{ StackType.Cable, MaterialType.Cable }, { StackType.Cable, MaterialType.Cable },
{ StackType.Gold, MaterialType.Gold },
{ StackType.Glass, MaterialType.Glass }, { StackType.Glass, MaterialType.Glass },
{ StackType.Metal, MaterialType.Metal } { StackType.Metal, MaterialType.Metal }
}; };

View File

@@ -0,0 +1,39 @@
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Random;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Random;
namespace Content.Server.GameObjects.Components.Items.Storage.Fill
{
[RegisterComponent]
internal sealed class ToolboxEmergencyFillComponent : Component, IMapInit
{
public override string Name => "ToolboxEmergencyFill";
#pragma warning disable 649
[Dependency] private readonly IEntityManager _entityManager;
#pragma warning restore 649
void IMapInit.MapInit()
{
var storage = Owner.GetComponent<IStorageComponent>();
var random = IoCManager.Resolve<IRobustRandom>();
void Spawn(string prototype)
{
storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.GridPosition));
}
Spawn("BreathMaskClothing");
Spawn("BreathMaskClothing");
Spawn("FoodChocolateBar");
Spawn("FlashlightLantern");
Spawn("FlashlightLantern");
Spawn(random.Prob(0.15f) ? "HarmonicaInstrument" : "FoodChocolateBar");
}
}
}

View File

@@ -0,0 +1,39 @@
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Random;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Random;
namespace Content.Server.GameObjects.Components.Items.Storage.Fill
{
[RegisterComponent]
internal sealed class ToolboxGoldFillComponent : Component, IMapInit
{
public override string Name => "ToolboxGoldFill";
#pragma warning disable 649
[Dependency] private readonly IEntityManager _entityManager;
#pragma warning restore 649
void IMapInit.MapInit()
{
var storage = Owner.GetComponent<IStorageComponent>();
var random = IoCManager.Resolve<IRobustRandom>();
void Spawn(string prototype)
{
storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.GridPosition));
}
Spawn("GoldStack");
Spawn("GoldStack");
Spawn("GoldStack");
Spawn("GoldStack");
Spawn("GoldStack");
Spawn(random.Prob(0.05f) ? "DrinkGoldenCup" : "GoldStack");
}
}
}

View File

@@ -190,6 +190,9 @@ namespace Content.Server.GameObjects.Components.Research
case "Glass": case "Glass":
SetAppearance(LatheVisualState.InsertingGlass); SetAppearance(LatheVisualState.InsertingGlass);
break; break;
case "Gold":
SetAppearance(LatheVisualState.InsertingGold);
break;
} }
Timer.Spawn(InsertionTime, async () => Timer.Spawn(InsertionTime, async () =>

View File

@@ -214,6 +214,7 @@ namespace Content.Shared.Construction
Metal, Metal,
Glass, Glass,
Cable, Cable,
Gold,
} }
} }
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Power namespace Content.Shared.GameObjects.Components.Power
@@ -9,6 +9,7 @@ namespace Content.Shared.GameObjects.Components.Power
Idle, Idle,
Producing, Producing,
InsertingMetal, InsertingMetal,
InsertingGlass InsertingGlass,
InsertingGold
} }
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.Reflection; using Robust.Shared.Interfaces.Reflection;
using Robust.Shared.IoC; using Robust.Shared.IoC;
@@ -121,6 +121,7 @@ namespace Content.Shared.GameObjects.Components
Metal, Metal,
Glass, Glass,
Cable, Cable,
Gold,
Ointment, Ointment,
Brutepack, Brutepack,
FloorTileSteel, FloorTileSteel,

View File

@@ -77,3 +77,27 @@
components: components:
- type: Stack - type: Stack
count: 1 count: 1
- type: entity
name: Gold Bar
id: GoldStack
parent: MaterialStack
components:
- type: Material
materials:
- key: enum.MaterialKeys.Stack
mat: gold
- type: Stack
stacktype: enum.StackType.Gold
- type: Sprite
texture: Objects/Materials/goldbar_single.png
- type: Icon
texture: Objects/Materials/goldbar_single.png
- type: entity
id: GoldStack1
name: Gold Bar 1
parent: GoldStack
components:
- type: Stack
count: 1

View File

@@ -18,26 +18,36 @@
description: A bright red toolbox, stocked with emergency tools description: A bright red toolbox, stocked with emergency tools
components: components:
- type: Sprite - type: Sprite
texture: Objects/Tools/toolbox_r.png sprite: Objects/Tools/Toolboxes/toolbox_red.rsi
state: icon
- type: Icon - type: Icon
texture: Objects/Tools/toolbox_r.png sprite: Objects/Tools/Toolboxes/toolbox_red.rsi
state: icon
- type: Item
sprite: Objects/Tools/Toolboxes/toolbox_red.rsi
- type: entity - type: entity
id: ToolboxEmergencyFilled id: ToolboxEmergencyFilled
name: Emergency Toolbox
parent: ToolboxEmergency parent: ToolboxEmergency
suffix: Filled suffix: Filled
components:
- type: ToolboxEmergencyFill
- type: entity - type: entity
name: Mechanical Toolbox name: Mechanical Toolbox
parent: ToolboxBase parent: ToolboxBase
id: BlueToolboxItem id: ToolboxMechanical
description: A blue box, stocked with mechanical tools description: A blue box, stocked with mechanical tools
components: components:
- type: Sprite - type: Sprite
texture: Objects/Tools/Toolbox_b.png sprite: Objects/Tools/Toolboxes/toolbox_blue.rsi
state: icon
- type: Icon - type: Icon
texture: Objects/Tools/Toolbox_b.png sprite: Objects/Tools/Toolboxes/toolbox_blue.rsi
state: icon
- type: Item
sprite: Objects/Tools/Toolboxes/toolbox_blue.rsi
- type: entity - type: entity
name: Electrical Toolbox name: Electrical Toolbox
@@ -46,9 +56,13 @@
description: A toolbox typically stocked with electrical gear description: A toolbox typically stocked with electrical gear
components: components:
- type: Sprite - type: Sprite
texture: Objects/Tools/Toolbox_y.png sprite: Objects/Tools/Toolboxes/toolbox_yellow.rsi
state: icon
- type: Icon - type: Icon
texture: Objects/Tools/Toolbox_y.png sprite: Objects/Tools/Toolboxes/toolbox_yellow.rsi
state: icon
- type: Item
sprite: Objects/Tools/Toolboxes/toolbox_yellow.rsi
- type: entity - type: entity
id: ToolboxElectricalFilled id: ToolboxElectricalFilled
@@ -57,3 +71,56 @@
parent: ToolboxElectrical parent: ToolboxElectrical
components: components:
- type: ToolboxElectricalFill - type: ToolboxElectricalFill
- type: entity
name: Artistic Toolbox
parent: ToolboxBase
id: ToolboxArtistic
description: A toolbox typically stocked with artistic supplies
components:
- type: Sprite
sprite: Objects/Tools/Toolboxes/toolbox_green.rsi
state: icon
- type: Icon
sprite: Objects/Tools/Toolboxes/toolbox_green.rsi
state: icon
- type: Item
sprite: Objects/Tools/Toolboxes/toolbox_green.rsi
- type: entity
name: Syndicate Toolbox
parent: ToolboxBase
id: ToolboxSyndicate
description: A sinister looking toolbox filled with elite syndicate tools.
components:
- type: Sprite
sprite: Objects/Tools/Toolboxes/toolbox_syn.rsi
state: icon
- type: Icon
sprite: Objects/Tools/Toolboxes/toolbox_syn.rsi
state: icon
- type: Item
sprite: Objects/Tools/Toolboxes/toolbox_syn.rsi
- type: entity
name: Golden Toolbox
parent: ToolboxBase
id: ToolboxGolden
description: A solid gold toolbox. A rapper would kill for this.
components:
- type: Sprite
sprite: Objects/Tools/Toolboxes/toolbox_gold.rsi
state: icon
- type: Icon
sprite: Objects/Tools/Toolboxes/toolbox_gold.rsi
state: icon
- type: Item
sprite: Objects/Tools/Toolboxes/toolbox_gold.rsi
- type: entity
id: ToolboxGoldFilled
name: Golden Toolbox
parent: ToolboxGolden
suffix: Filled
components:
- type: ToolboxGoldFill

View File

@@ -17,3 +17,12 @@
electricresistivity: 1.0e+13 electricresistivity: 1.0e+13
thermalconductivity: 0.9 thermalconductivity: 0.9
specificheat: 840 specificheat: 840
- type: material
id: gold
name: Gold
icon: Objects/Materials/goldbar_single.png
density: 10000
electricresistivity: 8.0e-9
thermalconductivity: 30
specificheat: 1000

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -91,6 +91,23 @@
] ]
] ]
}, },
{
"name": "autolathe_inserting_gold_plate",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1
]
]
},
{ {
"name": "autolathe_inserting_unlit", "name": "autolathe_inserting_unlit",
"directions": 1, "directions": 1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

View File

@@ -0,0 +1,55 @@
{
"version": 1,
"copyright": "Taken from https://github.com/tgstation/tgstation",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "inhand-left",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "inhand-right",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "icon",
"directions": 1,
"delays": [
[
1
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

View File

@@ -0,0 +1,72 @@
{
"version": 1,
"copyright": "Taken from https://github.com/tgstation/tgstation",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "inhand-left",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "inhand-right",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "icon",
"directions": 1,
"delays": [
[
0.2,
0.2,
0.1,
0.1,
0.1,
0.1,
0.1,
0.2,
0.2,
0.2,
0.2,
0.1,
0.1,
0.1,
0.1,
0.1,
0.2,
0.2
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

View File

@@ -0,0 +1,55 @@
{
"version": 1,
"copyright": "Taken from https://github.com/tgstation/tgstation",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "inhand-left",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "inhand-right",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "icon",
"directions": 1,
"delays": [
[
1
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

View File

@@ -0,0 +1,55 @@
{
"version": 1,
"copyright": "Taken from https://github.com/tgstation/tgstation",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "inhand-left",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "inhand-right",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "icon",
"directions": 1,
"delays": [
[
1
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

View File

@@ -0,0 +1,55 @@
{
"version": 1,
"copyright": "Taken from https://github.com/tgstation/tgstation",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "inhand-left",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "inhand-right",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "icon",
"directions": 1,
"delays": [
[
1
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

View File

@@ -0,0 +1,55 @@
{
"version": 1,
"copyright": "Taken from https://github.com/tgstation/tgstation",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "inhand-left",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "inhand-right",
"directions": 4,
"delays": [
[
1
],
[
1
],
[
1
],
[
1
]
]
},
{
"name": "icon",
"directions": 1,
"delays": [
[
1
]
]
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B