mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-04 21:37:27 +00:00
* add reputation system * add contracts button to PDA * give traitors contracts * add GetRandomObjective to SharedObjectivesSystem * add TryRemoveObjective overload * add everything needed for reputation store and objectives * "ui" * giant uplink reputation tagging * prevent buying reputation-locked gear with uplink implant * :trollface: * more ui stuff * :trollface: * :trollface: * remove default objectives * :trollface: * UI fixes * stuff * objective component changes * add offerings and stuff to yml * make some objectives work * make rcd objective real * more ui fix * :trollface: * ui usable * bunch of low risk objectives * syndie jail wip * more wip * massive amount of work * add bad guidebooks * prevent fultoning anchored things * fixes * disable claim buttons when no slots are open * :trollface: * :trollface: * :trollface: * update ui when a slot unlocks * move rejecting to offerings, remove rescan (automatic now) * add verb to attach fulton, fix * dont get objective to ransom/kill someone you already ransomed * make offering slots random + maximum count in rep level * :trollface: * rela * update syndie jail * more syndie jail update * make marshal real * fix * fix power room power * remove access from timer * :trollface: * engine * allow syndicate items on syndie jail * add ransom ui * update map loading * add ransom purchasing to cargo request console * warn not error for loading * ui fixes * final fixy * mg book fix * final fixy II * remove redundant Announcement word * more [] * end ransom when leaving the jail * :trollface: * 10 tc for roundstart traitors * make nuke core objective work for traitor * guidebook gaming * early merge of guidebook comments * update bunch of objectives * add min reputation to kill fellow traitor * guidebook gaming * evil * giant stuff * dont offer dupe objectives * evil * pronoun * fix * grr * blacklist assist and DAGD from assist objective * grr * fix linter * remove objectives from traitor rule test * nuke disk anti-troll * evil test * add objectives test to find bad objective groups * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixy * fix * fix stuff * reword ransom announcement * pro * goida --------- Signed-off-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: deltanedas <@deltanedas:kde.org> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
57 lines
2.1 KiB
C#
57 lines
2.1 KiB
C#
using Content.Shared._DV.Reputation;
|
|
using Content.Shared.Objectives.Components;
|
|
using Content.Shared.Prototypes;
|
|
using Content.Shared.Random;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Prototypes;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Content.IntegrationTests.Tests._DV;
|
|
|
|
/// <summary>
|
|
/// Checks that all ids in objective groups are valid
|
|
/// Objectives system just does nothing if you have a nonexistent prototype in an objective group.
|
|
/// </summary>
|
|
public sealed class ObjectivesTest
|
|
{
|
|
[Test]
|
|
public async Task AllReputationObjectivesValid()
|
|
{
|
|
await using var pair = await PoolManager.GetServerClient();
|
|
var server = pair.Server;
|
|
var protoMan = server.ResolveDependency<IPrototypeManager>();
|
|
var factory = server.ResolveDependency<IComponentFactory>();
|
|
|
|
var pools = new HashSet<WeightedRandomPrototype>();
|
|
foreach (var level in protoMan.EnumeratePrototypes<ReputationLevelPrototype>())
|
|
{
|
|
pools.Add(protoMan.Index(level.OfferingGroups));
|
|
}
|
|
|
|
await server.WaitPost(() =>
|
|
{
|
|
// 3 nested loops we gaming
|
|
Assert.Multiple(() =>
|
|
{
|
|
foreach (var pool in pools)
|
|
{
|
|
foreach (var id in pool.Weights.Keys)
|
|
{
|
|
Assert.That(protoMan.TryIndex<WeightedRandomPrototype>(id, out var proto),
|
|
$"Unknown objective group {id} found in offering group {pool.ID}");
|
|
foreach (var obj in proto.Weights.Keys)
|
|
{
|
|
Assert.That(protoMan.TryIndex<EntityPrototype>(obj, out var objProto),
|
|
$"Unknown objective {obj} found in objective group {id}");
|
|
Assert.That(objProto.TryGetComponent<ObjectiveComponent>(out _, factory),
|
|
$"Entity {obj} in objective group {id}");
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
await pair.CleanReturnAsync();
|
|
}
|
|
}
|