Skip to content

Commit

Permalink
Merge pull request Simple-Station#130 from Memeji/Nikko--Lewd-Traits
Browse files Browse the repository at this point in the history
Vagina Trait + Organization.
  • Loading branch information
FoxxoTrystan authored Aug 23, 2024
2 parents 1c7fc48 + dc2dbca commit 8a53e96
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 98 deletions.
Original file line number Diff line number Diff line change
@@ -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<ReagentPrototype> ReagentId = "NaturalLubricant";

[DataField]
public FixedPoint2 MaxVolume = FixedPoint2.New(25);

[DataField]
public Entity<SolutionComponent>? 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);
}
161 changes: 85 additions & 76 deletions Content.Server/FloofStation/Traits/LewdTraitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ public override void Initialize()
//Initializers
SubscribeLocalEvent<CumProducerComponent, ComponentStartup>(OnComponentInitCum);
SubscribeLocalEvent<MilkProducerComponent, ComponentStartup>(OnComponentInitMilk);
//SubscribeLocalEvent<SquirtProducerComponent, ComponentStartup>(OnComponentInitSquirt); //Unused-Trait is WIP
SubscribeLocalEvent<SquirtProducerComponent, ComponentStartup>(OnComponentInitSquirt);

//Verbs
SubscribeLocalEvent<CumProducerComponent, GetVerbsEvent<InnateVerb>>(AddCumVerb);
SubscribeLocalEvent<MilkProducerComponent, GetVerbsEvent<InnateVerb>>(AddMilkVerb);
//SubscribeLocalEvent<SquirtProducerComponent, GetVerbsEvent<InnateVerb>>(AddSquirtVerb); //Unused-Trait is WIP
SubscribeLocalEvent<SquirtProducerComponent, GetVerbsEvent<InnateVerb>>(AddSquirtVerb);

//Events
SubscribeLocalEvent<CumProducerComponent, CummingDoAfterEvent>(OnDoAfterCum);
SubscribeLocalEvent<MilkProducerComponent, MilkingDoAfterEvent>(OnDoAfterMilk);
//SubscribeLocalEvent<SquirtProducerComponent, SquirtingDoAfterEvent>(OnDoAfterSquirt); //Unused-Trait is WIP
SubscribeLocalEvent<SquirtProducerComponent, SquirtingDoAfterEvent>(OnDoAfterSquirt);
}

#region event handling
Expand All @@ -61,13 +61,13 @@ private void OnComponentInitMilk(Entity<MilkProducerComponent> entity, ref Compo
solutionMilk.AddReagent(entity.Comp.ReagentId, entity.Comp.MaxVolume - solutionMilk.Volume);
}

//private void OnComponentInitSquirt(Entity<SquirtProducerComponent> 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<SquirtProducerComponent> 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<CumProducerComponent> entity, ref GetVerbsEvent<InnateVerb> args)
{
Expand Down Expand Up @@ -113,26 +113,26 @@ public void AddMilkVerb(Entity<MilkProducerComponent> entity, ref GetVerbsEvent<
args.Verbs.Add(verbMilk);
}

//public void AddSquirtVerb(Entity<SquirtProducerComponent> entity, ref GetVerbsEvent<InnateVerb> args) //Unused-Trait is WIP
//{
// if (args.Using == null ||
// !args.CanInteract ||
// !EntityManager.HasComponent<RefillableSolutionComponent>(args.Using.Value)) //see if removing this part lets you milk on the ground.
// return;
public void AddSquirtVerb(Entity<SquirtProducerComponent> entity, ref GetVerbsEvent<InnateVerb> args)
{
if (args.Using == null ||
!args.CanInteract ||
!EntityManager.HasComponent<RefillableSolutionComponent>(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<CumProducerComponent> entity, ref CummingDoAfterEvent args)
{
Expand Down Expand Up @@ -188,32 +188,32 @@ private void OnDoAfterMilk(Entity<MilkProducerComponent> 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<SquirtProducerComponent> entity, ref SquirtingDoAfterEvent args) //Unused-Trait is WIP
//{
// if (args.Cancelled || args.Handled || args.Args.Used == null)
// return;
private void OnDoAfterSquirt(Entity<SquirtProducerComponent> 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
Expand Down Expand Up @@ -249,27 +249,28 @@ private void AttemptMilk(Entity<MilkProducerComponent> lewd, EntityUid userUid,
_doAfterSystem.TryStartDoAfter(doargs);
}

//private void AttemptSquirt(Entity<SquirtProducerComponent> lewd, EntityUid userUid, EntityUid containerUid) //Unused-Trait is WIP
//{
// if (!HasComp<SquirtProducerComponent>(userUid))
// return;
private void AttemptSquirt(Entity<SquirtProducerComponent> lewd, EntityUid userUid, EntityUid containerUid)
{
if (!HasComp<SquirtProducerComponent>(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<CumProducerComponent>(); //SquirtProducerComponent -unused ,
var queryCum = EntityQueryEnumerator<CumProducerComponent>();
var queryMilk = EntityQueryEnumerator<MilkProducerComponent>();
var querySquirt = EntityQueryEnumerator<SquirtProducerComponent>();
var now = _timing.CurTime;

while (queryCum.MoveNext(out var uid, out var containerCum))
Expand Down Expand Up @@ -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
}
10 changes: 10 additions & 0 deletions Content.Shared/Floofstation/Traits/Events/SquirtingDoAfterEvent.cs
Original file line number Diff line number Diff line change
@@ -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
{
}

5 changes: 5 additions & 0 deletions Resources/Locale/en-US/Floof/reagents/natural_sauce.ftl
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions Resources/Locale/en-US/Floof/verbs/squirt-verb.ftl
Original file line number Diff line number Diff line change
@@ -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

This file was deleted.

25 changes: 25 additions & 0 deletions Resources/Prototypes/Floof/Reagents/natural_sauce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,28 @@
collection: FootstepSticky
params:
volume: 6

- type: reagent
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"
recognizable: true
metabolisms:
Drink:
effects:
- !type:SatiateThirst
factor: 0.3
footstepSound:
collection: FootstepSticky
params:
volume: 4
tileReactions:
- !type:SpillTileReaction
paralyzeTime: 0.5
launchForwardsMultiplier: 1.2
requiredSlipSpeed: 1
39 changes: 19 additions & 20 deletions Resources/Prototypes/Floof/Traits/lewd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: NaturalLubricant
Quantity: 25

0 comments on commit 8a53e96

Please sign in to comment.