$treeview $search $mathjax
Stratagus
2.2.6
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "stratagus.h"
#include "unit_manager.h"
#include "unittype.h"
#include "upgrade.h"
#include "script.h"
#include "ai.h"
#include "pathfinder.h"
#include "ai_local.h"
#include "player.h"
#include "interface.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 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 | 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 | CclAiDump (lua_State *l) |
static int | DefaultResourceNumber (const char *name) |
static void | CclParseBuildQueue (lua_State *l, PlayerAi *ai, int offset) |
static int | CclDefineAiPlayer (lua_State *l) |
void | AiCclRegister () |
Save the AI state. |
void AiCclRegister | ( | ) |
Save the AI state.
Register CCL features for unit-type.
static void AiHelperInsert | ( | std::vector< std::vector< CUnitType * > > & | table, | |
unsigned int | n, | |||
CUnitType * | base | |||
) | [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 int CclAiAttackWithForce | ( | lua_State * | l | ) | [static] |
Attack with force.
l | Lua state. |
static int CclAiAttackWithForces | ( | lua_State * | l | ) | [static] |
Attack with forces.
l | Lua state. |
static int CclAiCheckForce | ( | lua_State * | l | ) | [static] |
Check if a force ready.
l | Lua state. |
static int CclAiDebug | ( | lua_State * | l | ) | [static] |
Set debugging flag of AI script
l | Lua state |
static int CclAiDebugPlayer | ( | lua_State * | l | ) | [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 int CclAiDump | ( | lua_State * | l | ) | [static] |
Dump some AI debug informations.
l | Lua state. |
static int CclAiForce | ( | lua_State * | l | ) | [static] |
Define a force, a groups of units.
l | Lua state. |
static int CclAiForceRole | ( | lua_State * | l | ) | [static] |
Define the role of a force.
l | Lua state. |
static int CclAiGetRace | ( | lua_State * | l | ) | [static] |
Get the race of the current AI player.
l | Lua state. |
static int CclAiGetSleepCycles | ( | lua_State * | l | ) | [static] |
Get the number of cycles to sleep.
l | Lua state |
static int CclAiNeed | ( | lua_State * | l | ) | [static] |
Need a unit.
l | Lua state. |
static int CclAiPlayer | ( | lua_State * | l | ) | [static] |
Return the player of the running AI.
l | Lua state. |
static int CclAiResearch | ( | lua_State * | l | ) | [static] |
Research an upgrade.
l | Lua state. |
static int CclAiSet | ( | lua_State * | l | ) | [static] |
Set the number of units.
l | Lua state |
static int CclAiSetCollect | ( | lua_State * | l | ) | [static] |
Set AI player resource collect percent.
l | Lua state. |
static int CclAiSetReserve | ( | lua_State * | l | ) | [static] |
Set AI player resource reserve.
l | Lua state. |
static int CclAiSleep | ( | lua_State * | l | ) | [static] |
Sleep n cycles.
l | Lua state. |
static int CclAiUpgradeTo | ( | lua_State * | l | ) | [static] |
Upgrade an unit to an new unit-type.
l | Lua state. |
static int CclAiWait | ( | lua_State * | l | ) | [static] |
Wait for a unit.
l | Lua State. |
static int CclAiWaitForce | ( | lua_State * | l | ) | [static] |
Wait for a force ready.
l | Lua state. |
static int CclAiWaitForces | ( | lua_State * | l | ) | [static] |
Wait for a forces ready.
l | Lua state. |
static int CclDefineAi | ( | lua_State * | l | ) | [static] |
Define an AI engine.
l | Lua state. |
static int CclDefineAiHelper | ( | lua_State * | l | ) | [static] |
Define helper for AI.
l | Lua state. |
static int CclDefineAiPlayer | ( | lua_State * | l | ) | [static] |
Define an AI player.
l | Lua state. |
static void CclParseBuildQueue | ( | lua_State * | l, | |
PlayerAi * | ai, | |||
int | offset | |||
) | [static] |
Parse AiBuildQueue builing list
l | Lua state. | |
ai | PlayerAi pointer which should be filled with the data. |
static int DefaultResourceNumber | ( | const char * | name | ) | [static] |
Get the default resource number
name | Resource name. |
static AiRequestType* FindInUnitTypeRequests | ( | const CUnitType * | type | ) | [static] |
Find unit-type in request table.
type | Unit-type to be found. |
static int FindInUpgradeToRequests | ( | const CUnitType * | type | ) | [static] |
Find unit-type in upgrade-to table.
type | Unit-type to be found. |
static std::vector<CUnitType *> getRefineryUnits | ( | ) | [static] |
Get sorted list of unittype with CanHarvest not null.
static std::vector<CUnitType *> getReparableUnits | ( | ) | [static] |
Get list of unittype which can be repared.
static std::vector<CUnitType *> getSupplyUnits | ( | ) | [static] |
Get sorted list of unittype with Supply not null.
static std::vector<CUnitType *> getUnitTypeFromString | ( | const std::string & | list | ) | [static] |
Transform list of unit separed with coma to a true list.
static void InitAiHelper | ( | AiHelper & | aiHelper | ) | [static] |
static void InsertResearchRequests | ( | CUpgrade * | upgrade | ) | [static] |
Append unit-type to request table.
upgrade | Upgrade to be appended. |
static void InsertUnitTypeRequests | ( | CUnitType * | type, | |
int | count | |||
) | [static] |
Append unit-type to request table.
type | Unit-type to be appended. | |
count | How many unit-types to build. |
static void InsertUpgradeToRequests | ( | CUnitType * | type | ) | [static] |
Append unit-type to request table.
type | Unit-type to be appended. |