diff --git a/Content.Server/Backmen/Shipwrecked/Components/ZombieComponents.cs b/Content.Server/Backmen/Shipwrecked/Components/ZombieComponents.cs index d58db980602..607fe6dc70f 100644 --- a/Content.Server/Backmen/Shipwrecked/Components/ZombieComponents.cs +++ b/Content.Server/Backmen/Shipwrecked/Components/ZombieComponents.cs @@ -18,5 +18,6 @@ public sealed partial class ZombieSurpriseComponent : Component [Access(typeof(NPCZombieSystem))] public sealed partial class ZombifiedOnSpawnComponent : Component { - + [DataField("isBoss")] + public bool IsBoss = false; } diff --git a/Content.Server/Backmen/Shipwrecked/NPCZombieSystem.cs b/Content.Server/Backmen/Shipwrecked/NPCZombieSystem.cs index 703b67fc0ab..d2745d276e3 100644 --- a/Content.Server/Backmen/Shipwrecked/NPCZombieSystem.cs +++ b/Content.Server/Backmen/Shipwrecked/NPCZombieSystem.cs @@ -4,8 +4,10 @@ using Content.Server.NPC.HTN; using Content.Server.NPC.Systems; using Content.Server.Zombies; +using Content.Shared.Damage; using Content.Shared.Humanoid; using Content.Shared.Tools.Components; +using Content.Shared.Weapons.Melee; using Content.Shared.Zombies; using Robust.Server.GameObjects; using Robust.Server.Physics; @@ -16,10 +18,6 @@ namespace Content.Server.Backmen.Shipwrecked; public sealed class NPCZombieSystem : EntitySystem { - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly NpcFactionSystem _npcFactonSystem = default!; - [Dependency] private readonly JointSystem _jointSystem = default!; - [Dependency] private readonly NPCSystem _npcSystem = default!; [Dependency] private readonly ZombieSystem _zombieSystem = default!; public override void Initialize() @@ -31,10 +29,72 @@ public override void Initialize() SubscribeLocalEvent(OnZombieWakeupTrigger); } + private void ZombifyEntity(EntityUid uid, bool isBoss) + { + + + _zombieSystem.ZombifyEntity(uid); + + + var z = EnsureComp(uid); + z.MaxZombieInfectionChance = 0.0001f; + z.MinZombieInfectionChance = 0.00001f; + + var melee = EnsureComp(uid); // npc (lower damage, like a flesh) + melee.Angle = 0; + melee.AttackRate = 1; + melee.BluntStaminaDamageFactor = 0.5; + melee.ClickDamageModifier = 1; + melee.Range = 1.5f; + + + + if (!isBoss) + { + z.HealingOnBite = new(); + + DamageSpecifier dspec = new() + { + DamageDict = new() + { + { "Slash", 8 } + } + }; + melee.Damage = dspec; + z.HealingOnBite = new(); + z.ZombieMovementSpeedDebuff = 0.60f; + Dirty(uid,melee); + } + else + { + DamageSpecifier dspec = new() + { + DamageDict = new() + { + { "Slash", 14 }, + { "Piercing", 6 } + } + }; + melee.Damage = dspec; + Dirty(uid,melee); + DamageSpecifier hspec = new() + { + DamageDict = new() + { + { "Blunt", -1 }, + { "Slash", -1 }, + { "Piercing", -1 } + } + }; + z.HealingOnBite = hspec; + } + Dirty(uid,z); + } + private void OnSpawnZombifiedStartup(EntityUid uid, ZombifiedOnSpawnComponent component, ComponentStartup args) { RemCompDeferred(uid); - _zombieSystem.ZombifyEntity(uid); + ZombifyEntity(uid, component.IsBoss); } [ValidatePrototypeId] private const string ZombieSurpriseDetector = "ZombieSurpriseDetector"; @@ -53,6 +113,6 @@ private void OnZombieWakeupTrigger(EntityUid uid, ZombieWakeupOnTriggerComponent if (toZombify == null || Deleted(toZombify)) return; - _zombieSystem.ZombifyEntity(toZombify.Value); + ZombifyEntity(toZombify.Value, false); } } diff --git a/Content.Shared/Clothing/Components/LoadoutComponent.cs b/Content.Shared/Clothing/Components/LoadoutComponent.cs index e4a02760d35..93f8e34814b 100644 --- a/Content.Shared/Clothing/Components/LoadoutComponent.cs +++ b/Content.Shared/Clothing/Components/LoadoutComponent.cs @@ -13,4 +13,7 @@ public sealed partial class LoadoutComponent : Component /// [DataField("prototypes", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer)), AutoNetworkedField] public List? Prototypes; + + [DataField("force")] + public bool Force = false; } diff --git a/Content.Shared/Clothing/LoadoutSystem.cs b/Content.Shared/Clothing/LoadoutSystem.cs index bb93e9e38c8..b451c2e4bc6 100644 --- a/Content.Shared/Clothing/LoadoutSystem.cs +++ b/Content.Shared/Clothing/LoadoutSystem.cs @@ -30,6 +30,6 @@ private void OnMapInit(EntityUid uid, LoadoutComponent component, MapInitEvent a return; var proto = _protoMan.Index(_random.Pick(component.Prototypes)); - _station.EquipStartingGear(uid, proto, null); + _station.EquipStartingGear(uid, proto, null, component.Force); } } diff --git a/Content.Shared/Station/SharedStationSpawningSystem.cs b/Content.Shared/Station/SharedStationSpawningSystem.cs index cf575fb4f2f..5ecd1a7672b 100644 --- a/Content.Shared/Station/SharedStationSpawningSystem.cs +++ b/Content.Shared/Station/SharedStationSpawningSystem.cs @@ -17,7 +17,8 @@ public abstract class SharedStationSpawningSystem : EntitySystem /// Entity to load out. /// Starting gear to use. /// Character profile to use, if any. - public void EquipStartingGear(EntityUid entity, StartingGearPrototype startingGear, HumanoidCharacterProfile? profile) + /// force for corpses + public void EquipStartingGear(EntityUid entity, StartingGearPrototype startingGear, HumanoidCharacterProfile? profile, bool force = false) { if (InventorySystem.TryGetSlots(entity, out var slotDefinitions)) { @@ -27,7 +28,7 @@ public void EquipStartingGear(EntityUid entity, StartingGearPrototype startingGe if (!string.IsNullOrEmpty(equipmentStr)) { var equipmentEntity = EntityManager.SpawnEntity(equipmentStr, EntityManager.GetComponent(entity).Coordinates); - InventorySystem.TryEquip(entity, equipmentEntity, slot.Name, true); + InventorySystem.TryEquip(entity, equipmentEntity, slot.Name, true, force); } } } diff --git a/Resources/Prototypes/Backmen/Entities/Mobs/NPC/corpses.yml b/Resources/Prototypes/Backmen/Entities/Mobs/NPC/corpses.yml index 592f0328b11..b134a2b4faa 100644 --- a/Resources/Prototypes/Backmen/Entities/Mobs/NPC/corpses.yml +++ b/Resources/Prototypes/Backmen/Entities/Mobs/NPC/corpses.yml @@ -16,6 +16,7 @@ id: CorpseUnaffiliated components: - type: Loadout + force: true prototypes: - UnaffiliatedChaplainGear - UnaffiliatedChefGear diff --git a/Resources/Prototypes/Backmen/Entities/Mobs/NPC/zombies.yml b/Resources/Prototypes/Backmen/Entities/Mobs/NPC/zombies.yml index be33e94df87..7d766fc5cfd 100644 --- a/Resources/Prototypes/Backmen/Entities/Mobs/NPC/zombies.yml +++ b/Resources/Prototypes/Backmen/Entities/Mobs/NPC/zombies.yml @@ -53,6 +53,7 @@ path: /Audio/Items/jaws_pry.ogg # BASE - type: Loadout + force: true prototypes: - UnaffiliatedChaplainGear - UnaffiliatedChefGear @@ -85,6 +86,7 @@ path: /Audio/Items/jaws_pry.ogg # BASE - type: Loadout + force: true prototypes: - UnaffiliatedChaplainGear - UnaffiliatedChefGear @@ -111,6 +113,7 @@ - Moth components: - type: ZombifiedOnSpawn + isBoss: true - type: MovementSpeedModifier baseWalkSpeed : 1.5 baseSprintSpeed : 3.0 @@ -122,6 +125,7 @@ path: /Audio/Items/jaws_pry.ogg # BASE - type: Loadout + force: true prototypes: - ZombieBruteGear - type: Damageable diff --git a/Resources/Prototypes/Backmen/game_presets.yml b/Resources/Prototypes/Backmen/game_presets.yml index 37331747772..3c0239975af 100644 --- a/Resources/Prototypes/Backmen/game_presets.yml +++ b/Resources/Prototypes/Backmen/game_presets.yml @@ -5,7 +5,6 @@ name: shipwrecked-title description: shipwrecked-description minPlayers: 1 - maxPlayers: 15 showInVote: true isMiniGame: true supportedMaps: ShipwreckedPool diff --git a/Resources/Prototypes/Entities/Mobs/Corpses/corpses.yml b/Resources/Prototypes/Entities/Mobs/Corpses/corpses.yml index cb774d36bdf..6ac76cbfe91 100644 --- a/Resources/Prototypes/Entities/Mobs/Corpses/corpses.yml +++ b/Resources/Prototypes/Entities/Mobs/Corpses/corpses.yml @@ -4,6 +4,7 @@ suffix: Dead, Service components: - type: Loadout + force: true prototypes: - HoPGear - ClownGear @@ -22,6 +23,7 @@ suffix: Dead, Engineer components: - type: Loadout + force: true prototypes: - TechnicalAssistantGear - AtmosphericTechnicianGear @@ -33,6 +35,7 @@ suffix: Dead, Cargo components: - type: Loadout + force: true prototypes: - CargoTechGear - SalvageSpecialistGear @@ -43,6 +46,7 @@ suffix: Dead, Medic components: - type: Loadout + force: true prototypes: - MedicalInternGear - PsychologistGear @@ -55,6 +59,7 @@ suffix: Dead, Science components: - type: Loadout + force: true prototypes: - ResearchAssistantGear - ScientistGear @@ -65,6 +70,7 @@ suffix: Dead, Security components: - type: Loadout + force: true prototypes: - SecurityCadetGear - SecurityOfficerGear @@ -77,6 +83,7 @@ suffix: Dead, Command components: - type: Loadout + force: true prototypes: - HoPGear - CentComCorvax