Crossfire Server, Trunk  1.75.0
Monster movements

Macros

#define ALLRUN   6
 Always run, never attack good for sim. More...
 
#define CIRCLE1   32
 If the upper four bits of move_type / attack_movement are set to this number, the monster will move in a circle until it is attacked, or the enemy field is set, this is good for non-aggressive monsters and NPC. More...
 
#define CIRCLE2   48
 Same as CIRCLE1 but a larger circle is used. More...
 
#define DISTATT   1
 Move toward a player if far, but maintain some space, attack from a distance - good for missile users only. More...
 
#define DISTHIT   7
 Attack from a distance if hit as recommended by Frank. More...
 
#define HI4   240
 
#define HITRUN   3
 Run to then hit player then run away cyclicly. More...
 
#define LO4   15
 bitmasks for upper and lower 4 bits from 8 bit fields More...
 
#define PACEH   64
 The monster will pace back and forth until attacked. More...
 
#define PACEH2   80
 The monster will pace as above but the length of the pace area is longer and the monster stops before changing directions. More...
 
#define PACEV   128
 The monster will pace back and forth until attacked. More...
 
#define PACEV2   144
 The monster will pace as above but the length of the pace area is longer and the monster stops before changing directions. More...
 
#define PETMOVE   16
 If the upper four bits of attack_movement are set to this number, the monster follows a player until the owner calls it back or off player followed denoted by ob->owner the monster will try to attack whatever the player is attacking, and will continue to do so until the calls off the monster - a key command will be inserted to do so. More...
 
#define RANDO   96
 The monster will go in a random direction until it is stopped by an obstacle, then it chooses another direction. More...
 
#define RANDO2   112
 Constantly move in a different random direction. More...
 
#define RUNATT   2
 Run but attack if player catches up to object. More...
 
#define RUSH   5
 Rush toward player blindly, similiar to dumb monster. More...
 
#define WAIT2   8
 Monster does not try to move towards player if far. More...
 
#define WAITATT   4
 Wait for player to approach then hit, move if hit. More...
 

Detailed Description

Author
kholl.nosp@m.and@.nosp@m.sunla.nosp@m.b.ci.nosp@m.t.cor.nosp@m.nell.nosp@m..edu

if your monsters start acting wierd, mail me.

The following definitions are for the attack_movement variable in monsters. If the attack_variable movement is left out of the monster archetype, or is set to zero, the standard mode of movement from previous versions of Crossfire will be used. The upper four bits of movement data are not in effect when the monster has an enemy. These should only be used for non agressive monsters. To program a monsters movement add the attack movement numbers to the movement numbers example a monster that moves in a circle until attacked and then attacks from a distance: CIRCLE1 = 32

+ DISTATT = 1

attack_movement = 33

Macro Definition Documentation

◆ ALLRUN

#define ALLRUN   6

Always run, never attack good for sim.

of weak player.

Definition at line 481 of file define.h.

◆ CIRCLE1

#define CIRCLE1   32

If the upper four bits of move_type / attack_movement are set to this number, the monster will move in a circle until it is attacked, or the enemy field is set, this is good for non-aggressive monsters and NPC.


Definition at line 493 of file define.h.

◆ CIRCLE2

#define CIRCLE2   48

Same as CIRCLE1 but a larger circle is used.


Definition at line 497 of file define.h.

◆ DISTATT

#define DISTATT   1

Move toward a player if far, but maintain some space, attack from a distance - good for missile users only.


Definition at line 475 of file define.h.

◆ DISTHIT

#define DISTHIT   7

Attack from a distance if hit as recommended by Frank.

Definition at line 482 of file define.h.

◆ HI4

#define HI4   240

Definition at line 515 of file define.h.

◆ HITRUN

#define HITRUN   3

Run to then hit player then run away cyclicly.


Definition at line 478 of file define.h.

◆ LO4

#define LO4   15

bitmasks for upper and lower 4 bits from 8 bit fields

Definition at line 514 of file define.h.

◆ PACEH

#define PACEH   64

The monster will pace back and forth until attacked.

This is HORIZONTAL movement.

Definition at line 498 of file define.h.

◆ PACEH2

#define PACEH2   80

The monster will pace as above but the length of the pace area is longer and the monster stops before changing directions.

This is HORIZONTAL movement.

Definition at line 500 of file define.h.

◆ PACEV

#define PACEV   128

The monster will pace back and forth until attacked.

This is VERTICAL movement.

Definition at line 508 of file define.h.

◆ PACEV2

#define PACEV2   144

The monster will pace as above but the length of the pace area is longer and the monster stops before changing directions.

This is VERTICAL movement.

Definition at line 510 of file define.h.

◆ PETMOVE

#define PETMOVE   16

If the upper four bits of attack_movement are set to this number, the monster follows a player until the owner calls it back or off player followed denoted by ob->owner the monster will try to attack whatever the player is attacking, and will continue to do so until the calls off the monster - a key command will be inserted to do so.


Definition at line 485 of file define.h.

◆ RANDO

#define RANDO   96

The monster will go in a random direction until it is stopped by an obstacle, then it chooses another direction.


Definition at line 504 of file define.h.

◆ RANDO2

#define RANDO2   112

Constantly move in a different random direction.


Definition at line 507 of file define.h.

◆ RUNATT

#define RUNATT   2

Run but attack if player catches up to object.


Definition at line 477 of file define.h.

◆ RUSH

#define RUSH   5

Rush toward player blindly, similiar to dumb monster.

Definition at line 480 of file define.h.

◆ WAIT2

#define WAIT2   8

Monster does not try to move towards player if far.

Maintains comfortable distance.

Definition at line 483 of file define.h.

◆ WAITATT

#define WAITATT   4

Wait for player to approach then hit, move if hit.


Definition at line 479 of file define.h.