Skip to content

Class: CWeaponMagazined

Client object binding for magazine-fed weapons.

Source

src/xrGame/WeaponScript.cpp, CWeaponMagazined binding.

Custom Constructor

CWeaponMagazined

Remarks

Base class for most firearms exposed to scripts. The binding inherits CWeapon, so can_kill() is available on all subclasses declared under this family.

Extends

Extended by

Constructors

Constructor

ts
protected new CWeaponMagazined(): CWeaponMagazined;

Cast-only runtime wrapper.

Returns

CWeaponMagazined

Inherited from

CWeapon.constructor

Methods

_construct()

ts
_construct(): DLL_Pure;

Construct engine-side object state.

Returns

DLL_Pure

Constructed base object.

Remarks

Lifecycle hook used by the engine. Calling it from gameplay scripts can reinitialize native state unexpectedly.

Inherited from

CWeapon._construct


can_kill()

ts
can_kill(): boolean;

Check whether the weapon can currently fire a lethal shot.

Returns

boolean

Whether the weapon can kill.

Remarks

Returns true when the weapon has suitable ammo available or does not use ammo. This is the same predicate used by actor and stalker weapon selection before considering an item lethal.

Inherited from

CWeapon.can_kill


getEnabled()

ts
getEnabled(): boolean;

Returns

boolean

Whether the object is enabled in the client object loop.

Inherited from

CWeapon.getEnabled


getVisible()

ts
getVisible(): boolean;

Returns

boolean

Whether the object is visible.

Inherited from

CWeapon.getVisible


net_Export()

ts
net_Export(net_packet: net_packet): void;

Export network state to a packet.

Parameters

ParameterTypeDescription
net_packetnet_packetDestination network packet.

Returns

void

Inherited from

CWeapon.net_Export


net_Import()

ts
net_Import(net_packet: net_packet): void;

Import network state from a packet.

Parameters

ParameterTypeDescription
net_packetnet_packetSource network packet.

Returns

void

Inherited from

CWeapon.net_Import


net_Spawn()

ts
net_Spawn(cse_abstract: cse_abstract): boolean;

Spawn the client object from its server object.

Parameters

ParameterTypeDescription
cse_abstractcse_abstractServer object used for spawn data.

Returns

boolean

Whether spawn succeeded.

Remarks

Lifecycle hook used during network spawn. Return false to reject spawn in custom subclasses.

Inherited from

CWeapon.net_Spawn


use()

ts
use(object: CGameObject): boolean;

Use another object through the engine interaction path.

Parameters

ParameterTypeDescription
objectCGameObjectObject being used.

Returns

boolean

Whether the use action was handled.

Inherited from

CWeapon.use


Visual()

ts
Visual(): IXR_IRender_Visual;

Returns

IXR_IRender_Visual

Render visual assigned to the object.

Inherited from

CWeapon.Visual

Properties

__name

ts
readonly __name: string;

LuaBind instance constructor name.

Inherited from

CWeapon.__name


__name

ts
readonly static __name: string;

LuaBind class constructor name.

Inherited from

CWeapon.__name