Zombie Bugfix (#7641)

* 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

* Update BibleSystem.cs

* Update ZombieOutbreak.cs

* Update zombie.ftl

* Update ZombieTransferSystem.cs

* Update DiseaseZombieSystem.cs

* Update DiseaseZombieSystem.cs

* Tunes outbreak to only happen toward the end of a round.

* Update BibleSystem.cs

* general fixes+cleaning code

Co-authored-by: Moony <moonheart08@users.noreply.github.com>
Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
EmoGarbage404
2022-04-19 21:54:10 -04:00
committed by GitHub
parent 0957606792
commit 8fc1f4d06c
5 changed files with 32 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Content.Server.Speech.Components;
using Content.Server.Ghost.Roles.Components;
using Content.Server.Disease.Components;
@@ -11,6 +11,7 @@ using Content.Server.Hands.Components;
using Content.Server.Nutrition.Components;
using Content.Server.Mind.Components;
using Content.Server.Chat.Managers;
using Content.Server.Inventory;
using Content.Shared.Damage;
using Content.Shared.MobState.Components;
using Content.Shared.Hands.EntitySystems;
@@ -27,6 +28,8 @@ namespace Content.Server.Disease.Zombie
public sealed class DiseaseZombieSystem : EntitySystem
{
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly ServerInventorySystem _serverInventory = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
[Dependency] private readonly SharedHandsSystem _sharedHands = default!;
@@ -59,6 +62,7 @@ namespace Content.Server.Disease.Zombie
_bloodstream.SetBloodLossThreshold(uid, 0f, bloodstream);
_bloodstream.TryModifyBleedAmount(uid, -bloodstream.BleedAmount, bloodstream);
_movementSpeedModifier.RefreshMovementSpeedModifiers(uid);
EntityManager.EnsureComponent<ReplacementAccentComponent>(uid).Accent = "zombie";
if (TryComp<DamageableComponent>(uid, out var comp))
@@ -84,8 +88,8 @@ namespace Content.Server.Disease.Zombie
_sharedHands.TryDrop(uid);
var pos = EntityManager.GetComponent<TransformComponent>(uid).Coordinates;
var virtualItem = EntityManager.SpawnEntity("ZombieClaw", pos);
_sharedHands.DoPickup(uid, hand.Value, virtualItem);
var claw = EntityManager.SpawnEntity("ZombieClaw", pos);
_sharedHands.DoPickup(uid, hand.Value, claw);
}
}
else
@@ -93,41 +97,28 @@ namespace Content.Server.Disease.Zombie
EnsureComp<ZombieTransferComponent>(uid);
}
if (TryComp<ContainerManagerComponent>(uid, out var cmcomp))
{
foreach (var container in cmcomp.Containers)
{
if (container.Value.ID == "gloves")
{
foreach (var entity in container.Value.ContainedEntities)
{
container.Value.Remove(entity);
}
}
}
}
if (TryComp<ServerInventoryComponent>(uid, out var servInvComp))
_serverInventory.TryUnequip(uid, "gloves", true, true, servInvComp);
if (TryComp<MindComponent>(uid, out var mindcomp))
{
if (mindcomp.Mind != null && mindcomp.Mind.TryGetSession(out var session))
{
var chatMgr = IoCManager.Resolve<IChatManager>();
chatMgr.DispatchServerMessage(session, Loc.GetString("zombie-infection-greeting"));
}
}
_popupSystem.PopupEntity(Loc.GetString("zombie-transform", ("target", uid)), uid, Filter.Pvs(uid));
uid.PopupMessageEveryone(Loc.GetString("zombie-transform", ("target", uid)));
if (TryComp<MetaDataComponent>(uid, out var metacomp))
{
metacomp.EntityName = Loc.GetString("zombie-name-prefix", ("target", metacomp.EntityName));
if (!HasComp<GhostRoleMobSpawnerComponent>(uid)) //this specific component gives build test trouble so pop off, ig
{
EntityManager.EnsureComponent<GhostTakeoverAvailableComponent>(uid, out var ghostcomp);
ghostcomp.RoleName = metacomp.EntityName;
ghostcomp.RoleDescription = Loc.GetString("zombie-role-desc");
ghostcomp.RoleRules = Loc.GetString("zombie-role-rules");
}
var mindcomp = EnsureComp<MindComponent>(uid);
if (mindcomp.Mind != null && mindcomp.Mind.TryGetSession(out var session))
{
var chatMgr = IoCManager.Resolve<IChatManager>();
chatMgr.DispatchServerMessage(session, Loc.GetString("zombie-infection-greeting"));
}
if (!HasComp<GhostRoleMobSpawnerComponent>(uid) && !mindcomp.HasMind) //this specific component gives build test trouble so pop off, ig
{
EntityManager.EnsureComponent<GhostTakeoverAvailableComponent>(uid, out var ghostcomp);
ghostcomp.RoleName = Loc.GetString("zombie-generic");
ghostcomp.RoleDescription = Loc.GetString("zombie-role-desc");
ghostcomp.RoleRules = Loc.GetString("zombie-role-rules");
}
}

View File

@@ -15,7 +15,8 @@ namespace Content.Server.StationEvents.Events
[Dependency] private readonly IChatManager _chatManager = default!;
public override string Name => "ZombieOutbreak";
public override float Weight => WeightLow;
public override int EarliestStart => 50;
public override float Weight => WeightLow / 2;
public override string? StartAudio => "/Audio/Announcements/bloblarm.ogg";
protected override float EndAfter => 1.0f;

View File

@@ -10,12 +10,14 @@ using Content.Shared.Damage;
using Content.Shared.MobState.Components;
using Content.Server.Disease;
using Content.Server.Weapons.Melee.ZombieTransfer.Components;
using Content.Server.Body.Components;
namespace Content.Server.Weapons.Melee.ZombieTransfer
{
public sealed class ZombieTransferSystem : EntitySystem
{
[Dependency] private readonly DiseaseSystem _disease = default!;
[Dependency] private readonly BodySystem _body = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
public override void Initialize()
@@ -37,7 +39,7 @@ namespace Content.Server.Weapons.Melee.ZombieTransfer
if (args.User == entity)
continue;
if (!HasComp<MobStateComponent>(entity))
if (!HasComp<MobStateComponent>(entity) || HasComp<DroneComponent>(entity))
continue;
if (_robustRandom.Prob(diseaseZombieComp.Probability) && HasComp<DiseaseCarrierComponent>(entity))
@@ -55,7 +57,7 @@ namespace Content.Server.Weapons.Melee.ZombieTransfer
dspec.DamageDict.TryAdd("Piercing", -7);
args.BonusDamage += dspec;
}
else if (mobState.IsAlive() && !HasComp<DroneComponent>(entity)) //heals when zombies bite live entities
else if (mobState.IsAlive()) //heals when zombies bite live entities
{
var healingSolution = new Solution();
healingSolution.AddReagent("Bicaridine", 1.00); //if OP, reduce/change chem

View File

@@ -1,6 +1,7 @@
zombie-transform = {CAPITALIZE(THE($target))} turned into a zombie!
zombie-infection-greeting = You have become a zombie. Your goal is to seek out the living and to try to infect them. Work together with your fellow zombies to overpower the remaining crewmates.
zombie-generic = zombie
zombie-name-prefix = zombified {$target}
zombie-role-desc = A malevolent creature of the dead.
zombie-role-rules = You are an antagonist. Search out the living and bite them in order to infect them and turn them into zombies. Work together with other the zombies to overtake the station.

View File

@@ -8,6 +8,7 @@
sprite: Objects/Weapons/Melee/zombie_claw.rsi
state: icon
- type: Item
- type: Sharp
- type: ZombieTransfer
- type: Unremoveable
- type: MeleeWeapon