Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ public void RefreshTraits()
"Scents",
"ScentsNSFW",
"BodyType",
"Quirks",
};

// Create UI view from model
Expand Down
59 changes: 59 additions & 0 deletions Content.Server/_CS/Traits/Abilities/AphrodesiacBiteSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Server.Consent;
using Content.Shared._CS.Traits.Abilities;
using Content.Shared.Actions;
using Content.Shared.Chemistry.Components;
using Content.Shared.Popups;
using Robust.Shared.Audio.Systems;

namespace Content.Server._CS.Traits.Abilities;

public sealed class AphrodesiacBiteSystem : EntitySystem
{
[Dependency] private readonly ConsentSystem _consent = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<AphrodesiacBiteEvent>(OnBite);
SubscribeLocalEvent<AphrodesiacBiteComponent, ComponentInit>(OnInit);
}

public void OnInit(EntityUid uid, AphrodesiacBiteComponent component, ComponentInit args)
{
_actions.AddAction(uid, ref component.ActionEntity, component.Action, uid);
}

public void OnBite(AphrodesiacBiteEvent ev)
{
if (ev.Handled)
return;

TryInject(ev.Target, ev.Performer);
}

public void TryInject(EntityUid target, EntityUid user)
{
if (!TryComp<BloodstreamComponent>(target, out var bloodstream))
return;

if (!TryComp<AphrodesiacBiteComponent>(user, out var bite))
return;

if (bite.RequiresConsent && !_consent.HasConsent(target, bite.ConsentToggleId))
{
_popup.PopupEntity(Loc.GetString("aphrodesiac-no-consent", ("target", target)), user, PopupType.LargeCaution);
return;
}

var solution = new Solution(bite.Reagent, bite.Amount);
if (_bloodstream.TryAddToChemicals(target, solution, bloodstream))
_audio.PlayPvs(bite.Sound, user);
}
}
37 changes: 37 additions & 0 deletions Content.Shared/_CS/Traits/Abilities/AphrodesiacBiteComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Content.Shared.Actions;
using Content.Shared.Consent;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;

namespace Content.Shared._CS.Traits.Abilities;

[RegisterComponent, NetworkedComponent]
public sealed partial class AphrodesiacBiteComponent : Component
{
[DataField]
public EntProtoId Action = "ActionAphrodesiacBite";

[DataField]
public EntityUid? ActionEntity;

[DataField("reagent")]
public string Reagent = "Libidozenithizine";

[DataField("amount")]
public int Amount = 5;

[DataField("sound")]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Effects/bite.ogg");

[DataField("consentRequired")]
public bool RequiresConsent = true;

[DataField("consentPrototype")]
public ProtoId<ConsentTogglePrototype> ConsentToggleId = "Aphrodisiacs";
}

public sealed partial class AphrodesiacBiteEvent : EntityTargetActionEvent
{

}
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/_CS/traits.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
trait-aphrodesiacbite-name = Aphrodesiac Bite
trait-aphrodesiacbite-desc = You have fangs capable of injecting a powerful aphrodesiac venom.
aphrodesiac-no-consent = {$target} doesn't consent to that!
28 changes: 0 additions & 28 deletions Resources/Prototypes/Traits/categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,3 @@
- type: traitCategory
id: Quirks
name: trait-category-quirks

- type: traitCategory
id: RPI
name: trait-category-rpi

- type: traitCategory
id: Examine
name: trait-category-examine

- type: traitCategory
id: Temperament
name: trait-category-temperament
maxTraitPoints: 2

- type: traitCategory
id: BodyType
name: trait-category-bodytypes
maxTraitPoints: 2

- type: traitCategory
id: Scents
name: trait-category-scents
maxTraitPoints: 2

- type: traitCategory
id: ScentsNSFW
name: trait-category-scents-nsfw
maxTraitPoints: 2
23 changes: 23 additions & 0 deletions Resources/Prototypes/_CS/Traits/Abilities/aphrodesiac_bite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- type: entity
id: ActionAphrodesiacBite
name: Aphrodesiac Bite
description: Inject a powerful aphrodesiac venom into someone.
components:
- type: Action
icon:
sprite: _CS/Traits/Abilities.rsi
state: aphrodesiac
itemIconStyle: BigAction
useDelay: 2
- type: TargetAction
- type: EntityTargetAction
event: !type:AphrodesiacBiteEvent

- type: trait
id: AbilityAphrodesiacBite
name: trait-aphrodesiacbite-name
description: trait-aphrodesiacbite-desc
category: Quirks
cost: 0
components:
- type: AphrodesiacBite
27 changes: 27 additions & 0 deletions Resources/Prototypes/_CS/Traits/categories.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- type: traitCategory
id: RPI
name: trait-category-rpi

- type: traitCategory
id: Examine
name: trait-category-examine

- type: traitCategory
id: Temperament
name: trait-category-temperament
maxTraitPoints: 2

- type: traitCategory
id: BodyType
name: trait-category-bodytypes
maxTraitPoints: 2

- type: traitCategory
id: Scents
name: trait-category-scents
maxTraitPoints: 2

- type: traitCategory
id: ScentsNSFW
name: trait-category-scents-nsfw
maxTraitPoints: 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Resources/Textures/_CS/Traits/Abilities.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "@cringe_cursed on Discord",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "aphrodesiac"
}
]
}
Loading