Toolboxes Update (#985)
This commit is contained in:
@@ -163,6 +163,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
= new Dictionary<StackType, MaterialType>
|
||||
{
|
||||
{ StackType.Cable, MaterialType.Cable },
|
||||
{ StackType.Gold, MaterialType.Gold },
|
||||
{ StackType.Glass, MaterialType.Glass },
|
||||
{ StackType.Metal, MaterialType.Metal }
|
||||
};
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,6 +190,9 @@ namespace Content.Server.GameObjects.Components.Research
|
||||
case "Glass":
|
||||
SetAppearance(LatheVisualState.InsertingGlass);
|
||||
break;
|
||||
case "Gold":
|
||||
SetAppearance(LatheVisualState.InsertingGold);
|
||||
break;
|
||||
}
|
||||
|
||||
Timer.Spawn(InsertionTime, async () =>
|
||||
|
||||
Reference in New Issue
Block a user