Zombies!!! (#7509)
* wip * heal on bite * more fixes and additions * don't crash * Update medicine.yml * zombie claw item and damage resist * ignoredcomponents.cs * Add zombie claw, fix infection, add immunities * fix * razzle dazzle * yaml fix * Update Content.Server/Disease/DiseaseZombieSystem.cs Co-authored-by: Moony <moonheart08@users.noreply.github.com> * Update Content.Server/Disease/DiseaseZombieSystem.cs Co-authored-by: Moony <moonheart08@users.noreply.github.com> * Update Content.Server/Disease/DiseaseZombieSystem.cs Co-authored-by: Moony <moonheart08@users.noreply.github.com> * Update Content.Server/Disease/DiseaseZombieSystem.cs Co-authored-by: Moony <moonheart08@users.noreply.github.com> * sdasadsadsadasd * Generalize DiseaseProgression.cs * final final final final final final cope seethe * Update medicine.yml * Update Content.Server/Disease/Components/DiseaseZombieComponent.cs Co-authored-by: mirrorcult <lunarautomaton6@gmail.com> * Update BloodstreamSystem.cs * Update Content.Server/Disease/Components/DiseaseZombieComponent.cs Co-authored-by: mirrorcult <lunarautomaton6@gmail.com> * Update Content.Server/Disease/DiseaseZombieSystem.cs Co-authored-by: mirrorcult <lunarautomaton6@gmail.com> * fixing until i die * folder + zombietransfer fix * smol fixe * the smallest of fixes * aaaa * Infection timer buff Co-authored-by: Moony <moonheart08@users.noreply.github.com> Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
54
Content.Server/StationEvents/Events/ZombieOutbreak.cs
Normal file
54
Content.Server/StationEvents/Events/ZombieOutbreak.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Robust.Shared.Random;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.Disease.Zombie.Components;
|
||||
using Content.Shared.MobState.Components;
|
||||
|
||||
namespace Content.Server.StationEvents.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Revives several dead entities as zombies
|
||||
/// </summary>
|
||||
public sealed class ZombieOutbreak : StationEvent
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||
|
||||
public override string Name => "ZombieOutbreak";
|
||||
public override float Weight => WeightLow;
|
||||
|
||||
public override string? StartAudio => "/Audio/Announcements/bloblarm.ogg";
|
||||
protected override float EndAfter => 1.0f;
|
||||
|
||||
public override int? MaxOccurrences => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Finds 1-3 random, dead entities accross the station
|
||||
/// and turns them into zombies.
|
||||
/// </summary>
|
||||
public override void Startup()
|
||||
{
|
||||
base.Startup();
|
||||
List<MobStateComponent> deadList = new();
|
||||
foreach (var mobState in _entityManager.EntityQuery<MobStateComponent>())
|
||||
{
|
||||
if (mobState.IsDead() || mobState.IsCritical())
|
||||
deadList.Add(mobState);
|
||||
}
|
||||
_random.Shuffle(deadList);
|
||||
|
||||
var toInfect = _random.Next(1, 3);
|
||||
|
||||
/// Now we give it to people in the list of dead entities earlier.
|
||||
foreach (var target in deadList)
|
||||
{
|
||||
if (toInfect-- == 0)
|
||||
break;
|
||||
|
||||
_entityManager.EnsureComponent<DiseaseZombieComponent>(target.Owner);
|
||||
}
|
||||
_chatManager.DispatchStationAnnouncement(Loc.GetString("station-event-zombie-outbreak-announcement"),
|
||||
playDefaultSound: false, colorOverride: Color.DarkMagenta);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user