Merge remote-tracking branch 'upstream/master' into ups

This commit is contained in:
Jabak
2024-08-23 02:25:53 +03:00
163 changed files with 2022 additions and 714 deletions

View File

@@ -35,7 +35,7 @@ public sealed partial class EmotePrototype : IPrototype
[DataField("chatTriggers")]
public HashSet<string>? ChatTriggers = new();
/// <summary> White Dream EDIT Start
/// <summary> Giedi Prime EDIT Start
/// Текст для кнопки в эмоут меню.
/// Бля ну или как это описать, вы поняли короче. ¯\_(ツ)_/¯
/// </summary>
@@ -44,7 +44,7 @@ public sealed partial class EmotePrototype : IPrototype
[DataField("allowMenu")]
public bool AllowToEmotionsMenu { get; } = false;
// White Dream EDIT end
// Giedi Prime EDIT end
}
/// <summary>

View File

@@ -75,7 +75,7 @@ namespace Content.Shared.DrawDepth
Items = DrawDepthTag.Default + 3,
Mobs = DrawDepthTag.Default + 4,
OverMobs = DrawDepthTag.Default + 5,
Doors = DrawDepthTag.Default + 6,
@@ -93,14 +93,14 @@ namespace Content.Shared.DrawDepth
/// <summary>
/// Explosions, fire, melee swings. Whatever.
/// </summary>
Effects = DrawDepthTag.Default + 9,
Effects = DrawDepthTag.Default + 10,
Ghosts = DrawDepthTag.Default + 10,
Ghosts = DrawDepthTag.Default + 11,
/// <summary>
/// Use this selectively if it absolutely needs to be drawn above (almost) everything else. Examples include
/// the pointing arrow, the drag & drop ghost-entity, and some debug tools.
/// </summary>
Overlays = DrawDepthTag.Default + 11,
Overlays = DrawDepthTag.Default + 12,
}
}

View File

@@ -1,5 +1,4 @@
using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.MouseRotator;
@@ -15,7 +14,7 @@ public sealed partial class MouseRotatorComponent : Component
/// How much the desired angle needs to change before a predictive event is sent
/// </summary>
[DataField, AutoNetworkedField]
public Angle AngleTolerance = Angle.FromDegrees(20.0);
public Angle AngleTolerance = Angle.FromDegrees(6.0); // WD edit
/// <summary>
/// The angle that will be lerped to
@@ -38,7 +37,7 @@ public sealed partial class MouseRotatorComponent : Component
/// like turrets or ship guns, which have finer range of movement.
/// </summary>
[DataField, AutoNetworkedField]
public bool Simple4DirMode = true;
public bool Simple4DirMode = false; // WD edit
}
/// <summary>

View File

@@ -27,7 +27,7 @@ public sealed partial class EmbeddableProjectileComponent : Component
/// How long it takes to remove the embedded object.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public float? RemovalTime = 3f;
public float? RemovalTime = 1f;
/// <summary>
/// Whether this entity will embed when thrown, or only when shot as a projectile.

View File

@@ -203,9 +203,9 @@ public abstract partial class SharedProjectileSystem : EntitySystem
}
}
public void SetShooter(EntityUid id, ProjectileComponent component, EntityUid shooterId)
public void SetShooter(EntityUid id, ProjectileComponent component, EntityUid? shooterId = null)
{
if (component.Shooter == shooterId)
if (component.Shooter == shooterId || shooterId == null)
return;
component.Shooter = shooterId;

View File

@@ -423,7 +423,7 @@ public abstract partial class SharedGunSystem : EntitySystem
Physics.SetLinearVelocity(uid, finalLinear, body: physics);
var projectile = EnsureComp<ProjectileComponent>(uid);
Projectiles.SetShooter(uid, projectile, user ?? gunUid);
Projectiles.SetShooter(uid, projectile, user);
projectile.Weapon = gunUid;
TransformSystem.SetWorldRotation(uid, direction.ToWorldAngle());

View File

@@ -25,7 +25,7 @@ public sealed class CustomGhostPrototype : IPrototype
public float AlphaOverride { get; } = -1;
[DataField("ghostName")]
public string GhostName = string.Empty;
public string? GhostName = string.Empty;
[DataField("ghostDescription")]
public string GhostDescription = string.Empty;

View File

@@ -0,0 +1,27 @@
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared._White.Explosion;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedExplosionSystem))]
public sealed partial class ExplosionEffectComponent : Component
{
[DataField, AutoNetworkedField]
public EntProtoId Explosion = "ExplosionEffectGrenade";
[DataField, AutoNetworkedField]
public EntProtoId ShockWave = "ExplosionEffectGrenadeShockWave";
[DataField, AutoNetworkedField]
public List<EntProtoId> ShrapnelEffects = new() { "ExplosionEffectShrapnel1", "ExplosionEffectShrapnel2" };
[DataField, AutoNetworkedField]
public int MinShrapnel = 5;
[DataField, AutoNetworkedField]
public int MaxShrapnel = 9;
[DataField, AutoNetworkedField]
public float ShrapnelSpeed = 5;
}

View File

@@ -0,0 +1,4 @@
namespace Content.Shared._White.Explosion;
[ByRefEvent]
public readonly record struct ExplosiveTriggeredEvent;

View File

@@ -0,0 +1,28 @@
using Robust.Shared.GameStates;
namespace Content.Shared._White.Explosion
{
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
[Access(typeof(SharedExplosionSystem))]
public sealed partial class ExplosionShockWaveComponent : Component
{
/// <summary>
/// The rate at which the wave fades, lower values means it's active for longer.
/// </summary>
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public float FalloffPower = 40f;
/// <summary>
/// How sharp the wave distortion is. Higher values make the wave more pronounced.
/// </summary>
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public float Sharpness = 10.0f;
/// <summary>
/// Width of the wave.
/// </summary>
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public float Width = 0.8f;
}
}

View File

@@ -0,0 +1,36 @@
using Content.Shared.Throwing;
using Robust.Shared.Random;
namespace Content.Shared._White.Explosion;
public sealed class SharedExplosionSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ThrowingSystem _throwing = default!;
public override void Initialize()
{
SubscribeLocalEvent<ExplosionEffectComponent, ExplosiveTriggeredEvent>(OnExplosionEffectTriggered);
}
private void OnExplosionEffectTriggered(EntityUid uid, ExplosionEffectComponent component, ref ExplosiveTriggeredEvent args)
{
SpawnNextToOrDrop(component.ShockWave, uid);
SpawnNextToOrDrop(component.Explosion, uid);
if (component.MaxShrapnel <= 0)
return;
foreach (var effect in component.ShrapnelEffects)
{
var shrapnelCount = _random.Next(component.MinShrapnel, component.MaxShrapnel);
for (var i = 0; i < shrapnelCount; i++)
{
var angle = _random.NextAngle();
var direction = angle.ToVec().Normalized() * 10;
var shrapnel = SpawnNextToOrDrop(effect, uid);
_throwing.TryThrow(shrapnel, direction, component.ShrapnelSpeed / 10);
}
}
}
}

View File

@@ -0,0 +1,27 @@
using Robust.Shared.GameStates;
using Robust.Shared.Utility;
using static Robust.Shared.Utility.SpriteSpecifier;
namespace Content.Shared._White.Lighting.Shaders;
/// <summary>
/// This is used for LightOverlay
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class LightingOverlayComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool? Enabled;
[DataField]
public SpriteSpecifier Sprite = new Texture(new ResPath("Effects/LightMasks/lightmask_lamp.png"));
[DataField]
public float Offsetx = -0.5f;
[DataField]
public float Offsety = 0.5f;
[DataField]
public Color? Color;
}

View File

@@ -20,6 +20,13 @@ public sealed class WhiteCVars
CVarDef.Create("white.show_trails", true, CVar.CLIENTONLY | CVar.ARCHIVE);
/*
* Bullet trails
*/
public static readonly CVarDef<bool> EnableLightsGlowing =
CVarDef.Create("white.enable_lights_glowing", true, CVar.CLIENTONLY | CVar.ARCHIVE);
/*
* Offer Indicator
*/
@@ -102,7 +109,7 @@ public sealed class WhiteCVars
*/
/// <summary>
/// URL of the TTS server API.
/// Is TTS enabled
/// </summary>
public static readonly CVarDef<bool> TtsEnabled =
CVarDef.Create("tts.enabled", true, CVar.SERVERONLY);
@@ -125,11 +132,9 @@ public sealed class WhiteCVars
public static readonly CVarDef<int> TtsMaxCacheSize =
CVarDef.Create("tts.max_cash_size", 200, CVar.SERVERONLY | CVar.ARCHIVE);
/*
* Stalin
*/
* Stalin
*/
public static readonly CVarDef<string> StalinSalt =
CVarDef.Create("stalin.salt", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL | CVar.ARCHIVE);
@@ -142,7 +147,6 @@ public sealed class WhiteCVars
public static readonly CVarDef<float> StalinDiscordMinimumAge =
CVarDef.Create("stalin.minimal_discord_age_minutes", 604800.0f, CVar.SERVERONLY | CVar.ARCHIVE);
/*
* NonPeaceful Round End
*/
@@ -405,4 +409,14 @@ public sealed class WhiteCVars
public static readonly CVarDef<string> TimeTrackerApiKey =
CVarDef.Create("white.time_tracker_key", "", CVar.SERVERONLY | CVar.CONFIDENTIAL | CVar.ARCHIVE);
/*
* Random Artifacts
*/
public static readonly CVarDef<bool> EnableRandomArtifacts =
CVarDef.Create("white.random_artifacts_enabled", true, CVar.SERVERONLY);
public static readonly CVarDef<float> ItemToArtifactRatio =
CVarDef.Create("white.random_artifacts_ratio", 0.4f, CVar.SERVERONLY);
}