-
Notifications
You must be signed in to change notification settings - Fork 110
Ивентовый контент NDA/Terror spider #571
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
base: develop
Are you sure you want to change the base?
Changes from 1 commit
6fb420f
613775b
948c869
1d35092
d905222
ad28bea
446f8d6
6488005
d42a079
a8ddc6d
52e75c2
6946fc4
aa2ec81
adcc81d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| using Content.Shared.Mobs; | ||
|
|
||
| namespace Content.Server.Imperial.SCP.SCP008.Components; | ||
|
|
||
| [RegisterComponent] | ||
| public sealed partial class SCP008InfectionAuraComponent : Component | ||
| { | ||
| [DataField("radius")] | ||
| public float Radius = 8f; | ||
|
|
||
| [DataField("zombifyDelay")] | ||
| public TimeSpan ZombifyDelay = TimeSpan.FromSeconds(12); | ||
|
|
||
| [DataField("updateInterval")] | ||
| public TimeSpan UpdateInterval = TimeSpan.FromSeconds(1); | ||
|
|
||
| [DataField] | ||
| public LookupFlags LookupFlags = LookupFlags.Dynamic; | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| [DataField("allowCritical")] | ||
| public bool AllowCritical = false; | ||
|
|
||
| [DataField("warningDelay")] | ||
| public TimeSpan WarningDelay = TimeSpan.FromSeconds(3); | ||
|
|
||
| [DataField("warningPopup")] | ||
| public string WarningPopup = "SCP-008: покиньте зону немедленно, иначе вы превратитесь в зомби!"; | ||
|
||
|
|
||
| [ViewVariables] | ||
| public TimeSpan NextUpdate; | ||
|
|
||
| [ViewVariables] | ||
| public TimeSpan LastUpdate; | ||
|
|
||
| [ViewVariables] | ||
| public Dictionary<EntityUid, TimeSpan> ExposureTime = new(); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| using Content.Server.Imperial.SCP.SCP008.Components; | ||
| using Content.Server.Zombies; | ||
| using Content.Shared.Mobs; | ||
| using Content.Shared.Mobs.Components; | ||
| using Content.Shared.Popups; | ||
| using Content.Shared.Zombies; | ||
| using Robust.Shared.Timing; | ||
|
|
||
| namespace Content.Server.Imperial.SCP.SCP008.Systems; | ||
|
|
||
| public sealed class SCP008InfectionAuraSystem : EntitySystem | ||
| { | ||
| [Dependency] private readonly EntityLookupSystem _lookup = default!; | ||
| [Dependency] private readonly SharedPopupSystem _popup = default!; | ||
| [Dependency] private readonly ZombieSystem _zombie = default!; | ||
| [Dependency] private readonly IGameTiming _timing = default!; | ||
|
|
||
| public override void Initialize() | ||
| { | ||
| base.Initialize(); | ||
|
|
||
| SubscribeLocalEvent<SCP008InfectionAuraComponent, MapInitEvent>(OnMapInit); | ||
| SubscribeLocalEvent<SCP008InfectionAuraComponent, ComponentShutdown>(OnShutdown); | ||
| } | ||
|
|
||
| private void OnMapInit(Entity<SCP008InfectionAuraComponent> ent, ref MapInitEvent args) | ||
| { | ||
| ent.Comp.LastUpdate = _timing.CurTime; | ||
| ent.Comp.NextUpdate = _timing.CurTime + ent.Comp.UpdateInterval; | ||
| ent.Comp.ExposureTime.Clear(); | ||
| } | ||
|
|
||
| private void OnShutdown(Entity<SCP008InfectionAuraComponent> ent, ref ComponentShutdown args) | ||
| { | ||
| ent.Comp.ExposureTime.Clear(); | ||
| } | ||
|
|
||
| public override void Update(float frameTime) | ||
| { | ||
| base.Update(frameTime); | ||
|
|
||
| var curTime = _timing.CurTime; | ||
| var query = EntityQueryEnumerator<SCP008InfectionAuraComponent>(); | ||
|
|
||
| while (query.MoveNext(out var uid, out var comp)) | ||
| { | ||
| if (comp.NextUpdate > curTime) | ||
| continue; | ||
|
|
||
| var elapsed = curTime - comp.LastUpdate; | ||
| comp.LastUpdate = curTime; | ||
| comp.NextUpdate = curTime + comp.UpdateInterval; | ||
|
|
||
| if (elapsed <= TimeSpan.Zero) | ||
| continue; | ||
|
|
||
| var currentlyInRange = new HashSet<EntityUid>(); | ||
| var nearbyEntities = _lookup.GetEntitiesInRange(uid, comp.Radius, comp.LookupFlags); | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| foreach (var target in nearbyEntities) | ||
| { | ||
| if (target == uid) | ||
| continue; | ||
|
|
||
| if (!TryComp<MobStateComponent>(target, out var mobState)) | ||
| continue; | ||
|
|
||
| var validState = mobState.CurrentState == MobState.Alive || | ||
| (comp.AllowCritical && mobState.CurrentState == MobState.Critical); | ||
|
|
||
| if (!validState) | ||
| continue; | ||
|
|
||
| if (HasComp<ZombieComponent>(target) || HasComp<ZombieImmuneComponent>(target)) | ||
| continue; | ||
|
|
||
| currentlyInRange.Add(target); | ||
|
|
||
| var totalExposure = elapsed; | ||
| var previousExposure = TimeSpan.Zero; | ||
| if (comp.ExposureTime.TryGetValue(target, out var existingExposure)) | ||
| { | ||
| previousExposure = existingExposure; | ||
| totalExposure += previousExposure; | ||
| } | ||
|
|
||
| var warningStart = comp.ZombifyDelay - comp.WarningDelay; | ||
| if (warningStart < TimeSpan.Zero) | ||
| warningStart = TimeSpan.Zero; | ||
|
|
||
| if (previousExposure < warningStart && totalExposure >= warningStart && totalExposure < comp.ZombifyDelay) | ||
| _popup.PopupEntity(comp.WarningPopup, target, target, PopupType.MediumCaution); | ||
|
|
||
| if (totalExposure >= comp.ZombifyDelay) | ||
| { | ||
| _zombie.ZombifyEntity(target, mobState); | ||
| comp.ExposureTime.Remove(target); | ||
| continue; | ||
| } | ||
|
|
||
| comp.ExposureTime[target] = totalExposure; | ||
| } | ||
|
|
||
| var toRemove = new List<EntityUid>(); | ||
| foreach (var (tracked, _) in comp.ExposureTime) | ||
| { | ||
| if (!currentlyInRange.Contains(tracked)) | ||
| toRemove.Add(tracked); | ||
| } | ||
|
|
||
| foreach (var tracked in toRemove) | ||
| { | ||
| comp.ExposureTime.Remove(tracked); | ||
| } | ||
|
Comment on lines
+106
to
+116
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Лишняя аллокация
🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,71 @@ | ||||||||||||||||||
| namespace Content.Server.Imperial.SCP.SCP096.Components; | ||||||||||||||||||
|
|
||||||||||||||||||
| using System.Collections.Generic; | ||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||
| using Robust.Shared.Audio; | ||||||||||||||||||
|
||||||||||||||||||
| namespace Content.Server.Imperial.SCP.SCP096.Components; | |
| using System.Collections.Generic; | |
| using Robust.Shared.Audio; | |
| using System.Collections.Generic; | |
| using Robust.Shared.Audio; | |
| namespace Content.Server.Imperial.SCP.SCP096.Components; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Content.Server/Imperial/SCP/SCP096/Components/SCP096RageOnLookComponent.cs`
around lines 1 - 4, The using directives (System.Collections.Generic and
Robust.Shared.Audio) are placed after the namespace declaration in
SCP096RageOnLookComponent (namespace
Content.Server.Imperial.SCP.SCP096.Components); move those using lines so they
appear above the namespace declaration to follow C# conventions and match the
repository style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RageLoopSound по умолчанию использует звук генератора аномалий — вероятно, заглушка.
/Audio/Ambience/Objects/anomaly_generator_ambi.ogg — это эмбиент генератора аномалий, не связанный с SCP-096. Если это временный звук-заглушка, стоит заменить его на соответствующий аудиоресурс SCP-096 или оставить комментарий о намеренном использовании.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Content.Server/Imperial/SCP/SCP096/Components/SCP096RageOnLookComponent.cs`
around lines 51 - 52, The default RageLoopSound in SCP096RageOnLookComponent is
set to an unrelated anomaly generator ambient file; update the SoundSpecifier
for the RageLoopSound field (public SoundSpecifier RageLoopSound) to point to
the correct SCP-096 loop audio asset, or if this is intentionally a placeholder,
replace the hardcoded SoundPathSpecifier with a neutral null/default value and
add an inline comment on the RageLoopSound field indicating it is a temporary
stub awaiting the proper SCP-096 audio resource so the intent is clear to future
reviewers.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| namespace Content.Server.Imperial.SCP.SCP096.Components; | ||
|
|
||
| [RegisterComponent] | ||
| public sealed partial class SCP096RageSuppressorComponent : Component | ||
| { | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.