Skip to content

Class: hit ​

Hit packet that can be sent to game objects.

Source ​

C++ class hit

Custom Constructor ​

hit

Remarks ​

A new hit defaults to wound damage with power 100, impulse 100, direction (1, 0, 0), and no draftsman.

Constructors ​

Constructor ​

ts
new hit(): hit;

Create an empty hit packet.

Returns ​

hit

Remarks ​

Uses the engine default values described on hit.

Constructor ​

ts
new hit(hit: hit): hit;

Copy an existing hit packet.

Parameters ​

ParameterTypeDescription
hithitSource hit.

Returns ​

hit

Methods ​

bone() ​

ts
bone(bone: string): void;

Target a model bone by name.

Parameters ​

ParameterTypeDescription
bonestringBone name used by the receiver model.

Returns ​

void

Remarks ​

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

Properties ​

direction ​

ts
direction: vector;

Hit direction.


draftsman ​

ts
draftsman: Nullable<game_object>;

Object that caused the hit.

Remarks ​

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


impulse ​

ts
impulse: number;

Physics impulse applied with the hit.


power ​

ts
power: number;

Hit damage power.


type ​

ts
type: TXR_hit_type;

Hit damage 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.