Skip to content

Commit

Permalink
Merge branch 'VMSolidus-Upstream-Merge-8-2-2024' of https://github.co…
Browse files Browse the repository at this point in the history
…m/VMSolidus/deep-station-14 into VMSolidus-Upstream-Merge-8-2-2024
  • Loading branch information
VMSolidus committed Aug 2, 2024
2 parents 3fa61be + efc50b9 commit 35dd95e
Show file tree
Hide file tree
Showing 247 changed files with 2,045 additions and 496 deletions.
42 changes: 42 additions & 0 deletions Content.Client/DeltaV/Lamiae/ClientLamiaVisuals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Delta-V - This file is licensed under AGPLv3
* Copyright (c) 2024 Delta-V Contributors
* See AGPLv3.txt for details.
*/

using Robust.Client.GameObjects;
using System.Numerics;
using Content.Shared.SegmentedEntity;

namespace Content.Client.DeltaV.Lamiae;

public sealed class ClientLamiaVisualSystem : VisualizerSystem<SegmentedEntitySegmentVisualsComponent>
{

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<SegmentedEntitySegmentComponent, AppearanceChangeEvent>(OnAppearanceChange);
}
private void OnAppearanceChange(EntityUid uid, SegmentedEntitySegmentComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null) return;

if (AppearanceSystem.TryGetData<float>(uid, ScaleVisuals.Scale, out var scale) && TryComp<SpriteComponent>(uid, out var sprite))
{
sprite.Scale = new Vector2(scale, scale);
}

if (AppearanceSystem.TryGetData<bool>(uid, SegmentedEntitySegmentVisualLayers.Armor, out var worn)
&& AppearanceSystem.TryGetData<string>(uid, SegmentedEntitySegmentVisualLayers.ArmorRsi, out var path))
{
var valid = !string.IsNullOrWhiteSpace(path);
if (valid)
{
args.Sprite.LayerSetRSI(SegmentedEntitySegmentVisualLayers.Armor, path);
}
args.Sprite.LayerSetVisible(SegmentedEntitySegmentVisualLayers.Armor, worn);
}
}
}
11 changes: 11 additions & 0 deletions Content.Client/DeltaV/Lamiae/LamiaSegmentVisualsComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Delta-V - This file is licensed under AGPLv3
* Copyright (c) 2024 Delta-V Contributors
* See AGPLv3.txt for details.
*/

namespace Content.Client.DeltaV.Lamiae;

[RegisterComponent]
public sealed partial class SegmentedEntitySegmentVisualsComponent : Component
{}
2 changes: 2 additions & 0 deletions Content.Server/Anomaly/AnomalySystem.Psionics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ private void InitializePsionics()
{
SubscribeLocalEvent<AnomalyComponent, DispelledEvent>(OnDispelled);
}

//Nyano - Summary: gives dispellable behavior to Anomalies.
private void OnDispelled(EntityUid uid, AnomalyComponent component, DispelledEvent args)
{
_dispel.DealDispelDamage(uid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Content.Shared.Ghost;
using Content.Shared.Maps;
using Content.Shared.Parallax;
using Content.Shared.SegmentedEntity;
using Content.Shared.Shuttles.Components;
using Content.Shared.Shuttles.Systems;
using Content.Shared.StatusEffect;
Expand Down Expand Up @@ -601,7 +602,9 @@ private void KnockOverKids(TransformComponent xform, ref ValueList<EntityUid> to
var childEnumerator = xform.ChildEnumerator;
while (childEnumerator.MoveNext(out var child))
{
if (!_buckleQuery.TryGetComponent(child, out var buckle) || buckle.Buckled)
if (!_buckleQuery.TryGetComponent(child, out var buckle) || buckle.Buckled
|| HasComp<SegmentedEntityComponent>(child)
|| HasComp<SegmentedEntitySegmentComponent>(child))
continue;

toKnock.Add(child);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Content.Server.SimpleStation14.Silicon.Death;
using Content.Server.Sound.Components;
using Content.Shared.Sound.Components;
using Content.Shared.Mobs;
using Content.Shared.SimpleStation14.Silicon.Systems;
using Content.Shared.Sound.Components;
Expand Down
8 changes: 7 additions & 1 deletion Content.Server/Weapons/Ranged/Systems/GunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,13 @@ public override void Shoot(EntityUid gunUid, GunComponent gun, List<(EntityUid?
if (!rayCastResults.Any())
break;

var result = rayCastResults[0];
var raycastEvent = new HitScanAfterRayCastEvent(rayCastResults);
RaiseLocalEvent(lastUser, ref raycastEvent);

if (raycastEvent.RayCastResults == null)
break;

var result = raycastEvent.RayCastResults[0];
var hit = result.HitEntity;
lastHit = hit;

Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2393,7 +2393,7 @@ public static readonly CVarDef<float>
/// Setting this above 0 isn't very realistic, but people who see CPR in movies and TV will expect CPR to work this way.
/// </summary>
public static readonly CVarDef<float> CPRResuscitationChance =
CVarDef.Create("cpr.resuscitation_chance", 0.05f, CVar.REPLICATED | CVar.SERVER);
CVarDef.Create("cpr.resuscitation_chance", 0.01f, CVar.REPLICATED | CVar.SERVER);

/// <summary>
/// By default, CPR reduces rot timers by an amount of seconds equal to the time spent performing CPR. This is an optional multiplier that can increase or decrease the amount
Expand Down
19 changes: 0 additions & 19 deletions Content.Shared/Contests/ContestsSystem.CVars.cs

This file was deleted.

2 changes: 2 additions & 0 deletions Content.Shared/Contests/ContestsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
using Content.Shared.Damage;
using Content.Shared.Damage.Components;
using Content.Shared.Mobs.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Physics.Components;

namespace Content.Shared.Contests
{
public sealed partial class ContestsSystem : EntitySystem
{
[Dependency] private readonly MobThresholdSystem _mobThreshold = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;

/// <summary>
/// The presumed average mass of a player entity
Expand Down
1 change: 1 addition & 0 deletions Content.Shared/Roles/StartingGearPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public string GetGear(string slot, HumanoidCharacterProfile? profile)
{
case "jumpsuit" when profile.Clothing == ClothingPreference.Jumpskirt && !string.IsNullOrEmpty(InnerClothingSkirt):
case "jumpsuit" when profile.Species == "Harpy" && !string.IsNullOrEmpty(InnerClothingSkirt):
case "jumpsuit" when profile.Species == "Lamia" && !string.IsNullOrEmpty(InnerClothingSkirt):
return InnerClothingSkirt;
case "back" when profile.Backpack == BackpackPreference.Satchel && !string.IsNullOrEmpty(Satchel):
return Satchel;
Expand Down
10 changes: 10 additions & 0 deletions Content.Shared/SegmentedEntity/SegmentSpawnedEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Content.Shared.SegmentedEntity;
public sealed class SegmentSpawnedEvent : EntityEventArgs
{
public EntityUid Lamia = default!;

public SegmentSpawnedEvent(EntityUid lamia)
{
Lamia = lamia;
}
}
84 changes: 84 additions & 0 deletions Content.Shared/SegmentedEntity/SegmentedEntityComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Delta-V - This file is licensed under AGPLv3
* Copyright (c) 2024 Delta-V Contributors
* See AGPLv3.txt for details.
*/

namespace Content.Shared.SegmentedEntity
{
/// <summary>
/// Controls initialization of any Multi-segmented entity
/// </summary>
[RegisterComponent]
public sealed partial class SegmentedEntityComponent : Component
{
/// <summary>
/// A list of each UID attached to the Lamia, in order of spawn
/// </summary>
[DataField("segments")]
public List<EntityUid> Segments = new();

/// <summary>
/// A clamped variable that represents the number of segments to be spawned
/// </summary>
[DataField("numberOfSegments")]
public int NumberOfSegments = 18;

/// <summary>
/// If UseTaperSystem is true, this constant represents the rate at which a segmented entity will taper towards the tip. Tapering is on a logarithmic scale, and will asymptotically approach 0.
/// </summary>
[DataField("offsetConstant")]
public float OffsetConstant = 1.03f;

/// <summary>
/// Represents the prototype used to parent all segments
/// </summary>
[DataField("initialSegmentId")]
public string InitialSegmentId = "LamiaInitialSegment";

/// <summary>
/// Represents the segment prototype to be spawned
/// </summary>
[DataField("SegmentId")]
public string SegmentId = "LamiaSegment";

/// <summary>
/// Toggles the tapering system on and off. When false, segmented entities will have a constant width.
/// </summary>
[DataField("useTaperSystem")]
public bool UseTaperSystem = true;

/// <summary>
/// The standard distance between the centerpoint of each segment.
/// </summary>
[DataField("staticOffset")]
public float StaticOffset = 0.15f;

/// <summary>
/// The standard sprite scale of each segment.
/// </summary>
[DataField("staticScale")]
public float StaticScale = 1f;

/// <summary>
/// Used to more finely tune how much damage should be transfered from tail to body.
/// </summary>
[DataField("damageModifierOffset")]
public float DamageModifierOffset = 0.4f;

/// <summary>
/// A clamped variable that represents how far from the tip should tapering begin.
/// </summary>
[DataField("taperOffset")]
public int TaperOffset = 18;

/// <summary>
/// Coefficient used to finely tune how much explosion damage should be transfered to the body. This is calculated multiplicatively with the derived damage modifier set.
/// </summary>
[DataField("explosiveModifierOffset")]
public float ExplosiveModifierOffset = 0.1f;

[DataField("bulletPassover")]
public bool BulletPassover = true;
}
}
35 changes: 35 additions & 0 deletions Content.Shared/SegmentedEntity/SegmentedEntitySegmentComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Delta-V - This file is licensed under AGPLv3
* Copyright (c) 2024 Delta-V Contributors
* See AGPLv3.txt for details.
*/

using Robust.Shared.GameStates;

namespace Content.Shared.SegmentedEntity
{
/// <summary>
/// Lamia segment
/// </summary>
[RegisterComponent]
[NetworkedComponent]
public sealed partial class SegmentedEntitySegmentComponent : Component
{
[DataField("AttachedToUid")]
public EntityUid AttachedToUid = default!;
public float DamageModifyFactor = default!;
public float OffsetSwitching = default!;
public float ScaleFactor = default!;
[DataField("DamageModifierCoefficient")]
public float DamageModifierCoefficient = default!;
public float ExplosiveModifyFactor = default!;
public float OffsetConstant = default!;
[DataField("Lamia")]
public EntityUid Lamia = default!;
public int MaxSegments = default!;
public int SegmentNumber = default!;
public float DamageModifierConstant = default!;
[DataField("segmentId")]
public string? segmentId;
}
}
18 changes: 18 additions & 0 deletions Content.Shared/SegmentedEntity/SegmentedEntitySegmentVisuals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Delta-V - This file is licensed under AGPLv3
* Copyright (c) 2024 Delta-V Contributors
* See AGPLv3.txt for details.
*/

using Robust.Shared.Serialization;

namespace Content.Shared.SegmentedEntity
{
[Serializable, NetSerializable]
public enum SegmentedEntitySegmentVisualLayers
{
Tail,
Armor,
ArmorRsi,
}
}
Loading

0 comments on commit 35dd95e

Please sign in to comment.