// SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com> // SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com> // SPDX-FileCopyrightText: 2025 Misandry // SPDX-FileCopyrightText: 2025 gus // // 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(OnBeforeStaminaDamage); SubscribeLocalEvent(OnBeforeStatusEffect); SubscribeLocalEvent(OnSlipAttempt); SubscribeLocalEvent(OnMeleeHit); SubscribeLocalEvent(OnStartup); } private void OnStartup(Entity ent, ref ComponentStartup args) { UpdateColorStartup(ent); ent.Comp.StructuralDamage ??= new DamageSpecifier(_prototype.Index("Structural"), 80f); } private void OnMeleeHit(Entity 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 ent, ref SlipAttemptEvent args) { args.NoSlip = true; } private void OnBeforeStatusEffect(Entity ent, ref BeforeStatusEffectAddedEvent args) { if (args.Key is not ("KnockedDown" or "Stun")) return; Roar(ent); args.Cancelled = true; } private void OnBeforeStaminaDamage(Entity ent, ref BeforeStaminaDamageEvent args) { args.Cancelled = true; } protected virtual void UpdateColorStartup(Entity hulk) { } public virtual void Roar(Entity hulk, float prob = 1f) { } }