# Conflicts: # .github/workflows/validate-rgas.yml # .github/workflows/validate-rsis.yml # Content.Client/Changelog/ChangelogTab.xaml.cs # Content.Client/Humanoid/HumanoidAppearanceSystem.cs # Content.Client/Options/UI/OptionsMenu.xaml.cs # Content.Client/SubFloor/SubFloorHideSystem.cs # Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml.cs # Content.Server/Advertise/EntitySystems/SpeakOnUIClosedSystem.cs # Content.Server/Antag/AntagSelectionSystem.cs # Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs # Content.Server/Explosion/EntitySystems/TriggerSystem.cs # Content.Server/Mindshield/MindShieldSystem.cs # Content.Server/Objectives/Systems/KillPersonConditionSystem.cs # Content.Server/Standing/StandingStateSystem.cs # Content.Server/Station/Systems/StationJobsSystem.Roundstart.cs # Content.Server/VendingMachines/VendingMachineSystem.cs # Content.Server/Zombies/ZombieSystem.Transform.cs # Content.Server/Zombies/ZombieSystem.cs # Content.Shared/Damage/Systems/DamageableSystem.cs # Content.Shared/Humanoid/HumanoidAppearanceComponent.cs # Content.Shared/Humanoid/Markings/MarkingManager.cs # Content.Shared/Humanoid/NamingSystem.cs # Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs # Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs # Content.Shared/Implants/Components/SubdermalImplantComponent.cs # Content.Shared/Standing/StandingStateSystem.cs # Content.Shared/VendingMachines/SharedVendingMachineSystem.cs # Content.Shared/VendingMachines/VendingMachineComponent.cs # Resources/Audio/Lobby/attributions.yml # Resources/Locale/en-US/_strings/administration/commands/forceghost.ftl # Resources/Locale/en-US/_strings/clothing/components/fire-protection-component.ftl # Resources/Locale/en-US/_strings/components/storage-voice-control-component.ftl # Resources/Locale/en-US/_strings/prototypes/roles/antags.ftl # Resources/Locale/en-US/_strings/reagents/meta/physical-desc.ftl # Resources/Locale/en-US/lathe/lathe-categories.ftl # Resources/Prototypes/Access/command.yml # Resources/Prototypes/Catalog/Fills/Books/bookshelf.yml # Resources/Prototypes/Catalog/Fills/Lockers/heads.yml # Resources/Prototypes/Catalog/Fills/Lockers/misc.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/chemvend.yml # Resources/Prototypes/Catalog/thief_toolbox_sets.yml # Resources/Prototypes/Datasets/Names/Operation_prefix.yml # Resources/Prototypes/Datasets/Names/Operation_suffix.yml # Resources/Prototypes/Datasets/Names/arachnid_first.yml # Resources/Prototypes/Datasets/Names/arachnid_last.yml # Resources/Prototypes/Datasets/Names/borg.yml # Resources/Prototypes/Datasets/Names/cargo_shuttle.yml # Resources/Prototypes/Datasets/Names/clown.yml # Resources/Prototypes/Datasets/Names/diona.yml # Resources/Prototypes/Datasets/Names/fake_human_first.yml # Resources/Prototypes/Datasets/Names/fake_human_last.yml # Resources/Prototypes/Datasets/Names/first.yml # Resources/Prototypes/Datasets/Names/first_female.yml # Resources/Prototypes/Datasets/Names/first_male.yml # Resources/Prototypes/Datasets/Names/fortunes.yml # Resources/Prototypes/Datasets/Names/hologram.yml # Resources/Prototypes/Datasets/Names/last.yml # Resources/Prototypes/Datasets/Names/military.yml # Resources/Prototypes/Datasets/Names/moth_first_female.yml # Resources/Prototypes/Datasets/Names/moth_first_male.yml # Resources/Prototypes/Datasets/Names/moth_last.yml # Resources/Prototypes/Datasets/Names/mushman_first.yml # Resources/Prototypes/Datasets/Names/mushman_last.yml # Resources/Prototypes/Datasets/Names/ninja.yml # Resources/Prototypes/Datasets/Names/ninja_title.yml # Resources/Prototypes/Datasets/Names/regalrat.yml # Resources/Prototypes/Datasets/Names/reptilian_female.yml # Resources/Prototypes/Datasets/Names/reptilian_male.yml # Resources/Prototypes/Datasets/Names/revenant.yml # Resources/Prototypes/Datasets/Names/skeleton_first.yml # Resources/Prototypes/Datasets/Names/syndicate.yml # Resources/Prototypes/Datasets/Names/vox.yml # Resources/Prototypes/Datasets/Names/wizard_first.yml # Resources/Prototypes/Datasets/Names/wizard_last.yml # Resources/Prototypes/Datasets/adjectives.yml # Resources/Prototypes/Datasets/corporations.yml # Resources/Prototypes/Datasets/criminal_records.yml # Resources/Prototypes/Datasets/rat_king_commands.yml # Resources/Prototypes/Datasets/verbs.yml # Resources/Prototypes/Entities/Clothing/Head/specific.yml # Resources/Prototypes/Entities/Clothing/OuterClothing/coats.yml # Resources/Prototypes/Entities/Clothing/OuterClothing/specific.yml # Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml # Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml # Resources/Prototypes/Entities/Mobs/Player/human.yml # Resources/Prototypes/Entities/Mobs/Player/humanoid.yml # Resources/Prototypes/Entities/Mobs/Species/arachnid.yml # Resources/Prototypes/Entities/Mobs/Species/base.yml # Resources/Prototypes/Entities/Mobs/Species/moth.yml # Resources/Prototypes/Entities/Mobs/Species/vox.yml # Resources/Prototypes/Entities/Objects/Devices/pda.yml # Resources/Prototypes/Entities/Objects/Misc/paper.yml # Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml # Resources/Prototypes/Entities/Stations/nanotrasen.yml # Resources/Prototypes/Entities/Structures/Furniture/carpets.yml # Resources/Prototypes/Entities/Structures/Storage/Closets/wall_lockers.yml # Resources/Prototypes/GameRules/roundstart.yml # Resources/Prototypes/Procedural/salvage_loot.yml # Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml # Resources/Prototypes/Recipes/Lathes/biogen.yml # Resources/Prototypes/Recipes/Lathes/categories.yml # Resources/Prototypes/Roles/Jobs/Security/warden.yml # Resources/Prototypes/Species/arachnid.yml # Resources/Prototypes/Species/diona.yml # Resources/Prototypes/Species/moth.yml # Resources/Prototypes/ai_factions.yml # Resources/Prototypes/game_presets.yml # Resources/ServerInfo/Guidebook/Mobs/SlimePerson.xml # Resources/ServerInfo/Guidebook/ServerRules/SpaceLaw/SpaceLaw.xml # Resources/ServerInfo/Guidebook/Service/Botany.xml # Resources/Textures/Clothing/Eyes/Glasses/glasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/jamjar.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/mercglasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/meson.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/ninjavisor.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/outlawglasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/science.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/secglasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/sunglasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/thermal.rsi/meta.json # Resources/Textures/Clothing/Eyes/Hud/beergoggles.rsi/inhand-left.png # Resources/Textures/Clothing/Eyes/Hud/beergoggles.rsi/inhand-right.png # Resources/Textures/Clothing/Eyes/Hud/beergoggles.rsi/meta.json # Resources/Textures/Clothing/Eyes/Hud/synd.rsi/meta.json # Resources/Textures/Clothing/Eyes/Hud/syndagent.rsi/meta.json # Resources/Textures/Clothing/Head/Hats/capcap.rsi/inhand-left.png # Resources/Textures/Clothing/Head/Hats/capcap.rsi/inhand-right.png # Resources/Textures/Clothing/Head/Hats/capcap.rsi/meta.json # Resources/Textures/Interface/Misc/program_icons.rsi/meta.json # Resources/Textures/Objects/Misc/Lights/lights.rsi/meta.json # Resources/Textures/Objects/Misc/bureaucracy.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/aloe.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/apple.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/carrot.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/chanterelle.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/chili.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/eggplant.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/gatfruit.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/lemon.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/onion_red.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/potato.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/sugarcane.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/tomato.rsi/meta.json # Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/meta.json # Resources/Textures/Objects/Specific/Robotics/cyborg_parts.rsi/meta.json # Resources/Textures/Objects/Tools/spray_painter.rsi/meta.json # Resources/Textures/Objects/Weapons/Grenades/flashbang.rsi/meta.json # Resources/Textures/Objects/Weapons/Grenades/grenade.rsi/meta.json # Resources/Textures/Objects/Weapons/Grenades/nukenade.rsi/meta.json # Resources/migration.yml # Tools/actions_changelogs_since_last_run.py
311 lines
13 KiB
C#
311 lines
13 KiB
C#
using Content.Server.Administration.Managers;
|
|
using Content.Server.Atmos.Components;
|
|
using Content.Server.Body.Components;
|
|
using Content.Server.Chat;
|
|
using Content.Server.Chat.Managers;
|
|
using Content.Server.GameTicking;
|
|
using Content.Server.Ghost;
|
|
using Content.Server.Ghost.Roles.Components;
|
|
using Content.Server.Humanoid;
|
|
using Content.Server.IdentityManagement;
|
|
using Content.Server.Inventory;
|
|
using Content.Server.Mind;
|
|
using Content.Server.Mind.Commands;
|
|
using Content.Server.NPC;
|
|
using Content.Server.NPC.HTN;
|
|
using Content.Server.NPC.Systems;
|
|
using Content.Server.Speech.Components;
|
|
using Content.Server.Temperature.Components;
|
|
using Content.Shared._Sunrise.CollectiveMind;
|
|
using Content.Shared.CombatMode;
|
|
using Content.Shared.CombatMode.Pacification;
|
|
using Content.Shared.Damage;
|
|
using Content.Shared.Hands.Components;
|
|
using Content.Shared.Hands.EntitySystems;
|
|
using Content.Shared.Cuffs.Components;
|
|
using Content.Shared.Humanoid;
|
|
using Content.Shared.Interaction.Components;
|
|
using Content.Shared.Mobs;
|
|
using Content.Shared.Mobs.Components;
|
|
using Content.Shared.Movement.Pulling.Components;
|
|
using Content.Shared.Movement.Systems;
|
|
using Content.Shared.NameModifier.EntitySystems;
|
|
using Content.Shared.NPC.Systems;
|
|
using Content.Shared.Nutrition.AnimalHusbandry;
|
|
using Content.Shared.Nutrition.Components;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared.Weapons.Melee;
|
|
using Content.Shared.Zombies;
|
|
using Content.Shared.Prying.Components;
|
|
using Content.Shared.Traits.Assorted;
|
|
using Robust.Shared.Audio.Systems;
|
|
using Content.Shared.Ghost.Roles.Components;
|
|
using Content.Shared.Tag;
|
|
|
|
namespace Content.Server.Zombies;
|
|
|
|
/// <summary>
|
|
/// Handles zombie propagation and inherent zombie traits
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Don't Shitcode Open Inside
|
|
/// </remarks>
|
|
public sealed partial class ZombieSystem
|
|
{
|
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
[Dependency] private readonly IChatManager _chatMan = default!;
|
|
[Dependency] private readonly SharedCombatModeSystem _combat = default!;
|
|
[Dependency] private readonly NpcFactionSystem _faction = default!;
|
|
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
|
[Dependency] private readonly HumanoidAppearanceSystem _humanoidAppearance = default!;
|
|
[Dependency] private readonly IdentitySystem _identity = default!;
|
|
[Dependency] private readonly ServerInventorySystem _inventory = default!;
|
|
[Dependency] private readonly MindSystem _mind = default!;
|
|
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
|
|
[Dependency] private readonly NPCSystem _npc = default!;
|
|
[Dependency] private readonly TagSystem _tag = default!;
|
|
[Dependency] private readonly NameModifierSystem _nameMod = default!;
|
|
[Dependency] private readonly GhostSystem _ghostSystem = default!;
|
|
[Dependency] private readonly IBanManager _banManager = default!;
|
|
|
|
/// <summary>
|
|
/// Handles an entity turning into a zombie when they die or go into crit
|
|
/// </summary>
|
|
private void OnDamageChanged(EntityUid uid, ZombifyOnDeathComponent component, MobStateChangedEvent args)
|
|
{
|
|
if (args.NewMobState == MobState.Dead)
|
|
{
|
|
ZombifyEntity(uid, args.Component);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// This is the general purpose function to call if you want to zombify an entity.
|
|
/// It handles both humanoid and nonhumanoid transformation and everything should be called through it.
|
|
/// </summary>
|
|
/// <param name="target">the entity being zombified</param>
|
|
/// <param name="mobState"></param>
|
|
/// <remarks>
|
|
/// ALRIGHT BIG BOYS, GIRLS AND ANYONE ELSE. YOU'VE COME TO THE LAYER OF THE BEAST. THIS IS YOUR WARNING.
|
|
/// This function is the god function for zombie stuff, and it is cursed. I have
|
|
/// attempted to label everything thouroughly for your sanity. I have attempted to
|
|
/// rewrite this, but this is how it shall lie eternal. Turn back now.
|
|
/// -emo
|
|
/// </remarks>
|
|
public void ZombifyEntity(EntityUid target, MobStateComponent? mobState = null)
|
|
{
|
|
//Don't zombfiy zombies
|
|
if (HasComp<ZombieComponent>(target) || HasComp<ZombieImmuneComponent>(target))
|
|
return;
|
|
|
|
if (!Resolve(target, ref mobState, logMissing: false))
|
|
return;
|
|
|
|
//you're a real zombie now, son.
|
|
var zombiecomp = AddComp<ZombieComponent>(target);
|
|
|
|
//we need to basically remove all of these because zombies shouldn't
|
|
//get diseases, breath, be thirst, be hungry, die in space, have offspring or be paraplegic.
|
|
RemComp<RespiratorComponent>(target);
|
|
RemComp<BarotraumaComponent>(target);
|
|
RemComp<HungerComponent>(target);
|
|
RemComp<ThirstComponent>(target);
|
|
RemComp<ReproductiveComponent>(target);
|
|
RemComp<ReproductivePartnerComponent>(target);
|
|
RemComp<LegsParalyzedComponent>(target);
|
|
RemComp<ComplexInteractionComponent>(target);
|
|
|
|
//funny voice
|
|
var accentType = "zombie";
|
|
if (TryComp<ZombieAccentOverrideComponent>(target, out var accent))
|
|
accentType = accent.Accent;
|
|
|
|
EnsureComp<ReplacementAccentComponent>(target).Accent = accentType;
|
|
|
|
//This is needed for stupid entities that fuck up combat mode component
|
|
//in an attempt to make an entity not attack. This is the easiest way to do it.
|
|
var combat = EnsureComp<CombatModeComponent>(target);
|
|
RemComp<PacifiedComponent>(target);
|
|
_combat.SetCanDisarm(target, false, combat);
|
|
_combat.SetInCombatMode(target, true, combat);
|
|
|
|
//This is the actual damage of the zombie. We assign the visual appearance
|
|
//and range here because of stuff we'll find out later
|
|
var melee = EnsureComp<MeleeWeaponComponent>(target);
|
|
melee.Animation = zombiecomp.AttackAnimation;
|
|
melee.WideAnimation = zombiecomp.AttackAnimation;
|
|
melee.AltDisarm = false;
|
|
melee.Range = 1.2f;
|
|
melee.Angle = 0.0f;
|
|
melee.HitSound = zombiecomp.BiteSound;
|
|
|
|
// Sunrise-Start
|
|
RemComp<CuffableComponent>(target);
|
|
|
|
var collectiveMindComponent = EnsureComp<CollectiveMindComponent>(target);
|
|
foreach (var collectiveMind in collectiveMindComponent.Minds.ToArray())
|
|
{
|
|
collectiveMindComponent.Minds.Remove(collectiveMind);
|
|
}
|
|
|
|
if (!collectiveMindComponent.Minds.Contains("Zombie"))
|
|
collectiveMindComponent.Minds.Add("Zombie");
|
|
// Sunrise-End
|
|
|
|
if (mobState.CurrentState == MobState.Alive)
|
|
{
|
|
// Groaning when damaged
|
|
EnsureComp<EmoteOnDamageComponent>(target);
|
|
_emoteOnDamage.AddEmote(target, "Scream");
|
|
|
|
// Random groaning
|
|
EnsureComp<AutoEmoteComponent>(target);
|
|
_autoEmote.AddEmote(target, "ZombieGroan");
|
|
}
|
|
|
|
//We have specific stuff for humanoid zombies because they matter more
|
|
if (TryComp<HumanoidAppearanceComponent>(target, out var huApComp)) //huapcomp
|
|
{
|
|
//store some values before changing them in case the humanoid get cloned later
|
|
zombiecomp.BeforeZombifiedSkinColor = huApComp.SkinColor;
|
|
zombiecomp.BeforeZombifiedEyeColor = huApComp.EyeColor;
|
|
zombiecomp.BeforeZombifiedCustomBaseLayers = new(huApComp.CustomBaseLayers);
|
|
if (TryComp<BloodstreamComponent>(target, out var stream))
|
|
zombiecomp.BeforeZombifiedBloodReagent = stream.BloodReagent;
|
|
|
|
_humanoidAppearance.SetSkinColor(target, zombiecomp.SkinColor, verify: false, humanoid: huApComp);
|
|
|
|
// Messing with the eye layer made it vanish upon cloning, and also it didn't even appear right
|
|
huApComp.EyeColor = zombiecomp.EyeColor;
|
|
|
|
// this might not resync on clone?
|
|
_humanoidAppearance.SetBaseLayerId(target, HumanoidVisualLayers.Tail, zombiecomp.BaseLayerExternal, humanoid: huApComp);
|
|
_humanoidAppearance.SetBaseLayerId(target, HumanoidVisualLayers.HeadSide, zombiecomp.BaseLayerExternal, humanoid: huApComp);
|
|
_humanoidAppearance.SetBaseLayerId(target, HumanoidVisualLayers.HeadTop, zombiecomp.BaseLayerExternal, humanoid: huApComp);
|
|
_humanoidAppearance.SetBaseLayerId(target, HumanoidVisualLayers.Snout, zombiecomp.BaseLayerExternal, humanoid: huApComp);
|
|
|
|
//This is done here because non-humanoids shouldn't get baller damage
|
|
//lord forgive me for the hardcoded damage
|
|
DamageSpecifier dspec = new()
|
|
{
|
|
DamageDict = new()
|
|
{
|
|
{ "Slash", 13 },
|
|
{ "Piercing", 7 },
|
|
{ "Structural", 10 }
|
|
}
|
|
};
|
|
melee.Damage = dspec;
|
|
|
|
// humanoid zombies get to pry open doors and shit
|
|
var pryComp = EnsureComp<PryingComponent>(target);
|
|
pryComp.SpeedModifier = 0.75f; // Sunrise-Edit
|
|
pryComp.PryPowered = true;
|
|
pryComp.Force = true;
|
|
|
|
Dirty(target, pryComp);
|
|
}
|
|
|
|
Dirty(target, melee);
|
|
|
|
//The zombie gets the assigned damage weaknesses and strengths
|
|
_damageable.SetDamageModifierSetId(target, "Zombie");
|
|
|
|
//This makes it so the zombie doesn't take bloodloss damage.
|
|
//NOTE: they are supposed to bleed, just not take damage
|
|
_bloodstream.SetBloodLossThreshold(target, 0f);
|
|
//Give them zombie blood
|
|
_bloodstream.ChangeBloodReagent(target, zombiecomp.NewBloodReagent);
|
|
|
|
//This is specifically here to combat insuls, because frying zombies on grilles is funny as shit.
|
|
_inventory.TryUnequip(target, "gloves", true, true);
|
|
//Should prevent instances of zombies using comms for information they shouldnt be able to have.
|
|
_inventory.TryUnequip(target, "ears", true, true);
|
|
|
|
//popup
|
|
_popup.PopupEntity(Loc.GetString("zombie-transform", ("target", target)), target, PopupType.LargeCaution);
|
|
|
|
//Make it sentient if it's an animal or something
|
|
MakeSentientCommand.MakeSentient(target, EntityManager);
|
|
|
|
//Make the zombie not die in the cold. Good for space zombies
|
|
if (TryComp<TemperatureComponent>(target, out var tempComp))
|
|
tempComp.ColdDamage.ClampMax(0);
|
|
|
|
//Heals the zombie from all the damage it took while human
|
|
if (TryComp<DamageableComponent>(target, out var damageablecomp))
|
|
_damageable.SetAllDamage(target, damageablecomp, 0);
|
|
_mobState.ChangeMobState(target, MobState.Alive);
|
|
|
|
_faction.ClearFactions(target, dirty: false);
|
|
_faction.AddFaction(target, "Zombie");
|
|
|
|
//gives it the funny "Zombie ___" name.
|
|
_nameMod.RefreshNameModifiers(target);
|
|
|
|
_identity.QueueIdentityUpdate(target);
|
|
|
|
var htn = EnsureComp<HTNComponent>(target);
|
|
htn.RootTask = new HTNCompoundTask() { Task = "SimpleHostileCompound" };
|
|
htn.Blackboard.SetValue(NPCBlackboard.Owner, target);
|
|
_npc.SleepNPC(target, htn);
|
|
|
|
//He's gotta have a mind
|
|
var hasMind = _mind.TryGetMind(target, out var mindId, out var mind);
|
|
if (hasMind && _mind.TryGetSession(mindId, out var session))
|
|
{
|
|
// Check if the user has a ban on "Zombie"
|
|
if (_banManager.IsAntagBanned(session.UserId, zombiecomp.ZombieRoleId))
|
|
{
|
|
// Ghost the player if they have a "Zombie" ban
|
|
_ghostSystem.OnGhostAttempt(mindId, false, true, mind);
|
|
}
|
|
//Zombie role for player manifest
|
|
_role.MindAddRole(mindId, "MindRoleZombie", mind: null, silent: true);
|
|
|
|
//Greeting message for new bebe zombers
|
|
_chatMan.DispatchServerMessage(session, Loc.GetString("zombie-infection-greeting"));
|
|
|
|
// Notificate player about new role assignment
|
|
_audio.PlayGlobal(zombiecomp.GreetSoundNotification, session);
|
|
}
|
|
else
|
|
{
|
|
_npc.WakeNPC(target, htn);
|
|
}
|
|
|
|
if (!HasComp<GhostRoleMobSpawnerComponent>(target) && !hasMind) //this specific component gives build test trouble so pop off, ig
|
|
{
|
|
//yet more hardcoding. Visit zombie.ftl for more information.
|
|
var ghostRole = EnsureComp<GhostRoleComponent>(target);
|
|
EnsureComp<GhostTakeoverAvailableComponent>(target);
|
|
ghostRole.RoleName = Loc.GetString("zombie-generic");
|
|
ghostRole.RoleDescription = Loc.GetString("zombie-role-desc");
|
|
ghostRole.RoleRules = Loc.GetString("zombie-role-rules");
|
|
}
|
|
|
|
if (TryComp<HandsComponent>(target, out var handsComp))
|
|
{
|
|
_hands.RemoveHands(target);
|
|
RemComp(target, handsComp);
|
|
}
|
|
|
|
// Sloth: What the fuck?
|
|
// How long until compregistry lmao.
|
|
RemComp<PullerComponent>(target);
|
|
|
|
// No longer waiting to become a zombie:
|
|
// Requires deferral because this is (probably) the event which called ZombifyEntity in the first place.
|
|
RemCompDeferred<PendingZombieComponent>(target);
|
|
|
|
//zombie gamemode stuff
|
|
var ev = new EntityZombifiedEvent(target);
|
|
RaiseLocalEvent(target, ref ev, true);
|
|
//zombies get slowdown once they convert
|
|
_movementSpeedModifier.RefreshMovementSpeedModifiers(target);
|
|
|
|
//Need to prevent them from getting an item, they have no hands.
|
|
// Also prevents them from becoming a Survivor. They're undead.
|
|
_tag.AddTag(target, "InvalidForGlobalSpawnSpell");
|
|
}
|
|
}
|