$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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
#include "stratagus.h"
#include "script.h"
#include "unittype.h"
#include "player.h"
#include "trigger.h"
#include "results.h"
#include "interface.h"
#include "unit.h"
#include "iolib.h"
#include "map.h"
trigger.cpp - The trigger handling. | |
CTimer | GameTimer |
static int | Trigger |
The game timer. | |
static bool * | ActiveTriggers |
TriggerDataType | TriggerData |
Some data accessible for script during the game. | |
typedef int(* | CompareFunction )(int, int) |
int | TriggerGetPlayer (lua_State *l) |
const CUnitType * | TriggerGetUnitType (lua_State *l) |
get player number. | |
static int | CompareEq (int a, int b) |
static int | CompareNEq (int a, int b) |
static int | CompareGrEq (int a, int b) |
static int | CompareGr (int a, int b) |
static int | CompareLeEq (int a, int b) |
static int | CompareLe (int a, int b) |
static CompareFunction | GetCompareFunction (const char *op) |
static int | CclGetNumUnitsAt (lua_State *l) |
static int | SelectAroundUnit (CUnit &unit, CUnit **around) |
static int | CclIfNearUnit (lua_State *l) |
static int | CclIfRescuedNearUnit (lua_State *l) |
int | GetNumOpponents (int player) |
int | GetTimer () |
void | StopGame (GameResults result) |
Outcome of the game. | |
void | ActionVictory () |
void | ActionDefeat () |
void | ActionDraw () |
void | ActionSetTimer (int cycles, bool increasing) |
void | ActionStartTimer () |
void | ActionStopTimer () |
static int | CclAddTrigger (lua_State *l) |
void | SetTrigger (int trigger) |
static int | CclSetActiveTriggers (lua_State *l) |
static int | TriggerExecuteAction (int script) |
static void | TriggerRemoveTrigger (int trig) |
void | TriggersEachCycle () |
get the unit-type | |
void | TriggerCclRegister () |
test triggers | |
void | SaveTriggers (CFile *file) |
Register ccl features. | |
void | InitTriggers () |
Save the trigger module. | |
void | CleanTriggers () |
Setup triggers. |
typedef int(* CompareFunction)(int, int) |
void ActionDefeat | ( | ) |
Action condition player lose.
void ActionDraw | ( | ) |
Action condition player draw.
void ActionSetTimer | ( | int | cycles, | |
bool | increasing | |||
) |
Action set timer
void ActionStartTimer | ( | ) |
Action start timer
void ActionStopTimer | ( | ) |
Action stop timer
void ActionVictory | ( | ) |
Action condition player wins.
static int CclAddTrigger | ( | lua_State * | l | ) | [static] |
Add a trigger.
static int CclGetNumUnitsAt | ( | lua_State * | l | ) | [static] |
Return the number of units of a giver unit-type and player at a location.
static int CclIfNearUnit | ( | lua_State * | l | ) | [static] |
Player has the quantity of unit-type near to unit-type.
static int CclIfRescuedNearUnit | ( | lua_State * | l | ) | [static] |
Player has the quantity of rescued unit-type near to unit-type.
static int CclSetActiveTriggers | ( | lua_State * | l | ) | [static] |
Set the active triggers
void CleanTriggers | ( | ) |
Setup triggers.
Clean up the trigger module.
static int CompareEq | ( | int | a, | |
int | b | |||
) | [static] |
static int CompareGr | ( | int | a, | |
int | b | |||
) | [static] |
static int CompareGrEq | ( | int | a, | |
int | b | |||
) | [static] |
static int CompareLe | ( | int | a, | |
int | b | |||
) | [static] |
static int CompareLeEq | ( | int | a, | |
int | b | |||
) | [static] |
static int CompareNEq | ( | int | a, | |
int | b | |||
) | [static] |
static CompareFunction GetCompareFunction | ( | const char * | op | ) | [static] |
Returns a function pointer to the comparison function
op | The operation |
int GetNumOpponents | ( | int | player | ) |
Returns the number of opponents of a given player.
int GetTimer | ( | ) |
Check the timer value
void InitTriggers | ( | ) |
Save the trigger module.
Initialize the trigger module.
void SaveTriggers | ( | CFile * | file | ) |
void SetTrigger | ( | int | trigger | ) |
Set the trigger values
void StopGame | ( | GameResults | result | ) |
Outcome of the game.
Stop the running game with a given result
void TriggerCclRegister | ( | ) |
test triggers
Register CCL features for triggers.
static int TriggerExecuteAction | ( | int | script | ) | [static] |
Execute a trigger action
script | Script to execute |
int TriggerGetPlayer | ( | lua_State * | l | ) |
Get player number.
l | Lua state. |
const CUnitType* TriggerGetUnitType | ( | lua_State * | l | ) |
get player number.
Get the unit-type.
l | Lua state. |
static void TriggerRemoveTrigger | ( | int | trig | ) | [static] |
Remove a trigger
trig | Current trigger |
void TriggersEachCycle | ( | ) |
get the unit-type
Check trigger each game cycle.
bool* ActiveTriggers [static] |
int Trigger [static] |
The game timer.
Some data accessible for script during the game.
the game timer