mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 16:17:27 +00:00
* or your debil * Woop * Whoops, Missed this * Whoops, Suicide System * Hush... Extended tests... Hush * AAAAAA * No-longer jaunt whilst dead * :) * Update Content.Shared/_Lavaland/Chasm/PreventChasmFallingSystem.cs Co-authored-by: Tobias Berger <toby@tobot.dev> Signed-off-by: William Lemon <William.Lemon2@gmail.com> * Update Content.Server/_Goobstation/Possession/PossessionSystem.cs Co-authored-by: Tobias Berger <toby@tobot.dev> Signed-off-by: William Lemon <William.Lemon2@gmail.com> * Please tobysenpai forgive me --------- Signed-off-by: William Lemon <William.Lemon2@gmail.com> Co-authored-by: Tobias Berger <toby@tobot.dev>
37 lines
1.5 KiB
C#
37 lines
1.5 KiB
C#
// SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
|
|
// SPDX-FileCopyrightText: 2025 Solstice <solsticeofthewinter@gmail.com>
|
|
// SPDX-FileCopyrightText: 2025 SolsticeOfTheWinter <solsticeofthewinter@gmail.com>
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
using Content.Server._Goobstation.Devil.Objectives.Components;
|
|
using Content.Server.Objectives.Systems;
|
|
using Content.Shared.Objectives.Components;
|
|
|
|
namespace Content.Server._Goobstation.Devil.Objectives.Systems;
|
|
|
|
public sealed partial class DevilObjectiveSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly NumberObjectiveSystem _number = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<SignContractConditionComponent, ObjectiveGetProgressEvent>(OnContractGetProgress);
|
|
SubscribeLocalEvent<MeetContractWeightConditionComponent, ObjectiveGetProgressEvent>(OnWeightGetProgress);
|
|
}
|
|
|
|
private void OnContractGetProgress(EntityUid uid, SignContractConditionComponent comp, ref ObjectiveGetProgressEvent args)
|
|
{
|
|
var target = _number.GetTarget(uid);
|
|
args.Progress = target != 0 ? MathF.Min((float)comp.ContractsSigned / target, 1f) : 1f;
|
|
}
|
|
|
|
private void OnWeightGetProgress(EntityUid uid, MeetContractWeightConditionComponent comp, ref ObjectiveGetProgressEvent args)
|
|
{
|
|
var target = _number.GetTarget(uid);
|
|
args.Progress = target != 0 ? MathF.Min((float)comp.ContractWeight / target, 1f) : 1f;
|
|
}
|
|
}
|