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

@@ -0,0 +1,30 @@
using Content.Shared.Examine;
using Content.Shared.Ghost;
using Content.Shared.Weapons.Melee.Events;
namespace Content.Shared._White.Chaplain;
public sealed class HolyWeaponSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<HolyWeaponComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<HolyWeaponComponent, AttemptMeleeEvent>(OnMeleeAttempt);
}
private void OnMeleeAttempt(Entity<HolyWeaponComponent> ent, ref AttemptMeleeEvent args)
{
if (HasComp<HolyComponent>(args.User) || HasComp<GhostComponent>(args.User))
return;
args.Cancelled = true;
args.Message = $"Вам не хватает веры, чтобы использовать {Name(ent)}";
}
private void OnExamined(Entity<HolyWeaponComponent> ent, ref ExaminedEvent args)
{
args.PushMarkup("[color=lightblue]Данное оружие наделено священной силой.[/color]");
}
}