Drone 1984 (#7009)

This commit is contained in:
Rane
2022-03-07 06:46:36 -05:00
committed by GitHub
parent af1f99e564
commit f5fa1ac80d
30 changed files with 134 additions and 29 deletions

View File

@@ -13,5 +13,6 @@ namespace Content.Server.Drone.Components
[DataField("tools")] public List<EntitySpawnEntry> Tools = new();
public List<EntityUid> ToolUids = new();
public bool AlreadyAwoken = false;
public float InteractionBlockRange = 2.5f;
}
}

View File

@@ -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,8 +39,12 @@ namespace Content.Server.Drone
private void OnInteractionAttempt(EntityUid uid, DroneComponent component, InteractionAttemptEvent args)
{
if (HasComp<MobStateComponent>(args.Target) && !HasComp<DroneComponent>(args.Target))
if (NonDronesInRange(uid, component))
args.Cancel();
if (HasComp<SharedItemComponent>(args.Target) && !HasComp<UnremoveableComponent>(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<GhostTakeoverAvailableComponent>(uid);
}
@@ -130,5 +134,19 @@ namespace Content.Server.Drone
appearance.SetData(DroneVisuals.Status, status);
}
}
private bool NonDronesInRange(EntityUid uid, DroneComponent component)
{
var xform = Comp<TransformComponent>(uid);
foreach (var entity in _lookup.GetEntitiesInRange(xform.MapID, xform.WorldPosition, component.InteractionBlockRange))
{
if (HasComp<MindComponent>(entity) && !HasComp<DroneComponent>(entity) && !HasComp<GhostComponent>(entity))
{
_popupSystem.PopupEntity(Loc.GetString("drone-too-close"), uid, Filter.Entities(uid));
return true;
}
}
return false;
}
}
}

View File

@@ -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!

View File

@@ -69,6 +69,9 @@
whitelist:
components:
- LightBulb
- type: Tag
tags:
- DroneUsable
- type: entity
name: PDA box

View File

@@ -8,6 +8,9 @@
- HEAD
- type: Sprite
state: icon
- type: Tag
tags:
- DroneUsable
- type: entity
abstract: true

View File

@@ -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

View File

@@ -9,3 +9,6 @@
- type: Sprite
sprite: Objects/Misc/module.rsi
state: id_mod
- type: Tag
tags:
- DroneUsable

View File

@@ -8,6 +8,9 @@
- type: Sprite
sprite: Objects/Misc/module.rsi
state: cpuboard
- type: Tag
tags:
- DroneUsable
- type: entity
parent: BaseComputerCircuitboard

View File

@@ -8,3 +8,6 @@
sprite: Objects/Misc/module.rsi
state: charger_APC
netsync: false
- type: Tag
tags:
- DroneUsable

View File

@@ -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

View File

@@ -7,6 +7,7 @@
- type: Tag
tags:
- DoorElectronics
- DroneUsable
- type: Sprite
sprite: Objects/Misc/module.rsi
state: door_electronics

View File

@@ -7,6 +7,7 @@
- type: Tag
tags:
- FirelockElectronics
- DroneUsable
- type: Sprite
sprite: Objects/Misc/module.rsi
state: mainboard

View File

@@ -7,3 +7,6 @@
- type: Sprite
sprite: Objects/Misc/module.rsi
state: generic
- type: Tag
tags:
- DroneUsable

View File

@@ -13,6 +13,7 @@
- type: Tag
tags:
- Sheet
- DroneUsable
- type: entity
parent: SheetGlassBase

View File

@@ -14,6 +14,7 @@
tags:
- Sheet
- Metal
- DroneUsable
- type: entity
parent: SheetMetalBase

View File

@@ -13,6 +13,7 @@
- type: Tag
tags:
- Sheet
- DroneUsable
- type: entity
parent: SheetOtherBase

View File

@@ -10,6 +10,9 @@
- type: Item
sprite: Objects/Materials/materials.rsi
- type: ItemStatus
- type: Tag
tags:
- DroneUsable
- type: entity
parent: MaterialBase

View File

@@ -10,6 +10,9 @@
- type: Item
sprite: Objects/Materials/parts.rsi
- type: ItemStatus
- type: Tag
tags:
- DroneUsable
- type: entity
parent: PartBase

View File

@@ -15,6 +15,9 @@
Blunt: 10
- type: Stack
count: 1
- type: Tag
tags:
- DroneUsable
- type: entity
name: steel tile

View File

@@ -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

View File

@@ -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

View File

@@ -22,6 +22,7 @@
- type: Tag
tags:
- TrashBag
- DroneUsable
- type: entity
name: trash bag

View File

@@ -18,3 +18,6 @@
- type: GasAnalyzerVisualizer
state_off: icon
state_working: working
- type: Tag
tags:
- DroneUsable

View File

@@ -12,6 +12,7 @@
- type: Tag
tags:
- CableCoil
- DroneUsable
- type: Stack
stackType: Cable
- type: Sprite

View File

@@ -7,6 +7,7 @@
- type: Tag
tags:
- Flashlight
- DroneUsable
- type: HandheldLight
toggleAction:
name: action-name-toggle-light

View File

@@ -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

View File

@@ -17,3 +17,6 @@
- name: LightBulb
amount: 5
type: Bulb
- type: Tag
tags:
- DroneUsable

View File

@@ -19,3 +19,6 @@
states:
enum.TrayScannerVisual.On: tray-on
enum.TrayScannerVisual.Off: tray-off
- type: Tag
tags:
- DroneUsable

View File

@@ -181,6 +181,9 @@
qualities:
- Pulsing
- type: SignalLinker
- type: Tag
tags:
- DroneUsable
- type: entity
name: power drill

View File

@@ -117,6 +117,9 @@
- type: Tag
id: Donut
- type: Tag
id: DroneUsable
- type: Tag
id: Egg