Skip to content

Commit

Permalink
Chitinid (#2707)
Browse files Browse the repository at this point in the history
* Start of the Chitinid Race

My first work for ss14 and a new Species to play, worker drone ants!

* Removed a uneeded bit

* Removing the displacement section because it still is being weird

Displacement map not working right but not really needed as well so just gonna do without it

* Nukie Steamroll Preventative (#2658)

* Update uplink_catalog.yml

* Update uplink_catalog.yml

* Update uplink_catalog.yml

* Update uplink_catalog.yml

* Automatic changelog update

* most asked for changes

* (hopefully) Fixed Linter Error

* More clean up edits

* 4 space indents!!

* Direction desired name changes + More radiation mechanics

Alienized the names of the little Ants and swapped their naming scheme. Added a radiation healing and purge mechanic to play into the radiation theme more.

* Hopefully final changes!

Adjustment to their resistances to make them less weak to blunt

And the negative of being unable to be injected by normal syringes (hypo and pill gaming)

* Forgot to add access to the new undergarments

* Final Final change (hopefully)

Added a little text pop up for failing to inject them

* Code Tweeks

* Quick Changes

Removed some uneeded comments, removed uneeded Local info

---------

Co-authored-by: rosieposie <[email protected]>
Co-authored-by: Delta-V bot <[email protected]>
  • Loading branch information
3 people authored Jan 23, 2025
1 parent 895aac2 commit 905bc06
Show file tree
Hide file tree
Showing 120 changed files with 1,948 additions and 29 deletions.
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 added Resources/Audio/_DV/Voice/Chitinid/moth_laugh.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/_DV/abilities/chitinid.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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

0 comments on commit 905bc06

Please sign in to comment.