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
new hit(): hit;Create an empty hit packet.
Returns
hit
Remarks
Uses the engine default values described on hit.
Constructor
new hit(hit: hit): hit;Copy an existing hit packet.
Parameters
| Parameter | Type | Description |
|---|---|---|
hit | hit | Source hit. |
Returns
hit
Methods
bone()
bone(bone: string): void;Target a model bone by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
bone | string | Bone 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
direction: vector;Hit direction.
draftsman
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
impulse: number;Physics impulse applied with the hit.
power
power: number;Hit damage power.
type
type: TXR_hit_type;Hit damage type.
burn
readonly static burn: 0;Engine enum value for hit.burn.
chemical_burn
readonly static chemical_burn: 2;Engine enum value for hit.chemical_burn.
dummy
readonly static dummy: 12;Engine enum value for hit.dummy.
explosion
readonly static explosion: 7;Engine enum value for hit.explosion.
fire_wound
readonly static fire_wound: 8;Engine enum value for hit.fire_wound.
light_burn
readonly static light_burn: 11;Engine enum value for hit.light_burn.
physic_strike
readonly static physic_strike: 10;Engine enum value for hit.physic_strike.
radiation
readonly static radiation: 3;Engine enum value for hit.radiation.
shock
readonly static shock: 1;Engine enum value for hit.shock.
strike
readonly static strike: 5;Engine enum value for hit.strike.
telepatic
readonly static telepatic: 4;Engine enum value for hit.telepatic.
wound
readonly static wound: 6;Engine enum value for hit.wound.