_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ 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.h"
#include "ai_local.h"
#include "interface.h"
#include "pathfinder.h"
#include "player.h"
#include "script.h"
#include "unit.h"
#include "unit_manager.h"
#include "unittype.h"
#include "upgrade.h"
Functions | |
script_ai.cpp - The AI ccl functions. | |
static void | AiHelperInsert (std::vector< std::vector< CUnitType * > > &table, unsigned int n, CUnitType &base) |
static std::vector< CUnitType * > | getUnitTypeFromString (const std::string &list) |
static std::vector< CUnitType * > | getReparableUnits () |
static std::vector< CUnitType * > | getSupplyUnits () |
static std::vector< CUnitType * > | getRefineryUnits () |
static void | InitAiHelper (AiHelper &aiHelper) |
static int | CclDefineAiHelper (lua_State *l) |
static CAiType * | GetAiTypesByName (const char *name) |
static int | CclDefineAi (lua_State *l) |
static void | InsertUnitTypeRequests (CUnitType *type, int count) |
static AiRequestType * | FindInUnitTypeRequests (const CUnitType *type) |
static int | FindInUpgradeToRequests (const CUnitType *type) |
static void | InsertUpgradeToRequests (CUnitType *type) |
static void | InsertResearchRequests (CUpgrade *upgrade) |
static int | CclAiGetRace (lua_State *l) |
static int | CclAiGetSleepCycles (lua_State *l) |
static int | CclAiDebug (lua_State *l) |
static int | CclAiDebugPlayer (lua_State *l) |
static int | CclAiNeed (lua_State *l) |
static int | CclAiSet (lua_State *l) |
static int | CclAiWait (lua_State *l) |
static int | CclAiForce (lua_State *l) |
static int | CclAiForceRole (lua_State *l) |
static int | CclAiReleaseForce (lua_State *l) |
static int | CclAiCheckForce (lua_State *l) |
static int | CclAiWaitForce (lua_State *l) |
static int | CclAiAttackWithForce (lua_State *l) |
static int | CclAiWaitForces (lua_State *l) |
static int | CclAiAttackWithForces (lua_State *l) |
static int | CclAiSleep (lua_State *l) |
static int | CclAiResearch (lua_State *l) |
static int | CclAiUpgradeTo (lua_State *l) |
static int | CclAiPlayer (lua_State *l) |
static int | CclAiSetReserve (lua_State *l) |
static int | CclAiSetCollect (lua_State *l) |
static int | CclAiSetBuildDepots (lua_State *l) |
static int | CclAiDump (lua_State *l) |
static void | CclParseBuildQueue (lua_State *l, PlayerAi *ai, int offset) |
static int | CclDefineAiPlayer (lua_State *l) |
void | AiCclRegister () |
Save the AI state. More... | |
void AiCclRegister | ( | ) |
Save the AI state.
Register CCL features for unit-type.
|
static |
Insert new unit-type element.
table | Table with elements. |
n | Index to insert new into table |
base | Base type to insert into table. |
|
static |
Attack with force.
l | Lua state. |
|
static |
Attack with forces.
l | Lua state. |
|
static |
Check if a force ready.
l | Lua state. |
|
static |
Set debugging flag of AI script
l | Lua state |
|
static |
Activate AI debugging for the given player(s) Player can be a number for a specific player "self" for current human player (ai me) "none" to disable
l | Lua State |
|
static |
Dump some AI debug information.
l | Lua state. |
|
static |
Define a force, a groups of units.
l | Lua state. |
|
static |
Define the role of a force.
l | Lua state. |
|
static |
Get the race of the current AI player.
l | Lua state. |
|
static |
Get the number of cycles to sleep.
l | Lua state |
|
static |
Need a unit.
l | Lua state. |
|
static |
Return the player of the running AI.
l | Lua state. |
|
static |
Release force.
l | Lua state. |
|
static |
Research an upgrade.
l | Lua state. |
|
static |
Set the number of units.
l | Lua state |
|
static |
Set AI player build.
l | Lua state. |
|
static |
Set AI player resource collect percent.
l | Lua state. |
|
static |
Set AI player resource reserve.
l | Lua state. |
|
static |
Sleep n cycles.
l | Lua state. |
|
static |
Upgrade an unit to an new unit-type.
l | Lua state. |
|
static |
Wait for a unit.
l | Lua State. |
|
static |
Wait for a force ready.
l | Lua state. |
|
static |
Wait for a forces ready.
l | Lua state. |
|
static |
Define an AI engine.
l | Lua state. |
|
static |
Define helper for AI.
l | Lua state. |
|
static |
Define an AI player.
l | Lua state. |
|
static |
Parse AiBuildQueue builing list
l | Lua state. |
ai | PlayerAi pointer which should be filled with the data. |
|
static |
Find unit-type in request table.
type | Unit-type to be found. |
|
static |
Find unit-type in upgrade-to table.
type | Unit-type to be found. |
|
static |
|
static |
Get sorted list of unittype with CanHarvest not null.
|
static |
Get list of unittype which can be repared.
|
static |
Get sorted list of unittype with Supply not null.
|
static |
Transform list of unit separed with coma to a true list.
|
static |
|
static |
Append unit-type to request table.
upgrade | Upgrade to be appended. |
|
static |
Append unit-type to request table.
type | Unit-type to be appended. |
count | How many unit-types to build. |
|
static |
Append unit-type to request table.
type | Unit-type to be appended. |