in-game chemical book (#17213)
This commit is contained in:
@@ -11,6 +11,7 @@ using Robust.Client.GameObjects;
|
|||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Client.Guidebook;
|
namespace Content.Client.Guidebook;
|
||||||
@@ -20,6 +21,7 @@ namespace Content.Client.Guidebook;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class GuidebookSystem : EntitySystem
|
public sealed class GuidebookSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
||||||
[Dependency] private readonly VerbSystem _verbSystem = default!;
|
[Dependency] private readonly VerbSystem _verbSystem = default!;
|
||||||
@@ -78,6 +80,9 @@ public sealed class GuidebookSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnInteract(EntityUid uid, GuideHelpComponent component, ActivateInWorldEvent args)
|
private void OnInteract(EntityUid uid, GuideHelpComponent component, ActivateInWorldEvent args)
|
||||||
{
|
{
|
||||||
|
if (!_timing.IsFirstTimePredicted)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!component.OpenOnActivation || component.Guides.Count == 0 || _tags.HasTag(uid, GuideEmbedTag))
|
if (!component.OpenOnActivation || component.Guides.Count == 0 || _tags.HasTag(uid, GuideEmbedTag))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
prob: 0.4
|
prob: 0.4
|
||||||
amount: 1
|
amount: 1
|
||||||
maxAmount: 4
|
maxAmount: 4
|
||||||
|
- id: BookChemicalCompendium
|
||||||
|
prob: 0.2
|
||||||
- id: BookNarsieLegend
|
- id: BookNarsieLegend
|
||||||
prob: 0.1
|
prob: 0.1
|
||||||
- id: BookTruth
|
- id: BookTruth
|
||||||
|
|||||||
@@ -27,6 +27,21 @@
|
|||||||
backgroundPatchMargin: 23.0, 16.0, 14.0, 15.0
|
backgroundPatchMargin: 23.0, 16.0, 14.0, 15.0
|
||||||
contentMargin: 20.0, 20.0, 20.0, 20.0
|
contentMargin: 20.0, 20.0, 20.0, 20.0
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
id: BookChemicalCompendium
|
||||||
|
parent: BaseItem
|
||||||
|
name: chemical compendium
|
||||||
|
description: A comprehensive guide written by some old skeleton of a professor about chemical synthesis.
|
||||||
|
components:
|
||||||
|
- type: Sprite
|
||||||
|
sprite: Objects/Misc/books.rsi
|
||||||
|
layers:
|
||||||
|
- state: book_chemistry
|
||||||
|
- type: GuideHelp
|
||||||
|
openOnActivation: true
|
||||||
|
guides:
|
||||||
|
- Chemicals
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: BookBase
|
parent: BookBase
|
||||||
id: BookRandom
|
id: BookRandom
|
||||||
|
|||||||
Reference in New Issue
Block a user