fix zombie mispredicts (#11043)
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Weapons.Melee;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Zombies
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class ZombieComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The coefficient of the damage reduction applied when a zombie
|
||||
/// attacks another zombie. longe name
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public float OtherZombieDamageCoefficient = 0.25f;
|
||||
|
||||
/// <summary>
|
||||
/// The baseline infection chance you have if you are completely nude
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MaxZombieInfectionChance = 0.50f;
|
||||
|
||||
/// <summary>
|
||||
/// The minimum infection chance possible. This is simply to prevent
|
||||
/// being invincible by bundling up.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MinZombieInfectionChance = 0.05f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float ZombieMovementSpeedDebuff = 0.75f;
|
||||
|
||||
/// <summary>
|
||||
/// The skin color of the zombie
|
||||
/// </summary>
|
||||
[DataField("skinColor")]
|
||||
public Color SkinColor = new(0.45f, 0.51f, 0.29f);
|
||||
|
||||
/// <summary>
|
||||
/// The eye color of the zombie
|
||||
/// </summary>
|
||||
[DataField("eyeColor")]
|
||||
public Color EyeColor = new(0.96f, 0.13f, 0.24f);
|
||||
|
||||
/// <summary>
|
||||
/// The attack arc of the zombie
|
||||
/// </summary>
|
||||
[DataField("attackArc", customTypeSerializer: typeof(PrototypeIdSerializer<MeleeWeaponAnimationPrototype>))]
|
||||
public string AttackArc = "claw";
|
||||
|
||||
/// <summary>
|
||||
/// The role prototype of the zombie antag role
|
||||
/// </summary>
|
||||
[ViewVariables, DataField("zombieRoldId", customTypeSerializer: typeof(PrototypeIdSerializer<AntagPrototype>))]
|
||||
public readonly string ZombieRoleId = "Zombie";
|
||||
}
|
||||
}
|
||||
@@ -13,12 +13,12 @@ using Content.Server.Inventory;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Content.Server.Speech;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Zombies;
|
||||
|
||||
namespace Content.Server.Zombies
|
||||
{
|
||||
public sealed class ZombieSystem : EntitySystem
|
||||
public sealed class ZombieSystem : SharedZombieSystem
|
||||
{
|
||||
[Dependency] private readonly DiseaseSystem _disease = default!;
|
||||
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
|
||||
@@ -36,7 +36,7 @@ namespace Content.Server.Zombies
|
||||
SubscribeLocalEvent<ZombieComponent, MeleeHitEvent>(OnMeleeHit);
|
||||
SubscribeLocalEvent<ZombieComponent, MobStateChangedEvent>(OnMobState);
|
||||
SubscribeLocalEvent<ActiveZombieComponent, DamageChangedEvent>(OnDamage);
|
||||
SubscribeLocalEvent<ZombieComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshSpeed);
|
||||
|
||||
}
|
||||
|
||||
private void OnMobState(EntityUid uid, ZombieComponent component, MobStateChangedEvent args)
|
||||
@@ -53,12 +53,6 @@ namespace Content.Server.Zombies
|
||||
DoGroan(uid, component);
|
||||
}
|
||||
|
||||
private void OnRefreshSpeed(EntityUid uid, ZombieComponent component, RefreshMovementSpeedModifiersEvent args)
|
||||
{
|
||||
var mod = component.ZombieMovementSpeedDebuff;
|
||||
args.ModifySpeed(mod, mod);
|
||||
}
|
||||
|
||||
private float GetZombieInfectionChance(EntityUid uid, ZombieComponent component)
|
||||
{
|
||||
var baseChance = component.MaxZombieInfectionChance;
|
||||
|
||||
Reference in New Issue
Block a user