Class: MockAlifeMonsterBase
Mock alife monster creature server object.
Extends
Implements
cse_alife_monster_base
Accessors
__name
Get Signature
get __name(): string;Returns
string
Implementation of
cse_alife_monster_base.__nameInherited from
MockServerAlifeCreatureAbstract.__name
__name
Get Signature
get static __name(): string;Returns
string
Inherited from
MockServerAlifeCreatureAbstract.__name
Constructors
Constructor
new MockAlifeMonsterBase(config: IMockAlifeObjectConfig): MockAlifeMonsterBase;Parameters
| Parameter | Type |
|---|---|
config | IMockAlifeObjectConfig |
Returns
MockAlifeMonsterBase
Inherited from
MockServerAlifeCreatureAbstract.constructor
Methods
can_save()
can_save(): boolean;Returns
boolean
Whether this object should be saved.
Implementation of
cse_alife_monster_base.can_saveInherited from
MockServerAlifeCreatureAbstract.can_save
can_switch_offline()
Call Signature
can_switch_offline(): boolean;Returns
boolean
Whether this object may switch offline.
Implementation of
cse_alife_monster_base.can_switch_offlineInherited from
MockServerAlifeCreatureAbstract.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_monster_base.can_switch_offlineInherited from
MockServerAlifeCreatureAbstract.can_switch_offline
can_switch_online()
Call Signature
can_switch_online(): boolean;Returns
boolean
Whether this object may switch online.
Implementation of
cse_alife_monster_base.can_switch_onlineInherited from
MockServerAlifeCreatureAbstract.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_monster_base.can_switch_onlineInherited from
MockServerAlifeCreatureAbstract.can_switch_online
clsid()
clsid(): TXR_class_id;Returns
TXR_class_id
Engine class id.
Implementation of
cse_alife_monster_base.clsidInherited from
MockServerAlifeCreatureAbstract.clsid
current_level_travel_speed()
Call Signature
current_level_travel_speed(): number;Returns
number
Travel speed used inside the current level.
Implementation of
cse_alife_monster_base.current_level_travel_speedInherited from
MockServerAlifeCreatureAbstract.current_level_travel_speed
Call Signature
current_level_travel_speed(value: number): void;Set travel speed used inside the current level.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | New travel speed. |
Returns
void
Implementation of
cse_alife_monster_base.current_level_travel_speedInherited from
MockServerAlifeCreatureAbstract.current_level_travel_speed
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_monster_base.FillPropsInherited from
MockServerAlifeCreatureAbstract.FillProps
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_monster_base.initInherited from
MockServerAlifeCreatureAbstract.init
interactive()
interactive(): boolean;Returns
boolean
Whether the object is interactive.
Implementation of
cse_alife_monster_base.interactiveInherited from
MockServerAlifeCreatureAbstract.interactive
keep_saved_data_anyway()
keep_saved_data_anyway(): boolean;Returns
boolean
Implementation of
cse_alife_monster_base.keep_saved_data_anywayInherited from
MockServerAlifeCreatureAbstract.keep_saved_data_anyway
kill()
kill(): void;Kill the server-side creature.
Returns
void
Remarks
Intended for creature server objects managed by ALife.
Implementation of
cse_alife_monster_base.killInherited from
MockServerAlifeCreatureAbstract.kill
move_offline()
Call Signature
move_offline(): boolean;Returns
boolean
Whether the object should move while offline.
Implementation of
cse_alife_monster_base.move_offlineInherited from
MockServerAlifeCreatureAbstract.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_monster_base.move_offlineInherited from
MockServerAlifeCreatureAbstract.move_offline
name()
name<T>(): T;Type Parameters
| Type Parameter |
|---|
T extends string |
Returns
T
Runtime object name.
Implementation of
cse_alife_monster_base.nameInherited from
MockServerAlifeCreatureAbstract.name
on_before_register()
on_before_register(): void;Returns
void
Implementation of
cse_alife_monster_base.on_before_registerInherited from
MockServerAlifeCreatureAbstract.on_before_register
on_death()
on_death(_killer?: cse_alife_object): void;Notify the server object that this creature died.
Parameters
| Parameter | Type |
|---|---|
_killer? | cse_alife_object |
Returns
void
Remarks
Marks server-side health as dead and records death time. It is not a general damage method.
Implementation of
cse_alife_monster_base.on_deathInherited from
MockServerAlifeCreatureAbstract.on_death
on_register()
on_register(): void;Returns
void
Implementation of
cse_alife_monster_base.on_registerInherited from
MockServerAlifeCreatureAbstract.on_register
on_spawn()
on_spawn(): void;Returns
void
Implementation of
cse_alife_monster_base.on_spawnInherited from
MockServerAlifeCreatureAbstract.on_spawn
on_unregister()
on_unregister(): void;Returns
void
Implementation of
cse_alife_monster_base.on_unregisterInherited from
MockServerAlifeCreatureAbstract.on_unregister
section_name()
section_name<T>(): T;Type Parameters
| Type Parameter |
|---|
T extends string |
Returns
T
Spawn section name.
Implementation of
cse_alife_monster_base.section_nameInherited from
MockServerAlifeCreatureAbstract.section_name
set_yaw()
set_yaw(yaw: number): void;Set object yaw.
Parameters
| Parameter | Type | Description |
|---|---|---|
yaw | number | Yaw angle. |
Returns
void
Implementation of
cse_alife_monster_base.set_yawInherited from
MockServerAlifeCreatureAbstract.set_yaw
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_monster_base.STATE_ReadInherited from
MockServerAlifeCreatureAbstract.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_monster_base.STATE_WriteInherited from
MockServerAlifeCreatureAbstract.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_monster_base.switch_offlineInherited from
MockServerAlifeCreatureAbstract.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_monster_base.switch_onlineInherited from
MockServerAlifeCreatureAbstract.switch_online
travel_speed()
Call Signature
travel_speed(): number;Returns
number
Travel speed used for graph movement.
Implementation of
cse_alife_monster_base.travel_speedInherited from
MockServerAlifeCreatureAbstract.travel_speed
Call Signature
travel_speed(value: number): void;Set travel speed used for graph movement.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | New travel speed. |
Returns
void
Implementation of
cse_alife_monster_base.travel_speedInherited from
MockServerAlifeCreatureAbstract.travel_speed
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_monster_base.updateInherited from
MockServerAlifeCreatureAbstract.update
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_monster_base.UPDATE_ReadInherited from
MockServerAlifeCreatureAbstract.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_monster_base.UPDATE_WriteInherited from
MockServerAlifeCreatureAbstract.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_monster_base.use_ai_locationsInherited from
MockServerAlifeCreatureAbstract.use_ai_locations
used_ai_locations()
used_ai_locations(): boolean;Returns
boolean
Whether the object uses AI location graph data.
Implementation of
cse_alife_monster_base.used_ai_locationsInherited from
MockServerAlifeCreatureAbstract.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_monster_base.visible_for_mapInherited from
MockServerAlifeCreatureAbstract.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_monster_base.visible_for_mapInherited from
MockServerAlifeCreatureAbstract.visible_for_map
create()
static create(config?: IMockAlifeObjectConfig): MockAlifeMonsterBase;Parameters
| Parameter | Type |
|---|---|
config | IMockAlifeObjectConfig |
Returns
MockAlifeMonsterBase
Overrides
MockServerAlifeCreatureAbstract.create
mock()
static mock(config?: IMockAlifeObjectConfig): cse_alife_monster_base;Parameters
| Parameter | Type |
|---|---|
config | IMockAlifeObjectConfig |
Returns
cse_alife_monster_base
Overrides
MockServerAlifeCreatureAbstract.mock
mockWithClassId()
static mockWithClassId(classId: number): cse_alife_monster_base;Parameters
| Parameter | Type |
|---|---|
classId | number |
Returns
cse_alife_monster_base
Overrides
MockServerAlifeCreatureAbstract.mockWithClassId
toMock()
static toMock(object: cse_alife_object): MockAlifeObject;Parameters
| Parameter | Type |
|---|---|
object | cse_alife_object |
Returns
Inherited from
MockServerAlifeCreatureAbstract.toMock
Properties
aiBrain
aiBrain: CALifeMonsterBrain;Overrides
MockServerAlifeCreatureAbstract.aiBrain
alive
alive: Mock<() => boolean>;Implementation of
cse_alife_monster_base.aliveInherited from
MockServerAlifeCreatureAbstract.alive
angle
angle: vector;Server-side orientation angles.
Implementation of
cse_alife_monster_base.angleInherited from
MockServerAlifeCreatureAbstract.angle
brain
brain: Mock<() => CALifeMonsterBrain>;Throws
If this creature type has no ALife monster brain.
Returns
ALife brain that drives offline monster behavior.
Implementation of
cse_alife_monster_base.brainOverrides
MockServerAlifeCreatureAbstract.brain
canSave
canSave: boolean;Inherited from
MockServerAlifeCreatureAbstract.canSave
canSwitchOffline
canSwitchOffline: boolean;Inherited from
MockServerAlifeCreatureAbstract.canSwitchOffline
canSwitchOnline
canSwitchOnline: boolean;Inherited from
MockServerAlifeCreatureAbstract.canSwitchOnline
classId
classId: TXR_class_id;Inherited from
MockServerAlifeCreatureAbstract.classId
clear_smart_terrain
clear_smart_terrain: Mock<UnknownFunction>;Implementation of
cse_alife_monster_base.clear_smart_terrainInherited from
MockServerAlifeCreatureAbstract.clear_smart_terrain
community
community: <T>() => T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Implementation of
cse_alife_monster_base.communityInherited from
MockServerAlifeCreatureAbstract.community
force_set_goodwill
force_set_goodwill: Mock<UnknownFunction>;Set goodwill from this creature toward another object.
Remarks
npc_id must resolve to an ALife object that can store personal goodwill.
Param
goodwill
New goodwill value.
Param
npc_id
Target object id.
Implementation of
cse_alife_monster_base.force_set_goodwillInherited from
MockServerAlifeCreatureAbstract.force_set_goodwill
g_group
g_group: Mock<() => number>;Returns
Game group id.
Implementation of
cse_alife_monster_base.g_groupInherited from
MockServerAlifeCreatureAbstract.g_group
g_squad
g_squad: Mock<() => number>;Returns
Game squad id.
Implementation of
cse_alife_monster_base.g_squadInherited from
MockServerAlifeCreatureAbstract.g_squad
g_team
g_team: Mock<() => number>;Returns
Game team id.
Implementation of
cse_alife_monster_base.g_teamInherited from
MockServerAlifeCreatureAbstract.g_team
group
group: number;Game group id.
Implementation of
cse_alife_monster_base.groupInherited from
MockServerAlifeCreatureAbstract.group
group_id
group_id: number;Object squad id, maximal u16 (65535) if no squad assigned.
Implementation of
cse_alife_monster_base.group_idInherited from
MockServerAlifeCreatureAbstract.group_id
has_detector
has_detector: Mock<() => boolean>;Returns
Whether the creature has a detector.
Implementation of
cse_alife_monster_base.has_detectorInherited from
MockServerAlifeCreatureAbstract.has_detector
health
health: Mock<() => number>;Returns
Current creature health.
Implementation of
cse_alife_monster_base.healthInherited from
MockServerAlifeCreatureAbstract.health
id
id: number;Server object id.
Implementation of
cse_alife_monster_base.idInherited from
MockServerAlifeCreatureAbstract.id
isInteractive
isInteractive: boolean;Inherited from
MockServerAlifeCreatureAbstract.isInteractive
isVisibleForMap
isVisibleForMap: boolean;Inherited from
MockServerAlifeCreatureAbstract.isVisibleForMap
m_game_vertex_id
m_game_vertex_id: number;Game graph vertex used by ALife simulation.
Implementation of
cse_alife_monster_base.m_game_vertex_idInherited from
MockServerAlifeCreatureAbstract.m_game_vertex_id
m_level_vertex_id
m_level_vertex_id: number;Level graph vertex used by ALife simulation.
Implementation of
cse_alife_monster_base.m_level_vertex_idInherited from
MockServerAlifeCreatureAbstract.m_level_vertex_id
m_smart_terrain_id
m_smart_terrain_id: number;Assigned smart terrain id, or 65535 when none is assigned.
Implementation of
cse_alife_monster_base.m_smart_terrain_idInherited from
MockServerAlifeCreatureAbstract.m_smart_terrain_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_monster_base.m_story_idInherited from
MockServerAlifeCreatureAbstract.m_story_id
o_torso
o_torso: Mock<() => rotation>;Returns
Torso rotation state.
Implementation of
cse_alife_monster_base.o_torsoInherited from
MockServerAlifeCreatureAbstract.o_torso
objectAlive
objectAlive: boolean;Inherited from
MockServerAlifeCreatureAbstract.objectAlive
objectCommunity
objectCommunity: string;Inherited from
MockServerAlifeCreatureAbstract.objectCommunity
objectCurrentLevelTravelSpeed
objectCurrentLevelTravelSpeed: number;Inherited from
MockServerAlifeCreatureAbstract.objectCurrentLevelTravelSpeed
objectHasDetector
objectHasDetector: boolean;Inherited from
MockServerAlifeCreatureAbstract.objectHasDetector
objectHealth
objectHealth: number;Inherited from
MockServerAlifeCreatureAbstract.objectHealth
objectName
objectName: string;Inherited from
MockServerAlifeCreatureAbstract.objectName
objectRank
objectRank: number = -1;Overrides
MockServerAlifeCreatureAbstract.objectRank
objectTravelSpeed
objectTravelSpeed: number;Inherited from
MockServerAlifeCreatureAbstract.objectTravelSpeed
online
online: boolean;Whether server object has client representation and is in online mode.
Implementation of
cse_alife_monster_base.onlineInherited from
MockServerAlifeCreatureAbstract.online
parent_id
parent_id: number;Parent server object id, or 65535 when there is no parent.
Implementation of
cse_alife_monster_base.parent_idInherited from
MockServerAlifeCreatureAbstract.parent_id
position
position: vector;Server-side world position.
Implementation of
cse_alife_monster_base.positionInherited from
MockServerAlifeCreatureAbstract.position
rank
rank: Mock<() => number>;Returns
Creature rank.
Implementation of
cse_alife_monster_base.rankOverrides
MockServerAlifeCreatureAbstract.rank
script_version
script_version: number;Script data version stored with this object.
Implementation of
cse_alife_monster_base.script_versionInherited from
MockServerAlifeCreatureAbstract.script_version
section
section: string;Inherited from
MockServerAlifeCreatureAbstract.section
shouldMoveOffline
shouldMoveOffline: boolean;Inherited from
MockServerAlifeCreatureAbstract.shouldMoveOffline
smart_terrain_id
smart_terrain_id: Mock<() => number>;Returns
Assigned smart terrain id, or 65535 when none is assigned.
Implementation of
cse_alife_monster_base.smart_terrain_idInherited from
MockServerAlifeCreatureAbstract.smart_terrain_id
smart_terrain_task_activate
smart_terrain_task_activate: Mock<UnknownFunction>;Works for CSE_ALifeMonsterAbstract, marks smart terrain as reached and switches logic to terrain task.
Remarks
Only meaningful for monsters assigned to a smart terrain task.
Implementation of
cse_alife_monster_base.smart_terrain_task_activateInherited from
MockServerAlifeCreatureAbstract.smart_terrain_task_activate
smart_terrain_task_deactivate
smart_terrain_task_deactivate: Mock<UnknownFunction>;Mark the current smart terrain task as not reached.
Implementation of
cse_alife_monster_base.smart_terrain_task_deactivateInherited from
MockServerAlifeCreatureAbstract.smart_terrain_task_deactivate
spawn_ini
spawn_ini: Mock<() => ini_file | null>;Returns
Spawn ini attached to this object, if any.
Implementation of
cse_alife_monster_base.spawn_iniInherited from
MockServerAlifeCreatureAbstract.spawn_ini
spawnIni
spawnIni: ini_file | null;Inherited from
MockServerAlifeCreatureAbstract.spawnIni
squad
squad: number;Squad identifier that links squad and parent smart terrain.
Implementation of
cse_alife_monster_base.squadInherited from
MockServerAlifeCreatureAbstract.squad
team
team: number;Team (community) of the object. Defined in game_relations.ltx -> [game_relations] -> [communities].
Example: 8 is monster, 9 is stalker, 0 is actor, 4 is freedom.
Implementation of
cse_alife_monster_base.teamInherited from
MockServerAlifeCreatureAbstract.team
torso
torso: rotation;Inherited from
MockServerAlifeCreatureAbstract.torso
usesAiLocations
usesAiLocations: boolean;