feat(hs): raise statue HP, transform players in-battle, per-player team roster packet, drop wing-unequip

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Acentech Dev
2026-07-21 10:24:54 +03:00
parent 7aae9dff0c
commit 1e8478fe70
9 changed files with 511 additions and 95 deletions

View File

@@ -29255,3 +29255,130 @@ public readonly ref struct HeykelSavasiHudStateRef
/// <returns>The packet as byte span.</returns>
public static implicit operator Span<byte>(HeykelSavasiHudStateRef packet) => packet._data;
}
/// <summary>
/// Is sent by the server when: Periodically (about once every one to two seconds) while the Heykel Savasi (Statue War) event is open for registration, in its pre-battle countdown, or being played.
/// Causes reaction on client side: The client tints each listed nearby player red or blue according to its team.
/// </summary>
public readonly ref struct HeykelSavasiTeamRosterRef
{
private readonly Span<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiTeamRosterRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public HeykelSavasiTeamRosterRef(Span<byte> data)
: this(data, true)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiTeamRosterRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
/// <param name="initialize">If set to <c>true</c>, the header data is automatically initialized and written to the underlying span.</param>
private HeykelSavasiTeamRosterRef(Span<byte> data, bool initialize)
{
this._data = data;
if (initialize)
{
var header = this.Header;
header.Type = HeaderType;
header.Code = Code;
header.Length = (byte)data.Length;
}
}
/// <summary>
/// Gets the header type of this data packet.
/// </summary>
public static byte HeaderType => 0xC1;
/// <summary>
/// Gets the operation code of this data packet.
/// </summary>
public static byte Code => 0xFC;
/// <summary>
/// Gets the header of this packet.
/// </summary>
public C1HeaderRef Header => new (this._data);
/// <summary>
/// Gets or sets the number of player-team entries which follow.
/// </summary>
public byte Count
{
get => this._data[3];
set => this._data[3] = value;
}
/// <summary>
/// Gets the <see cref="PlayerTeamRef"/> of the specified index.
/// </summary>
public PlayerTeamRef this[int index] => new (this._data[(4 + index * PlayerTeamRef.Length)..]);
/// <summary>
/// Performs an implicit conversion from a Span of bytes to a <see cref="HeykelSavasiTeamRoster"/>.
/// </summary>
/// <param name="packet">The packet as span.</param>
/// <returns>The packet as struct.</returns>
public static implicit operator HeykelSavasiTeamRosterRef(Span<byte> packet) => new (packet, false);
/// <summary>
/// Performs an implicit conversion from <see cref="HeykelSavasiTeamRoster"/> to a Span of bytes.
/// </summary>
/// <param name="packet">The packet as struct.</param>
/// <returns>The packet as byte span.</returns>
public static implicit operator Span<byte>(HeykelSavasiTeamRosterRef packet) => packet._data;
/// <summary>
/// Calculates the size of the packet for the specified count of <see cref="PlayerTeamRef"/>.
/// </summary>
/// <param name="playersCount">The count of <see cref="PlayerTeamRef"/> from which the size will be calculated.</param>
public static int GetRequiredSize(int playersCount) => playersCount * PlayerTeamRef.Length + 4;
/// <summary>
/// Maps a player's network id to its Heykel Savasi team..
/// </summary>
public readonly ref struct PlayerTeamRef
{
private readonly Span<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="PlayerTeamRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public PlayerTeamRef(Span<byte> data)
{
this._data = data;
}
/// <summary>
/// Gets the initial length of this data packet. When the size is dynamic, this value may be bigger than actually needed.
/// </summary>
public static int Length => 3;
/// <summary>
/// Gets or sets the network id of the player (same id used in the viewport/appearance packets).
/// </summary>
public ushort PlayerId
{
get => ReadUInt16BigEndian(this._data);
set => WriteUInt16BigEndian(this._data, value);
}
/// <summary>
/// Gets or sets 1 = red, 2 = blue.
/// </summary>
public byte Team
{
get => this._data[2];
set => this._data[2] = value;
}
}
}