Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jabak
2024-07-05 21:22:42 +03:00
1755 changed files with 20555 additions and 12385 deletions

View File

@@ -0,0 +1,17 @@
using Content.Shared.Damage.Prototypes;
using Robust.Shared.GameStates;
namespace Content.Shared.Damage.Components;
/// <summary>
/// Applies the specified DamageModifierSets when the entity takes damage.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class DamageProtectionBuffComponent : Component
{
/// <summary>
/// The damage modifiers for entities with this component.
/// </summary>
[DataField]
public Dictionary<string, DamageModifierSetPrototype> Modifiers = new();
}

View File

@@ -0,0 +1,19 @@
using Content.Shared.Damage.Components;
namespace Content.Shared.Damage.Systems;
public sealed class DamageProtectionBuffSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DamageProtectionBuffComponent, DamageModifyEvent>(OnDamageModify);
}
private void OnDamageModify(EntityUid uid, DamageProtectionBuffComponent component, DamageModifyEvent args)
{
foreach (var modifier in component.Modifiers.Values)
args.Damage = DamageSpecifier.ApplyModifierSet(args.Damage, modifier);
}
}

View File

@@ -0,0 +1,25 @@
using System.Numerics;
using Robust.Shared.GameStates;
namespace Content.Shared.Drowsiness;
/// <summary>
/// Exists for use as a status effect. Adds a shader to the client that scales with the effect duration.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class DrowsinessComponent : Component
{
/// <summary>
/// The random time between sleeping incidents, (min, max).
/// </summary>
[DataField("timeBetweenIncidents", required: true)]
public Vector2 TimeBetweenIncidents = new Vector2(5f, 60f);
/// <summary>
/// The duration of sleeping incidents, (min, max).
/// </summary>
[DataField("durationOfIncident", required: true)]
public Vector2 DurationOfIncident = new Vector2(2, 5);
public float NextIncidentTime;
}

View File

@@ -0,0 +1,9 @@
using Content.Shared.StatusEffect;
namespace Content.Shared.Drowsiness;
public abstract class SharedDrowsinessSystem : EntitySystem
{
[ValidatePrototypeId<StatusEffectPrototype>]
public const string DrowsinessKey = "Drowsiness";
}

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.NPC.Components;
/// Prevents an NPC from attacking ignored entities from enemy factions.
/// Can be added to if pettable, see PettableFriendComponent.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(NpcFactionSystem))]
[RegisterComponent, NetworkedComponent, Access(typeof(NpcFactionSystem), typeof(SharedNPCImprintingOnSpawnBehaviourSystem))] // TO DO (Metalgearsloth): If we start adding a billion access overrides they should be going through a system as then there's no reason to have access, but I'll fix this when I rework npcs.
public sealed partial class FactionExceptionComponent : Component
{
/// <summary>

View File

@@ -0,0 +1,5 @@
namespace Content.Shared.NPC.Systems;
public abstract partial class SharedNPCImprintingOnSpawnBehaviourSystem : EntitySystem
{
}

View File

@@ -0,0 +1,5 @@
namespace Content.Shared.NPC.Systems;
public abstract partial class SharedNPCSystem : EntitySystem
{
}

View File

@@ -0,0 +1,3 @@
namespace Content.Shared._White.Cult.Pentagram;
public abstract partial class SharedHellComponent : Component;