fish-station/Content.Shared/Zombies/SharedZombieSystem.cs
Vigers Ray 6020a6fd5b Merge remote-tracking branch 'space-wizards/master'
# Conflicts:
#	Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs
#	Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml.cs
#	Content.Server/Weapons/Ranged/Systems/GunSystem.cs
#	Content.Server/Zombies/ZombieSystem.cs
#	Content.Shared/Inventory/InventorySystem.Relay.cs
#	Content.Shared/Zombies/SharedZombieSystem.cs
#	Content.Shared/Zombies/ZombieComponent.cs
#	Resources/Locale/en-US/_strings/research/technologies.ftl
#	Resources/Prototypes/Entities/Clothing/OuterClothing/bio.yml
#	Resources/Prototypes/Polymorphs/polymorph.yml
#	Resources/Prototypes/Recipes/Lathes/security.yml
#	Resources/Prototypes/Research/arsenal.yml
#	Resources/Prototypes/Research/experimental.yml
2025-04-17 00:07:59 +03:00

52 lines
1.9 KiB
C#

using Content.Shared.Actions;
using Content.Shared.Armor;
using Content.Shared.Inventory;
using Content.Shared.Movement.Systems;
using Content.Shared.NameModifier.EntitySystems;
namespace Content.Shared.Zombies;
public abstract class SharedZombieSystem : EntitySystem
{
/// <inheritdoc/>
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ZombieComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshSpeed);
SubscribeLocalEvent<ZombieComponent, RefreshNameModifiersEvent>(OnRefreshNameModifiers);
SubscribeLocalEvent<ZombificationResistanceComponent, ArmorExamineEvent>(OnArmorExamine);
SubscribeLocalEvent<ZombificationResistanceComponent, InventoryRelayedEvent<ZombificationResistanceQueryEvent>>(OnResistanceQuery);
}
private void OnResistanceQuery(Entity<ZombificationResistanceComponent> ent, ref InventoryRelayedEvent<ZombificationResistanceQueryEvent> query)
{
query.Args.TotalCoefficient *= ent.Comp.ZombificationResistanceCoefficient;
}
private void OnArmorExamine(Entity<ZombificationResistanceComponent> ent, ref ArmorExamineEvent args)
{
var value = MathF.Round((1f - ent.Comp.ZombificationResistanceCoefficient) * 100, 1);
if (value == 0)
return;
args.Msg.PushNewline();
args.Msg.AddMarkupOrThrow(Loc.GetString(ent.Comp.Examine, ("value", value)));
}
private void OnRefreshSpeed(EntityUid uid, ZombieComponent component, RefreshMovementSpeedModifiersEvent args)
{
var mod = component.ZombieMovementSpeedBuff;
args.ModifySpeed(mod, mod);
}
private void OnRefreshNameModifiers(Entity<ZombieComponent> entity, ref RefreshNameModifiersEvent args)
{
args.AddModifier("zombie-name-prefix");
}
}
public sealed partial class ZombieJumpActionEvent : WorldTargetActionEvent;
public sealed partial class ZombieFlairActionEvent : InstantActionEvent;