- fix: Fix ling transform & closet skeleton. (#160)

This commit is contained in:
Aviu00
2024-03-02 18:10:00 +09:00
committed by GitHub
parent 50031ab5a9
commit d0e3d191eb
3 changed files with 73 additions and 12 deletions

View File

@@ -1,5 +1,4 @@
using System.Linq; using System.Linq;
using Content.Server._White.Cult;
using Content.Server._White.Cult.GameRule; using Content.Server._White.Cult.GameRule;
using Content.Server.Administration.Systems; using Content.Server.Administration.Systems;
using Content.Server.Bible.Components; using Content.Server.Bible.Components;
@@ -12,13 +11,14 @@ using Content.Server.GameTicking.Rules;
using Content.Server.Humanoid; using Content.Server.Humanoid;
using Content.Server.IdentityManagement; using Content.Server.IdentityManagement;
using Content.Server.Mind; using Content.Server.Mind;
using Content.Server.NPC.Components;
using Content.Server.NPC.Systems;
using Content.Server.Polymorph.Systems; using Content.Server.Polymorph.Systems;
using Content.Server.Popups; using Content.Server.Popups;
using Content.Server.Store.Components; using Content.Server.Store.Components;
using Content.Server.Temperature.Components; using Content.Server.Temperature.Components;
using Content.Server.Temperature.Systems; using Content.Server.Temperature.Systems;
using Content.Shared._White.Chaplain; using Content.Shared._White.Chaplain;
using Content.Shared._White.Cult.Components;
using Content.Shared.Actions; using Content.Shared.Actions;
using Content.Shared.Changeling; using Content.Shared.Changeling;
using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.EntitySystems;
@@ -36,10 +36,12 @@ using Content.Shared.Inventory;
using Content.Shared.Miracle.UI; using Content.Shared.Miracle.UI;
using Content.Shared.Mobs; using Content.Shared.Mobs;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
using Content.Shared.Ninja.Components;
using Content.Shared.Pulling; using Content.Shared.Pulling;
using Content.Shared.Pulling.Components; using Content.Shared.Pulling.Components;
using Content.Shared.Standing; using Content.Shared.Standing;
using Content.Shared.StatusEffect; using Content.Shared.StatusEffect;
using Content.Shared.Tag;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.GameObjects.Components.Localization; using Robust.Shared.GameObjects.Components.Localization;
using Robust.Shared.Player; using Robust.Shared.Player;
@@ -74,6 +76,8 @@ public sealed partial class ChangelingSystem
[Dependency] private readonly CuffableSystem _cuffable = default!; [Dependency] private readonly CuffableSystem _cuffable = default!;
[Dependency] private readonly NukeopsRuleSystem _nukeOps = default!; [Dependency] private readonly NukeopsRuleSystem _nukeOps = default!;
[Dependency] private readonly CultRuleSystem _cult = default!; [Dependency] private readonly CultRuleSystem _cult = default!;
[Dependency] private readonly NpcFactionSystem _faction = default!;
[Dependency] private readonly TagSystem _tag = default!;
private void InitializeAbilities() private void InitializeAbilities()
{ {
@@ -143,7 +147,8 @@ public sealed partial class ChangelingSystem
return; return;
} }
if (!TryComp<DnaComponent>(args.Target, out _)) if (!TryComp<DnaComponent>(args.Target, out _) ||
_tag.HasTag(args.Target, "Unimplantable")) // Terminator check
{ {
_popup.PopupEntity(Loc.GetString("changeling-popup-absorb-unknown"), uid, uid); _popup.PopupEntity(Loc.GetString("changeling-popup-absorb-unknown"), uid, uid);
return; return;
@@ -295,7 +300,8 @@ public sealed partial class ChangelingSystem
return; return;
} }
if (!TryComp<DnaComponent>(args.Target, out var dnaComponent)) if (!TryComp<DnaComponent>(args.Target, out var dnaComponent) ||
_tag.HasTag(args.Target, "Unimplantable")) // Terminator check
{ {
_popup.PopupEntity(Loc.GetString("changeling-popup-absorb-unknown"), uid, uid); _popup.PopupEntity(Loc.GetString("changeling-popup-absorb-unknown"), uid, uid);
return; return;
@@ -363,7 +369,8 @@ public sealed partial class ChangelingSystem
if (!_ui.TryGetUi(user, TransformStingSelectorUiKey.Key, out var bui)) if (!_ui.TryGetUi(user, TransformStingSelectorUiKey.Key, out var bui))
return; return;
if (HasComp<ChangelingComponent>(target)) if (HasComp<ChangelingComponent>(target) || HasComp<SpaceNinjaComponent>(target) ||
_tag.HasTag(target, "Unimplantable")) // Terminator check
{ {
_popup.PopupEntity(Loc.GetString("changeling-popup-transform-not-effective"), user, user); _popup.PopupEntity(Loc.GetString("changeling-popup-transform-not-effective"), user, user);
return; return;
@@ -843,6 +850,15 @@ public sealed partial class ChangelingSystem
_chemicalsSystem.UpdateAlert(polymorphEntity.Value, toAdd); _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); _nukeOps.TransferRole(target, polymorphEntity.Value);
_cult.TransferRole(target, polymorphEntity.Value); _cult.TransferRole(target, polymorphEntity.Value);

View File

@@ -208,6 +208,7 @@ namespace Content.Shared.Preferences
var bodyType = SharedHumanoidAppearanceSystem.DefaultBodyType; var bodyType = SharedHumanoidAppearanceSystem.DefaultBodyType;
if (prototypeManager.TryIndex<SpeciesPrototype>(species, out var speciesPrototype)) if (prototypeManager.TryIndex<SpeciesPrototype>(species, out var speciesPrototype))
{ {
bodyType = speciesPrototype.BodyTypes[0];
sex = random.Pick(speciesPrototype.Sexes); sex = random.Pick(speciesPrototype.Sexes);
age = random.Next(speciesPrototype.MinAge, age = random.Next(speciesPrototype.MinAge,
speciesPrototype speciesPrototype

View File

@@ -288,7 +288,7 @@
- type: polymorph - type: polymorph
id: MobHumanSyndicateAgent id: MobHumanSyndicateAgent
configuration: configuration:
entity: MobHumanSyndicateAgent entity: MobHuman
forced: true forced: true
revertOnCrit: false revertOnCrit: false
revertOnDeath: false revertOnDeath: false
@@ -299,7 +299,7 @@
- type: polymorph - type: polymorph
id: MobHumanSyndicateAgentNukeops id: MobHumanSyndicateAgentNukeops
configuration: configuration:
entity: MobHumanSyndicateAgentNukeops entity: MobHuman
forced: true forced: true
revertOnCrit: false revertOnCrit: false
revertOnDeath: false revertOnDeath: false
@@ -310,7 +310,7 @@
- type: polymorph - type: polymorph
id: MobHumanNukeOp id: MobHumanNukeOp
configuration: configuration:
entity: MobHumanNukeOp entity: MobHuman
forced: true forced: true
revertOnCrit: false revertOnCrit: false
revertOnDeath: false revertOnDeath: false
@@ -321,7 +321,7 @@
- type: polymorph - type: polymorph
id: MobHumanLoneNuclearOperative id: MobHumanLoneNuclearOperative
configuration: configuration:
entity: MobHumanLoneNuclearOperative entity: MobHuman
forced: true forced: true
revertOnCrit: false revertOnCrit: false
revertOnDeath: false revertOnDeath: false
@@ -332,7 +332,7 @@
- type: polymorph - type: polymorph
id: MobHumanSpaceNinja id: MobHumanSpaceNinja
configuration: configuration:
entity: MobHumanSpaceNinja entity: MobHuman
forced: true forced: true
revertOnCrit: false revertOnCrit: false
revertOnDeath: false revertOnDeath: false
@@ -354,7 +354,7 @@
- type: polymorph - type: polymorph
id: MobHumanTerminator id: MobHumanTerminator
configuration: configuration:
entity: MobHumanTerminator entity: MobHuman
forced: true forced: true
revertOnCrit: false revertOnCrit: false
revertOnDeath: false revertOnDeath: false
@@ -365,7 +365,51 @@
- type: polymorph - type: polymorph
id: MobTerminatorEndoskeleton id: MobTerminatorEndoskeleton
configuration: 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 forced: true
revertOnCrit: false revertOnCrit: false
revertOnDeath: false revertOnDeath: false