mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-03 01:27:26 +00:00
* OMG FINALLY FIXED THIS JANKY SHIT * oh * no structure, zero fucks given * this also * trolled * shitcode v2 * FUCK * what was i even fucking thinking??? * remove unused codeanalysis import Signed-off-by: deltanedas <39013340+deltanedas@users.noreply.github.com> --------- Signed-off-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
30 lines
986 B
C#
30 lines
986 B
C#
using Content.Shared.DeltaV.Addictions;
|
|
using Content.Shared.EntityEffects;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Server.EntityEffects.Effects;
|
|
|
|
public sealed partial class Addicted : EntityEffect
|
|
{
|
|
/// <summary>
|
|
/// How long should each metabolism cycle make the effect last for.
|
|
/// </summary>
|
|
[DataField]
|
|
public float AddictionTime = 3f;
|
|
|
|
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
|
=> Loc.GetString("reagent-effect-guidebook-addicted", ("chance", Probability));
|
|
|
|
public override void Effect(EntityEffectBaseArgs args)
|
|
{
|
|
var addictionTime = AddictionTime;
|
|
|
|
if (args is EntityEffectReagentArgs reagentArgs) {
|
|
addictionTime *= reagentArgs.Scale.Float();
|
|
}
|
|
|
|
var addictionSystem = args.EntityManager.System<SharedAddictionSystem>();
|
|
addictionSystem.TryApplyAddiction(args.TargetEntity, addictionTime);
|
|
}
|
|
}
|