Zombie Fixes and Tweaks (#9940)
This commit is contained in:
@@ -99,11 +99,14 @@ namespace Content.Server.Atmos.Miasma
|
||||
|
||||
EnsureComp<FliesComponent>(perishable.Owner);
|
||||
|
||||
if (rotting.DealDamage)
|
||||
{
|
||||
DamageSpecifier damage = new();
|
||||
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
|
||||
|
||||
_damageableSystem.TryChangeDamage(perishable.Owner, damage, true, true);
|
||||
}
|
||||
|
||||
if (!TryComp<PhysicsComponent>(perishable.Owner, out var physics))
|
||||
continue;
|
||||
|
||||
@@ -5,5 +5,11 @@ namespace Content.Server.Atmos.Miasma
|
||||
/// Tracking component for stuff that has started to rot.
|
||||
/// </summary>
|
||||
public sealed class RottingComponent : Component
|
||||
{}
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether or not the rotting should deal damage
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool DealDamage = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
var ev = new CuffedStateChangeEvent();
|
||||
_entMan.EventBus.RaiseLocalEvent(Owner, ref ev, true);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.Zombies
|
||||
/// attacks another zombie. longe name
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public float OtherZombieDamageCoefficient = 0.5f;
|
||||
public float OtherZombieDamageCoefficient = 0.25f;
|
||||
|
||||
/// <summary>
|
||||
/// The baseline infection chance you have if you are completely nude
|
||||
@@ -27,6 +27,9 @@ namespace Content.Server.Zombies
|
||||
[ViewVariables]
|
||||
public float MinZombieInfectionChance = 0.1f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float ZombieMovementSpeedDebuff = 0.75f;
|
||||
|
||||
/// <summary>
|
||||
/// The skin color of the zombie
|
||||
/// </summary>
|
||||
|
||||
@@ -8,15 +8,16 @@ using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Server.Disease;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Server.Popups;
|
||||
using Robust.Shared.Player;
|
||||
using Content.Server.Inventory;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Damage;
|
||||
|
||||
namespace Content.Server.Zombies
|
||||
{
|
||||
public sealed class ZombieSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly DamageableSystem _damage = default!;
|
||||
[Dependency] private readonly DiseaseSystem _disease = default!;
|
||||
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
|
||||
[Dependency] private readonly ZombifyOnDeathSystem _zombify = default!;
|
||||
@@ -29,6 +30,13 @@ namespace Content.Server.Zombies
|
||||
base.Initialize();
|
||||
|
||||
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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,16 +112,14 @@
|
||||
- type: damageModifierSet
|
||||
id: Zombie #Blunt resistent and immune to biological threats, but can be hacked apart and burned
|
||||
coefficients:
|
||||
Blunt: 0.6
|
||||
Slash: 0.9
|
||||
Piercing: 0.9
|
||||
Blunt: 0.5
|
||||
Slash: 0.7
|
||||
Piercing: 0.7
|
||||
Shock: 1.5
|
||||
Cold: 0.2
|
||||
Heat: 2.5
|
||||
Heat: 2.0
|
||||
Poison: 0.0
|
||||
flatReductions: #offsets rotting damage
|
||||
Blunt: 0.3
|
||||
Cellular: 0.3
|
||||
Radiation: 0.0
|
||||
|
||||
# immune to everything except physical and heat damage
|
||||
- type: damageModifierSet
|
||||
|
||||
Reference in New Issue
Block a user