Zombie Fixes and Tweaks (#9940)

This commit is contained in:
Nemanja
2022-07-26 20:35:34 -04:00
committed by GitHub
parent e795e5b5e1
commit 6276bda4f4
7 changed files with 47 additions and 19 deletions

View File

@@ -30,6 +30,7 @@ using Content.Shared.Zombies;
using Content.Shared.Popups;
using Content.Server.Atmos.Miasma;
using Content.Server.IdentityManagement;
using Content.Shared.Movement.Systems;
namespace Content.Server.Zombies
{
@@ -48,6 +49,7 @@ namespace Content.Server.Zombies
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly SharedHumanoidAppearanceSystem _sharedHuApp = default!;
[Dependency] private readonly IdentitySystem _identity = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
[Dependency] private readonly IChatManager _chatMan = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
@@ -63,8 +65,8 @@ namespace Content.Server.Zombies
/// </summary>
private void OnDamageChanged(EntityUid uid, ZombifyOnDeathComponent component, MobStateChangedEvent args)
{
if (args.CurrentMobState.IsDead() ||
args.CurrentMobState.IsCritical())
if (args.CurrentMobState == DamageState.Dead ||
args.CurrentMobState == DamageState.Critical)
{
ZombifyEntity(uid);
}
@@ -101,7 +103,8 @@ namespace Content.Server.Zombies
//funny voice
EnsureComp<ReplacementAccentComponent>(target).Accent = "zombie";
EnsureComp<RottingComponent>(target);
var rotting = EnsureComp<RottingComponent>(target);
rotting.DealDamage = false;
///This is needed for stupid entities that fuck up combat mode component
///in an attempt to make an entity not attack. This is the easiest way to do it.
@@ -129,6 +132,7 @@ namespace Content.Server.Zombies
DamageSpecifier dspec = new();
dspec.DamageDict.Add("Slash", 13);
dspec.DamageDict.Add("Piercing", 7);
dspec.DamageDict.Add("Structural", 10);
melee.Damage = dspec;
}
@@ -194,6 +198,8 @@ namespace Content.Server.Zombies
//zombie gamemode stuff
RaiseLocalEvent(new EntityZombifiedEvent(target));
//zombies get slowdown once they convert
_movementSpeedModifier.RefreshMovementSpeedModifiers(target);
}
}
}