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

@@ -99,11 +99,14 @@ namespace Content.Server.Atmos.Miasma
EnsureComp<FliesComponent>(perishable.Owner); EnsureComp<FliesComponent>(perishable.Owner);
if (rotting.DealDamage)
{
DamageSpecifier damage = new(); DamageSpecifier damage = new();
damage.DamageDict.Add("Blunt", 0.3); // Slowly accumulate enough to gib after like half an hour damage.DamageDict.Add("Blunt", 0.3); // Slowly accumulate enough to gib after like half an hour
damage.DamageDict.Add("Cellular", 0.3); // Cloning rework might use this eventually damage.DamageDict.Add("Cellular", 0.3); // Cloning rework might use this eventually
_damageableSystem.TryChangeDamage(perishable.Owner, damage, true, true); _damageableSystem.TryChangeDamage(perishable.Owner, damage, true, true);
}
if (!TryComp<PhysicsComponent>(perishable.Owner, out var physics)) if (!TryComp<PhysicsComponent>(perishable.Owner, out var physics))
continue; continue;

View File

@@ -5,5 +5,11 @@ namespace Content.Server.Atmos.Miasma
/// Tracking component for stuff that has started to rot. /// Tracking component for stuff that has started to rot.
/// </summary> /// </summary>
public sealed class RottingComponent : Component public sealed class RottingComponent : Component
{} {
/// <summary>
/// Whether or not the rotting should deal damage
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public bool DealDamage = true;
}
} }

View File

@@ -261,7 +261,11 @@ namespace Content.Server.Cuffs.Components
} }
} }
CanStillInteract = _entMan.TryGetComponent(Owner, out HandsComponent? handsComponent) && handsComponent.SortedHands.Count() > CuffedHandCount; if (_entMan.TryGetComponent(Owner, out HandsComponent? handsComponent))
CanStillInteract = handsComponent.SortedHands.Count() > CuffedHandCount;
else
CanStillInteract = true;
_sysMan.GetEntitySystem<ActionBlockerSystem>().UpdateCanMove(Owner); _sysMan.GetEntitySystem<ActionBlockerSystem>().UpdateCanMove(Owner);
var ev = new CuffedStateChangeEvent(); var ev = new CuffedStateChangeEvent();
_entMan.EventBus.RaiseLocalEvent(Owner, ref ev, true); _entMan.EventBus.RaiseLocalEvent(Owner, ref ev, true);

View File

@@ -12,7 +12,7 @@ namespace Content.Server.Zombies
/// attacks another zombie. longe name /// attacks another zombie. longe name
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
public float OtherZombieDamageCoefficient = 0.5f; public float OtherZombieDamageCoefficient = 0.25f;
/// <summary> /// <summary>
/// The baseline infection chance you have if you are completely nude /// The baseline infection chance you have if you are completely nude
@@ -27,6 +27,9 @@ namespace Content.Server.Zombies
[ViewVariables] [ViewVariables]
public float MinZombieInfectionChance = 0.1f; public float MinZombieInfectionChance = 0.1f;
[ViewVariables(VVAccess.ReadWrite)]
public float ZombieMovementSpeedDebuff = 0.75f;
/// <summary> /// <summary>
/// The skin color of the zombie /// The skin color of the zombie
/// </summary> /// </summary>

View File

@@ -8,15 +8,16 @@ using Content.Shared.Chemistry.Components;
using Content.Shared.MobState.Components; using Content.Shared.MobState.Components;
using Content.Server.Disease; using Content.Server.Disease;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Server.Popups;
using Robust.Shared.Player;
using Content.Server.Inventory; using Content.Server.Inventory;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Content.Shared.Movement.Systems;
using Content.Shared.Damage;
namespace Content.Server.Zombies namespace Content.Server.Zombies
{ {
public sealed class ZombieSystem : EntitySystem public sealed class ZombieSystem : EntitySystem
{ {
[Dependency] private readonly DamageableSystem _damage = default!;
[Dependency] private readonly DiseaseSystem _disease = default!; [Dependency] private readonly DiseaseSystem _disease = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!; [Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly ZombifyOnDeathSystem _zombify = default!; [Dependency] private readonly ZombifyOnDeathSystem _zombify = default!;
@@ -29,6 +30,13 @@ namespace Content.Server.Zombies
base.Initialize(); base.Initialize();
SubscribeLocalEvent<ZombieComponent, MeleeHitEvent>(OnMeleeHit); SubscribeLocalEvent<ZombieComponent, MeleeHitEvent>(OnMeleeHit);
SubscribeLocalEvent<ZombieComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshSpeed);
}
private void OnRefreshSpeed(EntityUid uid, ZombieComponent component, RefreshMovementSpeedModifiersEvent args)
{
var mod = component.ZombieMovementSpeedDebuff;
args.ModifySpeed(mod, mod);
} }
private float GetZombieInfectionChance(EntityUid uid, ZombieComponent component) private float GetZombieInfectionChance(EntityUid uid, ZombieComponent component)

View File

@@ -30,6 +30,7 @@ using Content.Shared.Zombies;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Server.Atmos.Miasma; using Content.Server.Atmos.Miasma;
using Content.Server.IdentityManagement; using Content.Server.IdentityManagement;
using Content.Shared.Movement.Systems;
namespace Content.Server.Zombies namespace Content.Server.Zombies
{ {
@@ -48,6 +49,7 @@ namespace Content.Server.Zombies
[Dependency] private readonly DamageableSystem _damageable = default!; [Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly SharedHumanoidAppearanceSystem _sharedHuApp = default!; [Dependency] private readonly SharedHumanoidAppearanceSystem _sharedHuApp = default!;
[Dependency] private readonly IdentitySystem _identity = default!; [Dependency] private readonly IdentitySystem _identity = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
[Dependency] private readonly IChatManager _chatMan = default!; [Dependency] private readonly IChatManager _chatMan = default!;
[Dependency] private readonly IPrototypeManager _proto = default!; [Dependency] private readonly IPrototypeManager _proto = default!;
@@ -63,8 +65,8 @@ namespace Content.Server.Zombies
/// </summary> /// </summary>
private void OnDamageChanged(EntityUid uid, ZombifyOnDeathComponent component, MobStateChangedEvent args) private void OnDamageChanged(EntityUid uid, ZombifyOnDeathComponent component, MobStateChangedEvent args)
{ {
if (args.CurrentMobState.IsDead() || if (args.CurrentMobState == DamageState.Dead ||
args.CurrentMobState.IsCritical()) args.CurrentMobState == DamageState.Critical)
{ {
ZombifyEntity(uid); ZombifyEntity(uid);
} }
@@ -101,7 +103,8 @@ namespace Content.Server.Zombies
//funny voice //funny voice
EnsureComp<ReplacementAccentComponent>(target).Accent = "zombie"; 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 ///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. ///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(); DamageSpecifier dspec = new();
dspec.DamageDict.Add("Slash", 13); dspec.DamageDict.Add("Slash", 13);
dspec.DamageDict.Add("Piercing", 7); dspec.DamageDict.Add("Piercing", 7);
dspec.DamageDict.Add("Structural", 10);
melee.Damage = dspec; melee.Damage = dspec;
} }
@@ -194,6 +198,8 @@ namespace Content.Server.Zombies
//zombie gamemode stuff //zombie gamemode stuff
RaiseLocalEvent(new EntityZombifiedEvent(target)); RaiseLocalEvent(new EntityZombifiedEvent(target));
//zombies get slowdown once they convert
_movementSpeedModifier.RefreshMovementSpeedModifiers(target);
} }
} }
} }

View File

@@ -112,16 +112,14 @@
- type: damageModifierSet - type: damageModifierSet
id: Zombie #Blunt resistent and immune to biological threats, but can be hacked apart and burned id: Zombie #Blunt resistent and immune to biological threats, but can be hacked apart and burned
coefficients: coefficients:
Blunt: 0.6 Blunt: 0.5
Slash: 0.9 Slash: 0.7
Piercing: 0.9 Piercing: 0.7
Shock: 1.5 Shock: 1.5
Cold: 0.2 Cold: 0.2
Heat: 2.5 Heat: 2.0
Poison: 0.0 Poison: 0.0
flatReductions: #offsets rotting damage Radiation: 0.0
Blunt: 0.3
Cellular: 0.3
# immune to everything except physical and heat damage # immune to everything except physical and heat damage
- type: damageModifierSet - type: damageModifierSet