V-Gears 0
Free Final Fantasy VII engine.
Formation::Enemy Struct Reference

Each enemy in the formation. More...

#include <Formation.h>

Public Member Functions

 Enemy ()
 Constructor. More...
 

Public Attributes

unsigned int id
 Enemy ID. More...
 
int x
 Enemy X position. More...
 
int y
 Enemy Y position. More...
 
int z
 Enemy Z position. More...
 
unsigned int row
 Enemy row. More...
 
char cover [5]
 Cover flags. More...
 
bool visible
 Indicates if the enemy is initially visible. More...
 
int direction
 Indicates initial direction facing if players get a side attack. More...
 
bool targeteable
 Indicates if the enemy is targeteable. More...
 
bool main_script_active
 

Detailed Description

Each enemy in the formation.

Constructor & Destructor Documentation

◆ Enemy()

Formation::Enemy::Enemy ( )
inline

Constructor.

Initializes to default values.

Member Data Documentation

◆ cover

char Formation::Enemy::cover[5]

Cover flags.

These flags are used in conjunction with row to determine if a target can be selected as the target of a short-range attack. The determination of this is worked out in this way: An enemy exists in row 1 and another in row 2. If the enemy in row 1 shares a cover flag with the enemy in row 2 then the enemy in row 2 cannot be targeted until all enemies in row 1 that share a cover flag with the row 2 enemy is defeated. It works like this. Two active enemies exist, A and B.

If ((B's row > A's row) and (B's cover flags AND A's cover flags) > 0) then enemy B cannot be targeted by short-range attacks.

For any enemies A and B.

Example: Consider the Battery Cap x6 battle in the forest between Nibelheim and Rocket Town. Their cover flags (in binary) are:

Row 1: 00100 Row 2: 00110 01100 Row 3: 00011 00100 11000

The battery caps in row 2 cannot be targeted by a short-range attack until the one in row 1 has been defeated because they share the 0x4 cover flag. Once row 1 has been cleared:

Row 2: 00110 01100 Row 3: 00011 00100 11000

The battery cap on left in row 2 covers the left two in row 3 because it shares flag 0x4 with the one in the middle and flag 0x2 with the one on the far left. As long as it is active these in row 3 cannot be targeted. Similarly, the battery cap on the right in row 2 shares the 0x4 flag with the middle of row 3 and the 0x8 flag with the far right of row 3 so these cannot be targeted until the right side of row 2 is defeated. It is also necessary to note that because row 1 does not share any flags with the extreme right and left of row 3, they can be targeted if the corresponding enemy in row 2 is defeated even if the row 1 enemy is still active. Also of note is that enemies in the same row that share cover flags are not considered.

◆ direction

int Formation::Enemy::direction

Indicates initial direction facing if players get a side attack.

◆ id

unsigned int Formation::Enemy::id

Enemy ID.

◆ main_script_active

bool Formation::Enemy::main_script_active
Todo:
Understand and document.

◆ row

unsigned int Formation::Enemy::row

Enemy row.

◆ targeteable

bool Formation::Enemy::targeteable

Indicates if the enemy is targeteable.

◆ visible

bool Formation::Enemy::visible

Indicates if the enemy is initially visible.

◆ x

int Formation::Enemy::x

Enemy X position.

◆ y

int Formation::Enemy::y

Enemy Y position.

◆ z

int Formation::Enemy::z

Enemy Z position.


The documentation for this struct was generated from the following file: