2024-06-30 05:43:43 +02:00
|
|
|
using Content.Server.Atmos.EntitySystems;
|
2021-11-28 19:25:51 -07:00
|
|
|
using Content.Shared.Database;
|
2024-06-30 05:43:43 +02:00
|
|
|
using Content.Shared.EntityEffects;
|
2023-06-04 16:45:02 -04:00
|
|
|
using Robust.Shared.Prototypes;
|
2021-11-28 19:25:51 -07:00
|
|
|
|
2024-06-30 05:43:43 +02:00
|
|
|
namespace Content.Server.EntityEffects.Effects;
|
2021-11-28 19:25:51 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Ignites a mob.
|
|
|
|
|
/// </summary>
|
2024-06-30 05:43:43 +02:00
|
|
|
public sealed partial class Ignite : EntityEffect
|
2021-11-28 19:25:51 -07:00
|
|
|
{
|
|
|
|
|
public override bool ShouldLog => true;
|
2023-06-04 16:45:02 -04:00
|
|
|
|
|
|
|
|
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
|
|
|
|
=> Loc.GetString("reagent-effect-guidebook-ignite", ("chance", Probability));
|
|
|
|
|
|
2021-11-28 19:25:51 -07:00
|
|
|
public override LogImpact LogImpact => LogImpact.Medium;
|
|
|
|
|
|
2024-06-30 05:43:43 +02:00
|
|
|
public override void Effect(EntityEffectBaseArgs args)
|
2021-11-28 19:25:51 -07:00
|
|
|
{
|
2024-05-12 17:34:52 -07:00
|
|
|
var flamSys = args.EntityManager.System<FlammableSystem>();
|
2024-06-30 05:43:43 +02:00
|
|
|
if (args is EntityEffectReagentArgs reagentArgs)
|
|
|
|
|
{
|
|
|
|
|
flamSys.Ignite(reagentArgs.TargetEntity, reagentArgs.OrganEntity ?? reagentArgs.TargetEntity);
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
flamSys.Ignite(args.TargetEntity, args.TargetEntity);
|
|
|
|
|
}
|
2021-11-28 19:25:51 -07:00
|
|
|
}
|
|
|
|
|
}
|