Ling update (#183)

* - add: Augmented Eyesight.

* - add: Dissonant Shriek.

* - tweak: Nuke use delays.

* - tweak: Tweak chemical regeneration and chemical costs.

* - add: Add chitinous helmet.

* - fix: Fix chem regeneration while dead.

* - tweak: Faster fleshmend.

* - add: Void Adaptation.

* - tweak: No lesser form delay.

* - tweak: Lesser form tweaks.

* - tweak: Stasis doafter is hidden now.

* - add: Refund after absorbing.

* - tweak: Some tweaks.
This commit is contained in:
Aviu00
2024-03-14 01:19:30 +09:00
committed by GitHub
parent 83c3df1593
commit c05a1d09c2
33 changed files with 529 additions and 130 deletions

View File

@@ -1,4 +1,4 @@
using Content.Shared.Humanoid;
using Content.Shared.Humanoid;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
@@ -9,7 +9,7 @@ namespace Content.Shared.Changeling;
public sealed partial class ChangelingComponent : Component
{
[DataField("chemRegenRate")]
public int ChemicalRegenRate = 2;
public int ChemicalRegenRate = 4;
[DataField("chemicalCap")]
public int ChemicalCapacity = 75;
@@ -24,7 +24,7 @@ public sealed partial class ChangelingComponent : Component
public float Accumulator;
[ViewVariables(VVAccess.ReadOnly)]
public float UpdateDelay = 6f;
public float UpdateDelay = 4f;
[ViewVariables(VVAccess.ReadOnly)]
public bool IsRegenerating;
@@ -48,13 +48,13 @@ public sealed partial class ChangelingComponent : Component
public float AbsorbDnaDelay = 10f;
[ViewVariables(VVAccess.ReadWrite), DataField("TransformDelay")]
public float TransformDelay = 2f;
public float TransformDelay;
[ViewVariables(VVAccess.ReadWrite), DataField("RegenerateDelay")]
public float RegenerateDelay = 60f;
[ViewVariables(VVAccess.ReadWrite), DataField("LesserFormDelay")]
public float LesserFormDelay = 5f;
public float LesserFormDelay;
public bool IsInited;
}

View File

@@ -1,4 +1,5 @@
using Content.Shared.Alert;
using Content.Shared.Alert;
using Content.Shared.Inventory;
using Content.Shared.Mobs.Systems;
using Robust.Shared.Network;
@@ -10,24 +11,38 @@ public sealed class ChemicalsSystem : EntitySystem
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
[Dependency] private readonly INetManager _net = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ClothingModifyChemicalRegenComponent, InventoryRelayedEvent<ChemRegenModifyEvent>>(
OnChemRegenModify);
SubscribeLocalEvent<VoidAdaptationComponent, ChemRegenModifyEvent>(OnVoidAdaptationChemRegenModify);
}
private void OnVoidAdaptationChemRegenModify(Entity<VoidAdaptationComponent> ent, ref ChemRegenModifyEvent args)
{
args.Multiplier *= ent.Comp.ChemMultiplier;
ent.Comp.ChemMultiplier = 1f;
}
private void OnChemRegenModify(Entity<ClothingModifyChemicalRegenComponent> ent,
ref InventoryRelayedEvent<ChemRegenModifyEvent> args)
{
args.Args.Multiplier *= ent.Comp.Multiplier;
}
public bool AddChemicals(EntityUid uid, ChangelingComponent component, int quantity)
{
var capacity = component.ChemicalCapacity;
if (_mobStateSystem.IsDead(uid))
capacity /= 2;
if (component.ChemicalsBalance >= capacity)
return false;
var toAdd = quantity;
component.ChemicalsBalance = Math.Min(component.ChemicalsBalance + quantity, capacity);
if (component.ChemicalsBalance == component.ChemicalCapacity)
return false;
if (component.ChemicalsBalance + toAdd > component.ChemicalCapacity)
{
var overflow = component.ChemicalsBalance + toAdd - component.ChemicalCapacity;
toAdd -= overflow;
component.ChemicalsBalance += toAdd;
}
component.ChemicalsBalance += toAdd;
Dirty(uid, component);
UpdateAlert(uid, component);
@@ -69,11 +84,11 @@ public sealed class ChemicalsSystem : EntitySystem
if(component.Accumulator < component.UpdateDelay)
continue;
if (component.IsRegenerating)
continue;
component.Accumulator = 0;
AddChemicals(uid, component, component.ChemicalRegenRate);
var ev = new ChemRegenModifyEvent();
RaiseLocalEvent(uid, ev);
var chemicals = (int) MathF.Round(component.ChemicalRegenRate * ev.Multiplier);
AddChemicals(uid, component, chemicals);
}
}

View File

@@ -0,0 +1,8 @@
namespace Content.Shared.Changeling;
[RegisterComponent]
public sealed partial class ClothingModifyChemicalRegenComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float Multiplier = 0.75f;
}

View File

@@ -0,0 +1,6 @@
namespace Content.Shared.Changeling;
[RegisterComponent]
public sealed partial class DeleteOnChangelingRefundComponent : Component
{
}

View File

@@ -1,5 +1,6 @@
using Content.Shared.Actions;
using Content.Shared.Actions;
using Content.Shared.DoAfter;
using Content.Shared.Inventory;
using Robust.Shared.Serialization;
namespace Content.Shared.Changeling;
@@ -97,3 +98,34 @@ public sealed partial class BiodegradeActionEvent : InstantActionEvent
{
}
public sealed partial class AugmentedEyesightActionEvent : InstantActionEvent
{
}
[Serializable, NetSerializable]
public sealed class AugmentedEyesightPurchasedEvent : EntityEventArgs
{
}
public sealed partial class DissonantShriekActionEvent : InstantActionEvent
{
}
[Serializable, NetSerializable]
public sealed class VoidAdaptationPurchasedEvent : EntityEventArgs
{
}
public sealed class ChemRegenModifyEvent : EntityEventArgs, IInventoryRelayEvent
{
public SlotFlags TargetSlots => ~SlotFlags.POCKET;
public float Multiplier = 1f;
}
public sealed class ChangelingRefundEvent : EntityEventArgs, IInventoryRelayEvent
{
public SlotFlags TargetSlots => SlotFlags.All;
public EntityUid Store;
}

View File

@@ -0,0 +1,7 @@
namespace Content.Shared.Changeling;
[RegisterComponent]
public sealed partial class VoidAdaptationComponent : Component
{
public float ChemMultiplier = 1f;
}