Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SwiftlyS2.Shared.Natives;
using SwiftlyS2.Shared.Players;

namespace SwiftlyS2.Shared.SchemaDefinitions;

Expand All @@ -17,6 +18,12 @@ public partial interface CBaseEntity
/// Gets the absolute rotation of the entity.
/// </summary>
public QAngle? AbsRotation { get; }

/// <summary>
/// Gets the team of the entity.
/// </summary>
public Team Team { get; set; }

/// <summary>
/// Teleports the entity to the specified position, orientation, and velocity.
/// </summary>
Expand All @@ -25,7 +32,7 @@ public partial interface CBaseEntity
/// <param name="position">The target position to move the entity to. If null, the entity's position is not changed.</param>
/// <param name="angle">The target orientation to set for the entity. If null, the entity's orientation is not changed.</param>
/// <param name="velocity">The velocity to apply to the entity after teleportation. If null, the entity's velocity is not changed.</param>
public void Teleport(Vector? position, QAngle? angle, Vector? velocity);
public void Teleport( Vector? position, QAngle? angle, Vector? velocity );


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using SwiftlyS2.Core.Natives;
using SwiftlyS2.Shared.Natives;
using SwiftlyS2.Shared.Players;
using SwiftlyS2.Shared.SchemaDefinitions;

namespace SwiftlyS2.Core.SchemaDefinitions;
Expand All @@ -15,6 +16,11 @@ public CEntitySubclassVDataBase VData {
public Vector? AbsOrigin => CBodyComponent?.SceneNode?.AbsOrigin;
public QAngle? AbsRotation => CBodyComponent?.SceneNode?.AbsRotation;

public Team Team {
get => (Team)TeamNum;
set => TeamNum = (byte)value;
}

public void Teleport( Vector? position, QAngle? angle, Vector? velocity )
{
unsafe
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SwiftlyS2.Shared.Natives;
using SwiftlyS2.Shared.Misc;
using SwiftlyS2.Shared.Natives;
using SwiftlyS2.Shared.SchemaDefinitions;
using SwiftlyS2.Shared.Schemas;

Expand All @@ -19,4 +20,6 @@ public partial interface CCSGameRules
/// <param name="reason">The reason for ending the round</param>
/// <param name="delay">The delay before ending the round</param>
public void TerminateRound( RoundEndReason reason, float delay );

public GamePhase GamePhaseEnum { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SwiftlyS2.Core.Natives;
using SwiftlyS2.Shared.Misc;
using SwiftlyS2.Shared.Natives;
using SwiftlyS2.Shared.SchemaDefinitions;
using SwiftlyS2.Shared.Schemas;
Expand All @@ -17,4 +18,9 @@ public void TerminateRound( RoundEndReason reason, float delay )
{
GameFunctions.TerminateRound(Address, (uint)reason, delay);
}

public GamePhase GamePhaseEnum {
get => (GamePhase)GamePhase;
set => GamePhase = (int)value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace SwiftlyS2.Shared.SchemaDefinitions;

public partial interface CCSObserverPawn
{
public new CCSObserver_ObserverServices? ObserverServices { get; }
public new CCSObserver_MovementServices? MovementServices { get; }
public new CCSObserver_CameraServices? CameraServices { get; }
public new CCSObserver_UseServices? UseServices { get; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using SwiftlyS2.Shared.SchemaDefinitions;

namespace SwiftlyS2.Core.SchemaDefinitions;

internal partial class CCSObserverPawnImpl : CCSObserverPawn
{
public new CCSObserver_ObserverServices? ObserverServices => base.ObserverServices?.As<CCSObserver_ObserverServices>();
public new CCSObserver_MovementServices? MovementServices => base.MovementServices?.As<CCSObserver_MovementServices>();
public new CCSObserver_CameraServices? CameraServices => base.CameraServices?.As<CCSObserver_CameraServices>();
public new CCSObserver_UseServices? UseServices => base.UseServices?.As<CCSObserver_UseServices>();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace SwiftlyS2.Shared.SchemaDefinitions;

public partial interface CCSPlayerPawn
{
public new CCSPlayer_WeaponServices? WeaponServices { get; }
public new CCSPlayer_ItemServices? ItemServices { get; }
public new CCSPlayer_UseServices? UseServices { get; }
public new CCSPlayer_WaterServices? WaterServices { get; }
public new CCSPlayer_MovementServices? MovementServices { get; }
public new CCSPlayer_CameraServices? CameraServices { get; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using SwiftlyS2.Shared.SchemaDefinitions;

namespace SwiftlyS2.Core.SchemaDefinitions;

internal partial class CCSPlayerPawnImpl : CCSPlayerPawn
{
public new CCSPlayer_WeaponServices? WeaponServices => base.WeaponServices?.As<CCSPlayer_WeaponServices>();
public new CCSPlayer_ItemServices? ItemServices => base.ItemServices?.As<CCSPlayer_ItemServices>();
public new CCSPlayer_UseServices? UseServices => base.UseServices?.As<CCSPlayer_UseServices>();
public new CCSPlayer_WaterServices? WaterServices => base.WaterServices?.As<CCSPlayer_WaterServices>();
public new CCSPlayer_MovementServices? MovementServices => base.MovementServices?.As<CCSPlayer_MovementServices>();
public new CCSPlayer_CameraServices? CameraServices => base.CameraServices?.As<CCSPlayer_CameraServices>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public partial interface CCSPlayerPawn : CCSPlayerPawnBase, ISchemaClass<CCSPlay

static CCSPlayerPawn ISchemaClass<CCSPlayerPawn>.From(nint handle) => new CCSPlayerPawnImpl(handle);
static int ISchemaClass<CCSPlayerPawn>.Size => 7280;


public CCSPlayer_BulletServices? BulletServices { get; }

Expand Down
12 changes: 12 additions & 0 deletions managed/src/SwiftlyS2.Shared/Misc/GamePhase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace SwiftlyS2.Shared.Misc;

public enum GamePhase : short
{
GAMEPHASE_WARMUP_ROUND = 0,
GAMEPHASE_PLAYING_STANDARD = 1,
GAMEPHASE_PLAYING_FIRST_HALF = 2,
GAMEPHASE_PLAYING_SECOND_HALF = 3,
GAMEPHASE_HALFTIME = 4,
GAMEPHASE_MATCH_ENDED = 5,
GAMEPHASE_MAX = 6
}
Loading