mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-02-14 19:30:01 +01:00
@@ -1,4 +1,5 @@
|
||||
using System.Linq; // Corvax-Wega-Hair-Extended
|
||||
using System.Numerics; // Corvax-Wega-Add
|
||||
using Content.Client.DisplacementMap;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Humanoid;
|
||||
@@ -44,10 +45,30 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem
|
||||
}
|
||||
}
|
||||
|
||||
// Corvax-Wega-Height-start
|
||||
private float ConvertHeightToScale(float height)
|
||||
{
|
||||
const float minH = 140f, maxH = 300f;
|
||||
const float minS = 0.65f, maxS = 1.5f;
|
||||
|
||||
var t = MathF.Pow((height - minH) / (maxH - minH), 0.7f);
|
||||
return Math.Clamp(minS + t * (maxS - minS), minS, maxS);
|
||||
}
|
||||
|
||||
private void ApplyHeightScale(Entity<HumanoidAppearanceComponent, SpriteComponent> entity)
|
||||
{
|
||||
var humanoid = entity.Comp1;
|
||||
|
||||
var scale = ConvertHeightToScale(humanoid.Height);
|
||||
_sprite.SetScale(entity.Owner, new Vector2(scale, scale));
|
||||
}
|
||||
// Corvax-Wega-Height-end
|
||||
|
||||
private void UpdateSprite(Entity<HumanoidAppearanceComponent, SpriteComponent> entity)
|
||||
{
|
||||
UpdateLayers(entity);
|
||||
ApplyMarkingSet(entity);
|
||||
ApplyHeightScale(entity); // Corvax-Wega-Height
|
||||
|
||||
var humanoidAppearance = entity.Comp1;
|
||||
var sprite = entity.Comp2;
|
||||
@@ -226,6 +247,7 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem
|
||||
humanoid.SkinColor = profile.Appearance.SkinColor;
|
||||
humanoid.EyeColor = profile.Appearance.EyeColor;
|
||||
humanoid.Status = profile.Status; // Corvax-Wega
|
||||
humanoid.Height = profile.Height; // Corvax-Wega-Height
|
||||
|
||||
UpdateSprite((uid, humanoid, Comp<SpriteComponent>(uid)));
|
||||
}
|
||||
|
||||
@@ -108,6 +108,17 @@
|
||||
</BoxContainer>
|
||||
<!-- Corvax-Wega-Barks-End -->
|
||||
</BoxContainer>
|
||||
<!-- Corvax-Wega-Height-Add-start -->
|
||||
<!-- Height -->
|
||||
<BoxContainer Margin="10" HorizontalExpand="True" Orientation="Vertical">
|
||||
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
|
||||
<Label Text="{Loc 'humanoid-profile-editor-height-label'}" />
|
||||
<Control HorizontalExpand="True"/>
|
||||
<Label Name="HeightDisplay" HorizontalAlignment="Right" />
|
||||
</BoxContainer>
|
||||
<Slider HorizontalExpand="True" Name="HeightSlider" MinValue="0" MaxValue="1" Value="0.5" />
|
||||
</BoxContainer>
|
||||
<!-- Corvax-Wega-Height-Add-end -->
|
||||
<!-- Skin -->
|
||||
<BoxContainer Margin="10" HorizontalExpand="True" Orientation="Vertical">
|
||||
<Label Text="{Loc 'humanoid-profile-editor-skin-color-label'}" />
|
||||
|
||||
@@ -254,6 +254,15 @@ namespace Content.Client.Lobby.UI
|
||||
|
||||
#endregion Status
|
||||
|
||||
#region Height
|
||||
|
||||
HeightSlider.OnValueChanged += _ =>
|
||||
{
|
||||
OnHeightChanged();
|
||||
};
|
||||
|
||||
#endregion Height
|
||||
|
||||
#region Barks
|
||||
|
||||
if (configurationManager.GetCVar(WegaCVars.BarksEnabled))
|
||||
@@ -1030,6 +1039,12 @@ namespace Content.Client.Lobby.UI
|
||||
return;
|
||||
|
||||
PreviewDummy = _controller.LoadProfileEntity(Profile, JobOverride, ShowClothes.Pressed);
|
||||
|
||||
// Corvax-Wega-Height-Apply-start
|
||||
var scale = ConvertHeightToScale(Profile.Height);
|
||||
_sprite.SetScale(PreviewDummy, new Vector2(scale, scale));
|
||||
// Corvax-Wega-Height-Apply-end
|
||||
|
||||
SpriteView.SetEntity(PreviewDummy);
|
||||
_entManager.System<MetaDataSystem>().SetEntityName(PreviewDummy, Profile.Name);
|
||||
|
||||
@@ -1081,6 +1096,7 @@ namespace Content.Client.Lobby.UI
|
||||
UpdateCMarkingsHair();
|
||||
UpdateCMarkingsFacialHair();
|
||||
UpdateStatusControls(); // Corvax-Wega
|
||||
UpdateHeightControls(); // Corvax-Wega-Height
|
||||
|
||||
RefreshAntags();
|
||||
RefreshJobs();
|
||||
@@ -1107,6 +1123,11 @@ namespace Content.Client.Lobby.UI
|
||||
|
||||
_entManager.System<HumanoidAppearanceSystem>().LoadProfile(PreviewDummy, Profile);
|
||||
|
||||
// Corvax-Wega-Height-Apply-start
|
||||
var scale = ConvertHeightToScale(Profile.Height);
|
||||
_sprite.SetScale(PreviewDummy, new Vector2(scale, scale));
|
||||
// Corvax-Wega-Height-Apply-end
|
||||
|
||||
// Check and set the dirty flag to enable the save/reset buttons as appropriate.
|
||||
SetDirty();
|
||||
}
|
||||
@@ -1599,6 +1620,40 @@ namespace Content.Client.Lobby.UI
|
||||
}
|
||||
// Corvax-Wega-Graphomancy-Extended-Edit-end
|
||||
|
||||
// Corvax-Wega-Height-start
|
||||
private void OnHeightChanged()
|
||||
{
|
||||
if (Profile == null)
|
||||
return;
|
||||
|
||||
var species = _prototypeManager.Index(Profile.Species);
|
||||
var newHeight = species.MinHeight + HeightSlider.Value * (species.MaxHeight - species.MinHeight);
|
||||
newHeight = (float)Math.Round(newHeight, 2);
|
||||
|
||||
Profile = Profile.WithHeight(newHeight);
|
||||
UpdateHeightDisplay();
|
||||
ReloadPreview();
|
||||
}
|
||||
|
||||
private void UpdateHeightDisplay()
|
||||
{
|
||||
if (Profile == null)
|
||||
return;
|
||||
|
||||
HeightDisplay.Text = Loc.GetString("humanoid-profile-editor-height-display",
|
||||
("value", Profile.Height.ToString("F2")));
|
||||
}
|
||||
|
||||
private float ConvertHeightToScale(float height)
|
||||
{
|
||||
const float minH = 140f, maxH = 300f;
|
||||
const float minS = 0.65f, maxS = 1.5f;
|
||||
|
||||
var t = MathF.Pow((height - minH) / (maxH - minH), 0.7f);
|
||||
return Math.Clamp(minS + t * (maxS - minS), minS, maxS);
|
||||
}
|
||||
// Corvax-Wega-Height-end
|
||||
|
||||
private void OnMarkingChange(MarkingSet markings)
|
||||
{
|
||||
if (Profile is null)
|
||||
@@ -1984,6 +2039,20 @@ namespace Content.Client.Lobby.UI
|
||||
}
|
||||
// Corvax-Wega-end
|
||||
|
||||
// Corvax-Wega-Height-start
|
||||
private void UpdateHeightControls()
|
||||
{
|
||||
if (Profile == null)
|
||||
return;
|
||||
|
||||
var species = _prototypeManager.Index(Profile.Species);
|
||||
var normalized = (Profile.Height - species.MinHeight) / (species.MaxHeight - species.MinHeight);
|
||||
HeightSlider.Value = normalized;
|
||||
|
||||
UpdateHeightDisplay();
|
||||
}
|
||||
// Corvax-Wega-Height-end
|
||||
|
||||
private void UpdateSpawnPriorityControls()
|
||||
{
|
||||
if (Profile == null)
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Shared.Height;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Humanoid.Prototypes;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Height
|
||||
{
|
||||
public sealed class HeightSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<SmallHeightComponent, ComponentStartup>(OnSmallHeightComponentStartup);
|
||||
SubscribeLocalEvent<BigHeightComponent, ComponentStartup>(OnBigHeightComponentStartup);
|
||||
SubscribeLocalEvent<SmallHeightComponent, ComponentShutdown>(OnSmallHeightComponentShutdown);
|
||||
SubscribeLocalEvent<BigHeightComponent, ComponentShutdown>(OnBigHeightComponentShutdown);
|
||||
}
|
||||
|
||||
private void OnSmallHeightComponentStartup(Entity<SmallHeightComponent> ent, ref ComponentStartup args)
|
||||
{
|
||||
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) && CheckSpeciesEntity(humanoid))
|
||||
return;
|
||||
|
||||
_sprite.SetScale(ent.Owner, new Vector2(0.85f, 0.85f));
|
||||
}
|
||||
|
||||
private void OnBigHeightComponentStartup(Entity<BigHeightComponent> ent, ref ComponentStartup args)
|
||||
{
|
||||
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) && CheckSpeciesEntity(humanoid))
|
||||
return;
|
||||
|
||||
_sprite.SetScale(ent.Owner, new Vector2(1.2f, 1.2f));
|
||||
}
|
||||
|
||||
private void OnSmallHeightComponentShutdown(Entity<SmallHeightComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) && CheckSpeciesEntity(humanoid))
|
||||
return;
|
||||
|
||||
_sprite.SetScale(ent.Owner, new Vector2(1.0f, 1.0f));
|
||||
}
|
||||
|
||||
private void OnBigHeightComponentShutdown(Entity<BigHeightComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) && CheckSpeciesEntity(humanoid))
|
||||
return;
|
||||
|
||||
_sprite.SetScale(ent.Owner, new Vector2(1.0f, 1.0f));
|
||||
}
|
||||
|
||||
private bool CheckSpeciesEntity(HumanoidAppearanceComponent humanoid)
|
||||
{
|
||||
var allowedSpecies = new[]
|
||||
{
|
||||
new ProtoId<SpeciesPrototype>("Dwarf"),
|
||||
new ProtoId<SpeciesPrototype>("Felinid"),
|
||||
new ProtoId<SpeciesPrototype>("Resomi")
|
||||
};
|
||||
return allowedSpecies.Contains(humanoid.Species);
|
||||
}
|
||||
}
|
||||
}
|
||||
2180
Content.Server.Database/Migrations/Postgres/20251210191327_Height.Designer.cs
generated
Normal file
2180
Content.Server.Database/Migrations/Postgres/20251210191327_Height.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Height : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<float>(
|
||||
name: "height",
|
||||
table: "profile",
|
||||
type: "real",
|
||||
nullable: false,
|
||||
defaultValue: 0f);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "height",
|
||||
table: "profile");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -886,6 +886,10 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("hair_name");
|
||||
|
||||
b.Property<float>("Height")
|
||||
.HasColumnType("real")
|
||||
.HasColumnName("height");
|
||||
|
||||
b.Property<string>("LinksFlavorText")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
|
||||
2103
Content.Server.Database/Migrations/Sqlite/20251210191322_Height.Designer.cs
generated
Normal file
2103
Content.Server.Database/Migrations/Sqlite/20251210191322_Height.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Height : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<float>(
|
||||
name: "height",
|
||||
table: "profile",
|
||||
type: "REAL",
|
||||
nullable: false,
|
||||
defaultValue: 0f);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "height",
|
||||
table: "profile");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -837,6 +837,10 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("hair_name");
|
||||
|
||||
b.Property<float>("Height")
|
||||
.HasColumnType("REAL")
|
||||
.HasColumnName("height");
|
||||
|
||||
b.Property<string>("LinksFlavorText")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
|
||||
@@ -419,6 +419,7 @@ namespace Content.Server.Database
|
||||
public string Voice { get; set; } = null!; // Corvax-TTS
|
||||
public string BarkVoice { get; set; } = null!; // Corvax-Wega-Barks
|
||||
public string Status { get; set; } = null!; // Corvax-Wega
|
||||
public float Height { get; set; } // Corvax-Wega-Height
|
||||
[Column(TypeName = "jsonb")] public JsonDocument? Markings { get; set; } = null!;
|
||||
public string HairName { get; set; } = null!;
|
||||
public string HairColor { get; set; } = null!;
|
||||
|
||||
@@ -307,6 +307,7 @@ namespace Content.Server.Database
|
||||
sex,
|
||||
gender,
|
||||
status, // Corvax-Wega
|
||||
profile.Height, // Corvax-Wega-Height
|
||||
new HumanoidCharacterAppearance
|
||||
(
|
||||
profile.HairName,
|
||||
@@ -354,6 +355,7 @@ namespace Content.Server.Database
|
||||
profile.BarkVoice = humanoid.BarkVoice; // Corvax-Wega-Barks
|
||||
profile.Status = humanoid.Status.ToString(); // Corvax-Wega
|
||||
profile.Age = humanoid.Age;
|
||||
profile.Height = humanoid.Height; // Corvax-Wega-Height
|
||||
profile.Sex = humanoid.Sex.ToString();
|
||||
profile.Gender = humanoid.Gender.ToString();
|
||||
profile.HairName = appearance.HairStyleId;
|
||||
|
||||
@@ -54,6 +54,9 @@ public sealed partial class HumanoidAppearanceComponent : Component
|
||||
[DataField, AutoNetworkedField]
|
||||
public Status Status = Status.No;
|
||||
|
||||
[DataField, AutoNetworkedField]
|
||||
public float Height = 175.0f;
|
||||
|
||||
[DataField("barkvoice")]
|
||||
public ProtoId<BarkPrototype> BarkVoice { get; set; } = SharedHumanoidAppearanceSystem.DefaultBarkVoice;
|
||||
// Corvax-Wega-end
|
||||
|
||||
@@ -140,6 +140,14 @@ public sealed partial class SpeciesPrototype : IPrototype
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int MaxAge = 120;
|
||||
|
||||
// Corvax-Wega-Height-start
|
||||
[DataField]
|
||||
public float MinHeight = 150.0f;
|
||||
|
||||
[DataField]
|
||||
public float MaxHeight = 205.0f;
|
||||
// Corvax-Wega-Height-end
|
||||
}
|
||||
|
||||
public enum SpeciesNaming : byte
|
||||
|
||||
@@ -169,6 +169,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
|
||||
targetHumanoid.SkinColor = sourceHumanoid.SkinColor;
|
||||
targetHumanoid.EyeColor = sourceHumanoid.EyeColor;
|
||||
targetHumanoid.Age = sourceHumanoid.Age;
|
||||
targetHumanoid.Height = sourceHumanoid.Height; // Corvax-Wega-Height
|
||||
targetHumanoid.CustomBaseLayers = new(sourceHumanoid.CustomBaseLayers);
|
||||
targetHumanoid.MarkingSet = new(sourceHumanoid.MarkingSet);
|
||||
SetTTSVoice(target, sourceHumanoid.Voice, targetHumanoid); // Corvax-TTS
|
||||
@@ -500,6 +501,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
|
||||
}
|
||||
|
||||
humanoid.Age = profile.Age;
|
||||
humanoid.Height = profile.Height; // Corvax-Wega-Height
|
||||
|
||||
Dirty(uid, humanoid);
|
||||
}
|
||||
|
||||
@@ -120,6 +120,9 @@ namespace Content.Shared.Preferences
|
||||
// Corvax-Wega-start
|
||||
[DataField]
|
||||
public Status Status { get; private set; } = Status.No;
|
||||
|
||||
[DataField]
|
||||
public float Height { get; set; } = 175.0f;
|
||||
// Corvax-Wega-end
|
||||
|
||||
/// <summary>
|
||||
@@ -181,6 +184,7 @@ namespace Content.Shared.Preferences
|
||||
Sex sex,
|
||||
Gender gender,
|
||||
Status status, // Corvax-Wega
|
||||
float height, // Corvax-Wega-Height
|
||||
HumanoidCharacterAppearance appearance,
|
||||
SpawnPriorityPreference spawnPriority,
|
||||
Dictionary<ProtoId<JobPrototype>, JobPriority> jobPriorities,
|
||||
@@ -208,6 +212,7 @@ namespace Content.Shared.Preferences
|
||||
Sex = sex;
|
||||
Gender = gender;
|
||||
Status = status; // Corvax-Wega
|
||||
Height = height; // Corvax-Wega-Height
|
||||
Appearance = appearance;
|
||||
SpawnPriority = spawnPriority;
|
||||
_jobPriorities = jobPriorities;
|
||||
@@ -252,6 +257,7 @@ namespace Content.Shared.Preferences
|
||||
other.Sex,
|
||||
other.Gender,
|
||||
other.Status, // Corvax-Wega
|
||||
other.Height, // Corvax-Wega-Height
|
||||
other.Appearance.Clone(),
|
||||
other.SpawnPriority,
|
||||
new Dictionary<ProtoId<JobPrototype>, JobPriority>(other.JobPriorities),
|
||||
@@ -311,10 +317,12 @@ namespace Content.Shared.Preferences
|
||||
|
||||
var sex = Sex.Unsexed;
|
||||
var age = 18;
|
||||
var height = 175.0f; // Corvax-Wega-Height
|
||||
if (prototypeManager.TryIndex<SpeciesPrototype>(species, out var speciesPrototype))
|
||||
{
|
||||
sex = random.Pick(speciesPrototype.Sexes);
|
||||
age = random.Next(speciesPrototype.MinAge, speciesPrototype.OldAge); // people don't look and keep making 119 year old characters with zero rp, cap it at middle aged
|
||||
height = random.NextFloat(speciesPrototype.MinHeight, speciesPrototype.MaxHeight); // Corvax-Wega-Height
|
||||
}
|
||||
|
||||
// Corvax-Wega-Barks-start
|
||||
@@ -357,6 +365,7 @@ namespace Content.Shared.Preferences
|
||||
BarkVoice = barkvoiceId, // Corvax-Wega-Barks
|
||||
Voice = voiceId, // Corvax-TTS
|
||||
Status = status, // Corvax-Wega
|
||||
Height = height, // Corvax-Wega-Height
|
||||
Appearance = HumanoidCharacterAppearance.Random(species, sex),
|
||||
};
|
||||
}
|
||||
@@ -443,6 +452,11 @@ namespace Content.Shared.Preferences
|
||||
{
|
||||
return new(this) { BarkVoice = barkvoice };
|
||||
}
|
||||
|
||||
public HumanoidCharacterProfile WithHeight(float height)
|
||||
{
|
||||
return new(this) { Height = height };
|
||||
}
|
||||
// Corvax-Wega-end
|
||||
|
||||
// Corvax-TTS-Start
|
||||
@@ -621,6 +635,7 @@ namespace Content.Shared.Preferences
|
||||
if (Sex != other.Sex) return false;
|
||||
if (Gender != other.Gender) return false;
|
||||
if (Status != other.Status) return false; // Corvax-Wega
|
||||
if (Height != other.Height) return false; // Corvax-Wega-Height
|
||||
if (Species != other.Species) return false;
|
||||
if (PreferenceUnavailable != other.PreferenceUnavailable) return false;
|
||||
if (SpawnPriority != other.SpawnPriority) return false;
|
||||
@@ -674,6 +689,7 @@ namespace Content.Shared.Preferences
|
||||
sex = speciesPrototype.Sexes[0];
|
||||
|
||||
var age = Math.Clamp(Age, speciesPrototype.MinAge, speciesPrototype.MaxAge);
|
||||
var height = Math.Clamp(Height, speciesPrototype.MinHeight, speciesPrototype.MaxHeight); // Corvax-Wega-Height
|
||||
|
||||
var gender = Gender switch
|
||||
{
|
||||
@@ -893,6 +909,7 @@ namespace Content.Shared.Preferences
|
||||
Sex = sex;
|
||||
Gender = gender;
|
||||
Status = status; // Corvax-Wega
|
||||
Height = height; // Corvax-Wega-Height
|
||||
Appearance = appearance;
|
||||
SpawnPriority = spawnPriority;
|
||||
|
||||
@@ -1041,6 +1058,7 @@ namespace Content.Shared.Preferences
|
||||
// Corvax-Wega-Graphomancy-Extended-end
|
||||
hashCode.Add(Species);
|
||||
hashCode.Add(Age);
|
||||
hashCode.Add(Height); // Corvax-Wega-Height
|
||||
hashCode.Add((int)Sex);
|
||||
hashCode.Add((int)Gender);
|
||||
hashCode.Add(Appearance);
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Height
|
||||
{
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class SmallHeightComponent : Component
|
||||
{
|
||||
}
|
||||
namespace Content.Shared.Height;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class BigHeightComponent : Component
|
||||
{
|
||||
}
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class SmallHeightComponent : Component
|
||||
{
|
||||
[DataField, AutoNetworkedField]
|
||||
public float LastHeight = default!;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class BigHeightComponent : Component
|
||||
{
|
||||
[DataField, AutoNetworkedField]
|
||||
public float LastHeight = default!;
|
||||
}
|
||||
|
||||
60
Content.Shared/_Wega/Height/HeightSystem.cs
Normal file
60
Content.Shared/_Wega/Height/HeightSystem.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using Content.Shared.Humanoid;
|
||||
|
||||
namespace Content.Shared.Height;
|
||||
|
||||
public sealed class HeightSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SmallHeightComponent, ComponentStartup>(OnSmallHeightComponentStartup);
|
||||
SubscribeLocalEvent<BigHeightComponent, ComponentStartup>(OnBigHeightComponentStartup);
|
||||
|
||||
SubscribeLocalEvent<SmallHeightComponent, ComponentShutdown>(OnSmallHeightComponentShutdown);
|
||||
SubscribeLocalEvent<BigHeightComponent, ComponentShutdown>(OnBigHeightComponentShutdown);
|
||||
}
|
||||
|
||||
private void OnSmallHeightComponentStartup(Entity<SmallHeightComponent> ent, ref ComponentStartup args)
|
||||
{
|
||||
if (!TryComp<HumanoidAppearanceComponent>(ent, out var humanoid))
|
||||
return;
|
||||
|
||||
ent.Comp.LastHeight = humanoid.Height;
|
||||
humanoid.Height = 140.0f;
|
||||
|
||||
Dirty(ent.Owner, humanoid);
|
||||
}
|
||||
|
||||
private void OnBigHeightComponentStartup(Entity<BigHeightComponent> ent, ref ComponentStartup args)
|
||||
{
|
||||
if (!TryComp<HumanoidAppearanceComponent>(ent, out var humanoid))
|
||||
return;
|
||||
|
||||
ent.Comp.LastHeight = humanoid.Height;
|
||||
humanoid.Height = humanoid.Height < 240.0f
|
||||
? 240.0f : 300.0f;
|
||||
|
||||
Dirty(ent.Owner, humanoid);
|
||||
}
|
||||
|
||||
private void OnSmallHeightComponentShutdown(Entity<SmallHeightComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
if (!TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) || ent.Comp.LastHeight == default)
|
||||
return;
|
||||
|
||||
humanoid.Height = ent.Comp.LastHeight;
|
||||
|
||||
Dirty(ent.Owner, humanoid);
|
||||
}
|
||||
|
||||
private void OnBigHeightComponentShutdown(Entity<BigHeightComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
if (!TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) || ent.Comp.LastHeight == default)
|
||||
return;
|
||||
|
||||
humanoid.Height = ent.Comp.LastHeight;
|
||||
|
||||
Dirty(ent.Owner, humanoid);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,9 @@ humanoid-profile-editor-status-semi-text = Неполное ЕРП
|
||||
humanoid-profile-editor-status-full-text = Полное ЕРП
|
||||
humanoid-profile-editor-status-absolute-text = Абсолютное ЕРП
|
||||
|
||||
humanoid-profile-editor-height-label = Рост:
|
||||
humanoid-profile-editor-height-display = {$value} см
|
||||
|
||||
humanoid-profile-editor-flavor-label = Внешний Вид
|
||||
humanoid-profile-editor-flavor-character-label = Черты характера и стиль общения
|
||||
humanoid-profile-editor-flavor-ooc-label = OOC Заметки
|
||||
|
||||
@@ -13,10 +13,6 @@ trait-sneezing-name = Насморк
|
||||
trait-sneezing-desc = Вы бесконтрольно чихаете и кашляете
|
||||
trait-noir-vision-name = Синдром детектива
|
||||
trait-noir-vision-desc = Вы видите всю гниль этого мира
|
||||
trait-tall-name = Высокий
|
||||
trait-tall-desc = Вы значительно выше других гумоноидов
|
||||
trait-short-name = Низкий
|
||||
trait-short-desc = Вы значительно ниже других гумоноидов
|
||||
|
||||
# Speech
|
||||
trait-auld-imperial-name = Староимпѣрская рѣчь
|
||||
@@ -28,4 +24,4 @@ trait-lisp-desc = Вы пщщщорой гщщщворите щщщщчень щ
|
||||
trait-unintelligible-name = Косноязычие
|
||||
trait-unintelligible-desc = Ри-вы те-го, й-по так-что, но-вас с-лож, по-нять-рой
|
||||
trait-aphasia-name = Афазия
|
||||
trait-aphasia-desc = Вы теряете возможность адекватно разговаривать. БИП-БУП
|
||||
trait-aphasia-desc = Вы теряете возможность адекватно разговаривать. БИП-БУП
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
femaleFirstNames: NamesTajaranFirstFemale
|
||||
maleLastNames: NamesTajaranLast # Corvax-LastnameGender
|
||||
femaleLastNames: NamesTajaranLast # Corvax-LastnameGender
|
||||
minHeight: 150 # Corvax-Wega-Height
|
||||
maxHeight: 180 # Corvax-Wega-Height
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobTajaranSprites
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
femaleFirstNames: NamesVulpFirstFemale
|
||||
maleLastNames: NamesVulpLast # Corvax-LastnameGender
|
||||
femaleLastNames: NamesVulpLast # Corvax-LastnameGender
|
||||
minHeight: 160 # Corvax-Wega-Height
|
||||
maxHeight: 210 # Corvax-Wega-Height
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobCorvaxVulpkaninSprites
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
femaleLastNames: NamesArachnidLast # Corvax-LastnameGender
|
||||
sexes:
|
||||
- Unsexed
|
||||
minHeight: 160 # Corvax-Wega-Height
|
||||
maxHeight: 190 # Corvax-Wega-Height
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobArachnidSprites
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
oldAge: 6000
|
||||
maxAge: 12000
|
||||
# Corvax-SpeciesAgeLore-End
|
||||
minHeight: 140 # Corvax-Wega-Height
|
||||
maxHeight: 225 # Corvax-Wega-Height
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobDionaSprites
|
||||
|
||||
@@ -12,3 +12,6 @@
|
||||
oldAge: 300
|
||||
maxAge: 600
|
||||
# Corvax-SpeciesAgeLore-End
|
||||
# Вот тут мне пох на лор
|
||||
minHeight: 150 # Corvax-Wega-Height
|
||||
maxHeight: 170 # Corvax-Wega-Height
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
femaleFirstNames: NamesMothFirstFemale
|
||||
maleLastNames: NamesMothLast # Corvax-LastnameGender
|
||||
femaleLastNames: NamesMothLast # Corvax-LastnameGender
|
||||
minHeight: 165 # Corvax-Wega-Height
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobMothSprites
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
maleFirstNames: NamesReptilianMale
|
||||
femaleFirstNames: NamesReptilianFemale
|
||||
naming: FirstDashFirst
|
||||
minHeight: 190 # Corvax-Wega-Height
|
||||
maxHeight: 250 # Corvax-Wega-Height
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobReptilianSprites
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
markingLimits: MobSlimeMarkingLimits
|
||||
dollPrototype: MobSlimePersonDummy
|
||||
skinColoration: Hues
|
||||
minHeight: 140 # Corvax-Wega-Height
|
||||
maxHeight: 190 # Corvax-Wega-Height
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobSlimeSprites
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
naming: First
|
||||
sexes:
|
||||
- Unsexed
|
||||
# Вот тут мне пох на лор
|
||||
minHeight: 140 # Corvax-Wega-Height
|
||||
maxHeight: 180 # Corvax-Wega-Height
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobVoxSprites
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
femaleFirstNames: NamesVulpFirstFemale # Corvax-CorvaxVulp_Port names_vulpkanin_female
|
||||
maleLastNames: NamesVulpLast # Corvax-LastnameGender
|
||||
femaleLastNames: NamesVulpLast # Corvax-LastnameGender
|
||||
minHeight: 160 # Corvax-Wega-Height
|
||||
maxHeight: 210 # Corvax-Wega-Height
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobVulpkaninSprites
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
name: Urist McFelinid
|
||||
abstract: true
|
||||
components:
|
||||
- type: Sprite
|
||||
scale: "0.8, 0.8"
|
||||
- type: HumanoidAppearance
|
||||
height: 150
|
||||
species: Felinid
|
||||
hideLayersOnEquip:
|
||||
- Hair
|
||||
@@ -85,9 +84,8 @@
|
||||
id: MobFelinidDummy
|
||||
categories: [ HideSpawnMenu ]
|
||||
components:
|
||||
- type: Sprite
|
||||
scale: "0.8, 0.8"
|
||||
- type: HumanoidAppearance
|
||||
height: 150
|
||||
species: Felinid
|
||||
hideLayersOnEquip:
|
||||
- Hair
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
layer:
|
||||
- MobLayer
|
||||
- type: HumanoidAppearance
|
||||
height: 150
|
||||
species: Resomi
|
||||
- type: Hunger
|
||||
- type: Puller
|
||||
@@ -213,6 +214,7 @@
|
||||
categories: [ HideSpawnMenu ]
|
||||
components:
|
||||
- type: HumanoidAppearance
|
||||
height: 150
|
||||
species: Resomi
|
||||
- type: Hands
|
||||
handDisplacement:
|
||||
@@ -304,4 +306,4 @@
|
||||
32:
|
||||
sprite: _Wega/Mobs/Species/Resomi/displacement.rsi
|
||||
state: outerclothing
|
||||
# Corvax-Wega-end
|
||||
# Corvax-Wega-end
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
femaleFirstNames: NamesAriralFirst
|
||||
maleLastNames: NamesAriralLast
|
||||
femaleLastNames: NamesAriralLast
|
||||
minHeight: 180
|
||||
maxHeight: 250
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobAriralSprites
|
||||
@@ -149,4 +151,4 @@
|
||||
id: MobAriralRFoot
|
||||
baseSprite:
|
||||
sprite: _Wega/Mobs/Species/Ariral/parts.rsi
|
||||
state: r_foot
|
||||
state: r_foot
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
maxAge: 350
|
||||
oldAge: 251
|
||||
youngAge: 151
|
||||
maxHeight: 220 # ...
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobDemonSprites
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
markingLimits: MobFelinidMarkingLimits
|
||||
dollPrototype: MobFelinidDummy
|
||||
skinColoration: HumanToned
|
||||
minHeight: 140
|
||||
maxHeight: 160
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobFelinidSprites
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
markingLimits: MobHarpyMarkingLimits
|
||||
dollPrototype: MobHarpyDummy
|
||||
skinColoration: HumanToned
|
||||
minHeight: 160
|
||||
maxHeight: 220 # ...
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobHarpySprites
|
||||
@@ -137,4 +139,4 @@
|
||||
id: MobHarpyRFoot
|
||||
baseSprite:
|
||||
sprite: _Wega/Mobs/Species/Harpy/parts.rsi
|
||||
state: r_foot
|
||||
state: r_foot
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
naming: First
|
||||
dollPrototype: MobResomiDummy
|
||||
skinColoration: Hues
|
||||
minHeight: 140
|
||||
maxHeight: 160
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobResomiSprites
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
markingLimits: MobSkrellMarkingLimits
|
||||
dollPrototype: MobSkrellDummy
|
||||
skinColoration: Hues
|
||||
minHeight: 165
|
||||
maxHeight: 200
|
||||
|
||||
- type: speciesBaseSprites
|
||||
id: MobSkrellSprites
|
||||
|
||||
@@ -21,25 +21,3 @@
|
||||
- ColourBlindness
|
||||
components:
|
||||
- type: NoirVision
|
||||
|
||||
- type: trait
|
||||
id: Tall
|
||||
name: trait-tall-name
|
||||
description: trait-tall-desc
|
||||
category: Quirks
|
||||
blacklist:
|
||||
components:
|
||||
- SmallHeight
|
||||
components:
|
||||
- type: BigHeight
|
||||
|
||||
- type: trait
|
||||
id: Short
|
||||
name: trait-short-name
|
||||
description: trait-short-desc
|
||||
category: Quirks
|
||||
blacklist:
|
||||
components:
|
||||
- BigHeight
|
||||
components:
|
||||
- type: SmallHeight
|
||||
|
||||
Reference in New Issue
Block a user