* - tweak: Cult door not bump openable. * - tweak: Better summoning and Narsie * - tweak: Construct update. * - tweak: Eldrich blade fits in suit storage. * - tweak: More spell limit. * - fix: Fix pylon desc. * - tweak: Teleport works on cuffed targets. * - tweak: More popups if target is holy. * - fix: No rune drawing using fingers. * - tweak: Better pylon placement & less pylon healing range. * - tweak: More blood rites charge. * - fix: Fix max spell amount. * - tweak: Less cult door and wall health. * - fix: Constructs are dead IC. * - add: Revive rune now notifies player. * - add: Narsie summon rune eui. * - fix: Fix narsie summon sound not playing for reapers. * - tweak: Whatever. * - add: Conceal presence spell. * - tweak: Tweakz. * - add: Blood spear. * - add: Blood boil barrage. * - tweak: Artificer flies. * - tweak: Blood bolt color tweaks. * - tweak: Runic door is bump openable again. * - fix: Fix concealed door outline. * - add: Update concealable name and desc. * - tweak: Remove the unremoveable. * - tweak: Gift ignore. * - add: Organs regenerate on rejuvenate. * - tweak: Brainless cultist is fine. * - add: Added more fun. * - add: Add rune descriptions. * - fix: Fixes. * - tweak: Blood rites now uses verb. * - tweak: Bring it back.
66 lines
2.2 KiB
C#
66 lines
2.2 KiB
C#
using Content.Shared.Ghost;
|
|
using Content.Shared.Item;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared._White.Cult.Components;
|
|
using Content.Shared.Inventory.Events;
|
|
using Content.Shared.Weapons.Melee.Events;
|
|
|
|
namespace Content.Shared._White.Cult.Systems;
|
|
|
|
public sealed class CultItemSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<CultItemComponent, GettingPickedUpAttemptEvent>(OnHandPickUp);
|
|
SubscribeLocalEvent<CultItemComponent, BeingEquippedAttemptEvent>(OnEquipAttempt);
|
|
SubscribeLocalEvent<CultItemComponent, AttemptMeleeEvent>(OnMeleeAttempt);
|
|
}
|
|
|
|
private void OnEquipAttempt(EntityUid uid, CultItemComponent component, BeingEquippedAttemptEvent args)
|
|
{
|
|
if (CanUse(args.Equipee) && CanUse(args.EquipTarget))
|
|
return;
|
|
|
|
args.Cancel();
|
|
_popupSystem.PopupClient(Loc.GetString("cult-item-component-equip-fail"), uid, args.Equipee);
|
|
}
|
|
|
|
private void OnMeleeAttempt(Entity<CultItemComponent> ent, ref AttemptMeleeEvent args)
|
|
{
|
|
if (CanUse(args.User))
|
|
return;
|
|
|
|
args.Cancelled = true;
|
|
args.Message = Loc.GetString("cult-item-component-attack-fail");
|
|
}
|
|
|
|
private void OnHandPickUp(EntityUid uid, CultItemComponent component, GettingPickedUpAttemptEvent args)
|
|
{
|
|
if (component.CanPickUp || CanUse(args.User))
|
|
return;
|
|
|
|
args.Cancel();
|
|
_transform.AttachToGridOrMap(uid);
|
|
_popupSystem.PopupClient(Loc.GetString("cult-item-component-pickup-fail", ("name", Name(uid))), uid, args.User);
|
|
}
|
|
|
|
public bool CanThrow(EntityUid player, EntityUid throwEnt)
|
|
{
|
|
if (!HasComp<CultItemComponent>(throwEnt) || CanUse(player))
|
|
return true;
|
|
|
|
_popupSystem.PopupEntity(Loc.GetString("cult-item-component-throw-fail"), player, player);
|
|
return false;
|
|
}
|
|
|
|
private bool CanUse(EntityUid? uid)
|
|
{
|
|
return HasComp<CultistComponent>(uid) || HasComp<GhostComponent>(uid);
|
|
}
|
|
}
|