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

View File

@@ -15,7 +15,8 @@ namespace Content.Server.StationEvents.Events
[Dependency] private readonly IChatManager _chatManager = default!; [Dependency] private readonly IChatManager _chatManager = default!;
public override string Name => "ZombieOutbreak"; 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"; public override string? StartAudio => "/Audio/Announcements/bloblarm.ogg";
protected override float EndAfter => 1.0f; protected override float EndAfter => 1.0f;

View File

@@ -10,12 +10,14 @@ using Content.Shared.Damage;
using Content.Shared.MobState.Components; using Content.Shared.MobState.Components;
using Content.Server.Disease; using Content.Server.Disease;
using Content.Server.Weapons.Melee.ZombieTransfer.Components; using Content.Server.Weapons.Melee.ZombieTransfer.Components;
using Content.Server.Body.Components;
namespace Content.Server.Weapons.Melee.ZombieTransfer namespace Content.Server.Weapons.Melee.ZombieTransfer
{ {
public sealed class ZombieTransferSystem : EntitySystem public sealed class ZombieTransferSystem : EntitySystem
{ {
[Dependency] private readonly DiseaseSystem _disease = default!; [Dependency] private readonly DiseaseSystem _disease = default!;
[Dependency] private readonly BodySystem _body = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!; [Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!;
public override void Initialize() public override void Initialize()
@@ -37,7 +39,7 @@ namespace Content.Server.Weapons.Melee.ZombieTransfer
if (args.User == entity) if (args.User == entity)
continue; continue;
if (!HasComp<MobStateComponent>(entity)) if (!HasComp<MobStateComponent>(entity) || HasComp<DroneComponent>(entity))
continue; continue;
if (_robustRandom.Prob(diseaseZombieComp.Probability) && HasComp<DiseaseCarrierComponent>(entity)) if (_robustRandom.Prob(diseaseZombieComp.Probability) && HasComp<DiseaseCarrierComponent>(entity))
@@ -55,7 +57,7 @@ namespace Content.Server.Weapons.Melee.ZombieTransfer
dspec.DamageDict.TryAdd("Piercing", -7); dspec.DamageDict.TryAdd("Piercing", -7);
args.BonusDamage += dspec; 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(); var healingSolution = new Solution();
healingSolution.AddReagent("Bicaridine", 1.00); //if OP, reduce/change chem 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-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-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-name-prefix = zombified {$target}
zombie-role-desc = A malevolent creature of the dead. 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. 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 sprite: Objects/Weapons/Melee/zombie_claw.rsi
state: icon state: icon
- type: Item - type: Item
- type: Sharp
- type: ZombieTransfer - type: ZombieTransfer
- type: Unremoveable - type: Unremoveable
- type: MeleeWeapon - type: MeleeWeapon