Skip to content

Class: MockHit ​

Mock of the X-Ray engine hit object for jest/node.

Implements ​

  • hit

Constructors ​

Constructor ​

ts
new MockHit(source?: hit): MockHit;

Parameters ​

ParameterType
source?hit

Returns ​

MockHit

Methods ​

create() ​

ts
static create(source?: hit): MockHit;

Parameters ​

ParameterType
source?hit

Returns ​

MockHit


mock() ​

ts
static mock(source?: hit): hit;

Parameters ​

ParameterType
source?hit

Returns ​

hit

Properties ​

bone ​

ts
bone: Mock<(bone: string) => void>;

Target a model bone by name.

Remarks ​

Stores the bone name on the hit. The receiving object resolves it against its own model.

Param ​

bone

Bone name used by the receiver model.

Implementation of ​

ts
hit.bone

boneName ​

ts
boneName: string | null = null;

direction ​

ts
direction: vector;

Hit direction.

Implementation of ​

ts
hit.direction

draftsman ​

ts
draftsman: game_object | null = null;

Object that caused the hit.

Remarks ​

Leave null for world or scripted damage that should not be attributed to a game object.

Implementation of ​

ts
hit.draftsman

impulse ​

ts
impulse: number = 100;

Physics impulse applied with the hit.

Implementation of ​

ts
hit.impulse

power ​

ts
power: number = 100;

Hit damage power.

Implementation of ​

ts
hit.power

type ​

ts
type: TXR_hit_type = MockHit.wound;

Hit damage type.

Implementation of ​

ts
hit.type

burn ​

ts
readonly static burn: 0;

Engine enum value for hit.burn.


chemical_burn ​

ts
readonly static chemical_burn: 2;

Engine enum value for hit.chemical_burn.


dummy ​

ts
readonly static dummy: 12;

Engine enum value for hit.dummy.


explosion ​

ts
readonly static explosion: 7;

Engine enum value for hit.explosion.


fire_wound ​

ts
readonly static fire_wound: 8;

Engine enum value for hit.fire_wound.


light_burn ​

ts
readonly static light_burn: 11;

Engine enum value for hit.light_burn.


physic_strike ​

ts
readonly static physic_strike: 10;

Engine enum value for hit.physic_strike.


radiation ​

ts
readonly static radiation: 3;

Engine enum value for hit.radiation.


shock ​

ts
readonly static shock: 1;

Engine enum value for hit.shock.


strike ​

ts
readonly static strike: 5;

Engine enum value for hit.strike.


telepatic ​

ts
readonly static telepatic: 4;

Engine enum value for hit.telepatic.


wound ​

ts
readonly static wound: 6;

Engine enum value for hit.wound.