Class: MockAlifeItemWeaponMagazined
Mock alife magazined weapon item server object.
Extends
Implements
cse_alife_item_weapon_magazined
Accessors
__name
Get Signature
get __name(): string;Returns
string
Implementation of
cse_alife_item_weapon_magazined.__nameInherited from
__name
Get Signature
get static __name(): string;Returns
string
Inherited from
Constructors
Constructor
new MockAlifeItemWeaponMagazined(config?:
| string
| IMockAlifeObjectConfig): MockAlifeItemWeaponMagazined;Parameters
| Parameter | Type |
|---|---|
config | | string | IMockAlifeObjectConfig |
Returns
MockAlifeItemWeaponMagazined
Inherited from
MockAlifeItemWeapon.constructor
Methods
add_upgrade()
add_upgrade(section: string): void;Add an upgrade section to the item.
Parameters
| Parameter | Type | Description |
|---|---|---|
section | string | Upgrade section id. |
Returns
void
Remarks
Adding the same upgrade twice is a fatal engine error.
Implementation of
cse_alife_item_weapon_magazined.add_upgradeInherited from
MockAlifeItemWeapon.add_upgrade
bfUseful()
bfUseful(): boolean;Returns
boolean
Whether the ALife item is useful to AI.
Implementation of
cse_alife_item_weapon_magazined.bfUsefulInherited from
can_save()
can_save(): boolean;Returns
boolean
Whether this object should be saved.
Implementation of
cse_alife_item_weapon_magazined.can_saveInherited from
can_switch_offline()
Call Signature
can_switch_offline(): boolean;Returns
boolean
Whether this object may switch offline.
Implementation of
cse_alife_item_weapon_magazined.can_switch_offlineInherited from
MockAlifeItemWeapon.can_switch_offline
Call Signature
can_switch_offline(value: boolean): void;Allow or block switching offline.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether offline switching is allowed. |
Returns
void
Remarks
Sets the object's switch-offline flag; it does not switch the object immediately.
Implementation of
cse_alife_item_weapon_magazined.can_switch_offlineInherited from
MockAlifeItemWeapon.can_switch_offline
can_switch_online()
Call Signature
can_switch_online(): boolean;Returns
boolean
Whether this object may switch online.
Implementation of
cse_alife_item_weapon_magazined.can_switch_onlineInherited from
MockAlifeItemWeapon.can_switch_online
Call Signature
can_switch_online(value: boolean): void;Allow or block switching online.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether online switching is allowed. |
Returns
void
Remarks
Sets the object's switch-online flag; it does not switch the object immediately.
Implementation of
cse_alife_item_weapon_magazined.can_switch_onlineInherited from
MockAlifeItemWeapon.can_switch_online
clone_addons()
clone_addons(_weapon: cse_alife_item_weapon): void;Copy addon flags from another weapon server object.
Parameters
| Parameter | Type |
|---|---|
_weapon | cse_alife_item_weapon |
Returns
void
Remarks
Copies addon state only. Ammo, condition, and installed upgrades are handled by other fields or helpers.
Implementation of
cse_alife_item_weapon_magazined.clone_addonsInherited from
MockAlifeItemWeapon.clone_addons
clsid()
clsid(): TXR_class_id;Returns
TXR_class_id
Engine class id.
Implementation of
cse_alife_item_weapon_magazined.clsidInherited from
FillProps()
FillProps(_pref: string, _items: prop_item_vec): void;Fill editor property rows for this object.
Parameters
| Parameter | Type |
|---|---|
_pref | string |
_items | prop_item_vec |
Returns
void
Implementation of
cse_alife_item_weapon_magazined.FillPropsInherited from
get_ammo_elapsed()
get_ammo_elapsed(): number;Returns
number
Ammo currently loaded in the weapon.
Implementation of
cse_alife_item_weapon_magazined.get_ammo_elapsedInherited from
MockAlifeItemWeapon.get_ammo_elapsed
get_ammo_magsize()
get_ammo_magsize(): number;Returns
number
Weapon magazine size from the weapon section.
Implementation of
cse_alife_item_weapon_magazined.get_ammo_magsizeInherited from
MockAlifeItemWeapon.get_ammo_magsize
has_upgrade()
has_upgrade(section: string): boolean;Check whether the item already has an upgrade section.
Parameters
| Parameter | Type | Description |
|---|---|---|
section | string | Upgrade section id. |
Returns
boolean
Whether the upgrade is installed.
Implementation of
cse_alife_item_weapon_magazined.has_upgradeInherited from
MockAlifeItemWeapon.has_upgrade
init()
init(): cse_alife_object;Initialize the ALife object and return its abstract base.
Returns
cse_alife_object
Initialized abstract entity.
Implementation of
cse_alife_item_weapon_magazined.initInherited from
interactive()
interactive(): boolean;Returns
boolean
Whether the object is interactive.
Implementation of
cse_alife_item_weapon_magazined.interactiveInherited from
MockAlifeItemWeapon.interactive
keep_saved_data_anyway()
keep_saved_data_anyway(): boolean;Returns
boolean
Implementation of
cse_alife_item_weapon_magazined.keep_saved_data_anywayInherited from
MockAlifeItemWeapon.keep_saved_data_anyway
move_offline()
Call Signature
move_offline(): boolean;Returns
boolean
Whether the object should move while offline.
Implementation of
cse_alife_item_weapon_magazined.move_offlineInherited from
MockAlifeItemWeapon.move_offline
Call Signature
move_offline(value: boolean): void;Set whether the object should move while offline.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether offline movement is enabled. |
Returns
void
Implementation of
cse_alife_item_weapon_magazined.move_offlineInherited from
MockAlifeItemWeapon.move_offline
name()
name<T>(): T;Type Parameters
| Type Parameter |
|---|
T extends string |
Returns
T
Runtime object name.
Implementation of
cse_alife_item_weapon_magazined.nameInherited from
on_before_register()
on_before_register(): void;Returns
void
Implementation of
cse_alife_item_weapon_magazined.on_before_registerInherited from
MockAlifeItemWeapon.on_before_register
on_register()
on_register(): void;Returns
void
Implementation of
cse_alife_item_weapon_magazined.on_registerInherited from
MockAlifeItemWeapon.on_register
on_spawn()
on_spawn(): void;Returns
void
Implementation of
cse_alife_item_weapon_magazined.on_spawnInherited from
on_unregister()
on_unregister(): void;Returns
void
Implementation of
cse_alife_item_weapon_magazined.on_unregisterInherited from
MockAlifeItemWeapon.on_unregister
section_name()
section_name<T>(): T;Type Parameters
| Type Parameter |
|---|
T extends string |
Returns
T
Spawn section name.
Implementation of
cse_alife_item_weapon_magazined.section_nameInherited from
MockAlifeItemWeapon.section_name
set_ammo_elapsed()
set_ammo_elapsed(count: number): void;Set ammo currently loaded in the weapon.
Parameters
| Parameter | Type | Description |
|---|---|---|
count | number | Loaded ammo count. |
Returns
void
Implementation of
cse_alife_item_weapon_magazined.set_ammo_elapsedInherited from
MockAlifeItemWeapon.set_ammo_elapsed
set_yaw()
set_yaw(yaw: number): void;Set object yaw.
Parameters
| Parameter | Type | Description |
|---|---|---|
yaw | number | Yaw angle. |
Returns
void
Implementation of
cse_alife_item_weapon_magazined.set_yawInherited from
STATE_Read()
STATE_Read(packet: net_packet, size: number): void;Read a state packet into this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Source network packet. |
size | number | Serialized state size. |
Returns
void
Remarks
Use only with packets written for the same server object class and state format.
Implementation of
cse_alife_item_weapon_magazined.STATE_ReadInherited from
MockAlifeItemWeapon.STATE_Read
STATE_Write()
STATE_Write(packet: net_packet): void;Write a state packet from this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Target network packet. |
Returns
void
Implementation of
cse_alife_item_weapon_magazined.STATE_WriteInherited from
MockAlifeItemWeapon.STATE_Write
switch_offline()
switch_offline(): void;Mark the server object offline.
Returns
void
Source
src/xrGame/alife_dynamic_object.cpp, CSE_ALifeDynamicObject::switch_offline.
Remarks
Requires the object to be online. The base implementation marks it offline, removes it from the online ALife set, and clears client data unless keep_saved_data_anyway() returns true.
Implementation of
cse_alife_item_weapon_magazined.switch_offlineInherited from
MockAlifeItemWeapon.switch_offline
switch_online()
switch_online(): void;Mark the server object online.
Returns
void
Source
src/xrGame/alife_dynamic_object.cpp, CSE_ALifeDynamicObject::switch_online.
Remarks
Requires the object to be offline. The base implementation marks it online and adds it to the online ALife set. Use the simulator switch manager for normal distance-based switching.
Implementation of
cse_alife_item_weapon_magazined.switch_onlineInherited from
MockAlifeItemWeapon.switch_online
update()
update(): void;Declared on the prototype rather than as an own jest.fn() field.
Returns
void
Remarks
Server objects override update and call super.update(). An own instance field is installed by this constructor before the subclass body runs, so it would shadow the subclass override entirely and leave super.update undefined. Spy on it with jest.spyOn(object, "update") when call assertions are needed.
Implementation of
cse_alife_item_weapon_magazined.updateInherited from
UPDATE_Read()
UPDATE_Read(packet: net_packet): void;Read an update packet into this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Source network packet. |
Returns
void
Remarks
Use only with packets written for the same server object class and update format.
Implementation of
cse_alife_item_weapon_magazined.UPDATE_ReadInherited from
MockAlifeItemWeapon.UPDATE_Read
UPDATE_Write()
UPDATE_Write(packet: net_packet): void;Write an update packet from this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Target network packet. |
Returns
void
Implementation of
cse_alife_item_weapon_magazined.UPDATE_WriteInherited from
MockAlifeItemWeapon.UPDATE_Write
use_ai_locations()
use_ai_locations(value: boolean): void;Enable or disable AI location graph use.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether AI locations should be used. |
Returns
void
Implementation of
cse_alife_item_weapon_magazined.use_ai_locationsInherited from
MockAlifeItemWeapon.use_ai_locations
used_ai_locations()
used_ai_locations(): boolean;Returns
boolean
Whether the object uses AI location graph data.
Implementation of
cse_alife_item_weapon_magazined.used_ai_locationsInherited from
MockAlifeItemWeapon.used_ai_locations
visible_for_map()
Call Signature
visible_for_map(): boolean;Returns
boolean
Whether the object is visible on the map.
Implementation of
cse_alife_item_weapon_magazined.visible_for_mapInherited from
MockAlifeItemWeapon.visible_for_map
Call Signature
visible_for_map(value: boolean): void;Set whether the object is visible on the map.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether the object should be shown on the map. |
Returns
void
Implementation of
cse_alife_item_weapon_magazined.visible_for_mapInherited from
MockAlifeItemWeapon.visible_for_map
create()
static create(config?: IMockAlifeObjectConfig): MockAlifeItemWeaponMagazined;Parameters
| Parameter | Type |
|---|---|
config | IMockAlifeObjectConfig |
Returns
MockAlifeItemWeaponMagazined
Overrides
mock()
static mock(config?: IMockAlifeObjectConfig): cse_alife_item_weapon_magazined;Parameters
| Parameter | Type |
|---|---|
config | IMockAlifeObjectConfig |
Returns
cse_alife_item_weapon_magazined
Overrides
mockWithClassId()
static mockWithClassId(classId: number): cse_alife_object;Parameters
| Parameter | Type |
|---|---|
classId | number |
Returns
cse_alife_object
Inherited from
MockAlifeItemWeapon.mockWithClassId
toMock()
static toMock(object: cse_alife_object): MockAlifeObject;Parameters
| Parameter | Type |
|---|---|
object | cse_alife_object |
Returns
Inherited from
Properties
alive
alive: Mock<() => boolean>;Inherited from
angle
angle: vector;Server-side orientation angles.
Implementation of
cse_alife_item_weapon_magazined.angleInherited from
canSave
canSave: boolean;Inherited from
canSwitchOffline
canSwitchOffline: boolean;Inherited from
MockAlifeItemWeapon.canSwitchOffline
canSwitchOnline
canSwitchOnline: boolean;Inherited from
MockAlifeItemWeapon.canSwitchOnline
classId
classId: TXR_class_id;Inherited from
clear_smart_terrain
clear_smart_terrain: Mock<UnknownFunction>;Inherited from
MockAlifeItemWeapon.clear_smart_terrain
community
community: <T>() => T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Inherited from
id
id: number;Server object id.
Implementation of
cse_alife_item_weapon_magazined.idInherited from
isInteractive
isInteractive: boolean;Inherited from
MockAlifeItemWeapon.isInteractive
isUsefulForNpc
isUsefulForNpc: boolean = false;Inherited from
MockAlifeItemWeapon.isUsefulForNpc
isVisibleForMap
isVisibleForMap: boolean;Inherited from
MockAlifeItemWeapon.isVisibleForMap
m_game_vertex_id
m_game_vertex_id: number;Game graph vertex used by ALife simulation.
Implementation of
cse_alife_item_weapon_magazined.m_game_vertex_idInherited from
MockAlifeItemWeapon.m_game_vertex_id
m_level_vertex_id
m_level_vertex_id: number;Level graph vertex used by ALife simulation.
Implementation of
cse_alife_item_weapon_magazined.m_level_vertex_idInherited from
MockAlifeItemWeapon.m_level_vertex_id
m_story_id
m_story_id: number;Always numeric value. Returns maximal u32 (4294967295) value if object has no story id.
Implementation of
cse_alife_item_weapon_magazined.m_story_idInherited from
MockAlifeItemWeapon.m_story_id
objectAlive
objectAlive: boolean;Inherited from
MockAlifeItemWeapon.objectAlive
objectAmmoElapsed
objectAmmoElapsed: number = 0;Inherited from
MockAlifeItemWeapon.objectAmmoElapsed
objectAmmoMagSize
objectAmmoMagSize: number = 30;Inherited from
MockAlifeItemWeapon.objectAmmoMagSize
objectCommunity
objectCommunity: string;Inherited from
MockAlifeItemWeapon.objectCommunity
objectName
objectName: string;Inherited from
MockAlifeItemWeapon.objectName
objectUpgrades
objectUpgrades: Set<string>;Inherited from
MockAlifeItemWeapon.objectUpgrades
online
online: boolean;Whether server object has client representation and is in online mode.
Implementation of
cse_alife_item_weapon_magazined.onlineInherited from
parent_id
parent_id: number;Parent server object id, or 65535 when there is no parent.
Implementation of
cse_alife_item_weapon_magazined.parent_idInherited from
position
position: vector;Server-side world position.
Implementation of
cse_alife_item_weapon_magazined.positionInherited from
script_version
script_version: number;Script data version stored with this object.
Implementation of
cse_alife_item_weapon_magazined.script_versionInherited from
MockAlifeItemWeapon.script_version
section
section: string;Inherited from
shouldMoveOffline
shouldMoveOffline: boolean;Inherited from
MockAlifeItemWeapon.shouldMoveOffline
spawn_ini
spawn_ini: Mock<() => ini_file | null>;Returns
Spawn ini attached to this object, if any.
Implementation of
cse_alife_item_weapon_magazined.spawn_iniInherited from
spawnIni
spawnIni: ini_file | null;Inherited from
usesAiLocations
usesAiLocations: boolean;