mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* Initial commit with shredder base functionality * Fix items being deleted and make items continue moving after a grid tile gets deleted * Make a bunch of previously unpullable/unrecyclable things work * temp commit * Fix the recycling hitbox to actually be good code * Fix material spawning via tiles * Finish up the prototype visuals for the shredder * SHRED EVERYTHING * Add reduced efficiency for recycling with shreder * Fix miss in conflict merge * Make more things pullable * Update shredder textures to look different to recyclers * Remove unused * "fix" repairability and sprites * Update sprites, set up TODO-s * Fix switches, description * Fix up some comments * Add "Do Not Map" to the smelter * Add to meta.json * Review fixes * Review changes * Review changes * Remove readonly in new system * Aaaand partial class * Fix the final test issues * Update and resolve merge conflicts * Update the impulse strength to match new mass values * Fix issues after merge conflict * Update size, fix physics resolve errors, prevent computers/circuitboards from being deleted * Review comments * Fix tiles giving steel * Add a todo about tilestacking
77 lines
2.7 KiB
C#
77 lines
2.7 KiB
C#
using Content.Shared.Maps;
|
|
using Content.Shared.Whitelist;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Shared.Materials;
|
|
|
|
/// <summary>
|
|
/// Makes an entity into a grid reclaimer, able to delete grids in front of it and produce materials.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true), AutoGenerateComponentPause]
|
|
[Access(typeof(TileReclaimerSystem))]
|
|
public sealed partial class TileReclaimerComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// An "enable" toggle for things like interfacing with machine linking.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool Enabled = true;
|
|
|
|
/// <summary>
|
|
/// A master control for whether or not the reclaimer is broken and can function.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool Broken;
|
|
|
|
/// <summary>
|
|
/// A whitelist for what grid entities can be affected by this reclaimer.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public EntityWhitelist? Whitelist;
|
|
|
|
/// <summary>
|
|
/// A whitelist for what grid entities can be affected by this reclaimer.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public EntityWhitelist? Blacklist;
|
|
|
|
/// <summary>
|
|
/// The delay after a grid has been consumed that it can recycle again.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public TimeSpan RecycleDelay = TimeSpan.FromSeconds(0.3f);
|
|
|
|
/// <summary>
|
|
/// The bounding box in local coordinates for where it will check for grids to reclaim.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public Box2 RecyclingBox = new(-0.5f, 0.5f, 0.5f, 1.5f);
|
|
|
|
/// <summary>
|
|
/// Multiplier for the material being extracted from the tile, as defined in the tile's <see cref="ContentTileDefinition.MaterialComposition"/>
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public float Efficiency = 1f;
|
|
|
|
/// <summary>
|
|
/// How strong impulse the reclaimer should apply to a grid after it has destroyed one of it tiles.
|
|
/// This helps guide the grid further into the reclaimer.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public float SlurpStrength = 1600f;
|
|
|
|
/// <summary>
|
|
/// Next time a recycling attempt can be made.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadOnly)]
|
|
[AutoNetworkedField, AutoPausedField]
|
|
public TimeSpan NextRecycle;
|
|
|
|
/// <summary>
|
|
/// The sound played when something is being processed.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public SoundSpecifier? Sound;
|
|
}
|