_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include "stratagus.h"
#include "ai_local.h"
#include "actions.h"
#include "action/action_attack.h"
#include "action/action_board.h"
#include "commands.h"
#include "depend.h"
#include "map.h"
#include "pathfinder.h"
#include "tileset.h"
#include "unit.h"
#include "unit_find.h"
#include "unittype.h"
Classes | |
class | EnemyUnitFinder |
class | AiForceEnemyFinder< FIND_TYPE > |
class | IsAnAlliedUnitOf |
class | UnitTypePrioritySorter_Decreasing |
class | AiForceCounter |
class | AiForceRallyPointFinder |
ai_force.cpp - AI force functions. | |
#define | AIATTACK_RANGE 0 |
#define | AIATTACK_ALLMAP 1 |
#define | AIATTACK_BUILDING 2 |
#define | AIATTACK_AGRESSIVE 3 |
int | UnitTypeEquivs [UnitTypeMax+1] |
AI helper variables. More... | |
void | AiResetUnitTypeEquiv () |
equivalence between unittypes More... | |
void | AiNewUnitTypeEquiv (const CUnitType &a, const CUnitType &b) |
Make two unittypes be considered equals. More... | |
int | AiFindUnitTypeEquiv (const CUnitType &unittype, int *result) |
Finds all equivalents units to a given one. More... | |
int | AiFindAvailableUnitTypeEquiv (const CUnitType &unittype, int *usableTypes) |
Finds all available equivalents units to a given one, in the preferred order. More... | |
void | AiRemoveDeadUnitInForces () |
Cleanup units in force. More... | |
bool | AiAssignToForce (CUnit &unit) |
Assign a new unit to a force. More... | |
void | AiAssignFreeUnitsToForce (int force) |
Assign a free units to a force. More... | |
void | AiAttackWithForceAt (unsigned int force, int x, int y) |
Attack with force at position. More... | |
void | AiAttackWithForce (unsigned int force) |
Attack with force. More... | |
void | AiAttackWithForces (int *forces) |
Attack with forces in array. More... | |
static void | AiGroupAttackerForTransport (AiForce &aiForce) |
void | AiForceManager () |
Periodic called force manager handler. More... | |
#define AIATTACK_AGRESSIVE 3 |
#define AIATTACK_ALLMAP 1 |
#define AIATTACK_BUILDING 2 |
#define AIATTACK_RANGE 0 |
void AiAssignFreeUnitsToForce | ( | int | force | ) |
Assign a free units to a force.
Assign free units to force.
bool AiAssignToForce | ( | CUnit & | unit | ) |
Assign a new unit to a force.
Ai assign unit to force.
unit | Unit to assign to force. |
void AiAttackWithForce | ( | unsigned int | force | ) |
Attack with force.
Attack opponent with force.
force | Force number to attack with. |
void AiAttackWithForceAt | ( | unsigned int | force, |
int | x, | ||
int | y | ||
) |
Attack with force at position.
Register ccl features.
Attack at position with force.
force | Force number to attack with. |
x | X tile map position to be attacked. |
y | Y tile map position to be attacked. |
void AiAttackWithForces | ( | int * | forces | ) |
Attack with forces in array.
Attack opponent with forces. Merge forces in array into one attack force and attack with it Merge is make because units in one force help each other during attack
forces | Array with Force numbers to attack with (array should be finished with -1). |
int AiFindAvailableUnitTypeEquiv | ( | const CUnitType & | unittype, |
int * | usableTypes | ||
) |
Finds all available equivalents units to a given one, in the preferred order.
Find All unittypes equivalent to a given one, and which are available UnitType are returned in the preferred order (ie palladin >> knight...)
unittype | The unittype to find equivalence for |
usableTypes | int array which will hold the result. (Size UnitTypeMax+1) |
int AiFindUnitTypeEquiv | ( | const CUnitType & | unittype, |
int * | result | ||
) |
Finds all equivalents units to a given one.
Find All unittypes equivalent to a given one
unittype | the unittype to find equivalence for |
result | int array which will hold the result. (Size UnitTypeMax+1) |
void AiForceManager | ( | ) |
Periodic called force manager handler.
Entry point of force manager, periodic called.
Load all unit before attack.
aiForce | force to group. |
Make two unittypes be considered equals.
Make two unittypes equivalents from the AI's point of vue
a | the first unittype |
b | the second unittype |
void AiRemoveDeadUnitInForces | ( | ) |
Cleanup units in force.
Cleanup units in forces.
void AiResetUnitTypeEquiv | ( | ) |
equivalence between unittypes
Remove any equivalence between unittypes.
Remove any equivalence between unittypes
int UnitTypeEquivs[UnitTypeMax+1] |
AI helper variables.