-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* skills * init * more jobs & prison station rename * prisoner ID card & access fix & new switches and windoors * make prison eng and med dangerous * prison officers 5 -> 8 * prison access to admin * auto prison shuttle & round end prison win type * prison map 1.3 * reduce prisoners amount * round end text fix * prison map 1.4 * prison map 1.5 * pacified prisoners & round end text fix & escaped prisoners names at round end text * conversion duration & conversion status icon & less shitcode * init * new end round song * ascendance fix hands * shadowling fix interactions * roundstart shadowling channel to antag select * fix ascendance not requires 15 thralls * thermal vision & more damage to burn shadowling & shadowling ghost now can't see ghosts * just end round without shuttle * veil action now turn off handheld lights * add ascendance ghost * loc fix & shadowling damage modifier set * mob states check support * raise RevertedEvent before remove components & some changes to API * mob states check support * raise RevertedEvent before remove components & some changes to API * raise attempt events * revert thralls when shadowling die * sponsor antag select fix * update shadowling game preset description * add shadowlings to secret * update shadowling game preset for sponsor antags * skill prototype & more skills & more receives, requires, affects * new skills support & changes to requires in prototypes * bartender's specials fix * add skills to jobs * salvage specialist add more skills * zombie immune & more damage to burn shadowling * thermal vision buff * unshaded thrall's eyes & change thrall owner when real died * Revert "Merge branch 'skills' into shadowlings" This reverts commit fcb4be5, reversing changes made to ba3ad05. * Revert "Merge branch 'skills' into shadowlings" This reverts commit ba3ad05, reversing changes made to 61262cf. * round end text fix & remove unused code * fix shadowlings convert zombies * changes to ice oil --------- Co-authored-by: Doublechest <[email protected]>
- Loading branch information
1 parent
fb0f9ca
commit d09e416
Showing
163 changed files
with
40,625 additions
and
28,759 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
Content.Client/Stories/Shadowling/ShadowlingHatchSystem.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,45 @@ | ||
using Content.Shared.Humanoid; | ||
using Content.Shared.StatusIcon.Components; | ||
using Content.Shared.Stories.Conversion; | ||
using Content.Shared.Stories.Shadowling; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Player; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.Stories.Shadowling; | ||
|
||
public sealed class ShadowlingSystem : SharedShadowlingSystem<ShadowlingThrallComponent, ShadowlingComponent> | ||
public sealed partial class ShadowlingSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IPlayerManager _player = default!; | ||
[Dependency] private readonly ILightManager _light = default!; | ||
|
||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
private readonly ProtoId<ShaderPrototype> _unshadedShaderProtoId = "unshaded"; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ShadowlingComponent, ComponentStartup>(OnStartup); | ||
SubscribeLocalEvent<ShadowlingComponent, PlayerAttachedEvent>(OnPlayerAttached); | ||
SubscribeLocalEvent<ShadowlingComponent, PlayerDetachedEvent>(OnPlayerDetached); | ||
SubscribeLocalEvent<ShadowlingComponent, ComponentShutdown>(OnShutdown); | ||
} | ||
SubscribeLocalEvent<ShadowlingComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent); | ||
|
||
private void OnStartup(EntityUid uid, ShadowlingComponent component, ref ComponentStartup ev) | ||
{ | ||
if (_player.LocalSession == null) | ||
return; | ||
if (_player.LocalSession.AttachedEntity != uid) | ||
return; | ||
|
||
ToggleDarkVision(component, true); | ||
// TODO: Использовать события ConvertedEvent, RevertedEvent. Сейчас они только на сервере. | ||
SubscribeLocalEvent<ShadowlingThrallComponent, ComponentInit>(OnConverted); | ||
SubscribeLocalEvent<ShadowlingThrallComponent, ComponentShutdown>(OnReverted); | ||
} | ||
|
||
private void OnPlayerAttached(EntityUid uid, ShadowlingComponent component, ref PlayerAttachedEvent ev) | ||
private void OnGetStatusIconsEvent(EntityUid uid, ShadowlingComponent component, ref GetStatusIconsEvent args) | ||
{ | ||
if (_player.LocalSession == null) | ||
return; | ||
if (_player.LocalSession.AttachedEntity != uid) | ||
return; | ||
if (ev.Entity != uid) | ||
return; | ||
|
||
ToggleDarkVision(component, true); | ||
args.StatusIcons.Add(_prototype.Index(component.StatusIcon)); | ||
} | ||
|
||
private void OnPlayerDetached(EntityUid uid, ShadowlingComponent component, ref PlayerDetachedEvent ev) | ||
private void OnConverted(EntityUid uid, ShadowlingThrallComponent component, ComponentInit args) | ||
{ | ||
if (_player.LocalSession?.AttachedEntity != null) | ||
return; | ||
if (ev.Entity != uid) | ||
if (!HasComp<HumanoidAppearanceComponent>(uid)) | ||
return; | ||
|
||
ToggleDarkVision(component, false); | ||
var sprite = Comp<SpriteComponent>(uid); | ||
sprite.LayerSetShader(sprite.LayerMapReserveBlank(HumanoidVisualLayers.Eyes), _prototype.Index(_unshadedShaderProtoId).Instance()); | ||
} | ||
|
||
private void OnShutdown(EntityUid uid, ShadowlingComponent component, ref ComponentShutdown ev) | ||
private void OnReverted(EntityUid uid, ShadowlingThrallComponent component, ComponentShutdown args) | ||
{ | ||
if (_player.LocalSession == null) | ||
if (!HasComp<HumanoidAppearanceComponent>(uid)) | ||
return; | ||
if (_player.LocalSession.AttachedEntity != uid) | ||
return; | ||
|
||
ToggleDarkVision(component, false); | ||
} | ||
|
||
private void ToggleDarkVision(ShadowlingComponent component, bool newState) | ||
{ | ||
if (newState) | ||
{ | ||
_light.DrawShadows = false; | ||
} | ||
else | ||
{ | ||
_light.DrawShadows = true; | ||
} | ||
var sprite = Comp<SpriteComponent>(uid); | ||
sprite.LayerSetShader(sprite.LayerMapReserveBlank(HumanoidVisualLayers.Eyes), (ShaderInstance?) null); | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
Content.Client/Stories/Shadowling/ShadowlingThrallComponent.cs
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
Content.Client/Stories/ThermalVision/ThermalVisionOverlay.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Numerics; | ||
using Content.Shared.Stories.ThermalVision; | ||
using Content.Shared.Mobs.Components; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Enums; | ||
|
||
namespace Content.Client.Stories.ThermalVision; | ||
|
||
public sealed class ThermalVisionOverlay : Overlay | ||
{ | ||
[Dependency] private readonly IEntityManager _entity = default!; | ||
[Dependency] private readonly IEyeManager _eye = default!; | ||
[Dependency] private readonly IPlayerManager _players = default!; | ||
|
||
private readonly TransformSystem _transform; | ||
|
||
public override OverlaySpace Space => OverlaySpace.ScreenSpace; | ||
|
||
public ThermalVisionOverlay() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
|
||
_transform = _entity.System<TransformSystem>(); | ||
} | ||
|
||
protected override void Draw(in OverlayDrawArgs args) | ||
{ | ||
if (!_entity.TryGetComponent(_players.LocalEntity, out ThermalVisionComponent? nightVision) || !nightVision.Enabled) | ||
return; | ||
|
||
var eye = args.Viewport.Eye; | ||
var eyeRot = eye?.Rotation ?? default; | ||
var zoom = Vector2.One / (args.Viewport.Eye?.Zoom ?? Vector2.One); | ||
|
||
var entities = _entity.EntityQueryEnumerator<MobStateComponent, SpriteComponent, TransformComponent>(); | ||
while (entities.MoveNext(out var uid, out _, out var sprite, out var xform)) | ||
{ | ||
if (xform.MapID != eye?.Position.MapId) | ||
continue; | ||
|
||
var position = _eye.CoordinatesToScreen(xform.Coordinates).Position; | ||
if (!args.ViewportBounds.Contains((int) position.X, (int) position.Y)) | ||
continue; | ||
|
||
var rotation = _transform.GetWorldRotation(xform); | ||
args.ScreenHandle.DrawEntity(uid, position, Vector2.One * 2 * zoom, rotation + eyeRot, Angle.Zero, null, sprite, xform, _transform); | ||
} | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
Content.Client/Stories/ThermalVision/ThermalVisionSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using Content.Shared.Stories.ThermalVision; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Client.Stories.ThermalVision; | ||
|
||
public sealed class ThermalVisionSystem : SharedThermalVisionSystem | ||
{ | ||
[Dependency] private readonly ILightManager _light = default!; | ||
[Dependency] private readonly IOverlayManager _overlay = default!; | ||
[Dependency] private readonly IPlayerManager _player = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ThermalVisionComponent, LocalPlayerAttachedEvent>(OnThermalVisionAttached); | ||
SubscribeLocalEvent<ThermalVisionComponent, LocalPlayerDetachedEvent>(OnThermalVisionDetached); | ||
} | ||
|
||
private void OnThermalVisionAttached(Entity<ThermalVisionComponent> ent, ref LocalPlayerAttachedEvent args) | ||
{ | ||
ThermalVisionChanged(ent); | ||
} | ||
|
||
private void OnThermalVisionDetached(Entity<ThermalVisionComponent> ent, ref LocalPlayerDetachedEvent args) | ||
{ | ||
Off(); | ||
} | ||
|
||
protected override void ThermalVisionChanged(Entity<ThermalVisionComponent> ent) | ||
{ | ||
if (ent != _player.LocalEntity) | ||
return; | ||
|
||
if (ent.Comp.Enabled) | ||
On(); | ||
else Off(); | ||
} | ||
|
||
protected override void ThermalVisionRemoved(Entity<ThermalVisionComponent> ent) | ||
{ | ||
if (ent != _player.LocalEntity) | ||
return; | ||
|
||
Off(); | ||
} | ||
|
||
private void Off() | ||
{ | ||
_overlay.RemoveOverlay(new ThermalVisionOverlay()); | ||
_light.DrawShadows = true; | ||
_light.DrawLighting = true; | ||
} | ||
|
||
private void On() | ||
{ | ||
_overlay.AddOverlay(new ThermalVisionOverlay()); | ||
_light.DrawShadows = false; | ||
_light.DrawLighting = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.