Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chitinid #2707

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0f191d2
Start of the Chitinid Race
ElusiveCoin Jan 12, 2025
57392c9
Removed a uneeded bit
ElusiveCoin Jan 12, 2025
70af13f
Removing the displacement section because it still is being weird
ElusiveCoin Jan 12, 2025
1282b54
Nukie Steamroll Preventative (#2658)
rosieposieeee Jan 12, 2025
05aa54d
Automatic changelog update
DeltaV-Bot Jan 12, 2025
e3b8ab1
most asked for changes
ElusiveCoin Jan 12, 2025
12fdf5e
(hopefully) Fixed Linter Error
ElusiveCoin Jan 12, 2025
1a599ed
Merge branch 'master' into Chitinid
ElusiveCoin Jan 12, 2025
44c1786
Merge branch 'master' into Chitinid
ElusiveCoin Jan 12, 2025
ba51343
More clean up edits
ElusiveCoin Jan 12, 2025
b2a709b
Merge branch 'Chitinid' of https://github.com/ElusiveCoin/Delta-v_Luc…
ElusiveCoin Jan 12, 2025
76f92af
4 space indents!!
ElusiveCoin Jan 13, 2025
ed9bfff
Merge branch 'master' into Chitinid
ElusiveCoin Jan 14, 2025
20da96b
Merge branch 'master' into Chitinid
ElusiveCoin Jan 15, 2025
72f3336
Merge branch 'master' into Chitinid
ElusiveCoin Jan 15, 2025
f4ebd6d
Direction desired name changes + More radiation mechanics
ElusiveCoin Jan 15, 2025
795ee49
Merge branch 'master' into Chitinid
ElusiveCoin Jan 15, 2025
470fe85
Merge branch 'master' into Chitinid
ElusiveCoin Jan 15, 2025
bd75fe5
Merge branch 'master' into Chitinid
ElusiveCoin Jan 15, 2025
0e2c9d0
Hopefully final changes!
ElusiveCoin Jan 16, 2025
75ac724
Forgot to add access to the new undergarments
ElusiveCoin Jan 16, 2025
58b136a
Merge branch 'master' into Chitinid
ElusiveCoin Jan 16, 2025
02fc8de
Final Final change (hopefully)
ElusiveCoin Jan 16, 2025
0a4375a
Merge branch 'master' into Chitinid
ElusiveCoin Jan 17, 2025
f975f1e
Merge branch 'master' into Chitinid
ElusiveCoin Jan 17, 2025
bbfda29
Merge remote-tracking branch 'upstream/master' into Chitinid
ElusiveCoin Jan 17, 2025
5233e19
Code Tweeks
ElusiveCoin Jan 17, 2025
258db12
Merge branch 'master' into Chitinid
ElusiveCoin Jan 18, 2025
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
10 changes: 10 additions & 0 deletions Content.Server/Chemistry/EntitySystems/InjectorSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Server.Abilities.Chitinid;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Shared.Chemistry;
Expand Down Expand Up @@ -108,6 +109,12 @@ private void OnInjectorAfterInteract(Entity<InjectorComponent> entity, ref After
/// </summary>
private void InjectDoAfter(Entity<InjectorComponent> injector, EntityUid target, EntityUid user)
{
if (HasComp<BlockInjectionComponent>(target)) // DeltaV
{
Popup.PopupEntity(Loc.GetString("injector-component-deny-user"), target, user);
return;
}

// Create a pop-up for the user
if (injector.Comp.ToggleState == InjectorToggleMode.Draw)
{
Expand Down Expand Up @@ -253,6 +260,9 @@ private bool TryInjectIntoBloodstream(Entity<InjectorComponent> injector, Entity
private bool TryInject(Entity<InjectorComponent> injector, EntityUid targetEntity,
Entity<SolutionComponent> targetSolution, EntityUid user, bool asRefill)
{
if (HasComp<BlockInjectionComponent>(targetEntity)) // DeltaV
return false;

if (!SolutionContainers.TryGetSolution(injector.Owner, injector.Comp.SolutionName, out var soln,
out var solution) || solution.Volume == 0)
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Content.Server.Abilities.Chitinid;

[RegisterComponent]
public sealed partial class BlockInjectionComponent : Component;
41 changes: 41 additions & 0 deletions Content.Server/_DV/Abilities/Chitinid/ChitinidComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;

namespace Content.Server.Abilities.Chitinid;

[RegisterComponent]
public sealed partial class ChitinidComponent : Component
{
[DataField]
public EntProtoId ChitzitePrototype = "Chitzite";

[DataField]
public EntProtoId ChitziteActionId = "ActionChitzite";

[DataField]
public EntityUid? ChitziteAction;

[DataField]
public FixedPoint2 AmountAbsorbed = 0f;

[DataField]
public DamageSpecifier Healing = new()
{
DamageDict = new()
{
{ "Radiation", -0.5 },
}
};

[DataField]
public FixedPoint2 MaximumAbsorbed = 30f;

[DataField]
public TimeSpan UpdateInterval = TimeSpan.FromSeconds(1);

[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan NextUpdate;
}
97 changes: 97 additions & 0 deletions Content.Server/_DV/Abilities/Chitinid/ChitinidSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
using Content.Server.Nutrition.Components;
using Content.Shared.Actions;
using Content.Shared.Actions.Events;
using Content.Shared.Audio;
using Content.Shared.Damage;
using Content.Shared.IdentityManagement;
using Content.Shared.Inventory;
using Content.Shared.Mobs.Systems;
using Content.Shared.Popups;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

namespace Content.Server.Abilities.Chitinid;

public sealed partial class ChitinidSystem : EntitySystem
{
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;

public override void Initialize()
{
SubscribeLocalEvent<ChitinidComponent, ChitziteActionEvent>(OnChitzite);
SubscribeLocalEvent<ChitinidComponent, MapInitEvent>(OnMapInit);
}

public override void Update(float frameTime)
{
base.Update(frameTime);
var query = EntityQueryEnumerator<ChitinidComponent, DamageableComponent>();
while (query.MoveNext(out var uid, out var chitinid, out var damageable))
{
if (_timing.CurTime < chitinid.NextUpdate)
continue;

chitinid.NextUpdate += chitinid.UpdateInterval;

if (chitinid.AmountAbsorbed >= chitinid.MaximumAbsorbed || _mobState.IsDead(uid))
continue;

if (_damageable.TryChangeDamage(uid, chitinid.Healing, damageable: damageable) is {} delta)
{
chitinid.AmountAbsorbed += -delta.GetTotal().Float();
if (chitinid.ChitziteAction != null && chitinid.AmountAbsorbed >= chitinid.MaximumAbsorbed)
{
_actions.SetCharges(chitinid.ChitziteAction, 1); // You get the charge back and that's it. Tough.
_actions.SetEnabled(chitinid.ChitziteAction, true);
}
}
}

var entQuery = EntityQueryEnumerator<CoughingUpChitziteComponent, ChitinidComponent>();
while (entQuery.MoveNext(out var ent, out var chitzite, out var chitinid))
{
if (_timing.CurTime < chitzite.NextCough)
continue;

Spawn(chitinid.ChitzitePrototype, Transform(ent).Coordinates);
chitinid.AmountAbsorbed = 0f;
RemCompDeferred(ent, chitzite);
}
}

private void OnMapInit(Entity<ChitinidComponent> ent, ref MapInitEvent args)
{
if (ent.Comp.ChitziteAction != null)
return;

ent.Comp.NextUpdate = _timing.CurTime + ent.Comp.UpdateInterval;

_actions.AddAction(ent, ref ent.Comp.ChitziteAction, ent.Comp.ChitziteActionId);
}

private void OnChitzite(Entity<ChitinidComponent> ent, ref ChitziteActionEvent args)
{
if (_inventory.TryGetSlotEntity(ent, "mask", out var maskUid) &&
TryComp<IngestionBlockerComponent>(maskUid, out var blocker) &&
blocker.Enabled)
{
_popup.PopupEntity(Loc.GetString("chitzite-mask", ("mask", maskUid)), ent, ent);
return;
}

_popup.PopupEntity(Loc.GetString("chitzite-cough", ("name", Identity.Entity(ent, EntityManager))), ent);
_audio.PlayPvs("/Audio/Animals/cat_hiss.ogg", ent, AudioHelpers.WithVariation(0.15f));

var chitzite = EnsureComp<CoughingUpChitziteComponent>(ent);
chitzite.NextCough = _timing.CurTime + chitzite.CoughUpTime;
args.Handled = true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;

namespace Content.Server.Abilities.Chitinid;

[RegisterComponent, AutoGenerateComponentPause]
public sealed partial class CoughingUpChitziteComponent : Component
{
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextCough;

[DataField]
public TimeSpan CoughUpTime = TimeSpan.FromSeconds(2.15);
}
3 changes: 3 additions & 0 deletions Content.Shared/_DV/Actions/Events/ChitziteActionEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Content.Shared.Actions.Events;

public sealed partial class ChitziteActionEvent : InstantActionEvent {}
9 changes: 9 additions & 0 deletions Resources/Audio/_DV/Voice/Chitinid/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- files: ["moth_scream.ogg"]
license: "CC-BY-SA-3.0"
copyright: "Taken from https://github.com/tgstation/tgstation/commit/31c19654e0f641166ecd80c672ea05362fd19488"
source: "https://github.com/tgstation/tgstation/commits/master/sound/voice/moth/scream_moth.ogg"

- files: ["moth_laugh.ogg, moth_chitter.ogg, moth_squeak.ogg"]
license: "CC-BY-SA-3.0"
copyright: "Taken from https://github.com/BeeStation/BeeStation-Hornet/commit/11ba3fa04105c93dd96a63ad4afaef4b20c02d0d"
source: "https://github.com/BeeStation/BeeStation-Hornet/blob/11ba3fa04105c93dd96a63ad4afaef4b20c02d0d/sound/emotes/"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions Resources/Locale/en-US/_DV/abilities/chitinid.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
action-name-chitzite = Cough Up Chitzite
action-description-chitzite = Purge the excess radiation build-up from your body, and gain a cool danger rock.
chitzite-mask = Take off your {$mask} first.
chitzite-cough = {CAPITALIZE(THE($name))} starts coughing up a hunk of Chitzite!
6 changes: 6 additions & 0 deletions Resources/Locale/en-US/_DV/chat/managers/chat_manager.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ chat-speech-verb-rodentia-1 = squeaks
chat-speech-verb-rodentia-2 = pieps
chat-speech-verb-rodentia-3 = chatters
chat-speech-verb-rodentia-4 = squeals
chat-speech-verb-name-chitinid = Chitinid
chat-speech-verb-chitinid-1 = clicks
chat-speech-verb-chitinid-2 = chitters
chat-speech-verb-chitinid-3 = hisses
chat-speech-verb-chitinid-4 = buzzes
164 changes: 164 additions & 0 deletions Resources/Locale/en-US/_DV/markings/chitinid.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
marking-ChitinidAntennasDefault-default = Antennae
marking-ChitinidAntennasDefault = Antennae (Default)

marking-ChitinidAntennasCurly-curly = Antennae
marking-ChitinidAntennasCurly = Antennae (Curly)

marking-ChitinidAntennasGray-gray = Antennae
marking-ChitinidAntennasGray = Antennae (Gray)

marking-ChitinidAntennasSlick-slick = Antennae
marking-ChitinidAntennasSlick = Antennae (Slick)

marking-ChitinidAntennasShort-short = Antennae
marking-ChitinidAntennasShort = Antennae (short)

marking-ChitinidAntennasLong-long = Antennae
marking-ChitinidAntennasLong = Antennae (Long)

marking-ChitinidAntennasBee-bee = Antennae
marking-ChitinidAntennasBee = Antennae (Bee)

marking-ChitinidAntennasFirefly-firefly_primary = Primary
marking-ChitinidAntennasFirefly-firefly_secondary = Secondary
marking-ChitinidAntennasFirefly = Antennae (Firefly)

marking-ChitinidAntennasRadar-radar = Antennae
marking-ChitinidAntennasRadar = Antennae (Radar)

marking-ChitinidAntennasSpeed-speed = Antennae
marking-ChitinidAntennasSpeed = Antennae (Speed)



marking-ChitinidWingsDefault-default = Wing
marking-ChitinidWingsDefault = Tail (Default)

marking-ChitinidWingsSmooth-smooth = Wing
marking-ChitinidWingsSmooth = Tail (Smooth)

marking-ChitinidWingsHoneypot-honeypot_primary = Primary
marking-ChitinidWingsHoneypot-honeypot_secondary = Secondary
marking-ChitinidWingsHoneypot = Tail (Honeypot)

marking-ChitinidWingsStubby-stubby = Wing
marking-ChitinidWingsStubby = Tail (Stubby)

marking-ChitinidWingsBee-bee_primary = Primary
marking-ChitinidWingsBee-bee_secondary = Secondary
marking-ChitinidWingsBee = Tail (Bee)

marking-ChitinidWingsFirefly-firefly_primary = Primary
marking-ChitinidWingsFirefly-firefly_secondary = Secondary
marking-ChitinidWingsFirefly = Tail (Firefly)



marking-ChitinidChestCharred-charred_chest = Chest
marking-ChitinidChestCharred = Chitinid Chest (Charred)

marking-ChitinidHeadCharred-charred_head = Head
marking-ChitinidHeadCharred = Chitinid Head (Charred)

marking-ChitinidLLegCharred-charred_l_leg = Left Leg
marking-ChitinidLLegCharred = Chitinid Left Leg (Charred)

marking-ChitinidRLegCharred-charred_r_leg = Right Leg
marking-ChitinidRLegCharred = Chitinid Right Leg (Charred)

marking-ChitinidLArmCharred-charred_l_arm = Left Arm
marking-ChitinidLArmCharred = Chitinid Left Arm (Charred)

marking-ChitinidRArmCharred-charred_r_arm = Right Arm
marking-ChitinidRArmCharred = Chitinid Right Arm (Charred)



marking-ChitinidChestPlated-plated_chest = Chest
marking-ChitinidChestPlated = Chitinid Chest (Plated)

marking-ChitinidLArmPlated-plated_l_arm = Left Arm
marking-ChitinidLArmPlated = Chitinid Left Arm (Plated)

marking-ChitinidRArmPlated-plated_r_arm = Right Arm
marking-ChitinidRArmPlated = Chitinid Right Arm (Plated)



marking-ChitinidChestStripes-stripes_chest = Chest
marking-ChitinidChestStripes = Chitinid Chest (Stripes)

marking-ChitinidHeadStripes-stripes_head = Head
marking-ChitinidHeadStripes = Chitinid Head (Stripes)

marking-ChitinidLLegStripes-stripes_l_leg = Left Leg
marking-ChitinidLLegStripes = Chitinid Left Leg (Stripes)

marking-ChitinidRLegStripes-stripes_r_leg = Right Leg
marking-ChitinidRLegStripes = Chitinid Right Leg (Stripes)

marking-ChitinidLArmStripes-stripes_l_arm = Left Arm
marking-ChitinidLArmStripes = Chitinid Left Arm (Stripes)

marking-ChitinidRArmStripes-stripes_r_arm = Right Arm
marking-ChitinidRArmStripes = Chitinid Right Arm (Stripes)



marking-ChitinidChestRadiant-radiant_chest = Chest
marking-ChitinidChestRadiant = Chitinid Chest (Radiant)

marking-ChitinidHeadRadiant-radiant_head = Head
marking-ChitinidHeadRadiant = Chitinid Head (Radiant)

marking-ChitinidLLegRadiant-radiant_l_leg = Left Leg
marking-ChitinidLLegRadiant = Chitinid Left Leg (Radiant)

marking-ChitinidRLegRadiant-radiant_r_leg = Right Leg
marking-ChitinidRLegRadiant = Chitinid Right Leg (Radiant)

marking-ChitinidLArmRadiant-radiant_l_arm = Left Arm
marking-ChitinidLArmRadiant = Chitinid Left Arm (Radiant)

marking-ChitinidRArmRadiant-radiant_r_arm = Right Arm
marking-ChitinidRArmRadiant = Chitinid Right Arm (Radiant)



marking-ChitinidChestToxic-toxic_chest = Chest
marking-ChitinidChestToxic = Chitinid Chest (Toxic)

marking-ChitinidHeadToxic-toxic_head = Head
marking-ChitinidHeadToxic = Chitinid Head (Toxic)

marking-ChitinidLLegToxic-toxic_l_leg = Left Leg
marking-ChitinidLLegToxic = Chitinid Left Leg (Toxic)

marking-ChitinidRLegToxic-toxic_r_leg = Right Leg
marking-ChitinidRLegToxic = Chitinid Right Leg (Toxic)

marking-ChitinidLArmToxic-toxic_l_arm = Left Arm
marking-ChitinidLArmToxic = Chitinid Left Arm (Toxic)

marking-ChitinidRArmToxic-toxic_r_arm = Right Arm
marking-ChitinidRArmToxic = Chitinid Right Arm (Toxic)



marking-ChitinidChestSpotted-spotted_chest = Chest
marking-ChitinidChestSpotted = Chitinid Chest (Spotted)

marking-ChitinidHeadSpotted-spotted_head = Head
marking-ChitinidHeadSpotted = Chitinid Head (Spotted)

marking-ChitinidLLegSpotted-spotted_l_leg = Left Leg
marking-ChitinidLLegSpotted = Chitinid Left Leg (Spotted)

marking-ChitinidRLegSpotted-spotted_r_leg = Right Leg
marking-ChitinidRLegSpotted = Chitinid Right Leg (Spotted)

marking-ChitinidLArmSpotted-spotted_l_arm = Left Arm
marking-ChitinidLArmSpotted = Chitinid Left Arm (Spotted)

marking-ChitinidRArmSpotted-spotted_r_arm = Right Arm
marking-ChitinidRArmSpotted = Chitinid Right Arm (Spotted)
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_DV/species/species.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
species-name-vulpkanin = Vulpkanin
species-name-harpy = Harpy
species-name-rodentia = Rodentia
species-name-chitinid = Chitinid
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ injector-component-drawing-user = You start drawing the needle.
injector-component-injecting-user = You start injecting the needle.
injector-component-drawing-target = {CAPITALIZE(THE($user))} is trying to use a needle to draw from you!
injector-component-injecting-target = {CAPITALIZE(THE($user))} is trying to inject a needle into you!
injector-component-deny-user = Exoskeleton too thick!
Loading
Loading