Class: MockCHelicopter
Mock of the X-Ray engine helicopter object.
Extends
MockCGameObject
Implements
CHelicopter
Constructors
Constructor
new MockCHelicopter(): MockCHelicopter;Returns
MockCHelicopter
Inherited from
MockCGameObject.constructorMethods
create()
static create(health?: number): MockCHelicopter;Parameters
| Parameter | Type | Default value |
|---|---|---|
health | number | 1 |
Returns
MockCHelicopter
Overrides
MockCGameObject.createmock()
static mock(health?: number): CHelicopter;Parameters
| Parameter | Type | Default value |
|---|---|---|
health | number | 1 |
Returns
CHelicopter
Overrides
MockCGameObject.mockProperties
__name
__name: string = "CGameObject";LuaBind instance constructor name.
Implementation of
CHelicopter.__nameInherited from
MockCGameObject.__name_construct
_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
CHelicopter._constructInherited from
MockCGameObject._constructClearEnemy
ClearEnemy: Mock<UnknownFunction>;Clear current enemy target and switch hunt state to CHelicopter.eEnemyNone.
Implementation of
CHelicopter.ClearEnemyDie
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
CHelicopter.DieExplode
Explode: MockedFunction<() => void>;Explode the helicopter.
Implementation of
CHelicopter.ExplodeGetBodyState
GetBodyState: MockedFunction<() => TXR_helicopter_body_state>;Returns
Current body aiming state.
Implementation of
CHelicopter.GetBodyStateGetCurrVelocity
GetCurrVelocity: Mock<() => number>;Returns
Current scalar velocity.
Implementation of
CHelicopter.GetCurrVelocityGetCurrVelocityVec
GetCurrVelocityVec: Mock<() => MockVector>;Returns
Current velocity vector.
Implementation of
CHelicopter.GetCurrVelocityVecGetDistanceToDestPosition
GetDistanceToDestPosition: Mock<() => number>;Returns
Distance to destination position.
Implementation of
CHelicopter.GetDistanceToDestPositiongetEnabled
getEnabled: MockedFunction<() => boolean>;Returns
Whether the object is enabled in the client object loop.
Implementation of
CHelicopter.getEnabledInherited from
MockCGameObject.getEnabledGetfHealth
GetfHealth: Mock<() => number>;Returns
Helicopter health.
Implementation of
CHelicopter.GetfHealthGetHuntState
GetHuntState: MockedFunction<() => TXR_helicopter_hunt_state>;Returns
Current enemy tracking state.
Implementation of
CHelicopter.GetHuntStateGetMaxVelocity
GetMaxVelocity: Mock<() => number>;Returns
Maximum movement velocity.
Implementation of
CHelicopter.GetMaxVelocityGetMovementState
GetMovementState: MockedFunction<() => TXR_helicopter_movement_state>;Returns
Current movement state.
Implementation of
CHelicopter.GetMovementStateGetOnPointRangeDist
GetOnPointRangeDist: MockedFunction<() => number>;Returns
Distance at which the helicopter treats a point as reached.
Implementation of
CHelicopter.GetOnPointRangeDistGetRealAltitude
GetRealAltitude: MockedFunction<() => number>;Returns
Current real altitude above terrain.
Implementation of
CHelicopter.GetRealAltitudeGetSafeAltitude
GetSafeAltitude: MockedFunction<() => number>;Returns
Safe altitude configured for the movement manager.
Implementation of
CHelicopter.GetSafeAltitudeGetSpeedInDestPoint
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
CHelicopter.GetSpeedInDestPointGetState
GetState: MockedFunction<() => TXR_helicopter_state>;Returns
Alive/dead state.
Implementation of
CHelicopter.GetStategetVisible
getVisible: MockedFunction<() => boolean>;Returns
Whether the object is visible.
Implementation of
CHelicopter.getVisibleInherited from
MockCGameObject.getVisibleGoPatrolByPatrolPath
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
CHelicopter.GoPatrolByPatrolPathGoPatrolByRoundPath
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
CHelicopter.GoPatrolByRoundPathhealth
health: number = 1;isVisible
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
CHelicopter.isVisibleLookAtPoint
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
CHelicopter.LookAtPointm_dead
m_dead: boolean = false;Whether the helicopter is marked dead.
Implementation of
CHelicopter.m_deadm_exploded
m_exploded: boolean = false;Whether the helicopter explosion has already been triggered.
Implementation of
CHelicopter.m_explodedm_flame_started
m_flame_started: boolean = false;Whether flame effects are currently started.
Implementation of
CHelicopter.m_flame_startedm_light_started
m_light_started: boolean = false;Whether helicopter lights are currently started.
Implementation of
CHelicopter.m_light_startedm_max_mgun_dist
m_max_mgun_dist: number = 0;Maximum machine-gun attack distance.
Implementation of
CHelicopter.m_max_mgun_distm_max_rocket_dist
m_max_rocket_dist: number = 0;Maximum rocket attack distance.
Implementation of
CHelicopter.m_max_rocket_distm_min_mgun_dist
m_min_mgun_dist: number = 0;Minimum machine-gun attack distance.
Implementation of
CHelicopter.m_min_mgun_distm_min_rocket_dist
m_min_rocket_dist: number = 0;Minimum rocket attack distance.
Implementation of
CHelicopter.m_min_rocket_distm_syncronize_rocket
m_syncronize_rocket: boolean = false;Whether rocket firing is synchronized with the helicopter attack logic.
Implementation of
CHelicopter.m_syncronize_rocketm_time_between_rocket_attack
m_time_between_rocket_attack: number = 0;Delay between rocket attacks.
Implementation of
CHelicopter.m_time_between_rocket_attackm_use_mgun_on_attack
m_use_mgun_on_attack: boolean = false;Whether machine-gun attacks are enabled.
Implementation of
CHelicopter.m_use_mgun_on_attackm_use_rocket_on_attack
m_use_rocket_on_attack: boolean = false;Whether rocket attacks are enabled.
Implementation of
CHelicopter.m_use_rocket_on_attacknet_Export
net_Export: MockedFunction<(net_packet: net_packet) => void>;Export network state to a packet.
Param
net_packet
Destination network packet.
Implementation of
CHelicopter.net_ExportInherited from
MockCGameObject.net_Exportnet_Import
net_Import: MockedFunction<(net_packet: net_packet) => void>;Import network state from a packet.
Param
net_packet
Source network packet.
Implementation of
CHelicopter.net_ImportInherited from
MockCGameObject.net_Importnet_Spawn
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
CHelicopter.net_SpawnInherited from
MockCGameObject.net_SpawnSetBarrelDirTolerance
SetBarrelDirTolerance: MockedFunction<(value: number) => void>;Set allowed barrel direction tolerance.
Param
value
Tolerance value.
Implementation of
CHelicopter.SetBarrelDirToleranceSetDestPosition
SetDestPosition: Mock<UnknownFunction>;Set movement destination and switch movement state to CHelicopter.eMovToPoint.
Param
position
Destination world position.
Implementation of
CHelicopter.SetDestPositionSetEnemy
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
CHelicopter.SetEnemySetfHealth
SetfHealth: Mock<(health: number) => number>;Set helicopter health.
Param
health
New health value.
Returns
Applied health value.
Implementation of
CHelicopter.SetfHealthSetFireTrailLength
SetFireTrailLength: MockedFunction<(value: number) => void>;Set fire trail length.
Param
value
Trail length.
Implementation of
CHelicopter.SetFireTrailLengthSetLinearAcc
SetLinearAcc: Mock<UnknownFunction>;Set forward and braking linear acceleration values.
Param
min
Forward acceleration.
Param
max
Braking acceleration.
Implementation of
CHelicopter.SetLinearAccSetMaxVelocity
SetMaxVelocity: Mock<UnknownFunction>;Set maximum movement velocity.
Param
value
Maximum velocity.
Implementation of
CHelicopter.SetMaxVelocitySetOnPointRangeDist
SetOnPointRangeDist: MockedFunction<(distance: number) => void>;Set point reach distance.
Param
distance
Reach distance.
Implementation of
CHelicopter.SetOnPointRangeDistSetSpeedInDestPoint
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
CHelicopter.SetSpeedInDestPointStartFlame
StartFlame: MockedFunction<() => void>;Start smoke/flame particle effects if they are not already active.
Implementation of
CHelicopter.StartFlameTurnEngineSound
TurnEngineSound: Mock<UnknownFunction>;Turn engine sound on or off.
Param
enabled
New sound state.
Implementation of
CHelicopter.TurnEngineSoundTurnLighting
TurnLighting: MockedFunction<(is_enabled: boolean) => void>;Turn helicopter lighting on or off.
Param
is_enabled
New lighting state.
Implementation of
CHelicopter.TurnLightinguse
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
CHelicopter.useInherited from
MockCGameObject.useUseFireTrail
UseFireTrail: MockedFunction<{
(): boolean;
(is_enabled: boolean): void;
}>;Returns
Whether fire trail rendering is enabled.
Implementation of
CHelicopter.UseFireTrailvelocity
velocity: number = 10;velocityVector
velocityVector: MockVector;Visual
Visual: MockedFunction<() => IXR_IRender_Visual>;Returns
Render visual assigned to the object.
Implementation of
CHelicopter.VisualInherited from
MockCGameObject.Visual