2024-03-07 16:01:54 +00:00
|
|
|
|
using Content.Server.Lightning;
|
|
|
|
|
|
using Content.Shared.Projectiles;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server._White.Wizard.Magic.TeslaProjectile;
|
|
|
|
|
|
|
|
|
|
|
|
public sealed class TeslaProjectileSystem : EntitySystem
|
|
|
|
|
|
{
|
|
|
|
|
|
[Dependency] private readonly LightningSystem _lightning = default!;
|
|
|
|
|
|
|
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
|
|
SubscribeLocalEvent<TeslaProjectileComponent, ProjectileHitEvent>(OnStartCollide);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnStartCollide(Entity<TeslaProjectileComponent> ent, ref ProjectileHitEvent args)
|
|
|
|
|
|
{
|
2024-06-22 12:55:50 +00:00
|
|
|
|
_lightning.ShootRandomLightnings(ent, 3, 4, "WizardLightning", 2, false, ent.Comp.Caster);
|
2024-03-07 16:01:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|