Changeling devour and transform (#34002)
* Initial: Create Devour componentry, preliminary identity storage and the systems for Devouring * I have genuinely no idea what i'm doing - added the radial menu, it has nothing in it. - trying to get it to populate. the event under the event is broken, i don't know why, but apparently it's not typed right - Added a placeholder transform - oh also fixed up some devour stuff and moved some things around. * Holey moley, Transform, better devour, oh my! - Move DnaComponent into Shared because we need it for the DNA cloning - Make Transform MOSTLY work on the LAST identity devoured. - Fix some issues on devour that involved prediction, canceling and Damage exeucting (Thanks Plykiya for pointing out AttemptFrequency!) * Proper tail stealing and Damage modifier attempt Add check to add a wagging component on the Changeling if the victim's species Prototype had one. attempt to add the Damage mitigation check * MAJOR CLEANUP AND FIXES AUGH 3 DAYS!!! - Nullspaced a clone of a victim - fix audio using server virtualized Pvs (i hate this) - fix the mispredicted doafters - Clean up a wholelotta code - utilize clone systems to clone appearances - Move CloneAppearance from server to shared So we can actually access it * Examine stuff, more cleanup, Jumpsuit ripping - make rotting prevent the action - Add ripping of clothing (guh why is it also server) - add some System stuff for pushing husked corpse inspection - clean up more badcode * Doing things properly, UI sorta kinda works. - Utilize Relayed events for Devour checking - Get a UI that partially works, Says the name of identities, doesn't show their looks - Make use of the New Dynamic BUI assignment - commit the sin of no client prediction cause nullspace entities aren't networked * Got an entity for the Frontend transform Issue with the looks * Stick a camera into a fake mobs forehead - Get the UI to see the net entity in pause space by using a ViewSubscriber to get the Pvs from the initially stored identity entity - Remove all the other parts used to try to get this to work before hand * Raaaaadiallllllls also fix protection coefficents - Change FancyWindow to Radial - Fix Issue where coeffeient checking was the wrong way round * absolutely massive cleanup, no more camera in mobs - cleaned up event variables that are not needed - Removed the use of a Pause space and go back to Nullspace usage - use a PvsOverride rather than ViewSharing - Remove old commented out code and Lots of unused code * Fix "Ui elements" dying on the screen - some minor cleanup - don't start the entities that get cloned * ftl, cleanup, and fixing missing transform details - add replace functionality to TypingIndicatorSystem and BodyEmotesSystem - add placeholder sounds and functions to TransformBodyEmotes - add extra Pvs handling for later use - attributions for the funny straw sound - Sound collections for all of the sounds - various cleanups * Some extra cleanup * Fix some false assumptions about TypingIndicator - Bubbles now transfer on spawned humans rather than used humans - Clean up YET MORE CODE - make it so you can't eat yourself * Oooprs, forgot to add a Husked Corpse Loc * Missing period in the husked corpse loc * bad devour windup placeholder * Husking and WIP Lungs - Husking now will be prevented from Revival fully and will change the appearance of players * Add finalized Sprites for actions and final meta - add devour on and off sprites - add transform action sprite - Add Armblade sprite for future use - Credit obscenelytinyshark for the sprites <3 * Remove ling lungs, Entity<> everything - Remove the ling lungs stuff for now... body system is overly complicated, makes my head hurt - Switch every method to use Entity<> from Uid, Comp format * cleanup, admin logging, WIP Roles * Admin verb, Roundstart, gamerule stuff - add a Admin verb to make Changelingification easy! - Add game rule stuff for admin verb and to tell the hapless goober how to be a changeling... sorta - clean up parts to make VV easy... USE THE VERB!! * Armor Coefficent Check - Remove bespoke changeling armor check and replace it with a generic armor coefficient query. * move to UnrevivableComponent instead of husked - Move UnrevivableComponent to shared - add Analyzable and ReasonMessage to UnrevivableComponent to give granular control of the message and whether or not it shows up in the analyzer - remove the check for HuskedComponent in DefibrillatorSystem * aaaaaaa CopyComp - Some cleanup - make Vocal system shared - make VocalSystem Not make more Actions than it needs - Use some code from ChameleonProjector so we can copy components - partially ungod method the Transform system * Cleanup, Moving more things to CopyComp - TransformBodyEmotes now uses CopyComp (it's a server component so i need to tell the server to deal with it - TypingIndicatorComponent also now uses CopyComp - cleaned up old, now unused "replace" methods in favor of CopyComp - BodyEmotesSystem now has a publically accessable LoadSounds to deal with the same problem Screaming had * WIP * Devour Windup noise, ForensicsSystem cleanup * Revert VocalSystem Changes - Reverted Moving VocalSystem to shared, copy comp acomplishes it - added component.ScreamActionEntity = null; for copy comp * cleanup unneeded comments * revert an accidental line removal * Remove duplicate SharedHumanoidAppearanceSystem * Cleanup Typo's and import Forensics components for Dna * Some more forensics calls * cleanup use CopyComp for now until CopyComps * CR cleanup * Undo some SharedHumanoidAppearanceSystem changes * Confound these spaces * Some Copycomp stuff and fixing some PVS override * use the proper TryCopyComps that are merged * Change TransformMenu with RadialWithSector * All sounds done, Fix lack of typing indicator issue * Updated attributions to include used sound authors * some ftl typos and mind_role text issue * DNA, Screaming, appearance, grammar, wagging - reduced all of the above using ApplyComponentChanges - Issue still remains with bodyEmotes sticking around in the UI * Fix UI stuff, partials, entprotoid, good practices - bunch of partials added - UI now has a predicted message - EntProtoID in the admin verb - RipClothing now uses Entity<ButcherableComponent> - husking is now optional (off by default) for testing/till we have hivemind/when we figure out what were doing with devour - remove TransformGrammarSet * More CR stuff and documentation - Make TargetIsProtected less of a meme, with a prototype set of DamageTypes to check - Documenation everywhere - Move DevourEvents into its own file * Predicted sounds and fix the comp clone list - Made all start and stop sounds shared - Split out the rest of the events and UI stuff into subfiles - Fixed some Clone comp list issues where comments had -'s causing them to be read incorrectly * Damage cap check, Identity Shutdown cleanup, cleanup * Sound stuff (but actually this time) * Missed documentation * Missed Documentation and a EntProtoId * Remove unused dependency * Remove a nullcheck * Some dummy minplayers * CR - Husked now uses a rem/ensure * Update Actions in the Prototype * Fixup mindswap handover - cleanup and handover PVS on mindswap * Fixup Missing meta from accidental "Take-theirs" * Add the Armblade to the roundstart-role * Cleanup, CR (everything but the UI and renames) * missed a spot * missed some more whitespace * Renames * Primary constructor and a space in these trying times * User interface stuff for Slime transformation * popup prediction * Ling devour no longer makes duplicate identities - added a key to identities to the original victim - Add some extra clone settings * add guard statements to OnClones * SentOnlyToOwner additions * fix for sound stoppage error * Move Organ deleter into soon to be atomized husk * clone event inventory * mono sounds * lower sound volume * Fix networked sound warning * Clone comps thing * review * attributions * Fix clobbered changes * I'm gonna weh out - whole bunch of CR changes * fix some very buggy git * okay its fixed * address most review points * fix inventory * we hate entityuids * fix test and more cleanup * move this * fix more stuff * fix validation and rootable * Remove Quickswitch due to some UI quirks * oops left out some better explanation * remove dangling LastConsumed component fields * fix test fail * try this * cleanup cloning subscriptions, add movement speed modifier * fix slime storage * fix cloning setting inheritance * Add session information to transform admin logs * slay the integration test hydra * dwarf size * more volume tweaks * comments * improve comments and unpredict deletion due to errors when shutting down the server * fix displancement cloning --------- Co-authored-by: ScarKy0 <scarky0@onet.eu> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -27,9 +27,9 @@ public sealed partial class AdminVerbSystem
|
||||
private static readonly EntProtoId DefaultNukeOpRule = "LoneOpsSpawn";
|
||||
private static readonly EntProtoId DefaultRevsRule = "Revolutionary";
|
||||
private static readonly EntProtoId DefaultThiefRule = "Thief";
|
||||
private static readonly ProtoId<StartingGearPrototype> PirateGearId = "PirateGear";
|
||||
|
||||
private static readonly EntProtoId DefaultChangelingRule = "Changeling";
|
||||
private static readonly EntProtoId ParadoxCloneRuleId = "ParadoxCloneSpawn";
|
||||
private static readonly ProtoId<StartingGearPrototype> PirateGearId = "PirateGear";
|
||||
|
||||
// All antag verbs have names so invokeverb works.
|
||||
private void AddAntagVerbs(GetVerbsEvent<Verb> args)
|
||||
@@ -58,7 +58,7 @@ public sealed partial class AdminVerbSystem
|
||||
_antag.ForceMakeAntag<TraitorRuleComponent>(targetPlayer, DefaultTraitorRule);
|
||||
},
|
||||
Impact = LogImpact.High,
|
||||
Message = string.Join(": ", traitorName, Loc.GetString("admin-verb-make-traitor")),
|
||||
Message = string.Join(": ", traitorName, Loc.GetString("admin-verb-make-traitor")),
|
||||
};
|
||||
args.Verbs.Add(traitor);
|
||||
|
||||
@@ -153,6 +153,21 @@ public sealed partial class AdminVerbSystem
|
||||
};
|
||||
args.Verbs.Add(thief);
|
||||
|
||||
var changelingName = Loc.GetString("admin-verb-text-make-changeling");
|
||||
Verb changeling = new()
|
||||
{
|
||||
Text = changelingName,
|
||||
Category = VerbCategory.Antag,
|
||||
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Objects/Weapons/Melee/armblade.rsi"), "icon"),
|
||||
Act = () =>
|
||||
{
|
||||
_antag.ForceMakeAntag<ChangelingRuleComponent>(targetPlayer, DefaultChangelingRule);
|
||||
},
|
||||
Impact = LogImpact.High,
|
||||
Message = string.Join(": ", changelingName, Loc.GetString("admin-verb-make-changeling")),
|
||||
};
|
||||
args.Verbs.Add(changeling);
|
||||
|
||||
var paradoxCloneName = Loc.GetString("admin-verb-text-make-paradox-clone");
|
||||
Verb paradox = new()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
using Content.Server.Forensics;
|
||||
using Content.Server.Speech.EntitySystems;
|
||||
using Content.Shared.Cloning.Events;
|
||||
using Content.Shared.Clothing.Components;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Labels.Components;
|
||||
using Content.Shared.Labels.EntitySystems;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Paper;
|
||||
using Content.Shared.Stacks;
|
||||
using Content.Shared.Speech.Components;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Store;
|
||||
using Content.Shared.Store.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -13,47 +18,58 @@ using Robust.Shared.Prototypes;
|
||||
namespace Content.Server.Cloning;
|
||||
|
||||
/// <summary>
|
||||
/// The part of item cloning responsible for copying over important components.
|
||||
/// This is used for <see cref="CopyItem"/>.
|
||||
/// Anything not copied over here gets reverted to the values the item had in its prototype.
|
||||
/// The part of item cloning responsible for copying over important components.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method of copying items is of course not perfect as we cannot clone every single component, which would be pretty much impossible with our ECS.
|
||||
/// We only consider the most important components so the paradox clone gets similar equipment.
|
||||
/// This method of using subscriptions was chosen to make it easy for forks to add their own custom components that need to be copied.
|
||||
/// These are all not part of their corresponding systems because we don't want systems every system to depend on a CloningSystem namespace import, which is still heavily coupled to med code.
|
||||
/// TODO: Create a more generic "CopyEntity" method/event (probably in RT) that doesn't have this problem and then move all these subscriptions.
|
||||
/// </remarks>
|
||||
public sealed partial class CloningSystem : EntitySystem
|
||||
public sealed partial class CloningSystem
|
||||
{
|
||||
[Dependency] private readonly SharedStackSystem _stack = default!;
|
||||
[Dependency] private readonly LabelSystem _label = default!;
|
||||
[Dependency] private readonly ForensicsSystem _forensics = default!;
|
||||
[Dependency] private readonly PaperSystem _paper = default!;
|
||||
[Dependency] private readonly VocalSystem _vocal = default!;
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<StackComponent, CloningItemEvent>(OnCloneStack);
|
||||
SubscribeLocalEvent<LabelComponent, CloningItemEvent>(OnCloneLabel);
|
||||
SubscribeLocalEvent<PaperComponent, CloningItemEvent>(OnClonePaper);
|
||||
SubscribeLocalEvent<ForensicsComponent, CloningItemEvent>(OnCloneForensics);
|
||||
SubscribeLocalEvent<StoreComponent, CloningItemEvent>(OnCloneStore);
|
||||
// These are used for <see cref="CopyItem"/>.
|
||||
// Anything not copied over here gets reverted to the values the item had in its prototype.
|
||||
// This method of copying items is of course not perfect as we cannot clone every single component, which would be pretty much impossible with our ECS.
|
||||
// We only consider the most important components so the paradox clone gets similar equipment.
|
||||
// This method of using subscriptions was chosen to make it easy for forks to add their own custom components that need to be copied.
|
||||
SubscribeLocalEvent<StackComponent, CloningItemEvent>(OnCloneItemStack);
|
||||
SubscribeLocalEvent<LabelComponent, CloningItemEvent>(OnCloneItemLabel);
|
||||
SubscribeLocalEvent<PaperComponent, CloningItemEvent>(OnCloneItemPaper);
|
||||
SubscribeLocalEvent<ForensicsComponent, CloningItemEvent>(OnCloneItemForensics);
|
||||
SubscribeLocalEvent<StoreComponent, CloningItemEvent>(OnCloneItemStore);
|
||||
|
||||
// These are for cloning components that cannot be cloned using CopyComp.
|
||||
// Put them into CloningSettingsPrototype.EventComponents to have them be applied to the clone.
|
||||
SubscribeLocalEvent<VocalComponent, CloningEvent>(OnCloneVocal);
|
||||
SubscribeLocalEvent<StorageComponent, CloningEvent>(OnCloneStorage);
|
||||
SubscribeLocalEvent<InventoryComponent, CloningEvent>(OnCloneInventory);
|
||||
SubscribeLocalEvent<MovementSpeedModifierComponent, CloningEvent>(OnCloneInventory);
|
||||
}
|
||||
|
||||
private void OnCloneStack(Entity<StackComponent> ent, ref CloningItemEvent args)
|
||||
private void OnCloneItemStack(Entity<StackComponent> ent, ref CloningItemEvent args)
|
||||
{
|
||||
// if the clone is a stack as well, adjust the count of the copy
|
||||
if (TryComp<StackComponent>(args.CloneUid, out var cloneStackComp))
|
||||
_stack.SetCount(args.CloneUid, ent.Comp.Count, cloneStackComp);
|
||||
}
|
||||
|
||||
private void OnCloneLabel(Entity<LabelComponent> ent, ref CloningItemEvent args)
|
||||
private void OnCloneItemLabel(Entity<LabelComponent> ent, ref CloningItemEvent args)
|
||||
{
|
||||
// copy the label
|
||||
_label.Label(args.CloneUid, ent.Comp.CurrentLabel);
|
||||
}
|
||||
|
||||
private void OnClonePaper(Entity<PaperComponent> ent, ref CloningItemEvent args)
|
||||
private void OnCloneItemPaper(Entity<PaperComponent> ent, ref CloningItemEvent args)
|
||||
{
|
||||
// copy the text and any stamps
|
||||
if (TryComp<PaperComponent>(args.CloneUid, out var clonePaperComp))
|
||||
@@ -63,13 +79,13 @@ public sealed partial class CloningSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCloneForensics(Entity<ForensicsComponent> ent, ref CloningItemEvent args)
|
||||
private void OnCloneItemForensics(Entity<ForensicsComponent> ent, ref CloningItemEvent args)
|
||||
{
|
||||
// copy any forensics to the cloned item
|
||||
_forensics.CopyForensicsFrom(ent.Comp, args.CloneUid);
|
||||
}
|
||||
|
||||
private void OnCloneStore(Entity<StoreComponent> ent, ref CloningItemEvent args)
|
||||
private void OnCloneItemStore(Entity<StoreComponent> ent, ref CloningItemEvent args)
|
||||
{
|
||||
// copy the current amount of currency in the store
|
||||
// at the moment this takes care of uplink implants and the portable nukie uplinks
|
||||
@@ -80,4 +96,35 @@ public sealed partial class CloningSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCloneVocal(Entity<VocalComponent> ent, ref CloningEvent args)
|
||||
{
|
||||
if (!args.Settings.EventComponents.Contains(Factory.GetRegistration(ent.Comp.GetType()).Name))
|
||||
return;
|
||||
|
||||
_vocal.CopyComponent(ent.AsNullable(), args.CloneUid);
|
||||
}
|
||||
|
||||
private void OnCloneStorage(Entity<StorageComponent> ent, ref CloningEvent args)
|
||||
{
|
||||
if (!args.Settings.EventComponents.Contains(Factory.GetRegistration(ent.Comp.GetType()).Name))
|
||||
return;
|
||||
|
||||
_storage.CopyComponent(ent.AsNullable(), args.CloneUid);
|
||||
}
|
||||
|
||||
private void OnCloneInventory(Entity<InventoryComponent> ent, ref CloningEvent args)
|
||||
{
|
||||
if (!args.Settings.EventComponents.Contains(Factory.GetRegistration(ent.Comp.GetType()).Name))
|
||||
return;
|
||||
|
||||
_inventory.CopyComponent(ent.AsNullable(), args.CloneUid);
|
||||
}
|
||||
|
||||
private void OnCloneInventory(Entity<MovementSpeedModifierComponent> ent, ref CloningEvent args)
|
||||
{
|
||||
if (!args.Settings.EventComponents.Contains(Factory.GetRegistration(ent.Comp.GetType()).Name))
|
||||
return;
|
||||
|
||||
_movementSpeedModifier.CopyComponent(ent.AsNullable(), args.CloneUid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.Cloning;
|
||||
/// System responsible for making a copy of a humanoid's body.
|
||||
/// For the cloning machines themselves look at CloningPodSystem, CloningConsoleSystem and MedicalScannerSystem instead.
|
||||
/// </summary>
|
||||
public sealed partial class CloningSystem : EntitySystem
|
||||
public sealed partial class CloningSystem : SharedCloningSystem
|
||||
{
|
||||
[Dependency] private readonly HumanoidAppearanceSystem _humanoidSystem = default!;
|
||||
[Dependency] private readonly InventorySystem _inventory = default!;
|
||||
@@ -84,13 +84,7 @@ public sealed partial class CloningSystem : EntitySystem
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy components from one entity to another based on a CloningSettingsPrototype.
|
||||
/// </summary>
|
||||
/// <param name="original">The orignal Entity to clone components from.</param>
|
||||
/// <param name="clone">The target Entity to clone components to.</param>
|
||||
/// <param name="settings">The clone settings prototype containing the list of components to clone.</param>
|
||||
public void CloneComponents(EntityUid original, EntityUid clone, CloningSettingsPrototype settings)
|
||||
public override void CloneComponents(EntityUid original, EntityUid clone, CloningSettingsPrototype settings)
|
||||
{
|
||||
var componentsToCopy = settings.Components;
|
||||
var componentsToEvent = settings.EventComponents;
|
||||
@@ -128,7 +122,8 @@ public sealed partial class CloningSystem : EntitySystem
|
||||
}
|
||||
|
||||
// If the original does not have the component, then the clone shouldn't have it either.
|
||||
RemComp(clone, componentRegistration.Type);
|
||||
if (!HasComp(original, componentRegistration.Type))
|
||||
RemComp(clone, componentRegistration.Type);
|
||||
}
|
||||
|
||||
var cloningEv = new CloningEvent(settings, clone);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Content.Server.Emoting.Systems;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Emoting.Components;
|
||||
|
||||
@@ -14,11 +14,6 @@ public sealed partial class BodyEmotesComponent : Component
|
||||
/// <summary>
|
||||
/// Emote sounds prototype id for body emotes.
|
||||
/// </summary>
|
||||
[DataField("soundsId", customTypeSerializer: typeof(PrototypeIdSerializer<EmoteSoundsPrototype>))]
|
||||
public string? SoundsId;
|
||||
|
||||
/// <summary>
|
||||
/// Loaded emote sounds prototype used for body emotes.
|
||||
/// </summary>
|
||||
public EmoteSoundsPrototype? Sounds;
|
||||
[DataField]
|
||||
public ProtoId<EmoteSoundsPrototype>? SoundsId;
|
||||
}
|
||||
|
||||
@@ -14,15 +14,8 @@ public sealed class BodyEmotesSystem : EntitySystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<BodyEmotesComponent, ComponentStartup>(OnStartup);
|
||||
SubscribeLocalEvent<BodyEmotesComponent, EmoteEvent>(OnEmote);
|
||||
}
|
||||
|
||||
private void OnStartup(EntityUid uid, BodyEmotesComponent component, ComponentStartup args)
|
||||
{
|
||||
if (component.SoundsId == null)
|
||||
return;
|
||||
_proto.TryIndex(component.SoundsId, out component.Sounds);
|
||||
SubscribeLocalEvent<BodyEmotesComponent, EmoteEvent>(OnEmote);
|
||||
}
|
||||
|
||||
private void OnEmote(EntityUid uid, BodyEmotesComponent component, ref EmoteEvent args)
|
||||
@@ -43,6 +36,9 @@ public sealed class BodyEmotesSystem : EntitySystem
|
||||
if (!TryComp(uid, out HandsComponent? hands) || hands.Count <= 0)
|
||||
return false;
|
||||
|
||||
return _chat.TryPlayEmoteSound(uid, component.Sounds, emote);
|
||||
if (!_proto.Resolve(component.SoundsId, out var sounds))
|
||||
return false;
|
||||
|
||||
return _chat.TryPlayEmoteSound(uid, sounds, emote);
|
||||
}
|
||||
}
|
||||
|
||||
23
Content.Server/GameTicking/Rules/ChangelingRuleSystem.cs
Normal file
23
Content.Server/GameTicking/Rules/ChangelingRuleSystem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server.Roles;
|
||||
using Content.Shared.Changeling;
|
||||
|
||||
namespace Content.Server.GameTicking.Rules;
|
||||
|
||||
/// <summary>
|
||||
/// Game rule system for Changelings
|
||||
/// </summary>
|
||||
public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponent>
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ChangelingRoleComponent, GetBriefingEvent>(OnGetBriefing);
|
||||
}
|
||||
|
||||
private void OnGetBriefing(Entity<ChangelingRoleComponent> ent, ref GetBriefingEvent args)
|
||||
{
|
||||
args.Append(Loc.GetString("changeling-briefing"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Content.Server.GameTicking.Rules.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Gamerule component for handling a changeling antagonist.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed partial class ChangelingRuleComponent : Component;
|
||||
@@ -14,7 +14,7 @@ public sealed partial class ParadoxCloneRuleComponent : Component
|
||||
/// Cloning settings to be used.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public ProtoId<CloningSettingsPrototype> Settings = "Antag";
|
||||
public ProtoId<CloningSettingsPrototype> Settings = "ParadoxCloningSettings";
|
||||
|
||||
/// <summary>
|
||||
/// Visual effect spawned when gibbing at round end.
|
||||
|
||||
@@ -2,6 +2,7 @@ using Content.Server.Actions;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Speech.Components;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.Cloning.Events;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Speech;
|
||||
using Content.Shared.Speech.Components;
|
||||
@@ -31,6 +32,25 @@ public sealed class VocalSystem : EntitySystem
|
||||
SubscribeLocalEvent<VocalComponent, ScreamActionEvent>(OnScreamAction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy this component's datafields from one entity to another.
|
||||
/// This can't use CopyComp because of the ScreamActionEntity DataField, which should not be copied.
|
||||
/// <summary>
|
||||
public void CopyComponent(Entity<VocalComponent?> source, EntityUid target)
|
||||
{
|
||||
if (!Resolve(source, ref source.Comp))
|
||||
return;
|
||||
|
||||
var targetComp = EnsureComp<VocalComponent>(target);
|
||||
targetComp.Sounds = source.Comp.Sounds;
|
||||
targetComp.ScreamId = source.Comp.ScreamId;
|
||||
targetComp.Wilhelm = source.Comp.Wilhelm;
|
||||
targetComp.WilhelmProbability = source.Comp.WilhelmProbability;
|
||||
LoadSounds(target, targetComp);
|
||||
|
||||
Dirty(target, targetComp);
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, VocalComponent component, MapInitEvent args)
|
||||
{
|
||||
// try to add scream action when vocal comp added
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Actions;
|
||||
using Content.Server.Humanoid;
|
||||
using Content.Shared.Cloning.Events;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Humanoid.Markings;
|
||||
using Content.Shared.Mobs;
|
||||
@@ -26,6 +27,15 @@ public sealed class WaggingSystem : EntitySystem
|
||||
SubscribeLocalEvent<WaggingComponent, ComponentShutdown>(OnWaggingShutdown);
|
||||
SubscribeLocalEvent<WaggingComponent, ToggleActionEvent>(OnWaggingToggle);
|
||||
SubscribeLocalEvent<WaggingComponent, MobStateChangedEvent>(OnMobStateChanged);
|
||||
SubscribeLocalEvent<WaggingComponent, CloningEvent>(OnCloning);
|
||||
}
|
||||
|
||||
private void OnCloning(Entity<WaggingComponent> ent, ref CloningEvent args)
|
||||
{
|
||||
if (!args.Settings.EventComponents.Contains(Factory.GetRegistration(ent.Comp.GetType()).Name))
|
||||
return;
|
||||
|
||||
EnsureComp<WaggingComponent>(args.CloneUid);
|
||||
}
|
||||
|
||||
private void OnWaggingMapInit(EntityUid uid, WaggingComponent component, MapInitEvent args)
|
||||
|
||||
Reference in New Issue
Block a user