mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-28 02:57:52 +03:00
* Уэээээээ * Почти настрадались * Скоро конец.... * СКОРО * Мышки плакали, кололись, но продолжали упорно жрать кактус * Все ближе! * Это такой конец? * Книжка говна * фиксики * ОНО ЖИВОЕ * Телепорт * разное * Added byond * ивенты теперь работают * Разфикс телепорта * Свет мой зеркальце скажи, да всю правду доложи - Я ль робастней всех на свете? * Разное * Еще многа всего * Многа разнава * Скоро конец.... * ЭТО КОНЕЦ * Фикс линтера (ну, или я на это надеюсь) * Еще один фикс линтера * Победа! * фиксики * пу пу пу * Фикс подмастерья * Мисклик * Высокочастотный меч * Неймспейсы * Пул способностей мага
64 lines
2.0 KiB
C#
64 lines
2.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 Content.Shared._Shitmed.Targeting;
|
|
using Content.Shared.Damage;
|
|
using Content.Shared.Mobs.Systems;
|
|
using Content.Shared.Projectiles;
|
|
using Content.Shared.Rejuvenate;
|
|
using Content.Shared.Tag;
|
|
using Content.Shared.Whitelist;
|
|
|
|
namespace Content.Shared._Shitcode.Wizard.Projectiles;
|
|
|
|
public sealed class RejuvenateOnProjectileHitSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
|
[Dependency] private readonly DamageableSystem _damageable = default!;
|
|
[Dependency] private readonly MobStateSystem _mobState = default!;
|
|
[Dependency] private readonly TagSystem _tag = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<RejuvenateOnProjectileHitComponent, ProjectileHitEvent>(OnHit);
|
|
}
|
|
|
|
private void OnHit(Entity<RejuvenateOnProjectileHitComponent> ent, ref ProjectileHitEvent args)
|
|
{
|
|
var (_, comp) = ent;
|
|
|
|
if (_whitelist.IsValid(comp.UndeadList, args.Target))
|
|
{
|
|
ApplyEffects(comp, args.Target, comp.ReverseEffects);
|
|
return;
|
|
}
|
|
|
|
ApplyEffects(comp, args.Target, !comp.ReverseEffects);
|
|
}
|
|
|
|
private void ApplyEffects(RejuvenateOnProjectileHitComponent comp, EntityUid target, bool rejuvenate)
|
|
{
|
|
if (rejuvenate)
|
|
{
|
|
if (!_tag.HasTag(target, comp.SoulTappedTag))
|
|
RaiseLocalEvent(target, new RejuvenateEvent(false, false));
|
|
return;
|
|
}
|
|
|
|
if (!_mobState.IsDead(target))
|
|
{
|
|
_damageable.TryChangeDamage(target,
|
|
comp.Damage,
|
|
true,
|
|
canSever: false,
|
|
targetPart: TargetBodyPart.Torso);
|
|
}
|
|
}
|
|
}
|