mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-27 18:47:52 +03:00
* Уэээээээ * Почти настрадались * Скоро конец.... * СКОРО * Мышки плакали, кололись, но продолжали упорно жрать кактус * Все ближе! * Это такой конец? * Книжка говна * фиксики * ОНО ЖИВОЕ * Телепорт * разное * Added byond * ивенты теперь работают * Разфикс телепорта * Свет мой зеркальце скажи, да всю правду доложи - Я ль робастней всех на свете? * Разное * Еще многа всего * Многа разнава * Скоро конец.... * ЭТО КОНЕЦ * Фикс линтера (ну, или я на это надеюсь) * Еще один фикс линтера * Победа! * фиксики * пу пу пу * Фикс подмастерья * Мисклик * Высокочастотный меч * Неймспейсы * Пул способностей мага
80 lines
2.7 KiB
C#
80 lines
2.7 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.Damage;
|
|
using Content.Shared.Damage.Prototypes;
|
|
using Content.Shared.Damage.Systems;
|
|
using Content.Shared.Slippery;
|
|
using Content.Shared.StatusEffect;
|
|
using Content.Shared.Weapons.Melee.Events;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared._Shitcode.Wizard.Mutate;
|
|
|
|
public abstract class SharedHulkSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<HulkComponent, BeforeStaminaDamageEvent>(OnBeforeStaminaDamage);
|
|
SubscribeLocalEvent<HulkComponent, BeforeStatusEffectAddedEvent>(OnBeforeStatusEffect);
|
|
SubscribeLocalEvent<HulkComponent, SlipAttemptEvent>(OnSlipAttempt);
|
|
SubscribeLocalEvent<HulkComponent, MeleeHitEvent>(OnMeleeHit);
|
|
SubscribeLocalEvent<HulkComponent, ComponentStartup>(OnStartup);
|
|
}
|
|
|
|
private void OnStartup(Entity<HulkComponent> ent, ref ComponentStartup args)
|
|
{
|
|
UpdateColorStartup(ent);
|
|
ent.Comp.StructuralDamage ??= new DamageSpecifier(_prototype.Index<DamageTypePrototype>("Structural"), 80f);
|
|
}
|
|
|
|
private void OnMeleeHit(Entity<HulkComponent> ent, ref MeleeHitEvent args)
|
|
{
|
|
args.BonusDamage += args.BaseDamage * ent.Comp.FistDamageMultiplier;
|
|
var total = args.BonusDamage.GetTotal();
|
|
if (total > 0 && total > ent.Comp.MaxBonusFistDamage)
|
|
args.BonusDamage *= ent.Comp.MaxBonusFistDamage / total;
|
|
|
|
if (ent.Comp.StructuralDamage != null)
|
|
args.BonusDamage += ent.Comp.StructuralDamage;
|
|
|
|
if (args.HitEntities.Count > 0)
|
|
Roar(ent, 0.2f);
|
|
}
|
|
|
|
private void OnSlipAttempt(Entity<HulkComponent> ent, ref SlipAttemptEvent args)
|
|
{
|
|
args.NoSlip = true;
|
|
}
|
|
|
|
private void OnBeforeStatusEffect(Entity<HulkComponent> ent, ref BeforeStatusEffectAddedEvent args)
|
|
{
|
|
if (args.Key is not ("KnockedDown" or "Stun"))
|
|
return;
|
|
|
|
Roar(ent);
|
|
args.Cancelled = true;
|
|
}
|
|
|
|
private void OnBeforeStaminaDamage(Entity<HulkComponent> ent, ref BeforeStaminaDamageEvent args)
|
|
{
|
|
args.Cancelled = true;
|
|
}
|
|
|
|
protected virtual void UpdateColorStartup(Entity<HulkComponent> hulk)
|
|
{
|
|
}
|
|
|
|
public virtual void Roar(Entity<HulkComponent> hulk, float prob = 1f)
|
|
{
|
|
}
|
|
}
|