explicit interface go brrrr
This commit is contained in:
@@ -214,7 +214,7 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
UserInterface?.SetState(newState);
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if(!eventArgs.User.TryGetComponent(out IActorComponent? actor))
|
||||
{
|
||||
@@ -224,7 +224,7 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
UserInterface?.Open(actor.playerSession);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
var item = eventArgs.Using;
|
||||
var user = eventArgs.User;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Content.Server.GameObjects.Components.Arcade
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if(!eventArgs.User.TryGetComponent(out IActorComponent? actor))
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Content.Server.GameObjects.Components.Arcade
|
||||
_game = new SpaceVillainGame(this);
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if(!eventArgs.User.TryGetComponent(out IActorComponent? actor))
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
DisconnectInternals();
|
||||
}
|
||||
|
||||
public void Equipped(EquippedEventArgs eventArgs)
|
||||
void IEquipped.Equipped(EquippedEventArgs eventArgs)
|
||||
{
|
||||
if ((EquipmentSlotDefines.SlotMasks[eventArgs.Slot] & _allowedSlots) != _allowedSlots) return;
|
||||
IsFunctional = true;
|
||||
@@ -48,10 +48,9 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
}
|
||||
}
|
||||
|
||||
public void Unequipped(UnequippedEventArgs eventArgs)
|
||||
void IUnequipped.Unequipped(UnequippedEventArgs eventArgs)
|
||||
{
|
||||
DisconnectInternals();
|
||||
|
||||
}
|
||||
|
||||
public void DisconnectInternals()
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
});
|
||||
}
|
||||
|
||||
public ReagentUnit ReagentReactTouch(ReagentPrototype reagent, ReagentUnit volume)
|
||||
ReagentUnit IReagentReaction.ReagentReactTouch(ReagentPrototype reagent, ReagentUnit volume)
|
||||
{
|
||||
switch (reagent.ID)
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.ComponentDependencies;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -166,14 +167,14 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
return air;
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IActorComponent? actor)) return false;
|
||||
OpenInterface(actor.playerSession);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IActorComponent? actor)) return;
|
||||
OpenInterface(actor.playerSession);
|
||||
@@ -323,7 +324,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
_integrity++;
|
||||
}
|
||||
|
||||
public void Dropped(DroppedEventArgs eventArgs)
|
||||
void IDropped.Dropped(DroppedEventArgs eventArgs)
|
||||
{
|
||||
DisconnectFromInternals(eventArgs.User);
|
||||
}
|
||||
@@ -363,7 +364,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
[UsedImplicitly]
|
||||
public class ToggleInternalsAction : IToggleItemAction
|
||||
{
|
||||
public void ExposeData(ObjectSerializer serializer) {}
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer) {}
|
||||
|
||||
public bool DoToggleAction(ToggleItemActionEventArgs args)
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Content.Server.GameObjects.Components.Body.Part
|
||||
}
|
||||
}
|
||||
|
||||
public async Task AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
// TODO BODY
|
||||
if (eventArgs.Target == null)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.GameObjects.Components.Botany
|
||||
{
|
||||
public override string Name => "Log";
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!ActionBlockerSystem.CanInteract(eventArgs.User))
|
||||
return false;
|
||||
|
||||
@@ -639,7 +639,7 @@ namespace Content.Server.GameObjects.Components.Botany
|
||||
Seed = Seed.Diverge(modified);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
var user = eventArgs.User;
|
||||
var usingItem = eventArgs.Using;
|
||||
@@ -767,7 +767,7 @@ namespace Content.Server.GameObjects.Components.Botany
|
||||
return false;
|
||||
}
|
||||
|
||||
public ReagentUnit ReagentReactTouch(ReagentPrototype reagent, ReagentUnit volume)
|
||||
ReagentUnit IReagentReaction.ReagentReactTouch(ReagentPrototype reagent, ReagentUnit volume)
|
||||
{
|
||||
if(_solutionContainer == null)
|
||||
return ReagentUnit.Zero;
|
||||
@@ -776,7 +776,7 @@ namespace Content.Server.GameObjects.Components.Botany
|
||||
return accepted;
|
||||
}
|
||||
|
||||
public ReagentUnit ReagentReactInjection(ReagentPrototype reagent, ReagentUnit volume)
|
||||
ReagentUnit IReagentReaction.ReagentReactInjection(ReagentPrototype reagent, ReagentUnit volume)
|
||||
{
|
||||
if(_solutionContainer == null)
|
||||
return ReagentUnit.Zero;
|
||||
@@ -785,13 +785,13 @@ namespace Content.Server.GameObjects.Components.Botany
|
||||
return accepted;
|
||||
}
|
||||
|
||||
public bool InteractHand(InteractHandEventArgs eventArgs)
|
||||
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
|
||||
{
|
||||
// DoHarvest does the sanity checks.
|
||||
return DoHarvest(eventArgs.User);
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
// DoHarvest does the sanity checks.
|
||||
DoHarvest(eventArgs.User);
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Server.GameObjects.Components.Botany
|
||||
private int _minSeeds = 1;
|
||||
private int _maxSeeds = 4;
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!_powerReceiver?.Powered ?? false)
|
||||
return false;
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
|
||||
}
|
||||
|
||||
// Feeding someone else
|
||||
public async Task AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Target == null)
|
||||
{
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
TargetNextEdge = Node.GetEdge(TargetPathfinding.Peek().Name);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (_handling)
|
||||
return true;
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!HasBoard && eventArgs.Using.TryGetComponent<MachineBoardComponent>(out var machineBoard))
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
serializer.DataField(ref _refineTime, "refineTime", 2f);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
// check if object is welder
|
||||
if (!eventArgs.Using.TryGetComponent(out ToolComponent? tool))
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
serializer.DataField(ref _ignoreResistances, "ignoreResistances", false);
|
||||
}
|
||||
|
||||
public void Land(LandEventArgs eventArgs)
|
||||
void ILand.Land(LandEventArgs eventArgs)
|
||||
{
|
||||
if (!Owner.TryGetComponent(out IDamageableComponent damageable)) return;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
serializer.DataField(ref _tools, "tools", new List<ToolQuality>());
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Using.TryGetComponent<ToolComponent>(out var tool))
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.Components.Damage
|
||||
serializer.DataField(ref _ignoreResistances, "ignoreResistances", false);
|
||||
}
|
||||
|
||||
public void DoHit(ThrowCollideEventArgs eventArgs)
|
||||
void IThrowCollide.DoHit(ThrowCollideEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Target.TryGetComponent(out IDamageableComponent damageable)) return;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
@@ -19,7 +20,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
set => _acts = (int) value;
|
||||
}
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(ref _acts, "acts", 0, WithFormat.Flags<ActsFlags>());
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.GameObjects.Components.Body;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
@@ -11,7 +12,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
{
|
||||
private bool _recursive = true;
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(ref _recursive, "recursive", true);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.Audio;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
@@ -12,7 +13,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
/// </summary>
|
||||
public string Sound { get; set; }
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(this, x => x.Sound, "sound", string.Empty);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.Audio;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
@@ -12,7 +13,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
/// </summary>
|
||||
private string SoundCollection { get; set; }
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(this, x => x.SoundCollection, "soundCollection", string.Empty);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Server.GameObjects.Components.Stack;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.Utility;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
@@ -15,7 +16,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
/// </summary>
|
||||
public Dictionary<string, MinMax> Spawn { get; set; } = new();
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(this, x => x.Spawn, "spawn", new Dictionary<string, MinMax>());
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Server.GameObjects.Components.Fluids;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
@@ -11,7 +12,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
|
||||
[UsedImplicitly]
|
||||
public class SpillBehavior : IThresholdBehavior
|
||||
{
|
||||
public void ExposeData(ObjectSerializer serializer) { }
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer) { }
|
||||
|
||||
public void Trigger(IEntity owner, DestructibleSystem system)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds
|
||||
[ViewVariables]
|
||||
public int Max;
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(ref Min, "min", 0);
|
||||
serializer.DataField(ref Max, "max", 0);
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds
|
||||
/// </summary>
|
||||
[ViewVariables] public IReadOnlyList<IThresholdBehavior> Behaviors => _behaviors;
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(this, x => x.Triggered, "triggered", false);
|
||||
serializer.DataField(this, x => x.TriggersOnce, "triggersOnce", false);
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Content.Server.GameObjects.Components.Fluids
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!Owner.TryGetComponent(out SolutionContainerComponent? contents))
|
||||
{
|
||||
|
||||
@@ -185,13 +185,13 @@ namespace Content.Server.GameObjects.Components.Fluids
|
||||
}
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
ToggleSafety(eventArgs.User);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
ToggleSafety(eventArgs.User);
|
||||
}
|
||||
@@ -212,7 +212,7 @@ namespace Content.Server.GameObjects.Components.Fluids
|
||||
appearance.SetData(SprayVisuals.Safety, _safety);
|
||||
}
|
||||
|
||||
public void Dropped(DroppedEventArgs eventArgs)
|
||||
void IDropped.Dropped(DroppedEventArgs eventArgs)
|
||||
{
|
||||
if(_hasSafety && Owner.TryGetComponent(out AppearanceComponent appearance))
|
||||
appearance.SetData(SprayVisuals.Safety, _safety);
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Content.Server.GameObjects.Components.Gravity
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Using.TryGetComponent(out WelderComponent? tool))
|
||||
return false;
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace Content.Server.GameObjects.Components.Instruments
|
||||
_laggedBatches = 0;
|
||||
}
|
||||
|
||||
public void Dropped(DroppedEventArgs eventArgs)
|
||||
void IDropped.Dropped(DroppedEventArgs eventArgs)
|
||||
{
|
||||
Clean();
|
||||
SendNetworkMessage(new InstrumentStopMidiMessage());
|
||||
@@ -298,7 +298,7 @@ namespace Content.Server.GameObjects.Components.Instruments
|
||||
UserInterface?.CloseAll();
|
||||
}
|
||||
|
||||
public void Thrown(ThrownEventArgs eventArgs)
|
||||
void IThrown.Thrown(ThrownEventArgs eventArgs)
|
||||
{
|
||||
Clean();
|
||||
SendNetworkMessage(new InstrumentStopMidiMessage());
|
||||
@@ -306,7 +306,7 @@ namespace Content.Server.GameObjects.Components.Instruments
|
||||
UserInterface?.CloseAll();
|
||||
}
|
||||
|
||||
public void HandSelected(HandSelectedEventArgs eventArgs)
|
||||
void IHandSelected.HandSelected(HandSelectedEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.User == null || !eventArgs.User.TryGetComponent(out BasicActorComponent? actor))
|
||||
return;
|
||||
@@ -318,14 +318,14 @@ namespace Content.Server.GameObjects.Components.Instruments
|
||||
InstrumentPlayer = session;
|
||||
}
|
||||
|
||||
public void HandDeselected(HandDeselectedEventArgs eventArgs)
|
||||
void IHandDeselected.HandDeselected(HandDeselectedEventArgs eventArgs)
|
||||
{
|
||||
Clean();
|
||||
SendNetworkMessage(new InstrumentStopMidiMessage());
|
||||
UserInterface?.CloseAll();
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if (Handheld || !eventArgs.User.TryGetComponent(out IActorComponent? actor)) return;
|
||||
|
||||
@@ -335,7 +335,7 @@ namespace Content.Server.GameObjects.Components.Instruments
|
||||
OpenUserInterface(actor.playerSession);
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IActorComponent? actor)) return false;
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.ComponentDependencies;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -282,7 +283,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
[UsedImplicitly]
|
||||
public class ToggleLightAction : IToggleItemAction
|
||||
{
|
||||
public void ExposeData(ObjectSerializer serializer) {}
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer) {}
|
||||
|
||||
public bool DoToggleAction(ToggleItemActionEventArgs args)
|
||||
{
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
{
|
||||
public override string Name => "Matchbox";
|
||||
|
||||
public int Priority => 1;
|
||||
int IInteractUsing.Priority => 1;
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Using.TryGetComponent<MatchstickComponent>(out var matchstick)
|
||||
&& matchstick.CurrentState == SharedBurningStates.Unlit)
|
||||
@@ -26,4 +26,4 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
Owner.SpawnTimer(_duration * 1000, () => CurrentState = SharedBurningStates.Burnt);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Target.TryGetComponent<IHotItem>(out var hotItem)
|
||||
&& hotItem.IsCurrentlyHot()
|
||||
@@ -102,4 +102,4 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
public string SoundCollection => _soundCollection;
|
||||
public string ChangeSound => _changeSound;
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(this, x => x.Behavior, "behavior", ToolQuality.None);
|
||||
serializer.DataField(ref _state, "state", string.Empty);
|
||||
@@ -104,7 +104,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
serializer.DataField(ref _tools, "tools", new List<ToolEntry>());
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
Cycle();
|
||||
return true;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
public override string Name => "TilePrying";
|
||||
private bool _toolComponentNeeded = true;
|
||||
|
||||
public async Task AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
TryPryTile(eventArgs.User, eventArgs.ClickLocation);
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
return ToggleWelderStatus(eventArgs.User);
|
||||
}
|
||||
@@ -257,7 +257,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
|
||||
}
|
||||
|
||||
public SuicideKind Suicide(IEntity victim, IChatManager chat)
|
||||
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)
|
||||
{
|
||||
string othersMessage;
|
||||
string selfMessage;
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Content.Server.GameObjects.Components.Items.Clothing
|
||||
return new ClothingComponentState(ClothingEquippedPrefix, EquippedPrefix);
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
if (!_quickEquipEnabled) return false;
|
||||
if (!eventArgs.User.TryGetComponent(out InventoryComponent inv)
|
||||
|
||||
@@ -12,22 +12,23 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
public class DebugEquipComponent : Component, IEquipped, IEquippedHand, IUnequipped, IUnequippedHand
|
||||
{
|
||||
public override string Name => "DebugEquip";
|
||||
public void Equipped(EquippedEventArgs eventArgs)
|
||||
|
||||
void IEquipped.Equipped(EquippedEventArgs eventArgs)
|
||||
{
|
||||
eventArgs.User.PopupMessage("equipped " + Owner.Name);
|
||||
}
|
||||
|
||||
public void EquippedHand(EquippedHandEventArgs eventArgs)
|
||||
void IEquippedHand.EquippedHand(EquippedHandEventArgs eventArgs)
|
||||
{
|
||||
eventArgs.User.PopupMessage("equipped hand " + Owner.Name);
|
||||
}
|
||||
|
||||
public void Unequipped(UnequippedEventArgs eventArgs)
|
||||
void IUnequipped.Unequipped(UnequippedEventArgs eventArgs)
|
||||
{
|
||||
eventArgs.User.PopupMessage("unequipped " + Owner.Name);
|
||||
}
|
||||
|
||||
public void UnequippedHand(UnequippedHandEventArgs eventArgs)
|
||||
void IUnequippedHand.UnequippedHand(UnequippedHandEventArgs eventArgs)
|
||||
{
|
||||
eventArgs.User.PopupMessage("unequipped hand" + Owner.Name);
|
||||
}
|
||||
|
||||
@@ -64,18 +64,18 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
Roll();
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
Roll();
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Land(LandEventArgs eventArgs)
|
||||
void ILand.Land(LandEventArgs eventArgs)
|
||||
{
|
||||
Roll();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Items/genhit.ogg", location, AudioHelpers.WithVariation(0.125f));
|
||||
}
|
||||
|
||||
public async Task AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.InRangeUnobstructed(ignoreInsideBlocker: true, popup: true)) return;
|
||||
if (!Owner.TryGetComponent(out StackComponent stack)) return;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
message.AddMarkup(Loc.GetString("It holds {0} charges.", refillAmmo));
|
||||
}
|
||||
|
||||
public async Task AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Target == null || !eventArgs.Target.TryGetComponent(out RCDComponent rcdComponent) || !eventArgs.User.TryGetComponent(out IHandsComponent hands))
|
||||
{
|
||||
|
||||
@@ -68,8 +68,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
///<summary>
|
||||
/// Method called when the RCD is clicked in-hand, this will cycle the RCD mode.
|
||||
///</summary>
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
SwapMode(eventArgs);
|
||||
return true;
|
||||
@@ -94,7 +93,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
message.AddMarkup(Loc.GetString("It's currently on {0} mode, and holds {1} charges.",_mode.ToString(), _ammo));
|
||||
}
|
||||
|
||||
public async Task AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
//No changing mode mid-RCD
|
||||
var startingMode = _mode;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
return user.InRangeUnobstructed(Owner, ignoreInsideBlocker: true, popup: true);
|
||||
}
|
||||
|
||||
public bool InteractHand(InteractHandEventArgs eventArgs)
|
||||
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
|
||||
{
|
||||
if (!CanPickup(eventArgs.User)) return false;
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
public string GroupId;
|
||||
public int Amount;
|
||||
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(ref PrototypeName, "name", null);
|
||||
serializer.DataField(ref Amount, "amount", 1);
|
||||
|
||||
@@ -45,17 +45,18 @@ namespace Content.Server.GameObjects.Components.Items
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
Squeak();
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
Squeak();
|
||||
return false;
|
||||
}
|
||||
public void Land(LandEventArgs eventArgs)
|
||||
|
||||
void ILand.Land(LandEventArgs eventArgs)
|
||||
{
|
||||
Squeak();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
victim.Delete();
|
||||
}
|
||||
|
||||
public SuicideKind Suicide(IEntity victim, IChatManager chat)
|
||||
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)
|
||||
{
|
||||
var othersMessage = Loc.GetString("{0:theName} has thrown themselves on a meat spike!", victim);
|
||||
victim.PopupMessageOtherClients(othersMessage);
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
UserInterface?.Toggle(actor.playerSession);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!Powered)
|
||||
{
|
||||
@@ -473,7 +473,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
_audioSystem.PlayFromEntity("/Audio/Machines/machine_switch.ogg",Owner,AudioParams.Default.WithVolume(-2f));
|
||||
}
|
||||
|
||||
public SuicideKind Suicide(IEntity victim, IChatManager chat)
|
||||
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)
|
||||
{
|
||||
var headCount = 0;
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
UserInterface?.Toggle(actor.playerSession);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IHandsComponent? hands))
|
||||
{
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace Content.Server.GameObjects.Components.MachineLinking
|
||||
{
|
||||
public override string Name => "SignalButton";
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
TransmitSignal(eventArgs.User);
|
||||
}
|
||||
|
||||
public bool InteractHand(InteractHandEventArgs eventArgs)
|
||||
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
|
||||
{
|
||||
TransmitSignal(eventArgs.User);
|
||||
return true;
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Content.Server.GameObjects.Components.MachineLinking
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Using.TryGetComponent<ToolComponent>(out var tool))
|
||||
return false;
|
||||
|
||||
@@ -32,12 +32,12 @@ namespace Content.Server.GameObjects.Components.MachineLinking
|
||||
serializer.DataField(ref _on, "on", true);
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
TransmitSignal(eventArgs.User);
|
||||
}
|
||||
|
||||
public bool InteractHand(InteractHandEventArgs eventArgs)
|
||||
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
|
||||
{
|
||||
TransmitSignal(eventArgs.User);
|
||||
return true;
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace Content.Server.GameObjects.Components.MachineLinking
|
||||
return this;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Using.TryGetComponent<ToolComponent>(out var tool))
|
||||
return false;
|
||||
|
||||
@@ -16,6 +16,7 @@ using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.ComponentDependencies;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -143,7 +144,7 @@ namespace Content.Server.GameObjects.Components
|
||||
[UsedImplicitly]
|
||||
public sealed class ToggleMagbootsAction : IToggleItemAction
|
||||
{
|
||||
public void ExposeData(ObjectSerializer serializer) { }
|
||||
void IExposeData.ExposeData(ObjectSerializer serializer) { }
|
||||
|
||||
public bool DoToggleAction(ToggleItemActionEventArgs args)
|
||||
{
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Content.Server.GameObjects.Components
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IActorComponent? actor))
|
||||
{
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if (!Powered ||
|
||||
!eventArgs.User.TryGetComponent(out IActorComponent? actor))
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
||||
serializer.DataField(this, h => h.Heal, "heal", new Dictionary<DamageType, int>());
|
||||
}
|
||||
|
||||
public async Task AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Target == null)
|
||||
{
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs args)
|
||||
void IActivate.Activate(ActivateEventArgs args)
|
||||
{
|
||||
if (!args.User.TryGetComponent(out IActorComponent? actor))
|
||||
{
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Content.Server.GameObjects.Components.Morgue
|
||||
}, _cremateCancelToken.Token);
|
||||
}
|
||||
|
||||
public SuicideKind Suicide(IEntity victim, IChatManager chat)
|
||||
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)
|
||||
{
|
||||
var mind = victim.PlayerSession()?.ContentData()?.Mind;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
AudioHelpers.WithVariation(0.125f));
|
||||
}
|
||||
|
||||
public void Land(LandEventArgs eventArgs)
|
||||
void ILand.Land(LandEventArgs eventArgs)
|
||||
{
|
||||
PlaySound();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
CreamPied = false;
|
||||
}
|
||||
|
||||
public ReagentUnit ReagentReactTouch(ReagentPrototype reagent, ReagentUnit volume)
|
||||
ReagentUnit IReagentReaction.ReagentReactTouch(ReagentPrototype reagent, ReagentUnit volume)
|
||||
{
|
||||
switch (reagent.ID)
|
||||
{
|
||||
@@ -50,7 +50,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
return ReagentUnit.Zero;
|
||||
}
|
||||
|
||||
public void HitBy(ThrowCollideEventArgs eventArgs)
|
||||
void IThrowCollide.HitBy(ThrowCollideEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Thrown.HasComponent<CreamPieComponent>() || CreamPied) return;
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
serializer.DataField(ref _temperature, "temperature", 673.15f);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Using.TryGetComponent(out IHotItem? lighter)
|
||||
&& lighter.IsCurrentlyHot()
|
||||
@@ -104,4 +104,4 @@ namespace Content.Server.GameObjects.Components.Nutrition
|
||||
return _currentState == SharedBurningStates.Lit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace Content.Server.GameObjects.Components.PDA
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
var item = eventArgs.Using;
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace Content.Server.GameObjects.Components.PDA
|
||||
UpdatePDAAppearance();
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IActorComponent? actor))
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Content.Server.GameObjects.Components.Paper
|
||||
message.AddMarkup(Content);
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IActorComponent? actor))
|
||||
return false;
|
||||
@@ -74,7 +74,7 @@ namespace Content.Server.GameObjects.Components.Paper
|
||||
UpdateUserInterface();
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Using.HasComponent<WriteComponent>())
|
||||
return false;
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Content.Server.GameObjects.Components
|
||||
return new PlaceableSurfaceComponentState(_isPlaceable,_placeCentered,_positionOffset);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!IsPlaceable)
|
||||
return false;
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
|
||||
UpdateColor();
|
||||
}
|
||||
|
||||
public void Land(LandEventArgs eventArgs)
|
||||
void ILand.Land(LandEventArgs eventArgs)
|
||||
{
|
||||
|
||||
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>("GlassBreak");
|
||||
|
||||
@@ -58,12 +58,12 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
|
||||
|
||||
// TODO CONSTRUCTION make this use a construction graph
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
return InsertBulb(eventArgs.Using);
|
||||
}
|
||||
|
||||
public bool InteractHand(InteractHandEventArgs eventArgs)
|
||||
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IDamageableComponent damageableComponent))
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents
|
||||
SetAppearance(RadiationCollectorVisualState.Deactivating);
|
||||
}
|
||||
|
||||
public void RadiationAct(float frameTime, SharedRadiationPulseComponent radiation)
|
||||
void IRadiationAct.RadiationAct(float frameTime, SharedRadiationPulseComponent radiation)
|
||||
{
|
||||
if (!_enabled) return;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
serializer.DataField(ref _wireType, "wireType", WireType.HighVoltage);
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Using.TryGetComponent(out ToolComponent tool)) return false;
|
||||
if (!await tool.UseTool(eventArgs.User, Owner, 0.25f, ToolQuality.Cutting)) return false;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.InRangeUnobstructed(ignoreInsideBlocker: true, popup: true)) return;
|
||||
if(!_mapManager.TryGetGrid(eventArgs.ClickLocation.GetGridId(Owner.EntityManager), out var grid))
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Content.Server.GameObjects.Components.Radio
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
return Use(eventArgs.User);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ namespace Content.Server.GameObjects.Components.Radio
|
||||
_radioSystem.SpreadMessage(this, speaker, message, BroadcastFrequency);
|
||||
}
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
Use(eventArgs.User);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace Content.Server.GameObjects.Components.Recycling
|
||||
Recycle(collidedWith);
|
||||
}
|
||||
|
||||
public SuicideKind Suicide(IEntity victim, IChatManager chat)
|
||||
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)
|
||||
{
|
||||
var mind = victim.PlayerSession()?.ContentData()?.Mind;
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@ namespace Content.Server.GameObjects.Components.Sound
|
||||
EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundName, Owner, AudioParams.Default.WithVolume(-2f));
|
||||
}
|
||||
}
|
||||
public void Land(LandEventArgs eventArgs)
|
||||
|
||||
void ILand.Land(LandEventArgs eventArgs)
|
||||
{
|
||||
PlaySoundEffect();
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Content.Server.GameObjects.Components.Stack
|
||||
return false;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Using.TryGetComponent<StackComponent>(out var stack))
|
||||
return false;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.GameObjects.Components.TraitorDeathMatch
|
||||
/// <inheritdoc />
|
||||
public override string Name => "TraitorDeathMatchRedemption";
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent<InventoryComponent>(out var userInv))
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Content.Server.GameObjects.Components.VendingMachines
|
||||
|
||||
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(VendingMachineUiKey.Key);
|
||||
|
||||
public void Activate(ActivateEventArgs eventArgs)
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if(!eventArgs.User.TryGetComponent(out IActorComponent? actor))
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Content.Server.GameObjects.Components.Watercloset
|
||||
UpdateSprite();
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
// are player trying place or lift of cistern lid?
|
||||
if (eventArgs.Using.TryGetComponent(out ToolComponent? tool)
|
||||
@@ -92,7 +92,7 @@ namespace Content.Server.GameObjects.Components.Watercloset
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool InteractHand(InteractHandEventArgs eventArgs)
|
||||
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
|
||||
{
|
||||
// trying get something from stash?
|
||||
if (LidOpen)
|
||||
@@ -104,7 +104,7 @@ namespace Content.Server.GameObjects.Components.Watercloset
|
||||
}
|
||||
|
||||
// just want to up/down seat?
|
||||
// check that nobody seats on seat right now
|
||||
// check that nobody seats on seat right now
|
||||
if (Owner.TryGetComponent(out StrapComponent? strap))
|
||||
{
|
||||
if (strap.BuckledEntities.Count != 0)
|
||||
@@ -144,7 +144,7 @@ namespace Content.Server.GameObjects.Components.Watercloset
|
||||
}
|
||||
}
|
||||
|
||||
public SuicideKind Suicide(IEntity victim, IChatManager chat)
|
||||
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)
|
||||
{
|
||||
// check that victim even have head
|
||||
if (victim.TryGetComponent<IBody>(out var body) &&
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
if (!Use(eventArgs.User))
|
||||
{
|
||||
|
||||
@@ -189,14 +189,14 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
_activated = true;
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
ToggleStatus(eventArgs.User);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!ActionBlockerSystem.CanInteract(eventArgs.User)) return false;
|
||||
if (!_cellSlot.InsertCell(eventArgs.Using)) return false;
|
||||
@@ -212,7 +212,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
}
|
||||
}
|
||||
|
||||
public void DoHit(ThrowCollideEventArgs eventArgs)
|
||||
void IThrowCollide.DoHit(ThrowCollideEventArgs eventArgs)
|
||||
{
|
||||
if (!Activated || Cell == null || !Cell.TryUseCharge(EnergyPerUse) || !eventArgs.Target.TryGetComponent(out StunnableComponent? stunnable))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user