Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Долой абьюз резоми #245

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Robust.Shared.GameStates;

namespace Content.Shared._Adventure.Hands;

[RegisterComponent, NetworkedComponent]
public sealed partial class NoInteractionInHandsComponent : Component
{
}
30 changes: 30 additions & 0 deletions Content.Shared/_Adventure/Hands/NoInteractionInHandsSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction.Events;
using Content.Shared._Adventure.Hands;
using Robust.Shared.Prototypes;

namespace Content.Server._Adventure.Hands;

public sealed partial class NoInteractionInHandsSystem : EntitySystem
{
[Dependency] private readonly SharedHandsSystem _hands = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<NoInteractionInHandsComponent, UseAttemptEvent>(OnUseAttempt);
}

private bool Blocked(EntityUid ent)
{
var transform = Transform(ent);
var parent = transform.ParentUid;

return _hands.IsHolding(parent, ent);
}

private void OnUseAttempt(Entity<NoInteractionInHandsComponent> ent, ref UseAttemptEvent args)
{
if (!args.Cancelled && Blocked(ent))
args.Cancel();
}
}
1 change: 1 addition & 0 deletions Resources/Prototypes/Adventure/Races/Resomi/Resomi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
shiveringHeatRegulation: 500
normalBodyTemperature: 293.15 # температура тела не поднимается сама по себе.
thermalRegulationTemperatureThreshold: 25
- type: NoInteractionInHands
- type: Temperature
heatDamageThreshold: 298.15 # 25с - начинаем получать урон.
coldDamageThreshold: 213
Expand Down