zombie event overhaul (#10874)
This commit is contained in:
@@ -2,8 +2,8 @@ using System.Linq;
|
||||
using Content.Server.Actions;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.Disease;
|
||||
using Content.Server.GameTicking.Rules.Configurations;
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Server.MobState;
|
||||
using Content.Server.Players;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Preferences.Managers;
|
||||
@@ -13,7 +13,6 @@ using Content.Server.Zombies;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.CharacterAppearance.Components;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.MobState;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Preferences;
|
||||
@@ -40,6 +39,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem
|
||||
[Dependency] private readonly DiseaseSystem _diseaseSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly ActionsSystem _action = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobState = default!;
|
||||
[Dependency] private readonly ZombifyOnDeathSystem _zombify = default!;
|
||||
|
||||
private Dictionary<string, string> _initialInfectedNames = new();
|
||||
@@ -90,8 +90,8 @@ public sealed class ZombieRuleSystem : GameRuleSystem
|
||||
("username", player.Value)));
|
||||
}
|
||||
|
||||
///Gets a bunch of the living players and displays them if they're under a threshold.
|
||||
///InitialInfected is used for the threshold because it scales with the player count well.
|
||||
//Gets a bunch of the living players and displays them if they're under a threshold.
|
||||
//InitialInfected is used for the threshold because it scales with the player count well.
|
||||
if (livingHumans.Count > 0 && livingHumans.Count <= _initialInfectedNames.Count)
|
||||
{
|
||||
ev.AddLine("");
|
||||
@@ -203,16 +203,16 @@ public sealed class ZombieRuleSystem : GameRuleSystem
|
||||
|
||||
livingHumans = new();
|
||||
|
||||
foreach (var ent in allPlayers)
|
||||
foreach (var (_, mob) in allPlayers)
|
||||
{
|
||||
if (ent.Item2.IsAlive())
|
||||
if (_mobState.IsAlive(mob.Owner, mob))
|
||||
{
|
||||
totalPlayers.Add(ent.Item2.Owner);
|
||||
totalPlayers.Add(mob.Owner);
|
||||
|
||||
if (allZombers.HasComponent(ent.Item1.Owner))
|
||||
livingZombies.Add(ent.Item2.Owner);
|
||||
if (allZombers.HasComponent(mob.Owner))
|
||||
livingZombies.Add(mob.Owner);
|
||||
else
|
||||
livingHumans.Add(ent.Item2.Owner);
|
||||
livingHumans.Add(mob.Owner);
|
||||
}
|
||||
}
|
||||
return ((float) livingZombies.Count) / (float) totalPlayers.Count;
|
||||
@@ -300,8 +300,8 @@ public sealed class ZombieRuleSystem : GameRuleSystem
|
||||
var messageWrapper = Loc.GetString("chat-manager-server-wrap-message");
|
||||
|
||||
//gets the names now in case the players leave.
|
||||
if (inCharacterName != null)
|
||||
_initialInfectedNames.Add(inCharacterName, mind.Session.Name);
|
||||
//this gets unhappy if people with the same name get chose. Probably shouldn't happen.
|
||||
_initialInfectedNames.Add(inCharacterName, mind.Session.Name);
|
||||
|
||||
// I went all the way to ChatManager.cs and all i got was this lousy T-shirt
|
||||
_chatManager.ChatMessageToOne(Shared.Chat.ChatChannel.Server, Loc.GetString("zombie-patientzero-role-greeting"),
|
||||
|
||||
Reference in New Issue
Block a user