Нерф священника (#264)

* - remove: Nuke HolyComponent.

* - tweak: SuitStorage for weapons.

* - tweak: More slots for weapons.

* - tweak: Cult magic tweaks.

* - fix: Fix desc.
This commit is contained in:
Aviu00
2024-04-04 02:04:08 +09:00
committed by GitHub
parent 5cb81d990c
commit 4ad5531d62
19 changed files with 89 additions and 60 deletions

View File

@@ -1,30 +1,27 @@
using System.Linq;
using Content.Shared.Examine;
using Content.Shared.Ghost;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Hands.EntitySystems;
namespace Content.Shared._White.Chaplain;
public sealed class HolyWeaponSystem : EntitySystem
{
[Dependency] private readonly SharedHandsSystem _hands = default!;
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]");
}
public bool IsHoldingHolyWeapon(EntityUid uid)
{
return _hands.EnumerateHeld(uid).Any(HasComp<HolyWeaponComponent>);
}
}