-
Notifications
You must be signed in to change notification settings - Fork 64
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
Static anomaly #1103
base: master
Are you sure you want to change the base?
Static anomaly #1103
Changes from all commits
75ed7c9
435c539
7ae9659
a9deb8b
8209015
0b5b024
a1637ca
6f8ebf1
e81a5e5
5d6b07e
44826c5
c4c9a08
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,94 @@ | ||
using Content.Shared.ADT.Silicon.Components; | ||
using Content.Shared.ADT.Anomaly.Effects.Components; | ||
using Content.Shared.StatusEffect; | ||
using Content.Shared.Anomaly.Components; | ||
using Content.Shared.Mobs.Components; | ||
using Content.Server.Chat; | ||
using Content.Shared.ADT.StaticTV.Components; | ||
using Content.Server.Body.Systems; | ||
using Content.Server.Chat.Systems; | ||
|
||
namespace Content.Server.ADT.Anomaly.Effects; | ||
public sealed class StaticAnomalySystem : EntitySystem | ||
{ | ||
[Dependency] private readonly EntityLookupSystem _lookup = default!; | ||
[Dependency] private readonly StatusEffectsSystem _status = default!; | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
[Dependency] private readonly BloodstreamSystem _blood = default!; | ||
[Dependency] private readonly AutoEmoteSystem _autoEmote = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<StaticAnomalyComponent, AnomalySupercriticalEvent>(OnSupercritical); | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
//Anomaly | ||
var AnomalyQuery = EntityQueryEnumerator<StaticAnomalyComponent>(); | ||
while (AnomalyQuery.MoveNext(out var uid, out var comp)) | ||
{ | ||
foreach (var ent in _lookup.GetEntitiesInRange(uid, comp.NoiseRange)) | ||
{ | ||
if (HasComp<MobStateComponent>(ent) == true) | ||
{ | ||
|
||
_status.TryAddStatusEffect<SeeingStaticComponent>(ent, "SeeingStatic", TimeSpan.FromSeconds(5f), true); | ||
|
||
if (_entityManager.TryGetComponent<SeeingStaticComponent>(ent, out var staticComp)) | ||
staticComp.Multiplier = comp.NoiseStrong; | ||
} | ||
} | ||
} | ||
|
||
//StaticTV | ||
var StaticTVQuery = EntityQueryEnumerator<StaticTVComponent>(); | ||
while (StaticTVQuery.MoveNext(out var uid, out var comp)) | ||
{ | ||
foreach (var ent in _lookup.GetEntitiesInRange(uid, comp.Range)) | ||
{ | ||
if (HasComp<MobStateComponent>(ent) == true) | ||
{ | ||
_status.TryAddStatusEffect<SeeingStaticComponent>(ent, "SeeingStatic", TimeSpan.FromSeconds(5f), true); | ||
|
||
if (_entityManager.TryGetComponent<SeeingStaticComponent>(ent, out var staticComp)) | ||
staticComp.Multiplier = comp.NoiseStrong; | ||
|
||
_blood.TryModifyBloodLevel(ent, (comp.BloodlossStrong)); | ||
_blood.TryModifyBleedAmount(ent, comp.BleedingStrong); | ||
} | ||
} | ||
} | ||
|
||
//FakeStaticTV | ||
var FakeStaticTVQuery = EntityQueryEnumerator<NervousSourceComponent>(); | ||
while (FakeStaticTVQuery.MoveNext(out var uid, out var comp)) | ||
{ | ||
foreach (var ent in _lookup.GetEntitiesInRange(uid, comp.NervousRange)) | ||
{ | ||
if (HasComp<MobStateComponent>(ent) == true) | ||
{ | ||
EnsureComp<AutoEmoteComponent>(ent); | ||
_autoEmote.AddEmote(ent, "NervousSream"); | ||
if (Transform(uid).Coordinates.TryDistance(EntityManager, Transform(ent).Coordinates, out var distance) | ||
&& distance >= comp.NervousRange) | ||
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. в игре достаточно способов это сломать, чего только телепорт стоит. |
||
{ | ||
_autoEmote.RemoveEmote(ent, "NervousSream"); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
//Anomaly | ||
private void OnSupercritical(EntityUid uid, StaticAnomalyComponent comp, ref AnomalySupercriticalEvent args) | ||
{ | ||
foreach (var ent in _lookup.GetEntitiesInRange(uid, comp.NoiseRange)) | ||
{ | ||
_status.TryRemoveStatusEffect(ent, "SeeingStatic"); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Content.Shared.ADT.Anomaly.Effects.Components; | ||
|
||
[RegisterComponent] | ||
public sealed partial class NervousSourceComponent : Component | ||
{ | ||
[DataField] | ||
public float NervousRange = 7; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Content.Shared.ADT.Anomaly.Effects.Components; | ||
|
||
[RegisterComponent] | ||
public sealed partial class StaticAnomalyComponent : Component | ||
{ | ||
[DataField] | ||
public float NoiseRange = 12; | ||
|
||
[DataField] | ||
public float NoiseStrong = 0.55f; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Content.Shared.ADT.StaticTV.Components; | ||
|
||
[RegisterComponent] | ||
public sealed partial class StaticTVComponent : Component | ||
{ | ||
[DataField] | ||
public float Range = 15; | ||
|
||
[DataField] | ||
public float NoiseStrong = 1f; | ||
|
||
[DataField] | ||
public float BleedingStrong = 0.03f; | ||
|
||
[DataField] | ||
public float BloodlossStrong = -0.04f; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
ent-ADTAnomalyMonkey = { ent-BaseAnomaly } | ||
.suffix = Обезьяна | ||
.desc = Иногда, когда слишком много думаешь, может выпасть мозг. Проверено самим главой времени. | ||
|
||
ent-ADTAnomalyStatic = { ent-BaseAnomaly } | ||
.suffix = Cтатика | ||
.desc = Кажется этот телевизор сломан. Подождите... кто это там? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ent-StativTV = статический телевизор | ||
.desc = Переключите канал! | ||
|
||
ent-FakeTV = фальшивый телевизор | ||
.desc = Кажется знакомым. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
- type: entity | ||
name: stativ TV | ||
parent: BaseStructure | ||
id: StativTV | ||
description: Change the channel! | ||
components: | ||
- type: Fixtures | ||
fixtures: | ||
fix1: | ||
shape: | ||
!type:PhysShapeCircle | ||
radius: 0.35 | ||
density: 200 | ||
mask: | ||
- FullTileMask | ||
layer: | ||
- WallLayer | ||
- type: Sprite | ||
sprite: ADT/Structures/Specific/Anomalies/static_anum.rsi | ||
state: pulse | ||
- type: Physics | ||
- type: StaticTV | ||
- type: Damageable | ||
damageContainer: Inorganic | ||
damageModifierSet: Metallic | ||
- type: Destructible | ||
thresholds: | ||
- trigger: | ||
!type:DamageTrigger | ||
damage: 500 | ||
behaviors: | ||
- !type:DoActsBehavior | ||
acts: [ "Destruction" ] | ||
- trigger: | ||
!type:DamageTrigger | ||
damage: 250 | ||
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.
|
||
behaviors: | ||
- !type:DoActsBehavior | ||
acts: ["Destruction"] | ||
- !type:PlaySoundBehavior | ||
sound: | ||
collection: MetalBreak | ||
|
||
- type: entity | ||
name: fake TV | ||
parent: BaseStructure | ||
id: FakeTV | ||
description: He looks familiar. | ||
components: | ||
- type: Fixtures | ||
fixtures: | ||
fix1: | ||
shape: | ||
!type:PhysShapeCircle | ||
radius: 0.35 | ||
density: 200 | ||
mask: | ||
- TableMask | ||
layer: | ||
- WallLayer | ||
- type: Sprite | ||
sprite: ADT/Objects/Misc/fakeTV.rsi | ||
state: fakeTV | ||
- type: Physics | ||
- type: PointLight | ||
radius: 1.2 | ||
energy: 10.5 | ||
color: "#ffffff" | ||
- type: NervousSource | ||
- type: Damageable | ||
damageContainer: Inorganic | ||
damageModifierSet: Metallic | ||
- type: Destructible | ||
thresholds: | ||
- trigger: | ||
!type:DamageTrigger | ||
damage: 75 | ||
behaviors: | ||
- !type:DoActsBehavior | ||
acts: [ "Destruction" ] | ||
- trigger: | ||
!type:DamageTrigger | ||
damage: 36 | ||
behaviors: | ||
- !type:DoActsBehavior | ||
acts: ["Destruction"] | ||
- !type:PlaySoundBehavior | ||
sound: | ||
collection: MetalBreak |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
- type: autoEmote | ||
id: NervousCrying | ||
emote: Crying | ||
interval: 15.0 | ||
chance: 0.5 | ||
withChat: false | ||
|
||
- type: autoEmote | ||
id: NervousSream | ||
emote: Scream | ||
interval: 15.0 | ||
chance: 0.5 | ||
withChat: false |
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. Если оставить так, на всех будет действовать ЭМИ, по крайней мере статика от него 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. Так вроде статика должна как раз на всех, разве нет? 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.
От ЭМИ гранат? С чего бы? 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. Но ведь это не так. Я много раз проверял. Эми всё так же действует только на КПБ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC0-1.0", | ||
"copyright": "Created by Username228 (#serj3428 discord) for space-station-14", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "fakeTV", | ||
"dalays": [ | ||
[ | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2 | ||
] | ||
] | ||
} | ||
] | ||
} |
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.
локальные переменные функции должны называться с маленькой буквы