Chaplain stuff (#98)

* - add: Null rod.

* - add: Only chaplain can use holy weapons.

* - add: Chaplain is cult immune.

* - fix: Fix component granting.

* - add: Only chaplain can use null rod.

* - add: Armaments beacon.

* - add: Chaplain playtime requirement.
This commit is contained in:
Aviu00
2024-02-20 19:28:44 +09:00
committed by GitHub
parent e6b6274874
commit 03fed0caa7
158 changed files with 2342 additions and 14 deletions

View File

@@ -1,8 +1,13 @@
using Content.Server.Doors.Systems;
using Content.Shared._White.Chaplain;
using Content.Shared.Doors;
using Content.Shared.Humanoid;
using Content.Shared.Stunnable;
using Content.Shared._White.Cult;
using Content.Shared.Doors.Components;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Physics.Systems;
using CultistComponent = Content.Shared._White.Cult.Components.CultistComponent;
@@ -13,6 +18,7 @@ public sealed class RunicDoorSystem : EntitySystem
[Dependency] private readonly DoorSystem _doorSystem = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedStunSystem _stunSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Initialize()
{
@@ -20,6 +26,18 @@ public sealed class RunicDoorSystem : EntitySystem
SubscribeLocalEvent<RunicDoorComponent, BeforeDoorOpenedEvent>(OnBeforeDoorOpened);
SubscribeLocalEvent<RunicDoorComponent, BeforeDoorClosedEvent>(OnBeforeDoorClosed);
SubscribeLocalEvent<RunicDoorComponent, AttackedEvent>(OnGetAttacked);
}
private void OnGetAttacked(Entity<RunicDoorComponent> ent, ref AttackedEvent args)
{
if (!HasComp<HolyWeaponComponent>(args.Used) || !TryComp<DoorComponent>(ent, out var doorComp) ||
doorComp.State is not DoorState.Closed)
return;
_audio.PlayPvs(new SoundPathSpecifier("/Audio/Magic/knock.ogg"), ent);
_doorSystem.StartOpening(ent, doorComp);
}
private void OnBeforeDoorOpened(EntityUid uid, RunicDoorComponent component, BeforeDoorOpenedEvent args)
@@ -61,7 +79,7 @@ public sealed class RunicDoorSystem : EntitySystem
_doorSystem.Deny(airlock);
if (!HasComp<HumanoidAppearanceComponent>(user))
if (!HasComp<HumanoidAppearanceComponent>(user) || HasComp<HolyComponent>(user))
return false;
var direction = Transform(user).MapPosition.Position - Transform(airlock).MapPosition.Position;