Skip to content

Class: MockCHelicopter

Mock of the X-Ray engine helicopter object.

Extends

  • MockCGameObject

Implements

  • CHelicopter

Constructors

Constructor

ts
new MockCHelicopter(): MockCHelicopter;

Returns

MockCHelicopter

Inherited from

ts
MockCGameObject.constructor

Methods

create()

ts
static create(health?: number): MockCHelicopter;

Parameters

ParameterTypeDefault value
healthnumber1

Returns

MockCHelicopter

Overrides

ts
MockCGameObject.create

mock()

ts
static mock(health?: number): CHelicopter;

Parameters

ParameterTypeDefault value
healthnumber1

Returns

CHelicopter

Overrides

ts
MockCGameObject.mock

Properties

__name

ts
__name: string = "CGameObject";

LuaBind instance constructor name.

Implementation of

ts
CHelicopter.__name

Inherited from

ts
MockCGameObject.__name

_construct

ts
_construct: MockedFunction<() => DLL_Pure>;

Construct engine-side object state.

Remarks

Lifecycle hook used by the engine. Calling it from gameplay scripts can reinitialize native state unexpectedly.

Returns

Constructed base object.

Implementation of

ts
CHelicopter._construct

Inherited from

ts
MockCGameObject._construct

ClearEnemy

ts
ClearEnemy: Mock<UnknownFunction>;

Clear current enemy target and switch hunt state to CHelicopter.eEnemyNone.

Implementation of

ts
CHelicopter.ClearEnemy

Die

ts
Die: MockedFunction<() => void>;

Switch the helicopter to dead state and enable its falling physics.

Remarks

This stops the engine sound and starts the broken-loop sound, but it is separate from Explode().

Implementation of

ts
CHelicopter.Die

Explode

ts
Explode: MockedFunction<() => void>;

Explode the helicopter.

Implementation of

ts
CHelicopter.Explode

GetBodyState

ts
GetBodyState: MockedFunction<() => TXR_helicopter_body_state>;

Returns

Current body aiming state.

Implementation of

ts
CHelicopter.GetBodyState

GetCurrVelocity

ts
GetCurrVelocity: Mock<() => number>;

Returns

Current scalar velocity.

Implementation of

ts
CHelicopter.GetCurrVelocity

GetCurrVelocityVec

ts
GetCurrVelocityVec: Mock<() => MockVector>;

Returns

Current velocity vector.

Implementation of

ts
CHelicopter.GetCurrVelocityVec

GetDistanceToDestPosition

ts
GetDistanceToDestPosition: Mock<() => number>;

Returns

Distance to destination position.

Implementation of

ts
CHelicopter.GetDistanceToDestPosition

getEnabled

ts
getEnabled: MockedFunction<() => boolean>;

Returns

Whether the object is enabled in the client object loop.

Implementation of

ts
CHelicopter.getEnabled

Inherited from

ts
MockCGameObject.getEnabled

GetfHealth

ts
GetfHealth: Mock<() => number>;

Returns

Helicopter health.

Implementation of

ts
CHelicopter.GetfHealth

GetHuntState

ts
GetHuntState: MockedFunction<() => TXR_helicopter_hunt_state>;

Returns

Current enemy tracking state.

Implementation of

ts
CHelicopter.GetHuntState

GetMaxVelocity

ts
GetMaxVelocity: Mock<() => number>;

Returns

Maximum movement velocity.

Implementation of

ts
CHelicopter.GetMaxVelocity

GetMovementState

ts
GetMovementState: MockedFunction<() => TXR_helicopter_movement_state>;

Returns

Current movement state.

Implementation of

ts
CHelicopter.GetMovementState

GetOnPointRangeDist

ts
GetOnPointRangeDist: MockedFunction<() => number>;

Returns

Distance at which the helicopter treats a point as reached.

Implementation of

ts
CHelicopter.GetOnPointRangeDist

GetRealAltitude

ts
GetRealAltitude: MockedFunction<() => number>;

Returns

Current real altitude above terrain.

Implementation of

ts
CHelicopter.GetRealAltitude

GetSafeAltitude

ts
GetSafeAltitude: MockedFunction<() => number>;

Returns

Safe altitude configured for the movement manager.

Implementation of

ts
CHelicopter.GetSafeAltitude

GetSpeedInDestPoint

ts
GetSpeedInDestPoint: MockedFunction<(value: number) => number>;

Get desired speed near the destination point.

Remarks

The native binding requires one numeric argument, but the implementation ignores it and returns the configured destination speed.

Param

value

Ignored by native code.

Returns

Speed used near the destination point.

Implementation of

ts
CHelicopter.GetSpeedInDestPoint

GetState

ts
GetState: MockedFunction<() => TXR_helicopter_state>;

Returns

Alive/dead state.

Implementation of

ts
CHelicopter.GetState

getVisible

ts
getVisible: MockedFunction<() => boolean>;

Returns

Whether the object is visible.

Implementation of

ts
CHelicopter.getVisible

Inherited from

ts
MockCGameObject.getVisible

GoPatrolByPatrolPath

ts
GoPatrolByPatrolPath: MockedFunction<(path_name: string, start_point: number) => void>;

Move by a named patrol path and switch movement state to CHelicopter.eMovPatrolPath.

Param

path_name

Patrol path name.

Param

start_point

Starting patrol vertex id.

Implementation of

ts
CHelicopter.GoPatrolByPatrolPath

GoPatrolByRoundPath

ts
GoPatrolByRoundPath: Mock<UnknownFunction>;

Move around a point by a generated round patrol path and switch movement state to CHelicopter.eMovRoundPath.

Remarks

Native code refuses radii smaller than the current speed and angular-speed constraints allow.

Param

center

Round path center.

Param

radius

Path radius.

Param

clockwise

Whether to move clockwise.

Implementation of

ts
CHelicopter.GoPatrolByRoundPath

health

ts
health: number = 1;

isVisible

ts
isVisible: Mock<() => boolean>;

Check whether an object is visible to the helicopter.

Param

game_object

Object to test.

Returns

Whether the object is visible.

Implementation of

ts
CHelicopter.isVisible

LookAtPoint

ts
LookAtPoint: Mock<UnknownFunction>;

Aim the helicopter body at a point or return aiming to path direction.

Remarks

Native code treats the boolean as an enable flag: true switches body state to eBodyToPoint, while false switches it back to eBodyByPath.

Param

position

Point to look at when enabled.

Param

is_smooth

Whether point aiming is enabled.

Implementation of

ts
CHelicopter.LookAtPoint

m_dead

ts
m_dead: boolean = false;

Whether the helicopter is marked dead.

Implementation of

ts
CHelicopter.m_dead

m_exploded

ts
m_exploded: boolean = false;

Whether the helicopter explosion has already been triggered.

Implementation of

ts
CHelicopter.m_exploded

m_flame_started

ts
m_flame_started: boolean = false;

Whether flame effects are currently started.

Implementation of

ts
CHelicopter.m_flame_started

m_light_started

ts
m_light_started: boolean = false;

Whether helicopter lights are currently started.

Implementation of

ts
CHelicopter.m_light_started

m_max_mgun_dist

ts
m_max_mgun_dist: number = 0;

Maximum machine-gun attack distance.

Implementation of

ts
CHelicopter.m_max_mgun_dist

m_max_rocket_dist

ts
m_max_rocket_dist: number = 0;

Maximum rocket attack distance.

Implementation of

ts
CHelicopter.m_max_rocket_dist

m_min_mgun_dist

ts
m_min_mgun_dist: number = 0;

Minimum machine-gun attack distance.

Implementation of

ts
CHelicopter.m_min_mgun_dist

m_min_rocket_dist

ts
m_min_rocket_dist: number = 0;

Minimum rocket attack distance.

Implementation of

ts
CHelicopter.m_min_rocket_dist

m_syncronize_rocket

ts
m_syncronize_rocket: boolean = false;

Whether rocket firing is synchronized with the helicopter attack logic.

Implementation of

ts
CHelicopter.m_syncronize_rocket

m_time_between_rocket_attack

ts
m_time_between_rocket_attack: number = 0;

Delay between rocket attacks.

Implementation of

ts
CHelicopter.m_time_between_rocket_attack

m_use_mgun_on_attack

ts
m_use_mgun_on_attack: boolean = false;

Whether machine-gun attacks are enabled.

Implementation of

ts
CHelicopter.m_use_mgun_on_attack

m_use_rocket_on_attack

ts
m_use_rocket_on_attack: boolean = false;

Whether rocket attacks are enabled.

Implementation of

ts
CHelicopter.m_use_rocket_on_attack

net_Export

ts
net_Export: MockedFunction<(net_packet: net_packet) => void>;

Export network state to a packet.

Param

net_packet

Destination network packet.

Implementation of

ts
CHelicopter.net_Export

Inherited from

ts
MockCGameObject.net_Export

net_Import

ts
net_Import: MockedFunction<(net_packet: net_packet) => void>;

Import network state from a packet.

Param

net_packet

Source network packet.

Implementation of

ts
CHelicopter.net_Import

Inherited from

ts
MockCGameObject.net_Import

net_Spawn

ts
net_Spawn: MockedFunction<(cse_abstract: cse_abstract) => boolean>;

Spawn the client object from its server object.

Remarks

Lifecycle hook used during network spawn. Return false to reject spawn in custom subclasses.

Param

cse_abstract

Server object used for spawn data.

Returns

Whether spawn succeeded.

Implementation of

ts
CHelicopter.net_Spawn

Inherited from

ts
MockCGameObject.net_Spawn

SetBarrelDirTolerance

ts
SetBarrelDirTolerance: MockedFunction<(value: number) => void>;

Set allowed barrel direction tolerance.

Param

value

Tolerance value.

Implementation of

ts
CHelicopter.SetBarrelDirTolerance

SetDestPosition

ts
SetDestPosition: Mock<UnknownFunction>;

Set movement destination and switch movement state to CHelicopter.eMovToPoint.

Param

position

Destination world position.

Implementation of

ts
CHelicopter.SetDestPosition

SetEnemy

ts
SetEnemy: Mock<UnknownFunction>;

Track an enemy object by its engine id.

Remarks

Passing nullish values is not safe for the native object overload. Use ClearEnemy() to clear the current enemy.

Param

game_object

Enemy object to track.

Implementation of

ts
CHelicopter.SetEnemy

SetfHealth

ts
SetfHealth: Mock<(health: number) => number>;

Set helicopter health.

Param

health

New health value.

Returns

Applied health value.

Implementation of

ts
CHelicopter.SetfHealth

SetFireTrailLength

ts
SetFireTrailLength: MockedFunction<(value: number) => void>;

Set fire trail length.

Param

value

Trail length.

Implementation of

ts
CHelicopter.SetFireTrailLength

SetLinearAcc

ts
SetLinearAcc: Mock<UnknownFunction>;

Set forward and braking linear acceleration values.

Param

min

Forward acceleration.

Param

max

Braking acceleration.

Implementation of

ts
CHelicopter.SetLinearAcc

SetMaxVelocity

ts
SetMaxVelocity: Mock<UnknownFunction>;

Set maximum movement velocity.

Param

value

Maximum velocity.

Implementation of

ts
CHelicopter.SetMaxVelocity

SetOnPointRangeDist

ts
SetOnPointRangeDist: MockedFunction<(distance: number) => void>;

Set point reach distance.

Param

distance

Reach distance.

Implementation of

ts
CHelicopter.SetOnPointRangeDist

SetSpeedInDestPoint

ts
SetSpeedInDestPoint: Mock<UnknownFunction>;

Set desired speed near the destination point.

Remarks

Used by the movement manager while approaching the current destination or patrol point.

Param

value

Speed value.

Implementation of

ts
CHelicopter.SetSpeedInDestPoint

StartFlame

ts
StartFlame: MockedFunction<() => void>;

Start smoke/flame particle effects if they are not already active.

Implementation of

ts
CHelicopter.StartFlame

TurnEngineSound

ts
TurnEngineSound: Mock<UnknownFunction>;

Turn engine sound on or off.

Param

enabled

New sound state.

Implementation of

ts
CHelicopter.TurnEngineSound

TurnLighting

ts
TurnLighting: MockedFunction<(is_enabled: boolean) => void>;

Turn helicopter lighting on or off.

Param

is_enabled

New lighting state.

Implementation of

ts
CHelicopter.TurnLighting

use

ts
use: MockedFunction<(object: CGameObject) => boolean>;

Use another object through the engine interaction path.

Param

object

Object being used.

Returns

Whether the use action was handled.

Implementation of

ts
CHelicopter.use

Inherited from

ts
MockCGameObject.use

UseFireTrail

ts
UseFireTrail: MockedFunction<{
  (): boolean;
  (is_enabled: boolean): void;
}>;

Returns

Whether fire trail rendering is enabled.

Implementation of

ts
CHelicopter.UseFireTrail

velocity

ts
velocity: number = 10;

velocityVector

ts
velocityVector: MockVector;

Visual

ts
Visual: MockedFunction<() => IXR_IRender_Visual>;

Returns

Render visual assigned to the object.

Implementation of

ts
CHelicopter.Visual

Inherited from

ts
MockCGameObject.Visual