xray16 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/inline.js +89 -0
- package/plugins/strip_lua_logger.js +1 -1
- package/types/index.d.ts +2 -0
- package/types/xr_lib/xr_luabind.d.ts +3 -3
- package/types/xr_object/client/xr_creature.d.ts +7 -0
- package/types/xr_object/client/xr_item.d.ts +27 -2
- package/types/xr_object/client/xr_physic.d.ts +24 -0
- package/types/xr_object/client/xr_zone.d.ts +7 -0
- package/types/xr_object/script/xr_script_interface.d.ts +0 -24
- package/types/xr_object/script/xr_script_object.d.ts +189 -125
- package/types/xr_object/server/xr_server_object.d.ts +13 -1
- package/types/xrf_plugin.d.ts +44 -0
package/package.json
CHANGED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typescript_1 = require("typescript");
|
|
4
|
+
const typescript_to_lua_1 = require("typescript-to-lua");
|
|
5
|
+
const diagnostics_1 = require("./utils/diagnostics");
|
|
6
|
+
const INLINE_MACROS = "$inline";
|
|
7
|
+
const expectedFunctionExpressionInInline = (0, diagnostics_1.createErrorDiagnosticFactory)("Expected a function expression in '__inline'.");
|
|
8
|
+
/**
|
|
9
|
+
* Plugin for transformation of casting methods.
|
|
10
|
+
* Simplifies TS/Lua testing and interoperation.
|
|
11
|
+
*
|
|
12
|
+
* Reference: https://gist.github.com/Cheatoid/ea4573c6bd1992fc4940090543ec9380
|
|
13
|
+
*/
|
|
14
|
+
const plugin = {
|
|
15
|
+
visitors: {
|
|
16
|
+
[typescript_1.SyntaxKind.ExpressionStatement]: (node, context) => {
|
|
17
|
+
const result = context.superTransformStatements(node);
|
|
18
|
+
if ((0, typescript_1.isExpressionStatement)(node)) {
|
|
19
|
+
const expr = node.expression;
|
|
20
|
+
if ((0, typescript_1.isCallExpression)(expr) && (0, typescript_1.isIdentifier)(expr.expression)) {
|
|
21
|
+
switch (expr.expression.text) {
|
|
22
|
+
case INLINE_MACROS: {
|
|
23
|
+
if (expr.arguments.length > 0) {
|
|
24
|
+
let bodyArg = expr.arguments[0];
|
|
25
|
+
if ((0, typescript_1.isIdentifier)(bodyArg)) {
|
|
26
|
+
try {
|
|
27
|
+
bodyArg = context.checker.getSymbolAtLocation(bodyArg).getDeclarations()[0];
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
context.diagnostics.push(expectedFunctionExpressionInInline(node));
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
if (!bodyArg) {
|
|
34
|
+
context.diagnostics.push(expectedFunctionExpressionInInline(node));
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const paramNames = [];
|
|
39
|
+
let funcExpr;
|
|
40
|
+
if ((0, typescript_1.isFunctionLike)(bodyArg)) {
|
|
41
|
+
const bodyNode = context.transformNode(bodyArg)[0];
|
|
42
|
+
if (!bodyNode) {
|
|
43
|
+
context.diagnostics.push(expectedFunctionExpressionInInline(node));
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
if ((0, typescript_to_lua_1.isVariableDeclarationStatement)(bodyNode) && bodyNode.right) {
|
|
47
|
+
if ((0, typescript_to_lua_1.isFunctionExpression)(bodyNode.right[0])) {
|
|
48
|
+
funcExpr = bodyNode.right[0];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
paramNames.push(...bodyArg.parameters.map((p) => p.name.getText()));
|
|
52
|
+
}
|
|
53
|
+
for (const stmt of result) {
|
|
54
|
+
if ((0, typescript_to_lua_1.isExpressionStatement)(stmt)) {
|
|
55
|
+
const callExpr = stmt.expression;
|
|
56
|
+
if ((0, typescript_to_lua_1.isCallExpression)(callExpr) &&
|
|
57
|
+
(0, typescript_to_lua_1.isIdentifier)(callExpr.expression) &&
|
|
58
|
+
callExpr.expression.text === expr.expression.text) {
|
|
59
|
+
const paramCount = callExpr.params.length;
|
|
60
|
+
if (paramCount > 0) {
|
|
61
|
+
let body = callExpr.params[0];
|
|
62
|
+
if ((0, typescript_to_lua_1.isIdentifier)(body)) {
|
|
63
|
+
body = funcExpr;
|
|
64
|
+
}
|
|
65
|
+
if (body && (0, typescript_to_lua_1.isFunctionExpression)(body)) {
|
|
66
|
+
const statements = body.body.statements;
|
|
67
|
+
for (let index = 1; index < paramCount; ++index) {
|
|
68
|
+
// Skip the body parameter.
|
|
69
|
+
const param = callExpr.params[index];
|
|
70
|
+
statements.unshift((0, typescript_to_lua_1.createVariableDeclarationStatement)([(0, typescript_to_lua_1.createIdentifier)(paramNames[index - 1])], [param]));
|
|
71
|
+
}
|
|
72
|
+
return (0, typescript_to_lua_1.createDoStatement)(statements, node);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
context.diagnostics.push(expectedFunctionExpressionInInline(node));
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
exports.default = plugin;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const typescript_1 = require("typescript");
|
|
4
4
|
const LUA_LOGGER_STRIP_TARGET = "LuaLogger";
|
|
5
|
-
const IS_LUA_LOGGER_DISABLED = process.argv.includes("--no-lua-logs");
|
|
5
|
+
const IS_LUA_LOGGER_DISABLED = process.argv.includes("--no-lua-logs") || process.env.NO_LUA_LOGS === "true";
|
|
6
6
|
/**
|
|
7
7
|
* Plugin that removes all LuaLogger instance creations and calls when possible.
|
|
8
8
|
*/
|
package/types/index.d.ts
CHANGED
|
@@ -40,8 +40,8 @@ declare module "xray16" {
|
|
|
40
40
|
* @group xr_luabind
|
|
41
41
|
*/
|
|
42
42
|
export class class_info_data extends EngineBinding {
|
|
43
|
-
public readonly methods:
|
|
44
|
-
public readonly attributes:
|
|
43
|
+
public readonly methods: LuaTable<string, (...args: Array<unknown>) => unknown>;
|
|
44
|
+
public readonly attributes: LuaTable<number, string>;
|
|
45
45
|
public readonly name: string;
|
|
46
46
|
|
|
47
47
|
private constructor();
|
|
@@ -50,7 +50,7 @@ declare module "xray16" {
|
|
|
50
50
|
/**
|
|
51
51
|
* @group xr_luabind
|
|
52
52
|
*/
|
|
53
|
-
export function class_names(this: void, lua_state: unknown /* lua_State*/):
|
|
53
|
+
export function class_names(this: void, lua_state: unknown /* lua_State*/): LuaTable<number, string>;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* @group xr_luabind
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
declare module "xray16" {
|
|
2
|
+
/**
|
|
3
|
+
* @source C++ class CEntityAlive : public CEntity
|
|
4
|
+
* @customConstructor CEntityAlive
|
|
5
|
+
* @group xr_creature
|
|
6
|
+
*/
|
|
7
|
+
export class CEntityAlive extends CGameObject {}
|
|
8
|
+
|
|
2
9
|
/**
|
|
3
10
|
* @source C++ class CActor : CGameObject
|
|
4
11
|
* @customConstructor CActor
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
declare module "xray16" {
|
|
2
|
+
/**
|
|
3
|
+
* @source C++ class explosive
|
|
4
|
+
* @customConstructor explosive
|
|
5
|
+
* @group xr_item
|
|
6
|
+
*/
|
|
7
|
+
export class explosive extends EngineBinding {
|
|
8
|
+
protected constructor();
|
|
9
|
+
|
|
10
|
+
public explode(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
2
13
|
/**
|
|
3
14
|
* @source C++ class CAntirad : CGameObject
|
|
4
15
|
* @customConstructor CAntirad
|
|
@@ -69,19 +80,33 @@ declare module "xray16" {
|
|
|
69
80
|
*/
|
|
70
81
|
export class CWeaponAmmo extends CGameObject {}
|
|
71
82
|
|
|
83
|
+
/**
|
|
84
|
+
* @source C++ class CWeapon : public CHudItemObject, public CShootingObject
|
|
85
|
+
* @customConstructor CWeaponAmmo
|
|
86
|
+
* @group xr_item
|
|
87
|
+
*/
|
|
88
|
+
export class CWeapon extends CInventoryItem {}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @source C++ class CWeaponMagazined : public CWeapon
|
|
92
|
+
* @customConstructor CWeaponMagazined
|
|
93
|
+
* @group xr_item
|
|
94
|
+
*/
|
|
95
|
+
export class CWeaponMagazined extends CWeapon {}
|
|
96
|
+
|
|
72
97
|
/**
|
|
73
98
|
* @source C++ class CWeaponAutomaticShotgun : CGameObject
|
|
74
99
|
* @customConstructor CWeaponAutomaticShotgun
|
|
75
100
|
* @group xr_item
|
|
76
101
|
*/
|
|
77
|
-
export class CWeaponAutomaticShotgun extends
|
|
102
|
+
export class CWeaponAutomaticShotgun extends CWeaponMagazined {}
|
|
78
103
|
|
|
79
104
|
/**
|
|
80
105
|
* @source C++ class CWeaponBM16 : CGameObject
|
|
81
106
|
* @customConstructor CWeaponBM16
|
|
82
107
|
* @group xr_item
|
|
83
108
|
*/
|
|
84
|
-
export class CWeaponBM16 extends
|
|
109
|
+
export class CWeaponBM16 extends CWeaponShotgun {}
|
|
85
110
|
|
|
86
111
|
/**
|
|
87
112
|
* @source C++ class CWeaponBinoculars : CGameObject
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
declare module "xray16" {
|
|
2
3
|
/**
|
|
3
4
|
* @source C++ class physics_element
|
|
@@ -174,4 +175,27 @@ declare module "xray16" {
|
|
|
174
175
|
export class IKinematicsAnimated {
|
|
175
176
|
public PlayCycle(value: string): void;
|
|
176
177
|
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @source C++ class CPhysicsShellHolder : public CGameObject, CParticlesPlayer,
|
|
181
|
+
* IObjectPhysicsCollision, IPhysicsShellHolder
|
|
182
|
+
* @customConstructor CPhysicsShellHolder
|
|
183
|
+
* @group xr_physic
|
|
184
|
+
*/
|
|
185
|
+
export class CPhysicsShellHolder extends EngineBinding {
|
|
186
|
+
protected constructor();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @source C++ class holder
|
|
191
|
+
* @customConstructor holder
|
|
192
|
+
* @group xr_physic
|
|
193
|
+
*/
|
|
194
|
+
export class holder {
|
|
195
|
+
public engaged(): boolean;
|
|
196
|
+
|
|
197
|
+
public Action(value1: u16, value2: u32): void;
|
|
198
|
+
|
|
199
|
+
public SetParam(value: i32, vector: vector): void;
|
|
200
|
+
}
|
|
177
201
|
}
|
|
@@ -6,6 +6,13 @@ declare module "xray16" {
|
|
|
6
6
|
*/
|
|
7
7
|
export class CSpaceRestrictor extends CGameObject {}
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @source C++ class CCustomZone : public CSpaceRestrictor, public Feel::Touch
|
|
11
|
+
* @customConstructor CCustomZone
|
|
12
|
+
* @group xr_zone
|
|
13
|
+
*/
|
|
14
|
+
export class CCustomZone extends CSpaceRestrictor {}
|
|
15
|
+
|
|
9
16
|
/**
|
|
10
17
|
* @source C++ class CLevelChanger : CGameObject
|
|
11
18
|
* @customConstructor CLevelChanger
|
|
@@ -29,30 +29,6 @@ declare module "xray16" {
|
|
|
29
29
|
public who: game_object;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* @source C++ class explosive
|
|
34
|
-
* @customConstructor explosive
|
|
35
|
-
* @group xr_script_interface
|
|
36
|
-
*/
|
|
37
|
-
export class explosive extends EngineBinding {
|
|
38
|
-
protected constructor();
|
|
39
|
-
|
|
40
|
-
public explode(): void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @source C++ class holder
|
|
45
|
-
* @customConstructor holder
|
|
46
|
-
* @group xr_script_interface
|
|
47
|
-
*/
|
|
48
|
-
export class holder {
|
|
49
|
-
public engaged(): boolean;
|
|
50
|
-
|
|
51
|
-
public Action(value1: u16, value2: u32): void;
|
|
52
|
-
|
|
53
|
-
public SetParam(value: i32, vector: vector): void;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
32
|
/**
|
|
57
33
|
* Visibility state of bloodsucker.
|
|
58
34
|
* Possible values are:
|
|
@@ -1,121 +1,4 @@
|
|
|
1
1
|
declare module "xray16" {
|
|
2
|
-
/*
|
|
3
|
-
* CAI_Stalker* cast_Stalker();
|
|
4
|
-
* CArtefact* cast_Artefact();
|
|
5
|
-
* CCar* cast_Car();
|
|
6
|
-
* CGameObject* cast_GameObject();
|
|
7
|
-
* CHelicopter* cast_Heli();
|
|
8
|
-
* CSpaceRestrictor* cast_SpaceRestrictor();
|
|
9
|
-
* CWeapon* cast_Weapon();
|
|
10
|
-
* CWeaponAmmo* cast_Ammo();
|
|
11
|
-
* CWeaponMagazined* cast_WeaponMagazined();
|
|
12
|
-
* ce_script_zone* cast_ScriptZone();
|
|
13
|
-
* class CCustomZone* cast_CustomZone();
|
|
14
|
-
* class CEntityAlive* cast_EntityAlive();
|
|
15
|
-
* class CPhysicsShellHolder* cast_PhysicsShellHolder();
|
|
16
|
-
* explosive* cast_Explosive();
|
|
17
|
-
*
|
|
18
|
-
* CTime get_info_time(char const*);
|
|
19
|
-
* bool bone_visible(char const*);
|
|
20
|
-
* bool has_ammo_type(unsigned char)
|
|
21
|
-
|
|
22
|
-
* bool is_on_belt(game_object*);
|
|
23
|
-
* bool use(game_object*);
|
|
24
|
-
*
|
|
25
|
-
* vector<MemorySpace::CNotYetVisibleObject,xalloc<MemorySpace::CNotYetVisibleObject> > not_yet_visible_objects();
|
|
26
|
-
* vector<MemorySpace::CSoundObject,xalloc<MemorySpace::CSoundObject>> memory_sound_objects();
|
|
27
|
-
|
|
28
|
-
* enum DetailPathManager::EDetailPathType detail_path_type();
|
|
29
|
-
* enum ETaskState get_task_state(char const*);
|
|
30
|
-
* enum MonsterSpace::EBodyState body_state();
|
|
31
|
-
* enum MonsterSpace::EBodyState target_body_state();
|
|
32
|
-
* enum MonsterSpace::EMentalState mental_state();
|
|
33
|
-
* enum MonsterSpace::EMentalState target_mental_state();
|
|
34
|
-
* enum MonsterSpace::EMovementType movement_type();
|
|
35
|
-
* enum MovementManager::EPathType path_type();
|
|
36
|
-
*
|
|
37
|
-
* float get_actor_jump_speed();
|
|
38
|
-
* float get_actor_max_walk_weight();
|
|
39
|
-
* float get_actor_max_weight();
|
|
40
|
-
* float get_actor_run_coef();
|
|
41
|
-
* float get_actor_runback_coef();
|
|
42
|
-
* float get_actor_sprint_koef();
|
|
43
|
-
* float get_additional_max_walk_weight();
|
|
44
|
-
* float get_additional_max_weight();
|
|
45
|
-
* float get_anomaly_power();
|
|
46
|
-
* float get_artefact_bleeding();
|
|
47
|
-
* float get_artefact_health();
|
|
48
|
-
* float get_artefact_power();
|
|
49
|
-
* float get_artefact_radiation();
|
|
50
|
-
* float get_artefact_satiety();
|
|
51
|
-
* float get_luminocity();
|
|
52
|
-
* float get_luminocity_hemi();
|
|
53
|
-
* float get_total_weight();
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
* game_object* get_attached_vehicle();
|
|
57
|
-
*
|
|
58
|
-
* holder* cast_HolderCustom();
|
|
59
|
-
* int get_ammo_count_for_type(unsigned char);
|
|
60
|
-
*
|
|
61
|
-
* unsigned char get_max_uses();
|
|
62
|
-
* unsigned char get_remaining_uses();
|
|
63
|
-
* unsigned char get_restrictor_type();
|
|
64
|
-
* unsigned char get_weapon_substate();
|
|
65
|
-
*
|
|
66
|
-
* unsigned int belt_count();
|
|
67
|
-
* unsigned int get_main_weapon_type();
|
|
68
|
-
* unsigned int get_spatial_type();
|
|
69
|
-
* remove_danger();
|
|
70
|
-
* remove_memory_sound_object();
|
|
71
|
-
* remove_memory_visible_object();
|
|
72
|
-
* remove_memory_hit_object();
|
|
73
|
-
* unsigned int get_state();
|
|
74
|
-
* unsigned int get_weapon_type();
|
|
75
|
-
* unsigned int play_hud_motion(char const*,bool,unsigned int);
|
|
76
|
-
*
|
|
77
|
-
* void attach_vehicle(game_object*);
|
|
78
|
-
* void clear_game_news();
|
|
79
|
-
* void detach_vehicle();
|
|
80
|
-
* void force_set_position(vector,bool);
|
|
81
|
-
*
|
|
82
|
-
* void iterate_feel_touch(function<void>);
|
|
83
|
-
|
|
84
|
-
* void phantom_set_enemy(game_object*);
|
|
85
|
-
* void set_actor_jump_speed(float);
|
|
86
|
-
* void set_actor_max_walk_weight(float);
|
|
87
|
-
* void set_actor_max_weight(float);
|
|
88
|
-
* void set_actor_run_coef(float);
|
|
89
|
-
* void set_actor_runback_coef(float);
|
|
90
|
-
* void set_actor_sprint_koef(float);
|
|
91
|
-
* void set_additional_max_walk_weight(float);
|
|
92
|
-
* void set_additional_max_weight(float);
|
|
93
|
-
* void set_alien_control(bool);
|
|
94
|
-
* void set_ammo_type(unsigned char);
|
|
95
|
-
*
|
|
96
|
-
* void set_artefact_bleeding(float);
|
|
97
|
-
* void set_artefact_health(float);
|
|
98
|
-
* void set_artefact_power(float);
|
|
99
|
-
* void set_artefact_radiation(float);
|
|
100
|
-
* void set_artefact_satiety(float);
|
|
101
|
-
*
|
|
102
|
-
* void set_bone_visible(char const*,bool,bool);
|
|
103
|
-
* void set_character_icon(char const*);
|
|
104
|
-
* void set_health_ex(float);
|
|
105
|
-
* void set_main_weapon_type(unsigned int);
|
|
106
|
-
|
|
107
|
-
*
|
|
108
|
-
* void set_remaining_uses(unsigned char);
|
|
109
|
-
* void set_restrictor_type(unsigned char);
|
|
110
|
-
* void set_spatial_type(unsigned int);
|
|
111
|
-
* void set_weapon_type(unsigned int);
|
|
112
|
-
|
|
113
|
-
* void start_trade(game_object*);
|
|
114
|
-
* void start_upgrade(game_object*);
|
|
115
|
-
* void switch_state(unsigned int);
|
|
116
|
-
* }
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
2
|
/**
|
|
120
3
|
* Client object base presentation as script object.
|
|
121
4
|
* Generic in-game entities from items to mutants and stalkers wrapped with luabind export.
|
|
@@ -430,10 +313,7 @@ declare module "xray16" {
|
|
|
430
313
|
|
|
431
314
|
public buy_item_condition_factor(value: f32): void;
|
|
432
315
|
|
|
433
|
-
|
|
434
|
-
* Change object squad/faction?
|
|
435
|
-
*/
|
|
436
|
-
public change_team(community_id: u8, squad_id: u8, group_id: u8): void;
|
|
316
|
+
public change_team(team_id: u8, squad_id: u8, group_id: u8): void;
|
|
437
317
|
|
|
438
318
|
public character_icon<T extends string>(): T;
|
|
439
319
|
|
|
@@ -605,7 +485,7 @@ declare module "xray16" {
|
|
|
605
485
|
|
|
606
486
|
public set_actor_relation_flags(value: flags32): void;
|
|
607
487
|
|
|
608
|
-
public set_alien_control(
|
|
488
|
+
public set_alien_control(is_enabled: boolean): void;
|
|
609
489
|
|
|
610
490
|
public set_body_state(state: TXR_MonsterBodyState): void;
|
|
611
491
|
|
|
@@ -772,7 +652,7 @@ declare module "xray16" {
|
|
|
772
652
|
|
|
773
653
|
/**
|
|
774
654
|
* Return formula: `personal_goodwill + reputation_goodwill + rank_goodwill +
|
|
775
|
-
*
|
|
655
|
+
* community_goodwill + community_to_community`
|
|
776
656
|
*
|
|
777
657
|
* @param target - target client object
|
|
778
658
|
* @returns goodwill level from object to target
|
|
@@ -783,8 +663,6 @@ declare module "xray16" {
|
|
|
783
663
|
|
|
784
664
|
public get_ammo_in_magazine(): u32;
|
|
785
665
|
|
|
786
|
-
public get_anomaly_power(): unknown;
|
|
787
|
-
|
|
788
666
|
public get_car(): CCar;
|
|
789
667
|
|
|
790
668
|
public get_corpse(): game_object | null;
|
|
@@ -1098,6 +976,10 @@ declare module "xray16" {
|
|
|
1098
976
|
|
|
1099
977
|
public inactualize_patrol_path(): void;
|
|
1100
978
|
|
|
979
|
+
public inactualize_level_path(): void;
|
|
980
|
+
|
|
981
|
+
public inactualize_game_path(): void;
|
|
982
|
+
|
|
1101
983
|
/**
|
|
1102
984
|
* Iterate over game object inventory.
|
|
1103
985
|
* Runs supplied callback for each item in inventory of the object.
|
|
@@ -1195,5 +1077,187 @@ declare module "xray16" {
|
|
|
1195
1077
|
public ammo_set_count(count: u16): void;
|
|
1196
1078
|
|
|
1197
1079
|
public ammo_box_size(): u16;
|
|
1080
|
+
|
|
1081
|
+
public cast_Stalker(): CAI_Stalker;
|
|
1082
|
+
|
|
1083
|
+
public cast_Artefact(): CArtefact;
|
|
1084
|
+
|
|
1085
|
+
public cast_Car(): CCar;
|
|
1086
|
+
|
|
1087
|
+
public cast_GameObject(): CGameObject;
|
|
1088
|
+
|
|
1089
|
+
public cast_Heli(): CHelicopter;
|
|
1090
|
+
|
|
1091
|
+
public cast_SpaceRestrictor(): CSpaceRestrictor;
|
|
1092
|
+
|
|
1093
|
+
public cast_HolderCustom(): holder;
|
|
1094
|
+
|
|
1095
|
+
public cast_Weapon(): CWeapon;
|
|
1096
|
+
|
|
1097
|
+
public cast_Ammo(): CWeaponAmmo;
|
|
1098
|
+
|
|
1099
|
+
public cast_WeaponMagazined(): CWeaponMagazined;
|
|
1100
|
+
|
|
1101
|
+
public cast_ScriptZone(): ce_script_zone;
|
|
1102
|
+
|
|
1103
|
+
public cast_CustomZone(): CCustomZone;
|
|
1104
|
+
|
|
1105
|
+
public cast_EntityAlive(): CEntityAlive;
|
|
1106
|
+
|
|
1107
|
+
public cast_Explosive(): explosive;
|
|
1108
|
+
|
|
1109
|
+
public cast_PhysicsShellHolder(): CPhysicsShellHolder;
|
|
1110
|
+
|
|
1111
|
+
public get_info_time(info: string): CTime;
|
|
1112
|
+
|
|
1113
|
+
public bone_visible(bone: string): boolean;
|
|
1114
|
+
|
|
1115
|
+
public has_ammo_type(type: string): boolean;
|
|
1116
|
+
|
|
1117
|
+
public is_on_belt(object: game_object): boolean;
|
|
1118
|
+
|
|
1119
|
+
public use(object: game_object): void;
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* Set remaining item uses count.
|
|
1123
|
+
*
|
|
1124
|
+
* @param remaining - count of remaining uses for item before destroy
|
|
1125
|
+
*/
|
|
1126
|
+
public set_remaining_uses(remaining: u8): void;
|
|
1127
|
+
|
|
1128
|
+
public get_max_uses(): u8;
|
|
1129
|
+
|
|
1130
|
+
public get_remaining_uses(): u8;
|
|
1131
|
+
|
|
1132
|
+
public set_restrictor_type(type: u8): void;
|
|
1133
|
+
|
|
1134
|
+
public get_restrictor_type(): u8;
|
|
1135
|
+
|
|
1136
|
+
public set_spatial_type(type: u8): void;
|
|
1137
|
+
|
|
1138
|
+
public set_weapon_type(type: u8): void;
|
|
1139
|
+
|
|
1140
|
+
public get_weapon_substate(): u8;
|
|
1141
|
+
|
|
1142
|
+
public start_trade(object: game_object): void;
|
|
1143
|
+
|
|
1144
|
+
public start_upgrade(object: game_object): void;
|
|
1145
|
+
|
|
1146
|
+
public switch_state(state: u32): void;
|
|
1147
|
+
|
|
1148
|
+
public phantom_set_enemy(object: game_object): void;
|
|
1149
|
+
|
|
1150
|
+
public set_actor_jump_speed(speed: f32): void;
|
|
1151
|
+
|
|
1152
|
+
public set_actor_max_walk_weight(weight: f32): void;
|
|
1153
|
+
|
|
1154
|
+
public set_actor_max_weight(weight: f32): void;
|
|
1155
|
+
|
|
1156
|
+
public set_actor_run_coef(coef: f32): void;
|
|
1157
|
+
|
|
1158
|
+
public set_actor_runback_coef(coef: f32): void;
|
|
1159
|
+
|
|
1160
|
+
public set_actor_sprint_koef(coef: f32): void;
|
|
1161
|
+
|
|
1162
|
+
public set_additional_max_walk_weight(weight: f32): void;
|
|
1163
|
+
|
|
1164
|
+
public set_additional_max_weight(weight: f32): void;
|
|
1165
|
+
|
|
1166
|
+
public set_ammo_type(type: u8): void;
|
|
1167
|
+
|
|
1168
|
+
public set_artefact_bleeding(rate: f32): void;
|
|
1169
|
+
|
|
1170
|
+
public set_artefact_health(rate: f32): void;
|
|
1171
|
+
|
|
1172
|
+
public set_artefact_power(rate: f32): void;
|
|
1173
|
+
|
|
1174
|
+
public set_artefact_radiation(rate: f32): void;
|
|
1175
|
+
|
|
1176
|
+
public set_artefact_satiety(rate: f32): void;
|
|
1177
|
+
|
|
1178
|
+
public set_bone_visible(name: string, a: boolean, b: boolean): void;
|
|
1179
|
+
|
|
1180
|
+
public set_character_icon(icon: string): void;
|
|
1181
|
+
|
|
1182
|
+
public set_health_ex(value: f32): void;
|
|
1183
|
+
|
|
1184
|
+
public set_main_weapon_type(type: u32): void;
|
|
1185
|
+
|
|
1186
|
+
public get_actor_jump_speed(): f32;
|
|
1187
|
+
|
|
1188
|
+
public get_actor_max_walk_weight(): f32;
|
|
1189
|
+
|
|
1190
|
+
public get_actor_max_weight(): f32;
|
|
1191
|
+
|
|
1192
|
+
public get_actor_run_coef(): f32;
|
|
1193
|
+
|
|
1194
|
+
public get_actor_runback_coef(): f32;
|
|
1195
|
+
|
|
1196
|
+
public get_actor_sprint_koef(): f32;
|
|
1197
|
+
|
|
1198
|
+
public get_additional_max_walk_weight(): f32;
|
|
1199
|
+
|
|
1200
|
+
public get_additional_max_weight(): f32;
|
|
1201
|
+
|
|
1202
|
+
public get_anomaly_power(): f32;
|
|
1203
|
+
|
|
1204
|
+
public get_artefact_bleeding(): f32;
|
|
1205
|
+
|
|
1206
|
+
public get_artefact_health(): f32;
|
|
1207
|
+
|
|
1208
|
+
public get_artefact_power(): f32;
|
|
1209
|
+
|
|
1210
|
+
public get_artefact_radiation(): f32;
|
|
1211
|
+
|
|
1212
|
+
public get_artefact_satiety(): f32;
|
|
1213
|
+
|
|
1214
|
+
public get_luminocity(): f32;
|
|
1215
|
+
|
|
1216
|
+
public get_luminocity_hemi(): f32;
|
|
1217
|
+
|
|
1218
|
+
public get_total_weight(): f32;
|
|
1219
|
+
|
|
1220
|
+
public get_attached_vehicle(): game_object;
|
|
1221
|
+
|
|
1222
|
+
public belt_count(): u32;
|
|
1223
|
+
|
|
1224
|
+
public get_main_weapon_type(): u32;
|
|
1225
|
+
|
|
1226
|
+
public get_spatial_type(): u32;
|
|
1227
|
+
|
|
1228
|
+
public get_state(): u32;
|
|
1229
|
+
|
|
1230
|
+
public get_weapon_type(): u32;
|
|
1231
|
+
|
|
1232
|
+
public play_hud_motion(chat: string, bool: boolean, int: u32): u32;
|
|
1233
|
+
|
|
1234
|
+
public attach_vehicle(vehicle: game_object): void;
|
|
1235
|
+
|
|
1236
|
+
public clear_game_news(): void;
|
|
1237
|
+
|
|
1238
|
+
public detach_vehicle(): void;
|
|
1239
|
+
|
|
1240
|
+
public force_set_position(position: vector, bool: boolean): void;
|
|
1241
|
+
|
|
1242
|
+
public get_ammo_count_for_type(type: u8): i32;
|
|
1198
1243
|
}
|
|
1244
|
+
|
|
1245
|
+
/*
|
|
1246
|
+
* vector<MemorySpace::CNotYetVisibleObject,xalloc<MemorySpace::CNotYetVisibleObject> > not_yet_visible_objects();
|
|
1247
|
+
* vector<MemorySpace::CSoundObject,xalloc<MemorySpace::CSoundObject>> memory_sound_objects();
|
|
1248
|
+
* enum DetailPathManager::EDetailPathType detail_path_type();
|
|
1249
|
+
* enum ETaskState get_task_state(char const*);
|
|
1250
|
+
* enum MonsterSpace::EBodyState body_state();
|
|
1251
|
+
* enum MonsterSpace::EBodyState target_body_state();
|
|
1252
|
+
* enum MonsterSpace::EMentalState mental_state();
|
|
1253
|
+
* enum MonsterSpace::EMentalState target_mental_state();
|
|
1254
|
+
* enum MonsterSpace::EMovementType movement_type();
|
|
1255
|
+
* enum MovementManager::EPathType path_type();
|
|
1256
|
+
* remove_danger();
|
|
1257
|
+
* remove_memory_sound_object();
|
|
1258
|
+
* remove_memory_visible_object();
|
|
1259
|
+
* remove_memory_hit_object();
|
|
1260
|
+
* void iterate_feel_touch(function<void>);
|
|
1261
|
+
* }
|
|
1262
|
+
*/
|
|
1199
1263
|
}
|
|
@@ -249,9 +249,21 @@ declare module "xray16" {
|
|
|
249
249
|
* @group xr_object_server
|
|
250
250
|
*/
|
|
251
251
|
export class cse_alife_creature_abstract extends cse_alife_dynamic_object_visual {
|
|
252
|
-
|
|
252
|
+
/**
|
|
253
|
+
* Squad identifier that links squad and parent smart terrain.
|
|
254
|
+
*/
|
|
253
255
|
public squad: u8;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Team (community) of the object.
|
|
259
|
+
* Defined in game_relations.ltx -> [game_relations] -> [communities].
|
|
260
|
+
*
|
|
261
|
+
* Example: 8 is monster, 9 is stalker, 0 is actor, 4 is freedom
|
|
262
|
+
*/
|
|
254
263
|
public team: u8;
|
|
264
|
+
|
|
265
|
+
public group: u8;
|
|
266
|
+
|
|
255
267
|
/**
|
|
256
268
|
* Object squad id, maximal u16 (65535) if no squad assigned.
|
|
257
269
|
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
/**
|
|
3
|
+
* Utility to get current filename, similar to __filename in nodejs.
|
|
4
|
+
*
|
|
5
|
+
* @group xrf_plugin
|
|
6
|
+
*/
|
|
7
|
+
const $filename: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Utility to transform TS provided array to a lua one.
|
|
11
|
+
* Just wrapper that is stripped compile time, but simplifies unit testing with TS.
|
|
12
|
+
*
|
|
13
|
+
* @group xrf_plugin
|
|
14
|
+
*/
|
|
15
|
+
function $fromArray<T>(array: Array<T>): LuaTable<number, T>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Utility to transform LUA array to JS array.
|
|
19
|
+
* Just wrapper that is stripped compile time, but simplifies unit testing with TS.
|
|
20
|
+
*
|
|
21
|
+
* @group xrf_plugin
|
|
22
|
+
*/
|
|
23
|
+
function $fromLuaArray<T>(array: LuaTable<number, T>): Array<T>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Utility to transform TS provided object to a lua table.
|
|
27
|
+
* Just wrapper that is stripped compile time, but simplifies unit testing with TS.
|
|
28
|
+
*
|
|
29
|
+
* @group xrf_plugin
|
|
30
|
+
*/
|
|
31
|
+
function $fromObject<K extends string | number, T>(object: Record<K, T>): LuaTable<K, T>;
|
|
32
|
+
function $fromObject<D>(object: D): LuaTable<keyof D, D[keyof D]>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Utility to transform LUA provided table to a TS one.
|
|
36
|
+
* Just wrapper that is stripped compile time, but simplifies unit testing with TS.
|
|
37
|
+
*
|
|
38
|
+
* @group xrf_plugin
|
|
39
|
+
*/
|
|
40
|
+
function $fromLuaTable<K extends string | number, T>(object: LuaTable<K, T>): Record<K, T>;
|
|
41
|
+
function $fromLuaTable<D>(object: LuaTable<keyof D, D[keyof D]>): D;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export {};
|