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

@@ -1,16 +1,10 @@
using Content.Server.Communications;
using Content.Server.DoAfter;
using Content.Server.Mind;
using Content.Server.Ninja.Events;
using Content.Server.Power.Components;
using Content.Server.Roles;
using Content.Server.Objectives.Components;
using Content.Shared.Communications;
using Content.Shared.DoAfter;
using Content.Shared.Interaction.Components;
using Content.Shared.Interaction.Events;
using Content.Shared.Ninja.Components;
using Content.Shared.Ninja.Systems;
using Content.Shared.Popups;
using Content.Shared.Research.Components;
using Content.Shared.Toggleable;
@@ -94,7 +88,7 @@ public sealed class NinjaGlovesSystem : SharedNinjaGlovesSystem
EnsureComp<ResearchStealerComponent>(user);
// prevent calling in multiple threats by toggling gloves after
if (_mind.TryGetRole<NinjaRoleComponent>(user, out var role) && !role.CalledInThreat)
if (_mind.TryGetObjectiveComp<TerrorConditionComponent>(user, out var obj) && !obj.CalledInThreat)
{
var hacker = EnsureComp<CommsHackerComponent>(user);
var rule = _ninja.NinjaRule(user);