Fixes (#73)
* - fix: Genitals sprite shit and meow for tajaran * - add: fart sound if kicked from server * - tweak: vulpies and tajaran now for donaters!!! * - fix: Fart on exit * - add: roleplay think * - fix: database shit and loc * - add: ears for slime * - fix: LOC interaction fix * - add: height setting * - fix: height for felinids * - fix: nigga fix * - fix: no bitches on captain * - fix: interaction panel animation shit
This commit is contained in:
14
Content.Shared/_Amour/CustomHeight/CustomHeightComponent.cs
Normal file
14
Content.Shared/_Amour/CustomHeight/CustomHeightComponent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Content.Shared._Amour.CustomHeight;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class CustomHeightComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public float Min = 0.89f;
|
||||
[DataField]
|
||||
public float Max = 1.1f;
|
||||
[DataField]
|
||||
public float Starting = 1f;
|
||||
[DataField]
|
||||
public bool Random = true;
|
||||
}
|
||||
79
Content.Shared/_Amour/CustomHeight/CustomHeightSystem.cs
Normal file
79
Content.Shared/_Amour/CustomHeight/CustomHeightSystem.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using Content.Shared._Amour.HumanoidAppearanceExtension;
|
||||
using Content.Shared.Humanoid;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared._Amour.CustomHeight;
|
||||
|
||||
public abstract class SharedCustomHeightSystem : EntitySystem
|
||||
{
|
||||
[Dependency] protected readonly SharedAppearanceSystem AppearanceSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<CustomHeightComponent,ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<CustomHeightComponent,HumanoidAppearanceLoadedEvent>(OnLoaded);
|
||||
}
|
||||
|
||||
private void OnLoaded(EntityUid uid, CustomHeightComponent component, HumanoidAppearanceLoadedEvent args)
|
||||
{
|
||||
SetHeight(uid,GetHeightFromByte(uid,args.Profile.Appearance.Height));
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, CustomHeightComponent component, ComponentInit args)
|
||||
{
|
||||
if(HasComp<HumanoidAppearanceComponent>(uid))
|
||||
return;
|
||||
|
||||
if (component.Random)
|
||||
component.Starting = _robustRandom.NextFloat(component.Min, component.Max);
|
||||
|
||||
if(component.Starting == 1f)
|
||||
return;
|
||||
|
||||
SetHeight(uid,component.Starting);
|
||||
}
|
||||
|
||||
public void SetHeight(Entity<CustomHeightComponent?> entity, float height)
|
||||
{
|
||||
if (!Resolve(entity, ref entity.Comp))
|
||||
entity.Comp = EnsureComp<CustomHeightComponent>(entity);
|
||||
|
||||
height = Math.Clamp(height, entity.Comp.Min, entity.Comp.Max);
|
||||
|
||||
AppearanceSystem.SetData(entity,HeightVisuals.State, height);
|
||||
}
|
||||
|
||||
public float GetHeightFromByte(Entity<CustomHeightComponent?> entity, byte per)
|
||||
{
|
||||
if (!Resolve(entity, ref entity.Comp))
|
||||
entity.Comp = EnsureComp<CustomHeightComponent>(entity);
|
||||
|
||||
var percent = (float)per / byte.MaxValue;
|
||||
var min = entity.Comp.Min;
|
||||
var max = entity.Comp.Max;
|
||||
|
||||
return min + (max - min) * percent;
|
||||
}
|
||||
|
||||
public byte GetByteFromHeight(Entity<CustomHeightComponent?> entity,float? varheight = null)
|
||||
{
|
||||
if (!Resolve(entity, ref entity.Comp))
|
||||
entity.Comp = EnsureComp<CustomHeightComponent>(entity);
|
||||
|
||||
var min = entity.Comp.Min;
|
||||
var max = entity.Comp.Max;
|
||||
|
||||
varheight ??= AppearanceSystem.TryGetData<float>(entity, HeightVisuals.State, out var height) ? height : min;
|
||||
|
||||
return (byte) ((varheight.Value - min) / (max - min) * byte.MaxValue);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum HeightVisuals : byte
|
||||
{
|
||||
State
|
||||
}
|
||||
@@ -18,7 +18,19 @@ public sealed partial class RequireAnimation : IInteractionAction
|
||||
{
|
||||
var animationSystem = entityManager.System<SharedAnimationSystem>();
|
||||
|
||||
var rotation = (entityManager.GetComponent<TransformComponent>(target).LocalPosition - entityManager.GetComponent<TransformComponent>(uid).LocalPosition)*0.5f;
|
||||
var targetTransform = entityManager.GetComponent<TransformComponent>(target);
|
||||
var userTransform = entityManager.GetComponent<TransformComponent>(uid);
|
||||
|
||||
var targetPos = targetTransform.LocalPosition;
|
||||
if (!targetTransform.ParentUid.Equals(targetTransform.GridUid))
|
||||
targetPos = entityManager.GetComponent<TransformComponent>(targetTransform.ParentUid).LocalPosition;
|
||||
|
||||
|
||||
var userPos = userTransform.LocalPosition;
|
||||
if (!userTransform.ParentUid.Equals(userTransform.GridUid))
|
||||
userPos = entityManager.GetComponent<TransformComponent>(userTransform.ParentUid).LocalPosition;
|
||||
|
||||
var rotation = (targetPos - userPos)*0.5f;
|
||||
|
||||
if (Length == 0)
|
||||
{
|
||||
|
||||
19
Content.Shared/_Amour/LoggerExtension/LoggerExt.cs
Normal file
19
Content.Shared/_Amour/LoggerExtension/LoggerExt.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace Content.Shared._Amour.LoggerExtension;
|
||||
|
||||
public static class LoggerExt
|
||||
{
|
||||
public static void Trace(this ISawmill logger, params (string,object)[] objects)
|
||||
{
|
||||
if(objects.Length == 0)
|
||||
return;
|
||||
|
||||
var text = "TRC: ";
|
||||
|
||||
foreach (var (name,obj) in objects)
|
||||
{
|
||||
text += $"{name}: {obj} ";
|
||||
}
|
||||
|
||||
logger.Debug(text);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Content.Shared._Amour.RoleplayInfo;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class RoleplayInfoComponent : Component
|
||||
{
|
||||
[DataField] public List<RoleplayInfo> Data = new();
|
||||
}
|
||||
22
Content.Shared/_Amour/RoleplayInfo/RoleplayInfoData.cs
Normal file
22
Content.Shared/_Amour/RoleplayInfo/RoleplayInfoData.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared._Amour.RoleplayInfo;
|
||||
|
||||
[Serializable, NetSerializable, DataDefinition]
|
||||
public sealed partial class RoleplayInfo
|
||||
{
|
||||
[DataField] public string Name ;
|
||||
[DataField] public RoleplaySelection RoleplaySelection;
|
||||
public RoleplayInfo(string name, RoleplaySelection roleplaySelection)
|
||||
{
|
||||
Name = name;
|
||||
RoleplaySelection = roleplaySelection;
|
||||
}
|
||||
}
|
||||
|
||||
public enum RoleplaySelection
|
||||
{
|
||||
No = 0,
|
||||
Maybe = 1,
|
||||
Yes = 2
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Amour.RoleplayInfo;
|
||||
|
||||
[Prototype]
|
||||
public sealed class RoleplayInfoPrototype : IPrototype
|
||||
{
|
||||
[IdDataField] public string ID { get; private set; } = default!;
|
||||
}
|
||||
19
Content.Shared/_Amour/RoleplayInfo/SharedRoleplaySystem.cs
Normal file
19
Content.Shared/_Amour/RoleplayInfo/SharedRoleplaySystem.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Linq;
|
||||
using Content.Shared._Amour.HumanoidAppearanceExtension;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Humanoid;
|
||||
|
||||
namespace Content.Shared._Amour.RoleplayInfo;
|
||||
|
||||
public abstract class SharedRoleplaySystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<RoleplayInfoComponent, HumanoidAppearanceLoadingEvent>(OnHumanoidLoading);
|
||||
}
|
||||
|
||||
private void OnHumanoidLoading(EntityUid uid, RoleplayInfoComponent component, HumanoidAppearanceLoadingEvent args)
|
||||
{
|
||||
component.Data = new List<RoleplayInfo>(args.Profile.RoleplayInfoData.Select(p => p.Value));
|
||||
}
|
||||
}
|
||||
10
Content.Shared/_Amour/Sponsor/SponsorItemPrototype.cs
Normal file
10
Content.Shared/_Amour/Sponsor/SponsorItemPrototype.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Amour.Sponsor;
|
||||
|
||||
[Prototype]
|
||||
public sealed class SponsorItemPrototype : IPrototype
|
||||
{
|
||||
[IdDataField] public string ID { get; private set; } = default!;
|
||||
[DataField] public List<string> Items = new();
|
||||
}
|
||||
Reference in New Issue
Block a user