Movement - JohnDoeAntler/LF2-AI-Abstraction GitHub Wiki

A class that includes plenty of movement presets such as tracing, dodging and surrounding specified target.

Constructor

Movement(Entity@ me);

// examples
Movement@ movement = Movement(Entity(self));

Properties

No property available.

Methods

init

reset keys.

void init();

// examples
movement.init();

face

forcing AI to face to specified target.

void face(Position@ pos);

// examples
movement.face(Position(target));

run

forcing AI run forward, run to left if facing left, else facing right.

void run();

// examples
movement.run();

stopRunning

forcing AI to stop running if AI is running, does nothing if AI is not running.

void stopRunning();

// examples
movement.stopRunning();

dash

forcing AI to dash if AI is running, does nothing if AI is not running.

void dash();

// examples
movement.dash();

DfA

Releasing DlA/DrA according to current facing direction

void DfA();

// examples
movement.DfA();

Releasing DlA/DrA to the specified target

void DfA(Position@ pos);

// examples
movement.DfA(Position(target));

DfJ

Releasing DlJ/DrJ according to current facing direction

void DfJ();

// examples
movement.DfJ();

Releasing DlJ/DrJ to the specified target

void DfJ(Position@ pos);

// examples
movement.DfJ(Position(target));

surround

surrounding to specified target, remaining certain distance at the same time.

void surround(Position@ pos, int x, int z);
void surround(Position@ pos, int x, int z, int runbuffer, int walkbuffer);

// examples
movement.surround(Position(target), 120, 30);
movement.surround(Position(target), 120, 30, 40, 1);

trace

go towards into specified target without any distancing.

void trace(Position@ pos);

// examples
movement.trace(Position(target));

dodge

dodge specified target.

void dodge(Position@ pos);

// examples
movement.dodge(Position(target));

goto

To specified point

void goto(int x, int z);

// examples
movement.goto(bg_width / 2, bg_zwidth1 / 2  + bg_zwidth2 / 2); // goto the center of the map

To specified target

it is very useful to catch stunned enemy, goto the position of on-ground item.

// definition
void goto(Position@ obj);

// examples
movement.goto(Position(target));

Snippets

No snippets available.

⚠️ **GitHub.com Fallback** ⚠️