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 26 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))
{
Popup.PopupEntity(Loc.GetString("injector-component-deny-user"), target, user);
return;
}
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved

// 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))
return false;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved

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;
32 changes: 32 additions & 0 deletions Content.Server/_DV/Abilities/Chitinid/ChitinidComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved

namespace Content.Server.Abilities.Chitinid;


ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
[RegisterComponent]
public sealed partial class ChitinidComponent : Component
{
[DataField("ChitzitePrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string ChitzitePrototype = "Chitzite";
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved

[DataField("ChitziteActionId",
customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? ChitziteActionId = "ActionChitzite";
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved

[DataField("ChitziteAction")]
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
public EntityUid? ChitziteAction;

[DataField]
public float AmountAbsorbed { get; set; } = 0f;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved

[DataField]
public float MaximumAbsorbed = 30f;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved

[DataField]
public TimeSpan UpdateInterval { get; set; } = TimeSpan.FromSeconds(1);
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved

[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan NextUpdate;
}
123 changes: 123 additions & 0 deletions Content.Server/_DV/Abilities/Chitinid/ChitinidSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
using Content.Server.Abilities.Felinid;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
using Content.Server.Chat.Systems;
using Content.Server.Nutrition.Components;
using Content.Server.Popups;
using Content.Shared.Actions;
using Content.Shared.Actions.Events;
using Content.Shared.Audio;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.IdentityManagement;
using Content.Shared.Inventory;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Systems;
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 _actionsSystem = default!;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
[Dependency] private readonly PopupSystem _popupSystem = default!;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
[Dependency] private readonly InventorySystem _inventorySystem = default!;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
[Dependency] private readonly IGameTiming _gameTiming = default!;
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ChitinidComponent, ComponentInit>(OnInit);
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
SubscribeLocalEvent<ChitinidComponent,ChitziteActionEvent>(OnChitzite);
SubscribeLocalEvent<ChitinidComponent,MapInitEvent>(OnMapInit);
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
}

private Queue<EntityUid> RemQueue = new();
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved


public override void Update(float frameTime)
{
base.Update(frameTime);
foreach (var bug in RemQueue)
{
RemComp<CoughingUpChitziteComponent>(bug);
}
RemQueue.Clear();
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved

var query = EntityQueryEnumerator<ChitinidComponent, DamageableComponent>();
while (query.MoveNext(out var uid, out var chitinid, out var damageable))
{
if (_gameTiming.CurTime < chitinid.NextUpdate)
continue;

chitinid.NextUpdate += chitinid.UpdateInterval;

if (chitinid.AmountAbsorbed >= chitinid.MaximumAbsorbed && !_mobState.IsDead(uid))
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
continue;

var damage = new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>("Radiation"), -0.5);
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
var delta = _damageable.TryChangeDamage(uid, damage);
if (delta != null)
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
{
chitinid.AmountAbsorbed += -(delta.GetTotal().Float());
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
if (chitinid.ChitziteAction != null && chitinid.AmountAbsorbed >= chitinid.MaximumAbsorbed)
{
_actionsSystem.SetCharges(chitinid.ChitziteAction, 1); // You get the charge back and that's it. Tough.
_actionsSystem.SetEnabled(chitinid.ChitziteAction, true);
}
}
}

foreach (var (chitziteComponent, chitinidComponent) in EntityQuery<CoughingUpChitziteComponent, ChitinidComponent>())
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
{
chitziteComponent.Accumulator += frameTime;
if (chitziteComponent.Accumulator < chitziteComponent.CoughUpTime.TotalSeconds)
continue;

chitziteComponent.Accumulator = 0;
SpawnChitzite(chitziteComponent.Owner, chitinidComponent);
RemQueue.Enqueue(chitziteComponent.Owner);
}
}

private void OnMapInit(Entity<ChitinidComponent> ent, ref MapInitEvent args)
{
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.UpdateInterval;
}

private void OnInit(EntityUid uid, ChitinidComponent component, ComponentInit args)
{
if (component.ChitziteAction != null)
return;

_actionsSystem.AddAction(uid, ref component.ChitziteAction, component.ChitziteActionId);
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
}

private void OnChitzite(EntityUid uid, ChitinidComponent component, ChitziteActionEvent args)
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
{
if (_inventorySystem.TryGetSlotEntity(uid, "mask", out var maskUid) &&
EntityManager.TryGetComponent<IngestionBlockerComponent>(maskUid, out var blocker) &&
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
blocker.Enabled)
{
_popupSystem.PopupEntity(Loc.GetString("chitzite-mask", ("mask", maskUid)), uid, uid);
return;
}

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

EnsureComp<CoughingUpChitziteComponent>(uid);
args.Handled = true;
}

private void SpawnChitzite(EntityUid uid, ChitinidComponent component)
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
{
var chitzite = EntityManager.SpawnEntity(component.ChitzitePrototype, Transform(uid).Coordinates);
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
component.AmountAbsorbed = 0f;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Server.Abilities.Chitinid;

[RegisterComponent]
public sealed partial class CoughingUpChitziteComponent : Component
{
[DataField("accumulator")]
public float Accumulator = 0f;

[DataField("coughUpTime")]
ElusiveCoin marked this conversation as resolved.
Show resolved Hide resolved
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)
Loading
Loading