importonly abstract class IGodModeSystem extends IReplicatedGameSystem
{
}

importonly final abstract class GodModeSystem extends IGodModeSystem
{
	public import function AddGodMode( entID : EntityID, gmType : gameGodModeType, sourceInfo : CName ) : Bool;
	public import function RemoveGodMode( entID : EntityID, gmType : gameGodModeType, sourceInfo : CName ) : Bool;
	public import function HasGodMode( entID : EntityID, gmType : gameGodModeType ) : Bool;
	public import function GetGodModeCount( entID : EntityID, gmType : gameGodModeType ) : Uint32;
	public import function GetGodModeSources( entID : EntityID, gmType : gameGodModeType ) : array< CName >;
	public import function ClearGodMode( entID : EntityID, sourceInfo : CName );
	public import function EnableOverride( entID : EntityID, gmType : gameGodModeType, sourceInfo : CName ) : Bool;
	public import function DisableOverride( entID : EntityID, sourceInfo : CName ) : Bool;
}

function GetImmortality( gameObject : GameObject, out type : gameGodModeType ) : Bool
{
	var godMode : GodModeSystem;
	var entityID : EntityID;
	godMode = GameInstance.GetGodModeSystem( gameObject.GetGame() );
	entityID = gameObject.GetEntityID();
	if( !( gameObject ) || !( godMode ) )
	{
		return false;
	}
	type = gameGodModeType.Invulnerable;
	if( godMode.HasGodMode( entityID, type ) )
	{
		return true;
	}
	type = gameGodModeType.Immortal;
	if( godMode.HasGodMode( entityID, type ) )
	{
		return true;
	}
	return false;
}

