Skip to content

Class: MockCAlifeMonsterBrain

Mock of the X-Ray engine CALifeMonsterBrain alife brain.

Implements

  • CALifeMonsterBrain

Constructors

Constructor

ts
new MockCAlifeMonsterBrain(): MockCAlifeMonsterBrain;

Returns

MockCAlifeMonsterBrain

Methods

create()

ts
static create(): MockCAlifeMonsterBrain;

Returns

MockCAlifeMonsterBrain


mock()

ts
static mock(): CALifeMonsterBrain;

Returns

CALifeMonsterBrain

Properties

action_type

ts
action_type: Mock<() => number>;

Get the meet action type for another ALife object.

Param

object

Other ALife schedulable object.

Param

index

Relation index.

Param

mutual_detection

Whether both objects detected each other.

Returns

Meet action type id.

Implementation of

ts
CALifeMonsterBrain.action_type

can_choose_alife_tasks

ts
can_choose_alife_tasks: MockedFunction<{
  (): boolean;
  (value: boolean): void;
}>;

Returns

Whether this brain may choose ALife tasks.

Implementation of

ts
CALifeMonsterBrain.can_choose_alife_tasks

canChooseAlifeTasks

ts
canChooseAlifeTasks: boolean = true;

default_behaviour

ts
default_behaviour: Mock<UnknownFunction>;

Reset the brain to default no-path behavior.

Implementation of

ts
CALifeMonsterBrain.default_behaviour

movement

ts
movement: MockedFunction<() => CALifeMonsterMovementManager>;

Returns

Offline movement manager.

Implementation of

ts
CALifeMonsterBrain.movement

object

ts
object: MockedFunction<() => cse_alife_monster_abstract>;

Returns

Owning monster server object.

Implementation of

ts
CALifeMonsterBrain.object

on_location_change

ts
on_location_change: Mock<UnknownFunction>;

Called when the owning monster changes graph location.

Implementation of

ts
CALifeMonsterBrain.on_location_change

on_register

ts
on_register: Mock<UnknownFunction>;

Called when the owning monster is registered.

Remarks

Follows the owning server object's on_register lifecycle. It can run during savegame load or ALife update setup, so treat it as repeatable.

Implementation of

ts
CALifeMonsterBrain.on_register

on_state_read

ts
on_state_read: Mock<UnknownFunction>;

Read brain state from a network packet.

Param

packet

Source network packet.

Implementation of

ts
CALifeMonsterBrain.on_state_read

on_state_write

ts
on_state_write: Mock<UnknownFunction>;

Write brain state to a network packet.

Param

packet

Target network packet.

Implementation of

ts
CALifeMonsterBrain.on_state_write

on_switch_offline

ts
on_switch_offline: Mock<UnknownFunction>;

Called when the owning monster switches offline.

Implementation of

ts
CALifeMonsterBrain.on_switch_offline

on_switch_online

ts
on_switch_online: Mock<UnknownFunction>;

Called when the owning monster switches online.

Implementation of

ts
CALifeMonsterBrain.on_switch_online

on_unregister

ts
on_unregister: Mock<UnknownFunction>;

Called when the owning monster is unregistered.

Remarks

Pair cleanup here with state installed from on_register.

Implementation of

ts
CALifeMonsterBrain.on_unregister

perform_attack

ts
perform_attack: Mock<() => boolean>;

Try to perform an offline attack.

Returns

Whether an attack was performed.

Implementation of

ts
CALifeMonsterBrain.perform_attack

process_task

ts
process_task: Mock<UnknownFunction>;

Process the currently selected ALife task.

Implementation of

ts
CALifeMonsterBrain.process_task

select_task

ts
select_task: Mock<UnknownFunction>;

Select the next ALife task.

Param

forced

Whether task selection should ignore regular throttling.

Implementation of

ts
CALifeMonsterBrain.select_task

smart_terrain

ts
smart_terrain: MockedFunction<() => cse_alife_smart_zone>;

Returns

Smart terrain assigned to the owner.

Implementation of

ts
CALifeMonsterBrain.smart_terrain

update

ts
update: Mock<UnknownFunction>;

Update offline planning.

Param

forced

Whether the update should ignore regular throttling.

Implementation of

ts
CALifeMonsterBrain.update

update_script

ts
update_script: Mock<UnknownFunction>;

Script-facing update hook.

Implementation of

ts
CALifeMonsterBrain.update_script