SubscribeLocalEvent<HumanoidAppearanceComponent, GetVerbsEvent<Verb>>(OnVerbsRequest);
}
- // this was done enough times that it only made sense to do it here
-
- /// <summary>
- /// Clones a humanoid's appearance to a target mob, provided they both have humanoid components.
- /// </summary>
- /// <param name="source">Source entity to fetch the original appearance from.</param>
- /// <param name="target">Target entity to apply the source entity's appearance to.</param>
- /// <param name="sourceHumanoid">Source entity's humanoid component.</param>
- /// <param name="targetHumanoid">Target entity's humanoid component.</param>
- public void CloneAppearance(EntityUid source, EntityUid target, HumanoidAppearanceComponent? sourceHumanoid = null,
- HumanoidAppearanceComponent? targetHumanoid = null)
- {
- if (!Resolve(source, ref sourceHumanoid) || !Resolve(target, ref targetHumanoid))
- {
- return;
- }
-
- targetHumanoid.Species = sourceHumanoid.Species;
- targetHumanoid.SkinColor = sourceHumanoid.SkinColor;
- targetHumanoid.EyeColor = sourceHumanoid.EyeColor;
- targetHumanoid.Age = sourceHumanoid.Age;
- SetSex(target, sourceHumanoid.Sex, false, targetHumanoid);
- targetHumanoid.CustomBaseLayers = new(sourceHumanoid.CustomBaseLayers);
- targetHumanoid.MarkingSet = new(sourceHumanoid.MarkingSet);
-
- targetHumanoid.Gender = sourceHumanoid.Gender;
- if (TryComp<GrammarComponent>(target, out var grammar))
- {
- grammar.Gender = sourceHumanoid.Gender;
- }
-
- Dirty(target, targetHumanoid);
- }
-
/// <summary>
/// Removes a marking from a humanoid by ID.
/// </summary>
Dirty(uid, humanoid);
}
+ /// <summary>
+ /// Clones a humanoid's appearance to a target mob, provided they both have humanoid components.
+ /// </summary>
+ /// <param name="source">Source entity to fetch the original appearance from.</param>
+ /// <param name="target">Target entity to apply the source entity's appearance to.</param>
+ /// <param name="sourceHumanoid">Source entity's humanoid component.</param>
+ /// <param name="targetHumanoid">Target entity's humanoid component.</param>
+ public void CloneAppearance(EntityUid source, EntityUid target, HumanoidAppearanceComponent? sourceHumanoid = null,
+ HumanoidAppearanceComponent? targetHumanoid = null)
+ {
+ if (!Resolve(source, ref sourceHumanoid) || !Resolve(target, ref targetHumanoid))
+ return;
+
+ targetHumanoid.Species = sourceHumanoid.Species;
+ targetHumanoid.SkinColor = sourceHumanoid.SkinColor;
+ targetHumanoid.EyeColor = sourceHumanoid.EyeColor;
+ targetHumanoid.Age = sourceHumanoid.Age;
+ SetSex(target, sourceHumanoid.Sex, false, targetHumanoid);
+ targetHumanoid.CustomBaseLayers = new(sourceHumanoid.CustomBaseLayers);
+ targetHumanoid.MarkingSet = new(sourceHumanoid.MarkingSet);
+
+ targetHumanoid.Gender = sourceHumanoid.Gender;
+ if (TryComp<GrammarComponent>(target, out var grammar))
+ grammar.Gender = sourceHumanoid.Gender;
+
+ Dirty(target, targetHumanoid);
+ }
+
/// <summary>
/// Sets the visibility for multiple layers at once on a humanoid's sprite.
/// </summary>