first commit
This commit is contained in:
49
NitroxModel-Subnautica/Packets/CyclopsDamage.cs
Normal file
49
NitroxModel-Subnautica/Packets/CyclopsDamage.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using NitroxModel.DataStructures;
|
||||
using NitroxModel.Packets;
|
||||
using NitroxModel_Subnautica.DataStructures.GameLogic;
|
||||
|
||||
namespace NitroxModel_Subnautica.Packets
|
||||
{
|
||||
/// <summary>
|
||||
/// A state update packet for the Cyclops that could be sent due to a <see cref="CyclopsDamagePoint"/> create/repair, <see cref="SubFire"/> create/extinguish,
|
||||
/// or a general Cyclops health change. A health change to 0 means the Cyclops has been destroyed.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class CyclopsDamage : Packet
|
||||
{
|
||||
public NitroxId Id { get; }
|
||||
public float SubHealth { get; }
|
||||
public float DamageManagerHealth { get; }
|
||||
public float SubFireHealth { get; }
|
||||
public int[] DamagePointIndexes { get; }
|
||||
public CyclopsFireData[] RoomFires { get; }
|
||||
public CyclopsDamageInfoData DamageInfo { get; }
|
||||
|
||||
/// <param name="id"><see cref="SubRoot"/> Id.</param>
|
||||
/// <param name="subHealth"><see cref="SubRoot.liveMixin.health"/>.</param>
|
||||
/// <param name="damageManagerHealth"><see cref="CyclopsExternalDamageManager.subLiveMixin.health"/>.</param>
|
||||
/// <param name="subFireHealth"><see cref="SubFire.liveMixin.health"/>.</param>
|
||||
/// <param name="damagePointIndexes"><see cref="CyclopsExternalDamageManager.damagePoints"/> where <see cref="GameObject.activeSelf"/>.
|
||||
/// Null if only a Cyclops health change.</param>
|
||||
/// <param name="roomFires"><see cref="SubFire.RoomFire.spawnNodes"/> where <see cref="Transform.childCount"/> > 0.
|
||||
/// Null if only a Cyclops health change.</param>
|
||||
/// <param name="damageInfo">Null if a repair or extinguish.</param>
|
||||
public CyclopsDamage(NitroxId id, float subHealth, float damageManagerHealth, float subFireHealth, int[] damagePointIndexes, CyclopsFireData[] roomFires, CyclopsDamageInfoData damageInfo = null)
|
||||
{
|
||||
Id = id;
|
||||
SubHealth = subHealth;
|
||||
DamageManagerHealth = damageManagerHealth;
|
||||
SubFireHealth = subFireHealth;
|
||||
DamagePointIndexes = damagePointIndexes;
|
||||
RoomFires = roomFires;
|
||||
DamageInfo = damageInfo;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[CyclopsDamage - Id: {Id}, SubHealth: {SubHealth}, DamageManagerHealth: {DamageManagerHealth}, SubFireHealth: {SubFireHealth}{(DamagePointIndexes == null ? "" : $" DamagePointIndexes: {string.Join(", ", DamagePointIndexes.Select(x => x.ToString()).ToArray())}")}{(RoomFires == null ? "" : $" RoomFires: {string.Join(", ", RoomFires.Select(x => x.ToString()).ToArray())}")}{(DamageInfo == null ? "" : $" DamageInfo: DealerId: {DamageInfo?.DealerId}")}";
|
||||
}
|
||||
}
|
||||
}
|
28
NitroxModel-Subnautica/Packets/CyclopsDamagePointRepaired.cs
Normal file
28
NitroxModel-Subnautica/Packets/CyclopsDamagePointRepaired.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using NitroxModel.DataStructures;
|
||||
using NitroxModel.Packets;
|
||||
|
||||
namespace NitroxModel_Subnautica.Packets
|
||||
{
|
||||
[Serializable]
|
||||
public class CyclopsDamagePointRepaired : Packet
|
||||
{
|
||||
public NitroxId Id { get; }
|
||||
public int DamagePointIndex { get; }
|
||||
public float RepairAmount { get; }
|
||||
|
||||
/// <param name="id">The Cyclops id</param>
|
||||
/// <param name="repairAmount">The amount to repair the damage by. A large repair amount is passed if the point is meant to be fully repaired</param>
|
||||
public CyclopsDamagePointRepaired(NitroxId id, int damagePointIndex, float repairAmount)
|
||||
{
|
||||
Id = id;
|
||||
DamagePointIndex = damagePointIndex;
|
||||
RepairAmount = repairAmount;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[CyclopsDamagePointRepaired - Id: {Id}, DamagePointIndex: {DamagePointIndex}, RepairAmount: {RepairAmount}]";
|
||||
}
|
||||
}
|
||||
}
|
22
NitroxModel-Subnautica/Packets/CyclopsDecoyLaunch.cs
Normal file
22
NitroxModel-Subnautica/Packets/CyclopsDecoyLaunch.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using NitroxModel.DataStructures;
|
||||
using NitroxModel.Packets;
|
||||
|
||||
namespace NitroxModel_Subnautica.Packets
|
||||
{
|
||||
[Serializable]
|
||||
public class CyclopsDecoyLaunch : Packet
|
||||
{
|
||||
public NitroxId Id { get; }
|
||||
|
||||
public CyclopsDecoyLaunch(NitroxId id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[CyclopsDecoyLaunch - Id: {Id}]";
|
||||
}
|
||||
}
|
||||
}
|
32
NitroxModel-Subnautica/Packets/CyclopsFireCreated.cs
Normal file
32
NitroxModel-Subnautica/Packets/CyclopsFireCreated.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using NitroxModel.DataStructures;
|
||||
using NitroxModel.Packets;
|
||||
using NitroxModel_Subnautica.DataStructures.GameLogic;
|
||||
|
||||
namespace NitroxModel_Subnautica.Packets
|
||||
{
|
||||
/// <summary>
|
||||
/// Triggered when a fire has been created in <see cref="SubFire.CreateFire(SubFire.RoomFire)"/>
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class CyclopsFireCreated : Packet
|
||||
{
|
||||
public CyclopsFireData FireCreatedData { get; }
|
||||
|
||||
public CyclopsFireCreated(NitroxId id, NitroxId cyclopsId, CyclopsRooms room, int nodeIndex)
|
||||
{
|
||||
FireCreatedData = new CyclopsFireData(id, cyclopsId, room, nodeIndex);
|
||||
}
|
||||
|
||||
/// <remarks>Used for deserialization</remarks>
|
||||
public CyclopsFireCreated(CyclopsFireData fireCreatedData)
|
||||
{
|
||||
FireCreatedData = fireCreatedData;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[CyclopsFireCreated - {FireCreatedData}]";
|
||||
}
|
||||
}
|
||||
}
|
23
NitroxModel-Subnautica/Packets/CyclopsFireSuppression.cs
Normal file
23
NitroxModel-Subnautica/Packets/CyclopsFireSuppression.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using NitroxModel.DataStructures;
|
||||
using NitroxModel.Packets;
|
||||
|
||||
namespace NitroxModel_Subnautica.Packets
|
||||
{
|
||||
[Serializable]
|
||||
public class CyclopsFireSuppression : Packet
|
||||
{
|
||||
public NitroxId Id { get; }
|
||||
|
||||
public CyclopsFireSuppression(NitroxId id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[CyclopsFireSuppressionSystem - Id: {Id}]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
39
NitroxModel-Subnautica/Packets/ExosuitArmActionPacket.cs
Normal file
39
NitroxModel-Subnautica/Packets/ExosuitArmActionPacket.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using NitroxModel.DataStructures;
|
||||
using NitroxModel.DataStructures.Unity;
|
||||
using NitroxModel.Packets;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NitroxModel_Subnautica.Packets
|
||||
{
|
||||
[Serializable]
|
||||
public class ExosuitArmActionPacket : Packet
|
||||
{
|
||||
public TechType TechType { get; }
|
||||
public NitroxId ArmId { get; }
|
||||
public ExosuitArmAction ArmAction { get; }
|
||||
public NitroxVector3? OpVector { get; }
|
||||
public NitroxQuaternion? OpRotation { get; }
|
||||
|
||||
public ExosuitArmActionPacket(TechType techType, NitroxId armId, ExosuitArmAction armAction, NitroxVector3? opVector, NitroxQuaternion? opRotation)
|
||||
{
|
||||
TechType = techType;
|
||||
ArmId = armId;
|
||||
ArmAction = armAction;
|
||||
OpVector = opVector;
|
||||
OpRotation = opRotation;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[ExosuitArmAction - TechType: {TechType}, ArmId:{ArmId}, ArmAction: {ArmAction}, Vector: {OpVector}, Rotation: {OpRotation}]";
|
||||
}
|
||||
}
|
||||
|
||||
public enum ExosuitArmAction
|
||||
{
|
||||
START_USE_TOOL,
|
||||
END_USE_TOOL,
|
||||
ALT_HIT
|
||||
}
|
||||
}
|
16
NitroxModel-Subnautica/Packets/RocketLaunch.cs
Normal file
16
NitroxModel-Subnautica/Packets/RocketLaunch.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using NitroxModel.DataStructures;
|
||||
using NitroxModel.Packets;
|
||||
|
||||
namespace NitroxModel_Subnautica.Packets;
|
||||
|
||||
[Serializable]
|
||||
public class RocketLaunch : Packet
|
||||
{
|
||||
public NitroxId RocketId { get; }
|
||||
|
||||
public RocketLaunch(NitroxId rocketId)
|
||||
{
|
||||
RocketId = rocketId;
|
||||
}
|
||||
}
|
19
NitroxModel-Subnautica/Packets/RocketResync.cs
Normal file
19
NitroxModel-Subnautica/Packets/RocketResync.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NitroxModel.DataStructures;
|
||||
using NitroxModel.Packets;
|
||||
|
||||
namespace NitroxModel_Subnautica.Packets;
|
||||
|
||||
[Serializable]
|
||||
public class RocketResync : Packet
|
||||
{
|
||||
public NitroxId RocketId { get; }
|
||||
public List<PreflightCheck> PreflightChecks { get; }
|
||||
|
||||
public RocketResync(NitroxId rocketId, List<PreflightCheck> preflightChecks)
|
||||
{
|
||||
RocketId = rocketId;
|
||||
PreflightChecks = preflightChecks;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user