From 19d0d62c7c8b0f3d1e2f274bf5251c044d456f7a Mon Sep 17 00:00:00 2001 From: Pierson Arnold Date: Wed, 21 Aug 2024 12:54:03 -0500 Subject: [PATCH 1/2] Added vagina trait and some organization --- .../Components/SquirtProducerComponent.cs | 38 +++++ .../FloofStation/Traits/LewdTraitSystem.cs | 161 +++++++++--------- .../Traits/Events/SquirtingDoAfterEvent.cs | 10 ++ .../en-US/Floof/reagents/natural_sauce.ftl | 5 + .../floofstation/{cum => verbs}/cum-verb.ftl | 0 .../{milk => verbs}/milk-verb.ftl | 0 .../en-US/floofstation/verbs/squirt-verb.ftl | 5 + .../reagents/floofstation/natural_sauce.ftl | 2 - .../Floof/Reagents/natural_sauce.yml | 20 +++ Resources/Prototypes/Floof/Traits/lewd.yml | 39 +++-- 10 files changed, 182 insertions(+), 98 deletions(-) create mode 100644 Content.Server/FloofStation/Traits/Components/SquirtProducerComponent.cs create mode 100644 Content.Shared/Floofstation/Traits/Events/SquirtingDoAfterEvent.cs create mode 100644 Resources/Locale/en-US/Floof/reagents/natural_sauce.ftl rename Resources/Locale/en-US/floofstation/{cum => verbs}/cum-verb.ftl (100%) rename Resources/Locale/en-US/floofstation/{milk => verbs}/milk-verb.ftl (100%) create mode 100644 Resources/Locale/en-US/floofstation/verbs/squirt-verb.ftl delete mode 100644 Resources/Locale/en-US/reagents/floofstation/natural_sauce.ftl diff --git a/Content.Server/FloofStation/Traits/Components/SquirtProducerComponent.cs b/Content.Server/FloofStation/Traits/Components/SquirtProducerComponent.cs new file mode 100644 index 00000000000..6ad056e5490 --- /dev/null +++ b/Content.Server/FloofStation/Traits/Components/SquirtProducerComponent.cs @@ -0,0 +1,38 @@ +using Content.Shared.FixedPoint; +using Content.Shared.Chemistry.Components; +using Content.Shared.Chemistry.Reagent; +using Content.Shared.FloofStation.Traits; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; +using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; +using Robust.Shared.GameStates; + +namespace Content.Server.FloofStation.Traits; + +[RegisterComponent, Access(typeof(LewdTraitSystem))] +public sealed partial class SquirtProducerComponent : Component +{ + [DataField("solutionname")] + public string SolutionName = "vagina"; + + [DataField] + public ProtoId ReagentId = "Natural Lubricant"; + + [DataField] + public FixedPoint2 MaxVolume = FixedPoint2.New(25); + + [DataField] + public Entity? Solution = null; + + [DataField] + public FixedPoint2 QuantityPerUpdate = 5; + + [DataField] + public float HungerUsage = 10f; + + [DataField] + public TimeSpan GrowthDelay = TimeSpan.FromSeconds(10); + + [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] + public TimeSpan NextGrowth = TimeSpan.FromSeconds(0); +} diff --git a/Content.Server/FloofStation/Traits/LewdTraitSystem.cs b/Content.Server/FloofStation/Traits/LewdTraitSystem.cs index 6a5a927d417..d2f21480ca2 100644 --- a/Content.Server/FloofStation/Traits/LewdTraitSystem.cs +++ b/Content.Server/FloofStation/Traits/LewdTraitSystem.cs @@ -31,17 +31,17 @@ public override void Initialize() //Initializers SubscribeLocalEvent(OnComponentInitCum); SubscribeLocalEvent(OnComponentInitMilk); - //SubscribeLocalEvent(OnComponentInitSquirt); //Unused-Trait is WIP + SubscribeLocalEvent(OnComponentInitSquirt); //Verbs SubscribeLocalEvent>(AddCumVerb); SubscribeLocalEvent>(AddMilkVerb); - //SubscribeLocalEvent>(AddSquirtVerb); //Unused-Trait is WIP + SubscribeLocalEvent>(AddSquirtVerb); //Events SubscribeLocalEvent(OnDoAfterCum); SubscribeLocalEvent(OnDoAfterMilk); - //SubscribeLocalEvent(OnDoAfterSquirt); //Unused-Trait is WIP + SubscribeLocalEvent(OnDoAfterSquirt); } #region event handling @@ -61,13 +61,13 @@ private void OnComponentInitMilk(Entity entity, ref Compo solutionMilk.AddReagent(entity.Comp.ReagentId, entity.Comp.MaxVolume - solutionMilk.Volume); } - //private void OnComponentInitSquirt(Entity entity, ref ComponentStartup args) //Unused-Trait is WIP - //{ - // var solutionSquirt = _solutionContainer.EnsureSolution(entity.Owner, entity.Comp.SolutionName); - // solutionSquirt.MaxVolume = entity.Comp.MaxVolume; + private void OnComponentInitSquirt(Entity entity, ref ComponentStartup args) + { + var solutionSquirt = _solutionContainer.EnsureSolution(entity.Owner, entity.Comp.SolutionName); + solutionSquirt.MaxVolume = entity.Comp.MaxVolume; - // solutionSquirt.AddReagent(entity.Comp.ReagentId, entity.Comp.MaxVolume - solutionSquirt.Volume); - //} + solutionSquirt.AddReagent(entity.Comp.ReagentId, entity.Comp.MaxVolume - solutionSquirt.Volume); + } public void AddCumVerb(Entity entity, ref GetVerbsEvent args) { @@ -113,26 +113,26 @@ public void AddMilkVerb(Entity entity, ref GetVerbsEvent< args.Verbs.Add(verbMilk); } - //public void AddSquirtVerb(Entity entity, ref GetVerbsEvent args) //Unused-Trait is WIP - //{ - // if (args.Using == null || - // !args.CanInteract || - // !EntityManager.HasComponent(args.Using.Value)) //see if removing this part lets you milk on the ground. - // return; + public void AddSquirtVerb(Entity entity, ref GetVerbsEvent args) + { + if (args.Using == null || + !args.CanInteract || + !EntityManager.HasComponent(args.Using.Value)) //see if removing this part lets you milk on the ground. + return; - // _solutionContainer.EnsureSolution(entity.Owner, entity.Comp.SolutionName); + _solutionContainer.EnsureSolution(entity.Owner, entity.Comp.SolutionName); - // var user = args.User; - // var used = args.Using.Value; + var user = args.User; + var used = args.Using.Value; - // InnateVerb verbSquirt = new() - // { - // Act = () => AttemptSquirt(entity, user, used), - // Text = Loc.GetString($"squirt-verb-get-text"), - // Priority = 1 - // }; - // args.Verbs.Add(verbSquirt); - //} + InnateVerb verbSquirt = new() + { + Act = () => AttemptSquirt(entity, user, used), + Text = Loc.GetString($"squirt-verb-get-text"), + Priority = 1 + }; + args.Verbs.Add(verbSquirt); + } private void OnDoAfterCum(Entity entity, ref CummingDoAfterEvent args) { @@ -188,32 +188,32 @@ private void OnDoAfterMilk(Entity entity, ref MilkingDoAf _popupSystem.PopupEntity(Loc.GetString("milk-verb-success", ("amount", quantity), ("target", Identity.Entity(args.Args.Used.Value, EntityManager))), entity.Owner, args.Args.User, PopupType.Medium); } - //private void OnDoAfterSquirt(Entity entity, ref SquirtingDoAfterEvent args) //Unused-Trait is WIP - //{ - // if (args.Cancelled || args.Handled || args.Args.Used == null) - // return; + private void OnDoAfterSquirt(Entity entity, ref SquirtingDoAfterEvent args) + { + if (args.Cancelled || args.Handled || args.Args.Used == null) + return; - // if (!_solutionContainer.ResolveSolution(entity.Owner, entity.Comp.SolutionName, ref entity.Comp.Solution, out var solution)) - // return; + if (!_solutionContainer.ResolveSolution(entity.Owner, entity.Comp.SolutionName, ref entity.Comp.Solution, out var solution)) + return; - // if (!_solutionContainer.TryGetRefillableSolution(args.Args.Used.Value, out var targetSoln, out var targetSolution)) - // return; + if (!_solutionContainer.TryGetRefillableSolution(args.Args.Used.Value, out var targetSoln, out var targetSolution)) + return; - // args.Handled = true; - // var quantity = solution.Volume; - // if (quantity == 0) - // { - // _popupSystem.PopupEntity(Loc.GetString("squirt-verb-dry"), entity.Owner, args.Args.User); - // return; - // } + args.Handled = true; + var quantity = solution.Volume; + if (quantity == 0) + { + _popupSystem.PopupEntity(Loc.GetString("squirt-verb-dry"), entity.Owner, args.Args.User); + return; + } - // if (quantity > targetSolution.AvailableVolume) - // quantity = targetSolution.AvailableVolume; + if (quantity > targetSolution.AvailableVolume) + quantity = targetSolution.AvailableVolume; - // var split = _solutionContainer.SplitSolution(entity.Comp.Solution.Value, quantity); - // _solutionContainer.TryAddSolution(targetSoln.Value, split); - // _popupSystem.PopupEntity(Loc.GetString("squirt-verb-success", ("amount", quantity), ("target", Identity.Entity(args.Args.Used.Value, EntityManager))), entity.Owner, args.Args.User, PopupType.Medium); - //} + var split = _solutionContainer.SplitSolution(entity.Comp.Solution.Value, quantity); + _solutionContainer.TryAddSolution(targetSoln.Value, split); + _popupSystem.PopupEntity(Loc.GetString("squirt-verb-success", ("amount", quantity), ("target", Identity.Entity(args.Args.Used.Value, EntityManager))), entity.Owner, args.Args.User, PopupType.Medium); + } #endregion #region utilities @@ -249,27 +249,28 @@ private void AttemptMilk(Entity lewd, EntityUid userUid, _doAfterSystem.TryStartDoAfter(doargs); } - //private void AttemptSquirt(Entity lewd, EntityUid userUid, EntityUid containerUid) //Unused-Trait is WIP - //{ - // if (!HasComp(userUid)) - // return; + private void AttemptSquirt(Entity lewd, EntityUid userUid, EntityUid containerUid) + { + if (!HasComp(userUid)) + return; - // var doargs = new DoAfterArgs(EntityManager, userUid, 5, new SquirtingDoAfterEvent(), lewd, lewd, used: containerUid) - // { - // BreakOnUserMove = true, - // BreakOnDamage = true, - // BreakOnTargetMove = true, - // MovementThreshold = 1.0f, - // }; + var doargs = new DoAfterArgs(EntityManager, userUid, 5, new SquirtingDoAfterEvent(), lewd, lewd, used: containerUid) + { + BreakOnUserMove = true, + BreakOnDamage = true, + BreakOnTargetMove = true, + MovementThreshold = 1.0f, + }; - // _doAfterSystem.TryStartDoAfter(doargs); - //} + _doAfterSystem.TryStartDoAfter(doargs); + } public override void Update(float frameTime) { base.Update(frameTime); - var queryCum = EntityQueryEnumerator(); //SquirtProducerComponent -unused , + var queryCum = EntityQueryEnumerator(); var queryMilk = EntityQueryEnumerator(); + var querySquirt = EntityQueryEnumerator(); var now = _timing.CurTime; while (queryCum.MoveNext(out var uid, out var containerCum)) @@ -320,21 +321,29 @@ public override void Update(float frameTime) _solutionContainer.TryAddReagent(containerMilk.Solution.Value, containerMilk.ReagentId, containerMilk.QuantityPerUpdate, out _); } - //if (!(now < containerSquirt.NextGrowth)) //Unused-Trait is WIP - //{ - // containerSquirt.NextGrowth = now + containerSquirt.GrowthDelay; - - // - // if (EntityManager.TryGetComponent(uid, out HungerComponent? hunger)) - // { - // - // if (!(_hunger.GetHungerThreshold(hunger) < HungerThreshold.Okay)) - // _hunger.ModifyHunger(uid, -containerSquirt.HungerUsage, hunger); - // } - - // if (_solutionContainer.ResolveSolution(uid, containerSquirt.SolutionName, ref containerSquirt.Solution)) - // _solutionContainer.TryAddReagent(containerSquirt.Solution.Value, containerSquirt.ReagentId, containerSquirt.QuantityPerUpdate, out _); - //} + while (querySquirt.MoveNext(out var uid, out var containerSquirt)) + { + if (now < containerSquirt.NextGrowth) + continue; + + containerSquirt.NextGrowth = now + containerSquirt.GrowthDelay; + + if (_mobState.IsDead(uid)) + continue; + + if (EntityManager.TryGetComponent(uid, out HungerComponent? hunger)) + { + if (_hunger.GetHungerThreshold(hunger) < HungerThreshold.Okay) + continue; + + //_hunger.ModifyHunger(uid, -containerMilk.HungerUsage, hunger); + } + + if (!_solutionContainer.ResolveSolution(uid, containerSquirt.SolutionName, ref containerSquirt.Solution)) + continue; + + _solutionContainer.TryAddReagent(containerSquirt.Solution.Value, containerSquirt.ReagentId, containerSquirt.QuantityPerUpdate, out _); + } } #endregion } diff --git a/Content.Shared/Floofstation/Traits/Events/SquirtingDoAfterEvent.cs b/Content.Shared/Floofstation/Traits/Events/SquirtingDoAfterEvent.cs new file mode 100644 index 00000000000..2deb48b76af --- /dev/null +++ b/Content.Shared/Floofstation/Traits/Events/SquirtingDoAfterEvent.cs @@ -0,0 +1,10 @@ +using Content.Shared.DoAfter; +using Robust.Shared.Serialization; + +namespace Content.Shared.FloofStation.Traits.Events; + +[Serializable, NetSerializable] +public sealed partial class SquirtingDoAfterEvent : SimpleDoAfterEvent +{ +} + diff --git a/Resources/Locale/en-US/Floof/reagents/natural_sauce.ftl b/Resources/Locale/en-US/Floof/reagents/natural_sauce.ftl new file mode 100644 index 00000000000..797b6bcc2f8 --- /dev/null +++ b/Resources/Locale/en-US/Floof/reagents/natural_sauce.ftl @@ -0,0 +1,5 @@ +reagent-name-cum = cum +reagent-desc-cum = A sticky cloudy-white liquid. + +reagent-name-nat-lube = natural lubricant +reagent-desc-nat-lube = A slippery clear liquid. diff --git a/Resources/Locale/en-US/floofstation/cum/cum-verb.ftl b/Resources/Locale/en-US/floofstation/verbs/cum-verb.ftl similarity index 100% rename from Resources/Locale/en-US/floofstation/cum/cum-verb.ftl rename to Resources/Locale/en-US/floofstation/verbs/cum-verb.ftl diff --git a/Resources/Locale/en-US/floofstation/milk/milk-verb.ftl b/Resources/Locale/en-US/floofstation/verbs/milk-verb.ftl similarity index 100% rename from Resources/Locale/en-US/floofstation/milk/milk-verb.ftl rename to Resources/Locale/en-US/floofstation/verbs/milk-verb.ftl diff --git a/Resources/Locale/en-US/floofstation/verbs/squirt-verb.ftl b/Resources/Locale/en-US/floofstation/verbs/squirt-verb.ftl new file mode 100644 index 00000000000..3e10d9d7d3d --- /dev/null +++ b/Resources/Locale/en-US/floofstation/verbs/squirt-verb.ftl @@ -0,0 +1,5 @@ +squirt-verb-dry = Your slit is dry. +squirt-verb-success = You fill {THE($target)} with {$amount}u of natural lubricant from your pussy. +squirt-verb-success-ground = You squirt out all over the ground! + +squirt-verb-get-text = Squirt diff --git a/Resources/Locale/en-US/reagents/floofstation/natural_sauce.ftl b/Resources/Locale/en-US/reagents/floofstation/natural_sauce.ftl deleted file mode 100644 index 887f9d8ba59..00000000000 --- a/Resources/Locale/en-US/reagents/floofstation/natural_sauce.ftl +++ /dev/null @@ -1,2 +0,0 @@ -reagent-name-cum = cum -reagent-desc-cum = A sticky cloudy-white liquid. diff --git a/Resources/Prototypes/Floof/Reagents/natural_sauce.yml b/Resources/Prototypes/Floof/Reagents/natural_sauce.yml index fe089b2ac80..403e21c102a 100644 --- a/Resources/Prototypes/Floof/Reagents/natural_sauce.yml +++ b/Resources/Prototypes/Floof/Reagents/natural_sauce.yml @@ -19,3 +19,23 @@ collection: FootstepSticky params: volume: 6 + +- type: reagent + id: Natural Lubricant + name: reagent-name-nat-lube + group: NaturalSauce + desc: reagent-desc-nat-lube + physicalDesc: reagent-physical-desc-shiny + flavor: funny + color: "#d6d6d6" + viscosity: 0.35 + recognizable: true + metabolisms: + Drink: + effects: + - !type:SatiateThirst + factor: 0.3 + footstepSound: + collection: FootstepSticky + params: + volume: 4 diff --git a/Resources/Prototypes/Floof/Traits/lewd.yml b/Resources/Prototypes/Floof/Traits/lewd.yml index fb05c082657..990f8a1b53e 100644 --- a/Resources/Prototypes/Floof/Traits/lewd.yml +++ b/Resources/Prototypes/Floof/Traits/lewd.yml @@ -38,23 +38,22 @@ - ReagentId: Milk Quantity: 50 -# WIP - Needs a Reagent -# - type: trait -# id: SquirtProducer -# category: Physical -# requirements: -# - !type:CharacterJobRequirement -# inverted: true -# jobs: -# - Borg -# - MedicalBorg -# components: -# - type: SquirtProducer -# solutionname: "vagina" -# - type: SolutionContainerManager -# solutions: -# vagina: -# maxVol: 250 -# reagents: -# - ReagentId: Water -# Quantity: 30 +- type: trait + id: SquirtProducer + category: Physical + requirements: + - !type:CharacterJobRequirement + inverted: true + jobs: + - Borg + - MedicalBorg + components: + - type: SquirtProducer + solutionname: "vagina" + - type: SolutionContainerManager + solutions: + vagina: + maxVol: 25 + reagents: + - ReagentId: Natural Lubricant + Quantity: 25 From dc2dbcac4f42409062ebc48aa3084cacc2c32f58 Mon Sep 17 00:00:00 2001 From: Pierson Arnold Date: Wed, 21 Aug 2024 13:39:23 -0500 Subject: [PATCH 2/2] Fixing a few missed details --- .../Traits/Components/SquirtProducerComponent.cs | 2 +- .../en-US/{floofstation => Floof}/verbs/cum-verb.ftl | 0 .../en-US/{floofstation => Floof}/verbs/milk-verb.ftl | 0 .../en-US/{floofstation => Floof}/verbs/squirt-verb.ftl | 0 Resources/Prototypes/Floof/Reagents/natural_sauce.yml | 9 +++++++-- Resources/Prototypes/Floof/Traits/lewd.yml | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) rename Resources/Locale/en-US/{floofstation => Floof}/verbs/cum-verb.ftl (100%) rename Resources/Locale/en-US/{floofstation => Floof}/verbs/milk-verb.ftl (100%) rename Resources/Locale/en-US/{floofstation => Floof}/verbs/squirt-verb.ftl (100%) diff --git a/Content.Server/FloofStation/Traits/Components/SquirtProducerComponent.cs b/Content.Server/FloofStation/Traits/Components/SquirtProducerComponent.cs index 6ad056e5490..3bde1b7d8c4 100644 --- a/Content.Server/FloofStation/Traits/Components/SquirtProducerComponent.cs +++ b/Content.Server/FloofStation/Traits/Components/SquirtProducerComponent.cs @@ -16,7 +16,7 @@ public sealed partial class SquirtProducerComponent : Component public string SolutionName = "vagina"; [DataField] - public ProtoId ReagentId = "Natural Lubricant"; + public ProtoId ReagentId = "NaturalLubricant"; [DataField] public FixedPoint2 MaxVolume = FixedPoint2.New(25); diff --git a/Resources/Locale/en-US/floofstation/verbs/cum-verb.ftl b/Resources/Locale/en-US/Floof/verbs/cum-verb.ftl similarity index 100% rename from Resources/Locale/en-US/floofstation/verbs/cum-verb.ftl rename to Resources/Locale/en-US/Floof/verbs/cum-verb.ftl diff --git a/Resources/Locale/en-US/floofstation/verbs/milk-verb.ftl b/Resources/Locale/en-US/Floof/verbs/milk-verb.ftl similarity index 100% rename from Resources/Locale/en-US/floofstation/verbs/milk-verb.ftl rename to Resources/Locale/en-US/Floof/verbs/milk-verb.ftl diff --git a/Resources/Locale/en-US/floofstation/verbs/squirt-verb.ftl b/Resources/Locale/en-US/Floof/verbs/squirt-verb.ftl similarity index 100% rename from Resources/Locale/en-US/floofstation/verbs/squirt-verb.ftl rename to Resources/Locale/en-US/Floof/verbs/squirt-verb.ftl diff --git a/Resources/Prototypes/Floof/Reagents/natural_sauce.yml b/Resources/Prototypes/Floof/Reagents/natural_sauce.yml index 403e21c102a..3eed107e14f 100644 --- a/Resources/Prototypes/Floof/Reagents/natural_sauce.yml +++ b/Resources/Prototypes/Floof/Reagents/natural_sauce.yml @@ -21,14 +21,14 @@ volume: 6 - type: reagent - id: Natural Lubricant + id: NaturalLubricant name: reagent-name-nat-lube group: NaturalSauce desc: reagent-desc-nat-lube + slippery: true physicalDesc: reagent-physical-desc-shiny flavor: funny color: "#d6d6d6" - viscosity: 0.35 recognizable: true metabolisms: Drink: @@ -39,3 +39,8 @@ collection: FootstepSticky params: volume: 4 + tileReactions: + - !type:SpillTileReaction + paralyzeTime: 0.5 + launchForwardsMultiplier: 1.2 + requiredSlipSpeed: 1 diff --git a/Resources/Prototypes/Floof/Traits/lewd.yml b/Resources/Prototypes/Floof/Traits/lewd.yml index 990f8a1b53e..cdcb36ad9a0 100644 --- a/Resources/Prototypes/Floof/Traits/lewd.yml +++ b/Resources/Prototypes/Floof/Traits/lewd.yml @@ -55,5 +55,5 @@ vagina: maxVol: 25 reagents: - - ReagentId: Natural Lubricant + - ReagentId: NaturalLubricant Quantity: 25