фиксы апстрима

This commit is contained in:
Vigers Ray 2025-08-23 23:49:03 +03:00
parent 252e81c728
commit 2dfd952b40
12 changed files with 45 additions and 38 deletions

View file

@ -31,6 +31,7 @@ using System.Collections.Frozen;
using System.Diagnostics.CodeAnalysis;
using Content.Shared.Flash;
using Content.Shared.Flash.Components;
using Content.Shared.Storage.Components;
namespace Content.Server.Vampire;

View file

@ -207,7 +207,7 @@ public sealed class AssaultOpsRuleSystem : GameRuleSystem<AssaultOpsRuleComponen
if (!TryComp<SubdermalImplantComponent>(implant, out var implantComp))
return false;
_subdermalImplant.ForceImplant(uid, implant, implantComp);
_subdermalImplant.ForceImplant(uid, (implant, implantComp));
return true;
}

View file

@ -218,7 +218,7 @@ public sealed class EvilTwinSystem : EntitySystem
var implantEnt = Spawn(MindShield, coords);
if (TryComp<SubdermalImplantComponent>(implantEnt, out var implantComp))
_subdermalImplant.ForceImplant(twinUid, implantEnt, implantComp);
_subdermalImplant.ForceImplant(twinUid, (implantEnt, implantComp));
}
EnsureComp<EvilTwinComponent>(twinUid).TargetMindId = mindId;

View file

@ -6,6 +6,7 @@ using Content.Shared.Damage;
using Content.Shared.Database;
using Content.Shared.DoAfter;
using Content.Shared._Sunrise.Execution;
using Content.Shared.Kitchen.Components;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Popups;

View file

@ -81,7 +81,7 @@ namespace Content.Server._Sunrise.Fugitive
if (!TryComp<SubdermalImplantComponent>(implantEnt, out var implantComp))
return;
_subdermalImplant.ForceImplant(fugitive, implantEnt, implantComp);
_subdermalImplant.ForceImplant(fugitive, (implantEnt, implantComp));
}
if (TryComp<ContainerManagerComponent>(fugitive, out var containerManagerComponent))

View file

@ -1,3 +1,4 @@
using Content.Shared._Sunrise.Abilities;
using Content.Shared.Actions;
using Content.Shared.Alert;
using Content.Shared.Atmos.Components;
@ -27,6 +28,7 @@ public sealed class SharedMagbootsSystem : EntitySystem
SubscribeLocalEvent<MagbootsComponent, ClothingGotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<MagbootsComponent, ClothingGotUnequippedEvent>(OnGotUnequipped);
SubscribeLocalEvent<MagbootsComponent, IsWeightlessEvent>(OnIsWeightless);
SubscribeLocalEvent<BorgMagbootsComponent, IsWeightlessEvent>(OnIsWeightless);
SubscribeLocalEvent<MagbootsComponent, InventoryRelayedEvent<IsWeightlessEvent>>(OnIsWeightless);
}
@ -73,6 +75,19 @@ public sealed class SharedMagbootsSystem : EntitySystem
args.Handled = true;
}
private void OnIsWeightless(Entity<BorgMagbootsComponent> ent, ref IsWeightlessEvent args)
{
if (args.Handled || !_toggle.IsActivated(ent.Owner))
return;
// do not cancel weightlessness if the person is in off-grid.
if (ent.Comp.RequiresGrid && !_gravity.EntityOnGravitySupportingGridOrMap(ent.Owner))
return;
args.IsWeightless = false;
args.Handled = true;
}
private void OnIsWeightless(Entity<MagbootsComponent> ent, ref InventoryRelayedEvent<IsWeightlessEvent> args)
{
OnIsWeightless(ent, ref args.Args);

View file

@ -70,14 +70,6 @@ public abstract partial class SharedGravitySystem : EntitySystem
if (entity.Comp2.BodyType is BodyType.Static or BodyType.Kinematic)
return false;
// Sunrise-Start
if (TryComp<BorgMagbootsComponent>(entity, out var borgMagbootsComponent) && borgMagbootsComponent.On)
{
return borgMagbootsComponent.RequiresGrid && !EntityOnGravitySupportingGridOrMap(entity);
}
// Sunrise-End
// Check if something other than the grid or map is overriding our gravity
var ev = new IsWeightlessEvent();
RaiseLocalEvent(entity, ref ev);

View file

@ -80,9 +80,9 @@ public abstract class SharedArmorSparkEffectSystem : EntitySystem
if (HasComp<ArmorComponent>(armorUid))
{
var coeffQuery = new CoefficientQueryEvent(SlotFlags.OUTERCLOTHING);
var relayedEvent = new InventoryRelayedEvent<CoefficientQueryEvent>(coeffQuery);
var relayedEvent = new InventoryRelayedEvent<CoefficientQueryEvent>(coeffQuery, armorUid);
RaiseLocalEvent(armorUid, relayedEvent);
if (coeffQuery.DamageModifiers.Coefficients.TryGetValue("Piercing", out var pierceCoeff))
{
// Coefficient of 0.2 or less means 80%+ damage reduction
@ -98,20 +98,20 @@ public abstract class SharedArmorSparkEffectSystem : EntitySystem
// Find the entity wearing the armor (the target of the damage)
var armorTransform = Transform(armorUid);
var wearer = armorTransform.ParentUid;
if (!Exists(wearer))
return;
var wearerTransform = Transform(wearer);
// Calculate random offset within the tile
var offsetX = _random.NextFloat(-component.MaxOffset, component.MaxOffset);
var offsetY = _random.NextFloat(-component.MaxOffset, component.MaxOffset);
var offset = new Vector2(offsetX, offsetY);
// Spawn the effect at the wearer's position with offset
var effectCoords = wearerTransform.Coordinates.Offset(offset);
SparkEffectAt(effectCoords, component.SparkEffectPrototype, component.RicochetSoundCollection);
}
@ -132,15 +132,15 @@ public abstract class SharedArmorSparkEffectSystem : EntitySystem
private void SpawnCyborgSparkEffect(EntityUid cyborgUid, CyborgSparkEffectComponent component)
{
var cyborgTransform = Transform(cyborgUid);
// Calculate random offset within the tile
var offsetX = _random.NextFloat(-component.MaxOffset, component.MaxOffset);
var offsetY = _random.NextFloat(-component.MaxOffset, component.MaxOffset);
var offset = new Vector2(offsetX, offsetY);
// Spawn the effect at the cyborg's position with offset
var effectCoords = cyborgTransform.Coordinates.Offset(offset);
SparkEffectAt(effectCoords, component.SparkEffectPrototype, component.RicochetSoundCollection);
}

View file

@ -32,13 +32,13 @@ public sealed class EmitSoundOnWearerMoveSystem : EntitySystem
{
base.Update(frameTime);
var query = EntityQueryEnumerator<EmitSoundOnWearerMoveComponent, PhysicsComponent, TransformComponent, ClothingComponent>();
while (query.MoveNext(out var uid, out var emitSoundOnMoveComponent, out var physics, out var xform, out var clothing))
var query = EntityQueryEnumerator<EmitSoundOnWearerMoveComponent, TransformComponent, ClothingComponent>();
while (query.MoveNext(out var uid, out var emitSoundOnMoveComponent, out var xform, out var clothing))
{
if (xform.GridUid == null)
continue;
if (emitSoundOnMoveComponent.RequiresGravity && _gravity.IsWeightless(uid, physics, xform))
if (emitSoundOnMoveComponent.RequiresGravity && _gravity.IsWeightless(uid))
continue;
var wearer = xform.ParentUid;

View file

@ -58,7 +58,7 @@
tags:
- SubdermalImplant
- Flashlight
- type: UnpoweredFlashlight
- type: UnpoweredFlashlight
- type: entity
parent: BaseSubdermalImplant

View file

@ -129,13 +129,11 @@
- type: Pullable
- type: Physics
bodyType: KinematicController
angularDamping: 10 # sunrise-edit
linearDamping: 10 # sunrise-edit
- type: GravityAffected
- type: Clickable
- type: WiresPanel
- type: Physics
bodyType: Dynamic
angularDamping: 10 # sunrise-edit
linearDamping: 10 # sunrise-edit
- type: Fixtures
fixtures:
fix1:

View file

@ -163,16 +163,6 @@
# group: null
#- type: entity
parent: Airlock
id: AirlockXenoborg
name: xenoborg airlock
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/xenoborg.rsi
- type: Paintable
group: null
- type: entity
# parent: Airlock
# id: AirlockHatchMaintenance
# name: maintenance hatch
@ -184,6 +174,16 @@
#
#end
- type: entity
parent: Airlock
id: AirlockXenoborg
name: xenoborg airlock
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/xenoborg.rsi
- type: Paintable
group: null
# Glass
- type: entity
parent: AirlockGlass