* init * fix vampire polymorph * fix vampire metabolizm * upd * теперь при бане будет указываться номер раунда, хд * fix * fix * fix locale * change speed * new nukeops shuttle * FULLY FIX EBANY VAMPIRE OBJECTIVES * fix faction * fix drank objective * try fix status icon * fix changelings * fix zombie faction * vampire status icon fix * upd roadmap * vampire blood amount alert * drain objective up * upd * upd
25 lines
No EOL
834 B
C#
25 lines
No EOL
834 B
C#
using Content.Server.Objectives.Components;
|
|
using Content.Server.Objectives.Systems;
|
|
using Content.Shared.Objectives.Components;
|
|
using Content.Shared.Vampire.Components;
|
|
using Content.Shared.Vampire;
|
|
|
|
namespace Content.Server.Vampire;
|
|
|
|
public sealed partial class VampireSystem
|
|
{
|
|
[Dependency] private readonly NumberObjectiveSystem _number = default!;
|
|
|
|
private void InitializeObjectives()
|
|
{
|
|
SubscribeLocalEvent<BloodDrainConditionComponent, ObjectiveGetProgressEvent>(OnBloodDrainGetProgress);
|
|
}
|
|
|
|
private void OnBloodDrainGetProgress(EntityUid uid, BloodDrainConditionComponent comp, ref ObjectiveGetProgressEvent args)
|
|
{
|
|
var target = _number.GetTarget(uid);
|
|
if (target > 0)
|
|
args.Progress = MathF.Min(comp.BloodDranked / target, 1f);
|
|
else args.Progress = 1f;
|
|
}
|
|
} |