From d0e3d191eb6f0208335b10a27e6abf30e1e6b278 Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Sat, 2 Mar 2024 18:10:00 +0900 Subject: [PATCH] - fix: Fix ling transform & closet skeleton. (#160) --- .../Changeling/ChangelingSystem.Abilities.cs | 26 +++++++-- .../Preferences/HumanoidCharacterProfile.cs | 1 + Resources/Prototypes/Polymorphs/polymorph.yml | 58 ++++++++++++++++--- 3 files changed, 73 insertions(+), 12 deletions(-) diff --git a/Content.Server/Changeling/ChangelingSystem.Abilities.cs b/Content.Server/Changeling/ChangelingSystem.Abilities.cs index 1855d8cb99..8cc4cce0b2 100644 --- a/Content.Server/Changeling/ChangelingSystem.Abilities.cs +++ b/Content.Server/Changeling/ChangelingSystem.Abilities.cs @@ -1,5 +1,4 @@ using System.Linq; -using Content.Server._White.Cult; using Content.Server._White.Cult.GameRule; using Content.Server.Administration.Systems; using Content.Server.Bible.Components; @@ -12,13 +11,14 @@ using Content.Server.GameTicking.Rules; using Content.Server.Humanoid; using Content.Server.IdentityManagement; using Content.Server.Mind; +using Content.Server.NPC.Components; +using Content.Server.NPC.Systems; using Content.Server.Polymorph.Systems; using Content.Server.Popups; using Content.Server.Store.Components; using Content.Server.Temperature.Components; using Content.Server.Temperature.Systems; using Content.Shared._White.Chaplain; -using Content.Shared._White.Cult.Components; using Content.Shared.Actions; using Content.Shared.Changeling; using Content.Shared.Chemistry.EntitySystems; @@ -36,10 +36,12 @@ using Content.Shared.Inventory; using Content.Shared.Miracle.UI; using Content.Shared.Mobs; using Content.Shared.Mobs.Systems; +using Content.Shared.Ninja.Components; using Content.Shared.Pulling; using Content.Shared.Pulling.Components; using Content.Shared.Standing; using Content.Shared.StatusEffect; +using Content.Shared.Tag; using Robust.Server.GameObjects; using Robust.Shared.GameObjects.Components.Localization; using Robust.Shared.Player; @@ -74,6 +76,8 @@ public sealed partial class ChangelingSystem [Dependency] private readonly CuffableSystem _cuffable = default!; [Dependency] private readonly NukeopsRuleSystem _nukeOps = default!; [Dependency] private readonly CultRuleSystem _cult = default!; + [Dependency] private readonly NpcFactionSystem _faction = default!; + [Dependency] private readonly TagSystem _tag = default!; private void InitializeAbilities() { @@ -143,7 +147,8 @@ public sealed partial class ChangelingSystem return; } - if (!TryComp(args.Target, out _)) + if (!TryComp(args.Target, out _) || + _tag.HasTag(args.Target, "Unimplantable")) // Terminator check { _popup.PopupEntity(Loc.GetString("changeling-popup-absorb-unknown"), uid, uid); return; @@ -295,7 +300,8 @@ public sealed partial class ChangelingSystem return; } - if (!TryComp(args.Target, out var dnaComponent)) + if (!TryComp(args.Target, out var dnaComponent) || + _tag.HasTag(args.Target, "Unimplantable")) // Terminator check { _popup.PopupEntity(Loc.GetString("changeling-popup-absorb-unknown"), uid, uid); return; @@ -363,7 +369,8 @@ public sealed partial class ChangelingSystem if (!_ui.TryGetUi(user, TransformStingSelectorUiKey.Key, out var bui)) return; - if (HasComp(target)) + if (HasComp(target) || HasComp(target) || + _tag.HasTag(target, "Unimplantable")) // Terminator check { _popup.PopupEntity(Loc.GetString("changeling-popup-transform-not-effective"), user, user); return; @@ -843,6 +850,15 @@ public sealed partial class ChangelingSystem _chemicalsSystem.UpdateAlert(polymorphEntity.Value, toAdd); } + if (TryComp(target, out NpcFactionMemberComponent? factionMember)) + { + _faction.ClearFactions(polymorphEntity.Value); + foreach (var faction in factionMember.Factions) + { + _faction.AddFaction(polymorphEntity.Value, faction); + } + } + _nukeOps.TransferRole(target, polymorphEntity.Value); _cult.TransferRole(target, polymorphEntity.Value); diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index 590317fb0c..97d0018eed 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -208,6 +208,7 @@ namespace Content.Shared.Preferences var bodyType = SharedHumanoidAppearanceSystem.DefaultBodyType; if (prototypeManager.TryIndex(species, out var speciesPrototype)) { + bodyType = speciesPrototype.BodyTypes[0]; sex = random.Pick(speciesPrototype.Sexes); age = random.Next(speciesPrototype.MinAge, speciesPrototype diff --git a/Resources/Prototypes/Polymorphs/polymorph.yml b/Resources/Prototypes/Polymorphs/polymorph.yml index 6e35690bf3..94ba593212 100644 --- a/Resources/Prototypes/Polymorphs/polymorph.yml +++ b/Resources/Prototypes/Polymorphs/polymorph.yml @@ -288,7 +288,7 @@ - type: polymorph id: MobHumanSyndicateAgent configuration: - entity: MobHumanSyndicateAgent + entity: MobHuman forced: true revertOnCrit: false revertOnDeath: false @@ -299,7 +299,7 @@ - type: polymorph id: MobHumanSyndicateAgentNukeops configuration: - entity: MobHumanSyndicateAgentNukeops + entity: MobHuman forced: true revertOnCrit: false revertOnDeath: false @@ -310,7 +310,7 @@ - type: polymorph id: MobHumanNukeOp configuration: - entity: MobHumanNukeOp + entity: MobHuman forced: true revertOnCrit: false revertOnDeath: false @@ -321,7 +321,7 @@ - type: polymorph id: MobHumanLoneNuclearOperative configuration: - entity: MobHumanLoneNuclearOperative + entity: MobHuman forced: true revertOnCrit: false revertOnDeath: false @@ -332,7 +332,7 @@ - type: polymorph id: MobHumanSpaceNinja configuration: - entity: MobHumanSpaceNinja + entity: MobHuman forced: true revertOnCrit: false revertOnDeath: false @@ -354,7 +354,7 @@ - type: polymorph id: MobHumanTerminator configuration: - entity: MobHumanTerminator + entity: MobHuman forced: true revertOnCrit: false revertOnDeath: false @@ -365,7 +365,51 @@ - type: polymorph id: MobTerminatorEndoskeleton configuration: - entity: MobTerminatorEndoskeleton + entity: MobHuman + forced: true + revertOnCrit: false + revertOnDeath: false + transferDamage: true + allowRepeatedMorphs: true + inventory: Transfer + +- type: polymorph + id: MobSkeletonPerson + configuration: + entity: MobSkeletonPerson + forced: true + revertOnCrit: false + revertOnDeath: false + transferDamage: true + allowRepeatedMorphs: true + inventory: Transfer + +- type: polymorph + id: MobSkeletonPirate + configuration: + entity: MobSkeletonPerson + forced: true + revertOnCrit: false + revertOnDeath: false + transferDamage: true + allowRepeatedMorphs: true + inventory: Transfer + +- type: polymorph + id: MobSkeletonBiker + configuration: + entity: MobSkeletonPerson + forced: true + revertOnCrit: false + revertOnDeath: false + transferDamage: true + allowRepeatedMorphs: true + inventory: Transfer + +- type: polymorph + id: MobSkeletonCloset + configuration: + entity: MobSkeletonPerson forced: true revertOnCrit: false revertOnDeath: false