Skip to content
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

Shadowlings #32

Merged
merged 61 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
70ad11b
skills
Jun 30, 2024
8f309d0
init
Jul 10, 2024
cc87bf9
more jobs & prison station rename
Jul 10, 2024
388cf3c
prisoner ID card & access fix & new switches and windoors
Jul 11, 2024
f700b1c
make prison eng and med dangerous
Jul 15, 2024
e7f8461
prison officers 5 -> 8
Jul 15, 2024
2e8085f
prison access to admin
Jul 15, 2024
417bb14
auto prison shuttle & round end prison win type
Jul 15, 2024
e5226a4
prison map 1.3
Jul 15, 2024
121a2c3
reduce prisoners amount
Jul 15, 2024
c0d60d0
round end text fix
Jul 16, 2024
273de79
Merge branch 'master' into spaceprison
Jul 16, 2024
c54d5f2
Merge branch 'master' into spaceprison
Jul 16, 2024
aafe399
prison map 1.4
Jul 17, 2024
6fb489f
Merge branch 'master' into spaceprison
Jul 17, 2024
40b007a
Merge branch 'master' into spaceprison
Jul 17, 2024
6870c05
prison map 1.5
Jul 17, 2024
0445bb1
pacified prisoners & round end text fix & escaped prisoners names at …
Jul 17, 2024
5bd847f
conversion duration & conversion status icon & less shitcode
Jul 19, 2024
4a29b92
init
Jul 21, 2024
5ba26f4
new end round song
Jul 21, 2024
9defb75
ascendance fix hands
Jul 21, 2024
621efa1
shadowling fix interactions
Jul 21, 2024
6ac2b31
roundstart shadowling channel to antag select
Jul 21, 2024
589c8a7
fix ascendance not requires 15 thralls
Jul 21, 2024
ca2b479
thermal vision & more damage to burn shadowling & shadowling ghost no…
Jul 22, 2024
b362380
just end round without shuttle
Jul 22, 2024
d526518
veil action now turn off handheld lights
Jul 22, 2024
88bac7e
add ascendance ghost
Jul 22, 2024
57b2a61
loc fix & shadowling damage modifier set
Jul 22, 2024
76bf408
mob states check support
Jul 22, 2024
02559b6
raise RevertedEvent before remove components & some changes to API
Jul 22, 2024
495ac02
mob states check support
Jul 22, 2024
5bca6f8
raise RevertedEvent before remove components & some changes to API
Jul 22, 2024
651fbfa
Merge branch 'conversion' of https://github.com/Space-Stories/space-s…
Jul 22, 2024
13261c5
Merge branch 'master' of https://github.com/Space-Stories/space-stati…
Jul 22, 2024
b229252
raise attempt events
Jul 22, 2024
53e4476
Merge branch 'conversion' into shadowlings
Jul 22, 2024
1919426
revert thralls when shadowling die
Jul 23, 2024
67b443e
sponsor antag select fix
Jul 23, 2024
1cf9aa3
Merge branch 'spaceprison' into shadowlings
Jul 23, 2024
41b200a
update shadowling game preset description
Jul 23, 2024
691078c
add shadowlings to secret
Jul 23, 2024
61262cf
update shadowling game preset for sponsor antags
Jul 23, 2024
20ed047
Merge branch 'master' into skills
Jul 23, 2024
d22a368
skill prototype & more skills & more receives, requires, affects
Jul 29, 2024
26ddea7
new skills support & changes to requires in prototypes
Jul 29, 2024
9ac6853
bartender's specials fix
Jul 29, 2024
416c683
add skills to jobs
Jul 30, 2024
ba3ad05
Merge branch 'skills' into shadowlings
Jul 30, 2024
ea0ee8d
salvage specialist add more skills
Jul 30, 2024
fcb4be5
Merge branch 'skills' into shadowlings
Jul 30, 2024
d09d8f0
zombie immune & more damage to burn shadowling
Jul 30, 2024
6466a81
thermal vision buff
Jul 30, 2024
10534a6
unshaded thrall's eyes & change thrall owner when real died
Jul 30, 2024
4816591
Revert "Merge branch 'skills' into shadowlings"
Jul 30, 2024
ce2409a
Revert "Merge branch 'skills' into shadowlings"
Jul 30, 2024
2cffb4f
round end text fix & remove unused code
Jul 31, 2024
b319fd9
fix shadowlings convert zombies
Jul 31, 2024
3bd8da0
changes to ice oil
Jul 31, 2024
9b397c9
Merge branch 'master' into shadowlings
Aug 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions Content.Client/Stories/Lib/InvisibilitySystem.cs

This file was deleted.

9 changes: 0 additions & 9 deletions Content.Client/Stories/Shadowling/ShadowlingComponent.cs

This file was deleted.

26 changes: 0 additions & 26 deletions Content.Client/Stories/Shadowling/ShadowlingHatchSystem.cs

This file was deleted.

42 changes: 0 additions & 42 deletions Content.Client/Stories/Shadowling/ShadowlingIconSystem.cs

This file was deleted.

75 changes: 22 additions & 53 deletions Content.Client/Stories/Shadowling/ShadowlingSystem.cs
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);
}
}

This file was deleted.

51 changes: 51 additions & 0 deletions Content.Client/Stories/ThermalVision/ThermalVisionOverlay.cs
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 Content.Client/Stories/ThermalVision/ThermalVisionSystem.cs
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;
}
}
15 changes: 15 additions & 0 deletions Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Content.Server.Stories.GameTicking.Rules.Components;

namespace Content.Server.Administration.Systems;

Expand Down Expand Up @@ -151,5 +152,19 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
Message = Loc.GetString("admin-verb-make-thief"),
};
args.Verbs.Add(thief);

Verb shadowling = new()
{
Text = Loc.GetString("admin-verb-text-make-shadowling"),
Category = VerbCategory.Antag,
Icon = new SpriteSpecifier.Rsi(new ResPath("Stories/Mobs/Demons/shadowling.rsi"), "shadowling"),
Act = () =>
{
_antag.ForceMakeAntag<ShadowlingRuleComponent>(targetPlayer, "Shadowling");
},
Impact = LogImpact.High,
Message = Loc.GetString("admin-verb-make-shadowling"),
};
args.Verbs.Add(shadowling);
}
}
3 changes: 3 additions & 0 deletions Content.Server/Roles/RoleSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Server.Stories.Shadowling;
using Content.Shared.Roles;

namespace Content.Server.Roles;
Expand All @@ -18,6 +19,8 @@ public override void Initialize()
SubscribeAntagEvents<TraitorRoleComponent>();
SubscribeAntagEvents<ZombieRoleComponent>();
SubscribeAntagEvents<ThiefRoleComponent>();
SubscribeAntagEvents<ShadowlingRoleComponent>(); // Stories | Оффы просто гении. Роль антага делается прототипом, но
SubscribeAntagEvents<ShadowlingThrallRoleComponent>(); // Stories | , чтобы игра считала её антагом, нужно писать сюда код.
}

public string? MindGetBriefing(EntityUid? mindId)
Expand Down
Loading
Loading