Use conditions to store progress for Ninja objectives (#20254)

* TryGetObjectiveComp

* helper function to get objective

* store N of jacked doors in condition

* store called in threat bool in condition

* store techs in steal research condition

* fix access

* remove unused transform system

* use popup from shared system

* fix formatting

* condition => obj everywhere

* i fogror to remove downloaded nodes from role

* change signature

* use query

* View Variables

* spider charge detonated => condition
This commit is contained in:
Slava0135
2023-10-10 09:32:10 +03:00
committed by GitHub
parent c35a018cad
commit 6f8c2b7e52
11 changed files with 76 additions and 88 deletions

View File

@@ -11,8 +11,8 @@ namespace Content.Shared.Ninja.Systems;
/// </summary>
public abstract class SharedSpaceNinjaSystem : EntitySystem
{
[Dependency] protected readonly SharedNinjaSuitSystem _suit = default!;
[Dependency] protected readonly SharedPopupSystem _popup = default!;
[Dependency] protected readonly SharedNinjaSuitSystem Suit = default!;
[Dependency] protected readonly SharedPopupSystem Popup = default!;
public override void Initialize()
{
@@ -74,7 +74,7 @@ public abstract class SharedSpaceNinjaSystem : EntitySystem
{
if (comp.Suit != null && TryComp<StealthClothingComponent>(comp.Suit, out var stealthClothing) && stealthClothing.Enabled)
{
_suit.RevealNinja(comp.Suit.Value, uid, null, stealthClothing);
Suit.RevealNinja(comp.Suit.Value, uid, null, stealthClothing);
}
}
@@ -83,7 +83,7 @@ public abstract class SharedSpaceNinjaSystem : EntitySystem
/// </summary>
private void OnShotAttempted(EntityUid uid, SpaceNinjaComponent comp, ref ShotAttemptedEvent args)
{
_popup.PopupClient(Loc.GetString("gun-disabled"), uid, uid);
Popup.PopupClient(Loc.GetString("gun-disabled"), uid, uid);
args.Cancel();
}
}