@@ -3,6 +3,7 @@ using System.Linq;
|
|||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Atmos.EntitySystems;
|
using Content.Server.Atmos.EntitySystems;
|
||||||
using Content.Server.Disposal.Tube;
|
using Content.Server.Disposal.Tube;
|
||||||
|
using Content.Server.Carrying;
|
||||||
using Content.Server.Disposal.Tube.Components;
|
using Content.Server.Disposal.Tube.Components;
|
||||||
using Content.Server.Disposal.Unit.Components;
|
using Content.Server.Disposal.Unit.Components;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
@@ -503,6 +504,9 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
|||||||
if (!CanInsert(unitId, unit, toInsertId))
|
if (!CanInsert(unitId, unit, toInsertId))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (HasComp<CarryingComponent>(toInsertId))
|
||||||
|
return false;
|
||||||
|
|
||||||
bool insertingSelf = userId == toInsertId;
|
bool insertingSelf = userId == toInsertId;
|
||||||
|
|
||||||
var delay = insertingSelf ? unit.EntryDelay : unit.DraggedEntryDelay;
|
var delay = insertingSelf ? unit.EntryDelay : unit.DraggedEntryDelay;
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
using Content.Server.Contests;
|
using Content.Server.Contests;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Server.Storage.Components;
|
using Content.Server.Storage.Components;
|
||||||
|
using Content.Server.Carrying;
|
||||||
|
using Content.Shared.Storage;
|
||||||
|
using Content.Shared.Inventory;
|
||||||
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
@@ -21,6 +25,7 @@ public sealed class EscapeInventorySystem : EntitySystem
|
|||||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||||
[Dependency] private readonly ContestsSystem _contests = default!;
|
[Dependency] private readonly ContestsSystem _contests = default!;
|
||||||
|
[Dependency] private readonly CarryingSystem _carryingSystem = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// You can't escape the hands of an entity this many times more massive than you.
|
/// You can't escape the hands of an entity this many times more massive than you.
|
||||||
@@ -64,7 +69,7 @@ public sealed class EscapeInventorySystem : EntitySystem
|
|||||||
AttemptEscape(uid, container.Owner, component);
|
AttemptEscape(uid, container.Owner, component);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AttemptEscape(EntityUid user, EntityUid container, CanEscapeInventoryComponent component, float multiplier = 1f)
|
public void AttemptEscape(EntityUid user, EntityUid container, CanEscapeInventoryComponent component, float multiplier = 1f)
|
||||||
{
|
{
|
||||||
if (component.IsEscaping)
|
if (component.IsEscaping)
|
||||||
return;
|
return;
|
||||||
@@ -93,7 +98,14 @@ public sealed class EscapeInventorySystem : EntitySystem
|
|||||||
if (args.Handled || args.Cancelled)
|
if (args.Handled || args.Cancelled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (TryComp<BeingCarriedComponent>(uid, out var carried))
|
||||||
|
{
|
||||||
|
_carryingSystem.DropCarried(carried.Carrier, uid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_containerSystem.AttachParentToContainerOrGrid((uid, Transform(uid)));
|
_containerSystem.AttachParentToContainerOrGrid((uid, Transform(uid)));
|
||||||
|
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
Content.Server/White/Carrying/BeingCarriedComponent.cs
Normal file
11
Content.Server/White/Carrying/BeingCarriedComponent.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace Content.Server.Carrying
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Stores the carrier of an entity being carried.
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class BeingCarriedComponent : Component
|
||||||
|
{
|
||||||
|
public EntityUid Carrier = default!;
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Content.Server/White/Carrying/CarriableComponent.cs
Normal file
17
Content.Server/White/Carrying/CarriableComponent.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace Content.Server.Carrying
|
||||||
|
{
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class CarriableComponent : Component
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Number of free hands required
|
||||||
|
/// to carry the entity
|
||||||
|
/// </summary>
|
||||||
|
[DataField("freeHandsRequired")]
|
||||||
|
public int FreeHandsRequired = 2;
|
||||||
|
|
||||||
|
public CancellationTokenSource? CancelToken;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Content.Server/White/Carrying/CarryingComponent.cs
Normal file
11
Content.Server/White/Carrying/CarryingComponent.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace Content.Server.Carrying
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Added to an entity when they are carrying somebody.
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class CarryingComponent : Component
|
||||||
|
{
|
||||||
|
public EntityUid Carried = default!;
|
||||||
|
}
|
||||||
|
}
|
||||||
312
Content.Server/White/Carrying/CarryingSystem.cs
Normal file
312
Content.Server/White/Carrying/CarryingSystem.cs
Normal file
@@ -0,0 +1,312 @@
|
|||||||
|
using System.Threading;
|
||||||
|
using Content.Server.DoAfter;
|
||||||
|
using Content.Server.Body.Systems;
|
||||||
|
using Content.Server.Hands.Systems;
|
||||||
|
using Content.Server.Resist;
|
||||||
|
using Content.Server.Popups;
|
||||||
|
using Content.Server.Contests;
|
||||||
|
using Content.Server.Climbing;
|
||||||
|
using Content.Shared.Mobs;
|
||||||
|
using Content.Shared.DoAfter;
|
||||||
|
using Content.Shared.Buckle.Components;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
|
using Content.Shared.Hands;
|
||||||
|
using Content.Shared.Stunnable;
|
||||||
|
using Content.Shared.Interaction.Events;
|
||||||
|
using Content.Shared.Verbs;
|
||||||
|
using Content.Shared.Carrying;
|
||||||
|
using Content.Shared.Movement.Events;
|
||||||
|
using Content.Shared.Movement.Systems;
|
||||||
|
using Content.Shared.Pulling;
|
||||||
|
using Content.Shared.Pulling.Components;
|
||||||
|
using Content.Shared.Standing;
|
||||||
|
using Content.Shared.ActionBlocker;
|
||||||
|
using Content.Shared.Throwing;
|
||||||
|
using Content.Shared.Physics.Pull;
|
||||||
|
using Content.Shared.Mobs.Systems;
|
||||||
|
using Robust.Shared.Map.Components;
|
||||||
|
|
||||||
|
namespace Content.Server.Carrying
|
||||||
|
{
|
||||||
|
public sealed class CarryingSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly HandVirtualItemSystem _virtualItemSystem = default!;
|
||||||
|
[Dependency] private readonly CarryingSlowdownSystem _slowdown = default!;
|
||||||
|
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||||
|
[Dependency] private readonly StandingStateSystem _standingState = default!;
|
||||||
|
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||||
|
[Dependency] private readonly SharedPullingSystem _pullingSystem = default!;
|
||||||
|
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||||
|
[Dependency] private readonly EscapeInventorySystem _escapeInventorySystem = default!;
|
||||||
|
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||||
|
[Dependency] private readonly ContestsSystem _contests = default!;
|
||||||
|
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
SubscribeLocalEvent<CarriableComponent, GetVerbsEvent<AlternativeVerb>>(AddCarryVerb);
|
||||||
|
SubscribeLocalEvent<CarryingComponent, VirtualItemDeletedEvent>(OnVirtualItemDeleted);
|
||||||
|
SubscribeLocalEvent<CarryingComponent, BeforeThrowEvent>(OnThrow);
|
||||||
|
SubscribeLocalEvent<CarryingComponent, EntParentChangedMessage>(OnParentChanged);
|
||||||
|
SubscribeLocalEvent<CarryingComponent, MobStateChangedEvent>(OnMobStateChanged);
|
||||||
|
SubscribeLocalEvent<BeingCarriedComponent, InteractionAttemptEvent>(OnInteractionAttempt);
|
||||||
|
SubscribeLocalEvent<BeingCarriedComponent, MoveInputEvent>(OnMoveInput);
|
||||||
|
SubscribeLocalEvent<BeingCarriedComponent, UpdateCanMoveEvent>(OnMoveAttempt);
|
||||||
|
SubscribeLocalEvent<BeingCarriedComponent, StandAttemptEvent>(OnStandAttempt);
|
||||||
|
SubscribeLocalEvent<BeingCarriedComponent, GettingInteractedWithAttemptEvent>(OnInteractedWith);
|
||||||
|
SubscribeLocalEvent<BeingCarriedComponent, PullAttemptEvent>(OnPullAttempt);
|
||||||
|
SubscribeLocalEvent<BeingCarriedComponent, StartClimbEvent>(OnStartClimb);
|
||||||
|
SubscribeLocalEvent<BeingCarriedComponent, BuckleChangeEvent>(OnBuckleChange);
|
||||||
|
SubscribeLocalEvent<CarriableComponent, CarryDoAfterEvent>(OnDoAfter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void AddCarryVerb(EntityUid uid, CarriableComponent component, GetVerbsEvent<AlternativeVerb> args)
|
||||||
|
{
|
||||||
|
if (!args.CanInteract || !args.CanAccess)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!CanCarry(args.User, uid, component))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (HasComp<CarryingComponent>(args.User)) // yeah not dealing with that
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (HasComp<BeingCarriedComponent>(args.User) || HasComp<BeingCarriedComponent>(args.Target))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_mobStateSystem.IsAlive(args.User))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (args.User == args.Target)
|
||||||
|
return;
|
||||||
|
|
||||||
|
AlternativeVerb verb = new()
|
||||||
|
{
|
||||||
|
Act = () =>
|
||||||
|
{
|
||||||
|
StartCarryDoAfter(args.User, uid, component);
|
||||||
|
},
|
||||||
|
Text = Loc.GetString("carry-verb"),
|
||||||
|
Priority = 2
|
||||||
|
};
|
||||||
|
args.Verbs.Add(verb);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Since the carried entity is stored as 2 virtual items, when deleted we want to drop them.
|
||||||
|
/// </summary>
|
||||||
|
private void OnVirtualItemDeleted(EntityUid uid, CarryingComponent component, VirtualItemDeletedEvent args)
|
||||||
|
{
|
||||||
|
if (!HasComp<CarriableComponent>(args.BlockingEntity))
|
||||||
|
return;
|
||||||
|
|
||||||
|
DropCarried(uid, args.BlockingEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Basically using virtual item passthrough to throw the carried person. A new age!
|
||||||
|
/// Maybe other things besides throwing should use virt items like this...
|
||||||
|
/// </summary>
|
||||||
|
private void OnThrow(EntityUid uid, CarryingComponent component, BeforeThrowEvent args)
|
||||||
|
{
|
||||||
|
if (!TryComp<HandVirtualItemComponent>(args.ItemUid, out var virtItem) || !HasComp<CarriableComponent>(virtItem.BlockingEntity))
|
||||||
|
return;
|
||||||
|
|
||||||
|
args.ItemUid = virtItem.BlockingEntity;
|
||||||
|
|
||||||
|
var multiplier = _contests.MassContest(uid, virtItem.BlockingEntity);
|
||||||
|
args.ThrowStrength = 5f * multiplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnParentChanged(EntityUid uid, CarryingComponent component, ref EntParentChangedMessage args)
|
||||||
|
{
|
||||||
|
if (Transform(uid).MapID != args.OldMapId)
|
||||||
|
return;
|
||||||
|
|
||||||
|
DropCarried(uid, component.Carried);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMobStateChanged(EntityUid uid, CarryingComponent component, MobStateChangedEvent args)
|
||||||
|
{
|
||||||
|
DropCarried(uid, component.Carried);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Only let the person being carried interact with their carrier and things on their person.
|
||||||
|
/// </summary>
|
||||||
|
private void OnInteractionAttempt(EntityUid uid, BeingCarriedComponent component, InteractionAttemptEvent args)
|
||||||
|
{
|
||||||
|
if (args.Target == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var targetParent = Transform(args.Target.Value).ParentUid;
|
||||||
|
|
||||||
|
if (args.Target.Value != component.Carrier && targetParent != component.Carrier && targetParent != uid)
|
||||||
|
args.Cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Try to escape via the escape inventory system.
|
||||||
|
/// </summary>
|
||||||
|
private void OnMoveInput(EntityUid uid, BeingCarriedComponent component, ref MoveInputEvent args)
|
||||||
|
{
|
||||||
|
if (!TryComp<CanEscapeInventoryComponent>(uid, out var escape))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_actionBlockerSystem.CanInteract(uid, component.Carrier))
|
||||||
|
{
|
||||||
|
_escapeInventorySystem.AttemptEscape(uid, component.Carrier, escape, _contests.MassContest(uid, component.Carrier));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMoveAttempt(EntityUid uid, BeingCarriedComponent component, UpdateCanMoveEvent args)
|
||||||
|
{
|
||||||
|
args.Cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnStandAttempt(EntityUid uid, BeingCarriedComponent component, StandAttemptEvent args)
|
||||||
|
{
|
||||||
|
args.Cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnInteractedWith(EntityUid uid, BeingCarriedComponent component, GettingInteractedWithAttemptEvent args)
|
||||||
|
{
|
||||||
|
if (args.Uid != component.Carrier)
|
||||||
|
args.Cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPullAttempt(EntityUid uid, BeingCarriedComponent component, PullAttemptEvent args)
|
||||||
|
{
|
||||||
|
args.Cancelled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnStartClimb(EntityUid uid, BeingCarriedComponent component, StartClimbEvent args)
|
||||||
|
{
|
||||||
|
DropCarried(component.Carrier, uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnBuckleChange(EntityUid uid, BeingCarriedComponent component, ref BuckleChangeEvent args)
|
||||||
|
{
|
||||||
|
DropCarried(component.Carrier, uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDoAfter(EntityUid uid, CarriableComponent component, CarryDoAfterEvent args)
|
||||||
|
{
|
||||||
|
component.CancelToken = null;
|
||||||
|
if (args.Handled || args.Cancelled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!CanCarry(args.Args.User, uid, component))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Carry(args.Args.User, uid);
|
||||||
|
args.Handled = true;
|
||||||
|
}
|
||||||
|
private void StartCarryDoAfter(EntityUid carrier, EntityUid carried, CarriableComponent component)
|
||||||
|
{
|
||||||
|
TimeSpan length = TimeSpan.FromSeconds(3);
|
||||||
|
|
||||||
|
var mod = _contests.MassContest(carrier, carried);
|
||||||
|
|
||||||
|
if (mod != 0)
|
||||||
|
length /= mod;
|
||||||
|
|
||||||
|
if (length >= TimeSpan.FromSeconds(9))
|
||||||
|
{
|
||||||
|
_popupSystem.PopupEntity(Loc.GetString("carry-too-heavy"), carried, carrier, Shared.Popups.PopupType.SmallCaution);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!HasComp<KnockedDownComponent>(carried))
|
||||||
|
length *= 2f;
|
||||||
|
|
||||||
|
component.CancelToken = new CancellationTokenSource();
|
||||||
|
|
||||||
|
var ev = new CarryDoAfterEvent();
|
||||||
|
var args = new DoAfterArgs(carrier, length, ev, carried, target: carried)
|
||||||
|
{
|
||||||
|
BreakOnTargetMove = true,
|
||||||
|
BreakOnUserMove = true,
|
||||||
|
NeedHand = true
|
||||||
|
};
|
||||||
|
|
||||||
|
_doAfterSystem.TryStartDoAfter(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Carry(EntityUid carrier, EntityUid carried)
|
||||||
|
{
|
||||||
|
if (TryComp<SharedPullableComponent>(carried, out var pullable))
|
||||||
|
_pullingSystem.TryStopPull(pullable);
|
||||||
|
|
||||||
|
Transform(carrier).AttachToGridOrMap();
|
||||||
|
Transform(carried).AttachToGridOrMap();
|
||||||
|
Transform(carried).Coordinates = Transform(carrier).Coordinates;
|
||||||
|
Transform(carried).AttachParent(Transform(carrier));
|
||||||
|
_virtualItemSystem.TrySpawnVirtualItemInHand(carried, carrier);
|
||||||
|
_virtualItemSystem.TrySpawnVirtualItemInHand(carried, carrier);
|
||||||
|
var carryingComp = EnsureComp<CarryingComponent>(carrier);
|
||||||
|
ApplyCarrySlowdown(carrier, carried);
|
||||||
|
var carriedComp = EnsureComp<BeingCarriedComponent>(carried);
|
||||||
|
EnsureComp<KnockedDownComponent>(carried);
|
||||||
|
EnsureComp<CanEscapeInventoryComponent>(carried);
|
||||||
|
|
||||||
|
carryingComp.Carried = carried;
|
||||||
|
carriedComp.Carrier = carrier;
|
||||||
|
|
||||||
|
_actionBlockerSystem.UpdateCanMove(carried);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DropCarried(EntityUid carrier, EntityUid carried)
|
||||||
|
{
|
||||||
|
RemComp<CarryingComponent>(carrier); // get rid of this first so we don't recusrively fire that event
|
||||||
|
RemComp<CarryingSlowdownComponent>(carrier);
|
||||||
|
RemComp<BeingCarriedComponent>(carried);
|
||||||
|
RemComp<KnockedDownComponent>(carried);
|
||||||
|
RemComp<CanEscapeInventoryComponent>(carried);
|
||||||
|
_actionBlockerSystem.UpdateCanMove(carried);
|
||||||
|
_virtualItemSystem.DeleteInHandsMatching(carrier, carried);
|
||||||
|
Transform(carried).AttachToGridOrMap();
|
||||||
|
_standingState.Stand(carried);
|
||||||
|
_movementSpeed.RefreshMovementSpeedModifiers(carrier);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyCarrySlowdown(EntityUid carrier, EntityUid carried)
|
||||||
|
{
|
||||||
|
var massRatio = _contests.MassContest(carrier, carried);
|
||||||
|
|
||||||
|
if (massRatio == 0)
|
||||||
|
massRatio = 1;
|
||||||
|
|
||||||
|
var massRatioSq = Math.Pow(massRatio, 2);
|
||||||
|
var modifier = (1 - (0.15 / massRatioSq));
|
||||||
|
modifier = Math.Max(0.1, modifier);
|
||||||
|
var slowdownComp = EnsureComp<CarryingSlowdownComponent>(carrier);
|
||||||
|
_slowdown.SetModifier(carrier, (float) modifier, (float) modifier, slowdownComp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanCarry(EntityUid carrier, EntityUid carried, CarriableComponent? carriedComp = null)
|
||||||
|
{
|
||||||
|
if (!Resolve(carried, ref carriedComp, false))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (carriedComp.CancelToken != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!HasComp<MapGridComponent>(Transform(carrier).ParentUid))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (HasComp<BeingCarriedComponent>(carrier) || HasComp<BeingCarriedComponent>(carried))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!TryComp<HandsComponent>(carrier, out var hands))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (hands.CountFreeHands() < carriedComp.FreeHandsRequired)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1329,7 +1329,7 @@ namespace Content.Shared.CCVar
|
|||||||
/// - When traversing grids it will snap to the nearest cardinal which will generally be imperceptible.
|
/// - When traversing grids it will snap to the nearest cardinal which will generally be imperceptible.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly CVarDef<bool> CameraRotationLocked =
|
public static readonly CVarDef<bool> CameraRotationLocked =
|
||||||
CVarDef.Create("shuttle.camera_rotation_locked", false, CVar.REPLICATED);
|
CVarDef.Create("shuttle.camera_rotation_locked", true, CVar.REPLICATED);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the arrivals terminal should be on a planet map.
|
/// Whether the arrivals terminal should be on a planet map.
|
||||||
@@ -1424,7 +1424,7 @@ namespace Content.Shared.CCVar
|
|||||||
/// Time in minutes after round start to auto-call the shuttle. Set to zero to disable.
|
/// Time in minutes after round start to auto-call the shuttle. Set to zero to disable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly CVarDef<int> EmergencyShuttleAutoCallTime =
|
public static readonly CVarDef<int> EmergencyShuttleAutoCallTime =
|
||||||
CVarDef.Create("shuttle.auto_call_time", 90, CVar.SERVERONLY);
|
CVarDef.Create("shuttle.auto_call_time", 0, CVar.SERVERONLY);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Time in minutes after the round was extended (by recalling the shuttle) to call
|
/// Time in minutes after the round was extended (by recalling the shuttle) to call
|
||||||
|
|||||||
10
Content.Shared/White/Carrying/CarryingDoAfterEvent.cs
Normal file
10
Content.Shared/White/Carrying/CarryingDoAfterEvent.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using Robust.Shared.Serialization;
|
||||||
|
using Content.Shared.DoAfter;
|
||||||
|
|
||||||
|
namespace Content.Shared.Carrying
|
||||||
|
{
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public sealed class CarryDoAfterEvent : SimpleDoAfterEvent
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
28
Content.Shared/White/Carrying/CarryingSlowdownComponent.cs
Normal file
28
Content.Shared/White/Carrying/CarryingSlowdownComponent.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using Robust.Shared.GameStates;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
|
namespace Content.Shared.Carrying
|
||||||
|
{
|
||||||
|
[RegisterComponent, NetworkedComponent, Access(typeof(CarryingSlowdownSystem))]
|
||||||
|
|
||||||
|
public sealed class CarryingSlowdownComponent : Component
|
||||||
|
{
|
||||||
|
[DataField("walkModifier", required: true)] [ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float WalkModifier = 1.0f;
|
||||||
|
|
||||||
|
[DataField("sprintModifier", required: true)] [ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float SprintModifier = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public sealed class CarryingSlowdownComponentState : ComponentState
|
||||||
|
{
|
||||||
|
public float WalkModifier;
|
||||||
|
public float SprintModifier;
|
||||||
|
public CarryingSlowdownComponentState(float walkModifier, float sprintModifier)
|
||||||
|
{
|
||||||
|
WalkModifier = walkModifier;
|
||||||
|
SprintModifier = sprintModifier;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
47
Content.Shared/White/Carrying/CarryingSlowdownSystem.cs
Normal file
47
Content.Shared/White/Carrying/CarryingSlowdownSystem.cs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
using Content.Shared.Movement.Systems;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
|
namespace Content.Shared.Carrying
|
||||||
|
{
|
||||||
|
public sealed class CarryingSlowdownSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
SubscribeLocalEvent<CarryingSlowdownComponent, ComponentGetState>(OnGetState);
|
||||||
|
SubscribeLocalEvent<CarryingSlowdownComponent, ComponentHandleState>(OnHandleState);
|
||||||
|
SubscribeLocalEvent<CarryingSlowdownComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMoveSpeed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetModifier(EntityUid uid, float walkSpeedModifier, float sprintSpeedModifier, CarryingSlowdownComponent? component = null)
|
||||||
|
{
|
||||||
|
if (!Resolve(uid, ref component))
|
||||||
|
return;
|
||||||
|
|
||||||
|
component.WalkModifier = walkSpeedModifier;
|
||||||
|
component.SprintModifier = sprintSpeedModifier;
|
||||||
|
_movementSpeed.RefreshMovementSpeedModifiers(uid);
|
||||||
|
}
|
||||||
|
private void OnGetState(EntityUid uid, CarryingSlowdownComponent component, ref ComponentGetState args)
|
||||||
|
{
|
||||||
|
args.State = new CarryingSlowdownComponentState(component.WalkModifier, component.SprintModifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnHandleState(EntityUid uid, CarryingSlowdownComponent component, ref ComponentHandleState args)
|
||||||
|
{
|
||||||
|
if (args.Current is CarryingSlowdownComponentState state)
|
||||||
|
{
|
||||||
|
component.WalkModifier = state.WalkModifier;
|
||||||
|
component.SprintModifier = state.SprintModifier;
|
||||||
|
|
||||||
|
_movementSpeed.RefreshMovementSpeedModifiers(uid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void OnRefreshMoveSpeed(EntityUid uid, CarryingSlowdownComponent component, RefreshMovementSpeedModifiersEvent args)
|
||||||
|
{
|
||||||
|
args.ModifySpeed(component.WalkModifier, component.SprintModifier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +1,2 @@
|
|||||||
reflect-shot = Отразил!
|
reflect-shot = Отразил!
|
||||||
|
carry-verb = Тащить на руках
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FlashlightSeclite
|
- id: FlashlightSeclite
|
||||||
- id: WeaponEgun
|
- id: WeaponDisabler
|
||||||
- id: ClothingHeadHatWarden
|
- id: ClothingHeadHatWarden
|
||||||
- id: ClothingHeadHatBeretWarden
|
- id: ClothingHeadHatBeretWarden
|
||||||
- id: ClothingBeltSecurityFilled
|
- id: ClothingBeltSecurityFilled
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
prob: 0.7
|
prob: 0.7
|
||||||
- id: ClothingNeckCloakMoth #bzzz Moth-pocalypse
|
- id: ClothingNeckCloakMoth #bzzz Moth-pocalypse
|
||||||
prob: 0.15
|
prob: 0.15
|
||||||
- id: WeaponEgun
|
- id: WeaponDisabler
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: LockerDetectiveFilled
|
id: LockerDetectiveFilled
|
||||||
|
|||||||
@@ -785,7 +785,7 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
parent: ClothingOuterHardsuitBase
|
parent: ClothingOuterHardsuitBase
|
||||||
id: ClothingOuterHardsuitDeathsquad
|
id: ClothingOuterHardsuitDeathsquad
|
||||||
name: death squad hardsuit
|
name: deathsquad hardsuit
|
||||||
description: An advanced hardsuit favored by commandos for use in special operations.
|
description: An advanced hardsuit favored by commandos for use in special operations.
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
@@ -795,26 +795,24 @@
|
|||||||
- type: PressureProtection
|
- type: PressureProtection
|
||||||
highPressureMultiplier: 0.02
|
highPressureMultiplier: 0.02
|
||||||
lowPressureMultiplier: 1000
|
lowPressureMultiplier: 1000
|
||||||
- type: TemperatureProtection
|
|
||||||
coefficient: 0.001
|
|
||||||
- type: ExplosionResistance
|
|
||||||
damageCoefficient: 0.2
|
|
||||||
- type: Armor
|
|
||||||
modifiers:
|
|
||||||
coefficients:
|
|
||||||
Blunt: 0.1 #best armor in the game
|
|
||||||
Slash: 0.1
|
|
||||||
Piercing: 0.1
|
|
||||||
Heat: 0.1
|
|
||||||
Radiation: 0.1
|
|
||||||
Caustic: 0.1
|
|
||||||
- type: ClothingSpeedModifier
|
- type: ClothingSpeedModifier
|
||||||
walkModifier: 1.0
|
walkModifier: 1.0
|
||||||
sprintModifier: 1.0
|
sprintModifier: 1.0
|
||||||
- type: HeldSpeedModifier
|
- type: Armor
|
||||||
|
modifiers:
|
||||||
|
coefficients:
|
||||||
|
Blunt: 0.2 #best armor in the game
|
||||||
|
Slash: 0.2
|
||||||
|
Piercing: 0.2
|
||||||
|
Heat: 0.2
|
||||||
|
Radiation: 0.2
|
||||||
|
Caustic: 0.2
|
||||||
|
- type: ExplosionResistance
|
||||||
|
damageCoefficient: 0.2
|
||||||
- type: ToggleableClothing
|
- type: ToggleableClothing
|
||||||
clothingPrototype: ClothingHeadHelmetHardsuitDeathsquad
|
clothingPrototype: ClothingHeadHelmetHardsuitDeathsquad
|
||||||
|
|
||||||
|
|
||||||
#CBURN Hardsuit
|
#CBURN Hardsuit
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: ClothingOuterHardsuitBase
|
parent: ClothingOuterHardsuitBase
|
||||||
@@ -913,4 +911,4 @@
|
|||||||
sprintModifier: 0.9
|
sprintModifier: 0.9
|
||||||
- type: HeldSpeedModifier
|
- type: HeldSpeedModifier
|
||||||
- type: ToggleableClothing
|
- type: ToggleableClothing
|
||||||
clothingPrototype: ClothingHeadHelmetHardsuitSanta
|
clothingPrototype: ClothingHeadHelmetHardsuitSanta
|
||||||
|
|||||||
@@ -225,6 +225,7 @@
|
|||||||
- CanPilot
|
- CanPilot
|
||||||
- FootstepSound
|
- FootstepSound
|
||||||
- DoorBumpOpener
|
- DoorBumpOpener
|
||||||
|
- type: Carriable
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
save: false
|
save: false
|
||||||
|
|||||||
@@ -323,7 +323,7 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 20
|
maxVol: 50
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Dexalin
|
- ReagentId: Dexalin
|
||||||
Quantity: 10
|
Quantity: 10
|
||||||
@@ -346,7 +346,7 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 20
|
maxVol: 50
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Dylovene
|
- ReagentId: Dylovene
|
||||||
Quantity: 10
|
Quantity: 10
|
||||||
@@ -369,7 +369,7 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 20
|
maxVol: 50
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Hyronalin
|
- ReagentId: Hyronalin
|
||||||
Quantity: 10
|
Quantity: 10
|
||||||
@@ -392,7 +392,7 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 20
|
maxVol: 50
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Iron
|
- ReagentId: Iron
|
||||||
Quantity: 10
|
Quantity: 10
|
||||||
@@ -438,7 +438,7 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 20
|
maxVol: 50
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Kelotane
|
- ReagentId: Kelotane
|
||||||
Quantity: 10
|
Quantity: 10
|
||||||
@@ -484,7 +484,7 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 20
|
maxVol: 50
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: SpaceDrugs
|
- ReagentId: SpaceDrugs
|
||||||
Quantity: 15
|
Quantity: 15
|
||||||
@@ -497,7 +497,7 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 20
|
maxVol: 50
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Tricordrazine
|
- ReagentId: Tricordrazine
|
||||||
Quantity: 10
|
Quantity: 10
|
||||||
@@ -569,7 +569,7 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 20
|
maxVol: 50
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Romerol
|
- ReagentId: Romerol
|
||||||
Quantity: 10
|
Quantity: 10
|
||||||
|
|||||||
@@ -441,7 +441,7 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 20
|
maxVol: 50
|
||||||
- type: SolutionSpiker
|
- type: SolutionSpiker
|
||||||
sourceSolution: food
|
sourceSolution: food
|
||||||
- type: DeleteOnTrigger
|
- type: DeleteOnTrigger
|
||||||
|
|||||||
@@ -733,3 +733,5 @@
|
|||||||
- type: Appearance
|
- type: Appearance
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 800
|
price: 800
|
||||||
|
- type: Item
|
||||||
|
size: 20
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
sprite: Structures/Machines/mixer.rsi
|
sprite: Structures/Machines/mixer.rsi
|
||||||
state: mixer_loaded
|
state: mixer_loaded
|
||||||
- type: ChemMaster
|
- type: ChemMaster
|
||||||
pillDosageLimit: 20
|
pillDosageLimit: 50
|
||||||
- type: Physics
|
- type: Physics
|
||||||
bodyType: Static
|
bodyType: Static
|
||||||
- type: Fixtures
|
- type: Fixtures
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
- Dwarf
|
- Dwarf
|
||||||
canBeAntag: false
|
canBeAntag: true
|
||||||
access:
|
access:
|
||||||
- Cargo
|
- Cargo
|
||||||
- Salvage
|
- Salvage
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
supervisors: job-supervisors-captain
|
supervisors: job-supervisors-captain
|
||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
canBeAntag: false
|
canBeAntag: true
|
||||||
access:
|
access:
|
||||||
- Command
|
- Command
|
||||||
- HeadOfPersonnel
|
- HeadOfPersonnel
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
startingGear: AtmosphericTechnicianGear
|
startingGear: AtmosphericTechnicianGear
|
||||||
icon: "JobIconAtmosphericTechnician"
|
icon: "JobIconAtmosphericTechnician"
|
||||||
supervisors: job-supervisors-ce
|
supervisors: job-supervisors-ce
|
||||||
|
canBeAntag: true
|
||||||
access:
|
access:
|
||||||
- Maintenance
|
- Maintenance
|
||||||
- Engineering
|
- Engineering
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
- Dwarf
|
- Dwarf
|
||||||
canBeAntag: false
|
canBeAntag: true
|
||||||
access:
|
access:
|
||||||
- Maintenance
|
- Maintenance
|
||||||
- Engineering
|
- Engineering
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
startingGear: TechnicalAssistantGear
|
startingGear: TechnicalAssistantGear
|
||||||
icon: "JobIconTechnicalAssistant"
|
icon: "JobIconTechnicalAssistant"
|
||||||
supervisors: job-supervisors-engineering
|
supervisors: job-supervisors-engineering
|
||||||
canBeAntag: false
|
canBeAntag: true
|
||||||
access:
|
access:
|
||||||
- Maintenance
|
- Maintenance
|
||||||
- Engineering
|
- Engineering
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
- Dwarf
|
- Dwarf
|
||||||
canBeAntag: false
|
canBeAntag: true
|
||||||
access:
|
access:
|
||||||
- Medical
|
- Medical
|
||||||
- Command
|
- Command
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
startingGear: MedicalInternGear
|
startingGear: MedicalInternGear
|
||||||
icon: "JobIconMedicalIntern"
|
icon: "JobIconMedicalIntern"
|
||||||
supervisors: job-supervisors-medicine
|
supervisors: job-supervisors-medicine
|
||||||
canBeAntag: false
|
canBeAntag: true
|
||||||
access:
|
access:
|
||||||
- Medical
|
- Medical
|
||||||
- Maintenance
|
- Maintenance
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
- type: job
|
- type: job
|
||||||
id: ResearchAssistant
|
id: ResearchAssistant
|
||||||
name: job-name-research-assistant
|
name: job-name-research-assistant
|
||||||
description: job-description-research-assistant
|
description: job-description-research-assistant
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
startingGear: ResearchAssistantGear
|
startingGear: ResearchAssistantGear
|
||||||
icon: "JobIconResearchAssistant"
|
icon: "JobIconResearchAssistant"
|
||||||
supervisors: job-supervisors-science
|
supervisors: job-supervisors-science
|
||||||
canBeAntag: false
|
canBeAntag: true
|
||||||
access:
|
access:
|
||||||
- Research
|
- Research
|
||||||
- Maintenance
|
- Maintenance
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
- Dwarf
|
- Dwarf
|
||||||
canBeAntag: false
|
canBeAntag: true
|
||||||
access:
|
access:
|
||||||
- Research
|
- Research
|
||||||
- Command
|
- Command
|
||||||
|
|||||||
Reference in New Issue
Block a user