Alchemy + Guidebook initialization (#124)

* remove Guidebook

* water and blood

* localization things

* added vital extract

* some fixes

* added bloodgrass

* guidebook localization

* fixes icons and remove unnecesary fields

* added inhand cauldron

* fix wallmount board

* Update bonfire.yml

* Update bonfire.yml

* alchemy furnace + mist

* fixes

* Guidebook localization

* Update drinks.yml

* Revert "remove Guidebook"

This reverts commit 7924cf235f.

* fix filtering guidebook

* test fix

* Update heater.yml
This commit is contained in:
Ed
2024-05-02 20:41:11 +03:00
committed by GitHub
parent 2c34befbcb
commit 4c692d7d4a
128 changed files with 1949 additions and 154 deletions

View File

@@ -13,6 +13,7 @@ using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
@@ -31,6 +32,8 @@ public sealed class GuidebookSystem : EntitySystem
[Dependency] private readonly SharedPointLightSystem _pointLightSystem = default!;
[Dependency] private readonly TagSystem _tags = default!;
[Dependency] private readonly IPrototypeManager _proto = default!; //CrystallPunk guidebook filter
public event Action<List<string>, List<string>?, string?, bool, string?>? OnGuidebookOpen;
public const string GuideEmbedTag = "GuideEmbeded";
@@ -39,6 +42,7 @@ public sealed class GuidebookSystem : EntitySystem
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<GuideHelpComponent, MapInitEvent>(OnCrystallPunkMapInit); //CrystallPunk guidebook filter
SubscribeLocalEvent<GuideHelpComponent, GetVerbsEvent<ExamineVerb>>(OnGetVerbs);
SubscribeLocalEvent<GuideHelpComponent, ActivateInWorldEvent>(OnInteract);
@@ -48,6 +52,21 @@ public sealed class GuidebookSystem : EntitySystem
OnGuidebookControlsTestGetAlternateVerbs);
}
//CrystallPunk guidebook filter
private void OnCrystallPunkMapInit(Entity<GuideHelpComponent> ent, ref MapInitEvent args)
{
foreach (var guide in ent.Comp.Guides)
{
var guideProto = _proto.Index<GuideEntryPrototype>(guide);
if (!guideProto.CrystallPunkAllowed) //REMOVE unnecessary guidebook
{
RemComp<GuideHelpComponent>(ent);
return;
}
}
}
//CrystallPunk guidebook filter end
/// <summary>
/// Gets a user entity to use for verbs and examinations. If the player has no attached entity, this will use a
/// dummy client-side entity so that users can still use the guidebook when not attached to anything (e.g., in the