zombie event overhaul (#10874)

This commit is contained in:
Nemanja
2022-08-29 22:35:19 -04:00
committed by GitHub
parent e789e1df2a
commit 0b52ac9389
5 changed files with 19 additions and 60 deletions

View File

@@ -18,14 +18,14 @@ namespace Content.Server.Zombies
/// The baseline infection chance you have if you are completely nude
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float MaxZombieInfectionChance = 0.75f;
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.1f;
public float MinZombieInfectionChance = 0.05f;
[ViewVariables(VVAccess.ReadWrite)]
public float ZombieMovementSpeedDebuff = 0.75f;

View File

@@ -61,7 +61,7 @@ namespace Content.Server.Zombies
private float GetZombieInfectionChance(EntityUid uid, ZombieComponent component)
{
float baseChance = component.MaxZombieInfectionChance;
var baseChance = component.MaxZombieInfectionChance;
if (!TryComp<InventoryComponent>(uid, out var inventoryComponent))
return baseChance;
@@ -90,7 +90,7 @@ namespace Content.Server.Zombies
var max = component.MaxZombieInfectionChance;
var min = component.MinZombieInfectionChance;
//gets a value between the max and min based on how many items the entity is wearing
float chance = (max-min) * ((total - items)/total) + min;
var chance = (max-min) * ((total - items)/total) + min;
return chance;
}
@@ -102,7 +102,7 @@ namespace Content.Server.Zombies
if (!args.HitEntities.Any())
return;
foreach (EntityUid entity in args.HitEntities)
foreach (var entity in args.HitEntities)
{
if (args.User == entity)
continue;
@@ -131,7 +131,7 @@ namespace Content.Server.Zombies
}
}
public void DoGroan(EntityUid uid, ActiveZombieComponent component)
private void DoGroan(EntityUid uid, ActiveZombieComponent component)
{
if (component.LastDamageGroanCooldown > 0)
return;