Decouple interactions from hands, cleanup old events, add new fears (#28393)

* ok basic shit

* second part

* pretend it isn't real it can't hurt you.

* 👁️ 👁️

* shadowcommander review
This commit is contained in:
Nemanja
2024-05-31 16:26:19 -04:00
committed by GitHub
parent c4291920a6
commit a1a8f04036
72 changed files with 312 additions and 165 deletions

View File

@@ -43,7 +43,7 @@ public sealed partial class RevenantSystem
private void InitializeAbilities()
{
SubscribeLocalEvent<RevenantComponent, InteractNoHandEvent>(OnInteract);
SubscribeLocalEvent<RevenantComponent, UserActivateInWorldEvent>(OnInteract);
SubscribeLocalEvent<RevenantComponent, SoulEvent>(OnSoulSearch);
SubscribeLocalEvent<RevenantComponent, HarvestEvent>(OnHarvest);
@@ -53,11 +53,14 @@ public sealed partial class RevenantSystem
SubscribeLocalEvent<RevenantComponent, RevenantMalfunctionActionEvent>(OnMalfunctionAction);
}
private void OnInteract(EntityUid uid, RevenantComponent component, InteractNoHandEvent args)
private void OnInteract(EntityUid uid, RevenantComponent component, UserActivateInWorldEvent args)
{
if (args.Target == args.User || args.Target == null)
if (args.Handled)
return;
var target = args.Target.Value;
if (args.Target == args.User)
return;
var target = args.Target;
if (HasComp<PoweredLightComponent>(target))
{
@@ -78,6 +81,8 @@ public sealed partial class RevenantSystem
{
BeginHarvestDoAfter(uid, target, component, essence);
}
args.Handled = true;
}
private void BeginSoulSearchDoAfter(EntityUid uid, EntityUid target, RevenantComponent revenant)