first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using NitroxClient.Communication.Abstract;
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.MonoBehaviours;
using NitroxModel.Packets;
using NitroxModel_Subnautica.DataStructures;
using UnityEngine;
namespace NitroxClient.Communication.Packets.Processors
{
public class SeamothModuleActionProcessor : ClientPacketProcessor<SeamothModulesAction>
{
private readonly IPacketSender packetSender;
public SeamothModuleActionProcessor(IPacketSender packetSender)
{
this.packetSender = packetSender;
}
public override void Process(SeamothModulesAction packet)
{
using (PacketSuppressor<SeamothModulesAction>.Suppress())
{
GameObject _gameObject = NitroxEntity.RequireObjectFrom(packet.Id);
SeaMoth seamoth = _gameObject.GetComponent<SeaMoth>();
if (seamoth != null)
{
TechType techType = packet.TechType.ToUnity();
if (techType == TechType.SeamothElectricalDefense)
{
float[] chargearray = seamoth.quickSlotCharge;
float charge = chargearray[packet.SlotID];
float slotCharge = seamoth.GetSlotCharge(packet.SlotID);
GameObject gameObject = global::Utils.SpawnZeroedAt(seamoth.seamothElectricalDefensePrefab, seamoth.transform, false);
ElectricalDefense component = gameObject.GetComponent<ElectricalDefense>();
component.charge = charge;
component.chargeScalar = slotCharge;
}
}
}
}
}
}