diff --git a/Content.Server/Drone/Components/DroneComponent.cs b/Content.Server/Drone/Components/DroneComponent.cs index 785552a4d6..87d49f50fc 100644 --- a/Content.Server/Drone/Components/DroneComponent.cs +++ b/Content.Server/Drone/Components/DroneComponent.cs @@ -13,5 +13,6 @@ namespace Content.Server.Drone.Components [DataField("tools")] public List Tools = new(); public List ToolUids = new(); public bool AlreadyAwoken = false; + public float InteractionBlockRange = 2.5f; } } diff --git a/Content.Server/Drone/DroneSystem.cs b/Content.Server/Drone/DroneSystem.cs index 773cd917d7..579fb7e2e9 100644 --- a/Content.Server/Drone/DroneSystem.cs +++ b/Content.Server/Drone/DroneSystem.cs @@ -1,20 +1,21 @@ using Content.Shared.Drone; using Content.Server.Drone.Components; using Content.Shared.MobState; -using Content.Shared.MobState.Components; using Content.Shared.Interaction.Events; using Content.Shared.Interaction.Components; using Content.Shared.Examine; -using Content.Server.Popups; -using Content.Server.Mind.Components; -using Content.Server.Ghost.Roles.Components; -using Content.Server.Hands.Components; -using Content.Shared.Body.Components; -using Content.Server.UserInterface; -using Content.Shared.Emoting; -using Robust.Shared.Player; using Content.Shared.Tag; using Content.Shared.Throwing; +using Content.Shared.Item; +using Content.Shared.Emoting; +using Content.Shared.Body.Components; +using Content.Server.Popups; +using Content.Server.Mind.Components; +using Content.Server.Ghost.Components; +using Content.Server.Ghost.Roles.Components; +using Content.Server.Hands.Components; +using Content.Server.UserInterface; +using Robust.Shared.Player; namespace Content.Server.Drone { @@ -22,6 +23,7 @@ namespace Content.Server.Drone { [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly TagSystem _tagSystem = default!; + [Dependency] private readonly EntityLookupSystem _lookup = default!; public override void Initialize() { base.Initialize(); @@ -37,9 +39,13 @@ namespace Content.Server.Drone private void OnInteractionAttempt(EntityUid uid, DroneComponent component, InteractionAttemptEvent args) { - if (HasComp(args.Target) && !HasComp(args.Target)) - { + if (NonDronesInRange(uid, component)) args.Cancel(); + + if (HasComp(args.Target) && !HasComp(args.Target)) + { + if (!_tagSystem.HasAnyTag(args.Target.Value, "DroneUsable", "Trash")) + args.Cancel(); } } @@ -81,7 +87,6 @@ namespace Content.Server.Drone private void OnMindAdded(EntityUid uid, DroneComponent drone, MindAddedMessage args) { UpdateDroneAppearance(uid, DroneStatus.On); - _tagSystem.AddTag(uid, "DoorBumpOpener"); _popupSystem.PopupEntity(Loc.GetString("drone-activated"), uid, Filter.Pvs(uid)); if (drone.AlreadyAwoken == false) @@ -108,7 +113,6 @@ namespace Content.Server.Drone private void OnMindRemoved(EntityUid uid, DroneComponent drone, MindRemovedMessage args) { UpdateDroneAppearance(uid, DroneStatus.Off); - _tagSystem.RemoveTag(uid, "DoorBumpOpener"); EnsureComp(uid); } @@ -130,5 +134,19 @@ namespace Content.Server.Drone appearance.SetData(DroneVisuals.Status, status); } } + + private bool NonDronesInRange(EntityUid uid, DroneComponent component) + { + var xform = Comp(uid); + foreach (var entity in _lookup.GetEntitiesInRange(xform.MapID, xform.WorldPosition, component.InteractionBlockRange)) + { + if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) + { + _popupSystem.PopupEntity(Loc.GetString("drone-too-close"), uid, Filter.Entities(uid)); + return true; + } + } + return false; + } } } diff --git a/Resources/Locale/en-US/drone/drone-system.ftl b/Resources/Locale/en-US/drone/drone-system.ftl index 68000da268..2a6cb8c165 100644 --- a/Resources/Locale/en-US/drone/drone-system.ftl +++ b/Resources/Locale/en-US/drone/drone-system.ftl @@ -1,3 +1,4 @@ drone-active = A maintenance drone. It seems totally unconcerned with you. drone-dormant = A dormant maintenance drone. Who knows when it will wake up? drone-activated = The drone whirrs to life! +drone-too-close = Too close to other beings! diff --git a/Resources/Prototypes/Catalog/Fills/Boxes/general.yml b/Resources/Prototypes/Catalog/Fills/Boxes/general.yml index 5fb57d15e0..03bafda5c1 100644 --- a/Resources/Prototypes/Catalog/Fills/Boxes/general.yml +++ b/Resources/Prototypes/Catalog/Fills/Boxes/general.yml @@ -69,6 +69,9 @@ whitelist: components: - LightBulb + - type: Tag + tags: + - DroneUsable - type: entity name: PDA box @@ -177,7 +180,7 @@ layers: - state: box - state: writing - + - type: entity name: flare box parent: BoxCardboard @@ -192,7 +195,7 @@ layers: - state: box - state: writing - + - type: entity name: trashbag box parent: BoxCardboard @@ -211,4 +214,4 @@ - type: Sprite layers: - state: box - - state: writing \ No newline at end of file + - state: writing diff --git a/Resources/Prototypes/Entities/Clothing/Head/base_clothinghead.yml b/Resources/Prototypes/Entities/Clothing/Head/base_clothinghead.yml index 13b925926d..aac9e93bad 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/base_clothinghead.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/base_clothinghead.yml @@ -8,6 +8,9 @@ - HEAD - type: Sprite state: icon + - type: Tag + tags: + - DroneUsable - type: entity abstract: true @@ -76,4 +79,4 @@ - type: PowerCellSlot cellSlot: startingItem: PowerCellHardsuitHelmet # self recharging - locked: true # no need to recharge manually \ No newline at end of file + locked: true # no need to recharge manually diff --git a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml index cdad71a0eb..743b8fa966 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml @@ -99,7 +99,27 @@ - type: MobState thresholds: 0: !type:NormalMobState {} - 70: !type:DeadMobState {} + 60: !type:DeadMobState {} + - type: Flashable + - type: NoSlip + - type: StatusEffects + allowed: + - Stun + - KnockedDown + - SlowedDown + - type: SlowOnDamage + speedModifierThresholds: + 20: 0.8 + 30: 0.6 + 40: 0.4 + 50: 0.2 + - type: Temperature + heatDamageThreshold: 5000 + currentTemperature: 310.15 + specificHeat: 42 + heatDamage: + types: + Heat : 1 #per second, scales with temperature & other constants - type: Sprite drawdepth: Mobs netsync: false diff --git a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/base_machineboard.yml b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/base_machineboard.yml index 64fadf1ffe..154f2bd790 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/base_machineboard.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/base_machineboard.yml @@ -9,3 +9,6 @@ - type: Sprite sprite: Objects/Misc/module.rsi state: id_mod + - type: Tag + tags: + - DroneUsable diff --git a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/computer.yml b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/computer.yml index 6c6e51fc1a..e27b4314f4 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/computer.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/computer.yml @@ -8,6 +8,9 @@ - type: Sprite sprite: Objects/Misc/module.rsi state: cpuboard + - type: Tag + tags: + - DroneUsable - type: entity parent: BaseComputerCircuitboard @@ -26,7 +29,7 @@ components: - type: ComputerBoard prototype: ComputerPowerMonitoring - + - type: entity parent: BaseComputerCircuitboard id: MedicalRecordsComputerCircuitboard @@ -35,7 +38,7 @@ components: - type: ComputerBoard prototype: ComputerMedicalRecords - + - type: entity parent: BaseComputerCircuitboard id: CriminalRecordsComputerCircuitboard diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/apc.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/apc.yml index 52d7de82f8..54d0db499e 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/apc.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/apc.yml @@ -8,3 +8,6 @@ sprite: Objects/Misc/module.rsi state: charger_APC netsync: false + - type: Tag + tags: + - DroneUsable diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/atmos_alarms.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/atmos_alarms.yml index 7aca4aa1e0..ac505900ec 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/atmos_alarms.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/atmos_alarms.yml @@ -7,6 +7,7 @@ - type: Tag tags: - AirAlarmElectronics + - DroneUsable - type: Sprite sprite: Objects/Misc/module.rsi state: airalarm_electronics @@ -20,6 +21,7 @@ - type: Tag tags: - FireAlarmElectronics + - DroneUsable - type: Sprite sprite: Objects/Misc/module.rsi - state: airalarm_electronics \ No newline at end of file + state: airalarm_electronics diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/door.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/door.yml index 57286f4936..d17ace440f 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/door.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/door.yml @@ -7,6 +7,7 @@ - type: Tag tags: - DoorElectronics + - DroneUsable - type: Sprite sprite: Objects/Misc/module.rsi state: door_electronics diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/firelock.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/firelock.yml index 60d4961041..8e4648aa5f 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/firelock.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/firelock.yml @@ -7,6 +7,7 @@ - type: Tag tags: - FirelockElectronics + - DroneUsable - type: Sprite sprite: Objects/Misc/module.rsi state: mainboard diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/solar.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/solar.yml index 2f52529967..db96a801d6 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/solar.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/solar.yml @@ -7,3 +7,6 @@ - type: Sprite sprite: Objects/Misc/module.rsi state: generic + - type: Tag + tags: + - DroneUsable diff --git a/Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml b/Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml index e24ecc6606..44f061d52f 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml @@ -13,6 +13,7 @@ - type: Tag tags: - Sheet + - DroneUsable - type: entity parent: SheetGlassBase diff --git a/Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml b/Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml index b1258ac2ff..e196b9191c 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml @@ -14,6 +14,7 @@ tags: - Sheet - Metal + - DroneUsable - type: entity parent: SheetMetalBase diff --git a/Resources/Prototypes/Entities/Objects/Materials/Sheets/other.yml b/Resources/Prototypes/Entities/Objects/Materials/Sheets/other.yml index e51ab62374..8daadea75d 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/Sheets/other.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/Sheets/other.yml @@ -13,6 +13,7 @@ - type: Tag tags: - Sheet + - DroneUsable - type: entity parent: SheetOtherBase diff --git a/Resources/Prototypes/Entities/Objects/Materials/materials.yml b/Resources/Prototypes/Entities/Objects/Materials/materials.yml index b8b914a8da..7c2869e16c 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/materials.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/materials.yml @@ -10,6 +10,9 @@ - type: Item sprite: Objects/Materials/materials.rsi - type: ItemStatus + - type: Tag + tags: + - DroneUsable - type: entity parent: MaterialBase diff --git a/Resources/Prototypes/Entities/Objects/Materials/parts.yml b/Resources/Prototypes/Entities/Objects/Materials/parts.yml index 42322c05e3..fcdfae5aa5 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/parts.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/parts.yml @@ -10,6 +10,9 @@ - type: Item sprite: Objects/Materials/parts.rsi - type: ItemStatus + - type: Tag + tags: + - DroneUsable - type: entity parent: PartBase diff --git a/Resources/Prototypes/Entities/Objects/Misc/tiles.yml b/Resources/Prototypes/Entities/Objects/Misc/tiles.yml index 3031d91525..e821684a22 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/tiles.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/tiles.yml @@ -15,6 +15,9 @@ Blunt: 10 - type: Stack count: 1 + - type: Tag + tags: + - DroneUsable - type: entity name: steel tile @@ -351,7 +354,7 @@ - FloorArcadeBlue - type: Stack stackType: FloorTileStackArcadeBlue - + - type: entity name: red arcade floor parent: FloorTileItemBase @@ -367,7 +370,7 @@ - FloorArcadeRed - type: Stack stackType: FloorTileStackArcadeRed - + - type: entity name: eighties floor parent: FloorTileItemBase @@ -400,7 +403,7 @@ - FloorShuttleWhite - type: Stack stackType: FloorTileStackShuttleWhite - + - type: entity name: blue shuttle floor parent: FloorTileItemBase @@ -416,7 +419,7 @@ - FloorShuttleBlue - type: Stack stackType: FloorTileStackShuttleBlue - + - type: entity name: orange shuttle floor parent: FloorTileItemBase @@ -432,7 +435,7 @@ - FloorShuttleOrange - type: Stack stackType: FloorTileStackShuttleOrange - + - type: entity name: purple shuttle floor parent: FloorTileItemBase @@ -448,7 +451,7 @@ - FloorShuttlePurple - type: Stack stackType: FloorTileStackShuttlePurple - + - type: entity name: red shuttle floor parent: FloorTileItemBase @@ -539,7 +542,7 @@ outputs: - plating - floor_grass - + - type: entity name: jungle grass tile parent: FloorTileItemBase diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml index 007f29e77d..5f8bd254f9 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml @@ -16,6 +16,9 @@ solutions: mop: maxVol: 50 + - type: Tag + tags: + - DroneUsable #No bucket because it holds chems, they can drag the thing around instead - type: entity name: mop bucket diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml index f157d99fcc..3aaef7666c 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml @@ -58,6 +58,10 @@ reagents: - ReagentId: SpaceCleaner Quantity: 100 + - type: Tag + tags: + - Spray + - DroneUsable #They don't have any other chem stuff on their whitelist so they can't refill it # Vapor diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/trashbag.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/trashbag.yml index 1248d816d1..35de6f531c 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/trashbag.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/trashbag.yml @@ -22,6 +22,7 @@ - type: Tag tags: - TrashBag + - DroneUsable - type: entity name: trash bag diff --git a/Resources/Prototypes/Entities/Objects/Specific/atmos.yml b/Resources/Prototypes/Entities/Objects/Specific/atmos.yml index 172d25e145..9e11ff92d7 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/atmos.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/atmos.yml @@ -18,3 +18,6 @@ - type: GasAnalyzerVisualizer state_off: icon state_working: working + - type: Tag + tags: + - DroneUsable diff --git a/Resources/Prototypes/Entities/Objects/Tools/cable_coils.yml b/Resources/Prototypes/Entities/Objects/Tools/cable_coils.yml index a89a2dfeaa..1983339287 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/cable_coils.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/cable_coils.yml @@ -12,6 +12,7 @@ - type: Tag tags: - CableCoil + - DroneUsable - type: Stack stackType: Cable - type: Sprite diff --git a/Resources/Prototypes/Entities/Objects/Tools/flashlights.yml b/Resources/Prototypes/Entities/Objects/Tools/flashlights.yml index eb987c752c..ac2ec7e79b 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/flashlights.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/flashlights.yml @@ -7,6 +7,7 @@ - type: Tag tags: - Flashlight + - DroneUsable - type: HandheldLight toggleAction: name: action-name-toggle-light diff --git a/Resources/Prototypes/Entities/Objects/Tools/inflatable_wall.yml b/Resources/Prototypes/Entities/Objects/Tools/inflatable_wall.yml index a1af0a8c2a..b7c5c51c36 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/inflatable_wall.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/inflatable_wall.yml @@ -21,6 +21,9 @@ doAfter: 1 removeOnInteract: true - type: Clickable + - type: Tag + tags: + - DroneUsable # - type: Appearance # TODO: Add stack sprites # visuals: # - type: StackVisualizer @@ -52,6 +55,9 @@ doAfter: 1 removeOnInteract: true - type: Clickable + - type: Tag + tags: + - DroneUsable - type: entity parent: InflatableWallStack diff --git a/Resources/Prototypes/Entities/Objects/Tools/light_replacer.yml b/Resources/Prototypes/Entities/Objects/Tools/light_replacer.yml index 4eb4e78b29..b755f18470 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/light_replacer.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/light_replacer.yml @@ -17,3 +17,6 @@ - name: LightBulb amount: 5 type: Bulb + - type: Tag + tags: + - DroneUsable diff --git a/Resources/Prototypes/Entities/Objects/Tools/t-ray.yml b/Resources/Prototypes/Entities/Objects/Tools/t-ray.yml index d68bc8905d..7b180ab655 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/t-ray.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/t-ray.yml @@ -19,3 +19,6 @@ states: enum.TrayScannerVisual.On: tray-on enum.TrayScannerVisual.Off: tray-off + - type: Tag + tags: + - DroneUsable diff --git a/Resources/Prototypes/Entities/Objects/Tools/tools.yml b/Resources/Prototypes/Entities/Objects/Tools/tools.yml index e3984c7c5b..d71429e05a 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/tools.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/tools.yml @@ -181,6 +181,9 @@ qualities: - Pulsing - type: SignalLinker + - type: Tag + tags: + - DroneUsable - type: entity name: power drill diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 4a85e83daa..ca0bd45a32 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -117,6 +117,9 @@ - type: Tag id: Donut +- type: Tag + id: DroneUsable + - type: Tag id: Egg @@ -285,7 +288,7 @@ - type: Tag id: Trash - + - type: Tag id: TrashBag