mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-20 06:58:55 +03:00
* Уэээээээ * Почти настрадались * Скоро конец.... * СКОРО * Мышки плакали, кололись, но продолжали упорно жрать кактус * Все ближе! * Это такой конец? * Книжка говна * фиксики * ОНО ЖИВОЕ * Телепорт * разное * Added byond * ивенты теперь работают * Разфикс телепорта * Свет мой зеркальце скажи, да всю правду доложи - Я ль робастней всех на свете? * Разное * Еще многа всего * Многа разнава * Скоро конец.... * ЭТО КОНЕЦ * Фикс линтера (ну, или я на это надеюсь) * Еще один фикс линтера * Победа! * фиксики * пу пу пу * Фикс подмастерья * Мисклик * Высокочастотный меч * Неймспейсы * Пул способностей мага
91 lines
3.0 KiB
C#
91 lines
3.0 KiB
C#
// SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
|
|
// SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com>
|
|
// SPDX-FileCopyrightText: 2025 Misandry <mary@thughunt.ing>
|
|
// SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
using System.Numerics;
|
|
using Content.Server.Lightning;
|
|
using Content.Shared._Shitcode.Wizard.TeslaBlast;
|
|
using Content.Shared.Electrocution;
|
|
using Content.Shared.Physics;
|
|
|
|
namespace Content.Server._Shitcode.Wizard.Systems;
|
|
|
|
public sealed class TeslaBlastSystem : SharedTeslaBlastSystem
|
|
{
|
|
[Dependency] private readonly LightningSystem _lightning = default!;
|
|
|
|
public override void ShootRandomLightnings(EntityUid performer,
|
|
float power,
|
|
float range,
|
|
int boltCount,
|
|
int arcDepth,
|
|
string lightningPrototype,
|
|
Vector2 minMaxDamage,
|
|
Vector2 minMaxStunTime)
|
|
{
|
|
base.ShootRandomLightnings(performer,
|
|
power,
|
|
range,
|
|
boltCount,
|
|
arcDepth,
|
|
lightningPrototype,
|
|
minMaxDamage,
|
|
minMaxStunTime);
|
|
|
|
var damage = float.Lerp(minMaxDamage.X, minMaxDamage.Y, power);
|
|
var stunTime = float.Lerp(minMaxStunTime.X, minMaxStunTime.Y, power);
|
|
|
|
var action = new Action<EntityUid>(uid =>
|
|
{
|
|
var preventCollide = EnsureComp<PreventCollideComponent>(uid);
|
|
preventCollide.Uid = performer;
|
|
|
|
var electrified = EnsureComp<ElectrifiedComponent>(uid);
|
|
electrified.IgnoredEntity = performer;
|
|
electrified.IgnoreInsulation = true;
|
|
electrified.ShockDamage = damage;
|
|
electrified.ShockTime = stunTime;
|
|
|
|
Entity<PreventCollideComponent, ElectrifiedComponent> ent = (uid, preventCollide, electrified);
|
|
Dirty(ent);
|
|
});
|
|
|
|
_lightning.ShootRandomLightnings(performer,
|
|
range,
|
|
boltCount,
|
|
lightningPrototype,
|
|
arcDepth,
|
|
false,
|
|
performer,
|
|
action);
|
|
}
|
|
|
|
public override void ShootLightning(EntityUid performer,
|
|
EntityUid target,
|
|
string lightningPrototype,
|
|
float damage)
|
|
{
|
|
base.ShootLightning(performer, target, lightningPrototype, damage);
|
|
|
|
var action = new Action<EntityUid>(uid =>
|
|
{
|
|
var preventCollide = EnsureComp<PreventCollideComponent>(uid);
|
|
preventCollide.Uid = performer;
|
|
|
|
var electrified = EnsureComp<ElectrifiedComponent>(uid);
|
|
electrified.IgnoredEntity = performer;
|
|
electrified.IgnoreInsulation = true;
|
|
electrified.ShockDamage = damage * 2f; // Multiplying by 2 because siemens is 0.5
|
|
electrified.SiemensCoefficient = 0.5f;
|
|
|
|
Entity<PreventCollideComponent, ElectrifiedComponent> ent = (uid, preventCollide, electrified);
|
|
Dirty(ent);
|
|
});
|
|
|
|
_lightning.ShootLightning(performer, target, lightningPrototype, false, action);
|
|
}
|
|
}
|