_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include "SDL_image.h"
#include "stratagus.h"
#include "game.h"
#include "actions.h"
#include "ai.h"
#include "animation.h"
#include "commands.h"
#include "construct.h"
#include "depend.h"
#include "editor.h"
#include "font.h"
#include "interface.h"
#include "iocompat.h"
#include "iolib.h"
#include "map.h"
#include "minimap.h"
#include "missile.h"
#include "netconnect.h"
#include "network.h"
#include "online_service.h"
#include "parameters.h"
#include "pathfinder.h"
#include "player.h"
#include "replay.h"
#include "results.h"
#include "settings.h"
#include "sound.h"
#include "sound_server.h"
#include "spells.h"
#include "tileset.h"
#include "translate.h"
#include "trigger.h"
#include "ui.h"
#include "unit.h"
#include "unit_manager.h"
#include "unittype.h"
#include "upgrade.h"
#include "version.h"
#include "video.h"
game.cpp - The game set-up and creation. | |
Settings | GameSettings |
static int | LcmPreventRecurse |
Game Settings. More... | |
GameResults | GameResult |
prevent recursion through LoadGameMap More... | |
std::string | GameName |
Outcome of the game. More... | |
std::string | FullGameName |
Name of the game. More... | |
unsigned long | GameCycle |
unsigned long | FastForwardCycle |
Game simulation cycle counter. More... | |
bool | UseHPForXp = false |
Cycle to fastforward to in a replay. More... | |
gcn::Gui * | Gui |
true if gain XP by dealing damage, false if by killing. More... | |
static std::vector< gcn::Container * > | Containers |
std::string | PlayerTypeNames [static_cast< int >(PlayerTypes::PlayerRescueActive)+1] |
void | CleanGame () |
void | SaveGameSettings (CFile &file) |
void | CreateGame (const std::string &filename, CMap *map) |
forward declaration More... | |
void | StartMap (const std::string &filename, bool clean) |
void | FreeAllContainers () |
Cleanup all modules. More... | |
static void | LoadStratagusMap (const std::string &smpname, const std::string &mapname) |
static void | WriteMapPreview (const char *mapname, CMap &map) |
static int | WriteMapPresentation (const std::string &mapname, CMap &map, Vec2i newSize) |
int | WriteMapSetup (const char *mapSetup, CMap &map, int writeTerrain, Vec2i newSize, Vec2i offset) |
int | SaveStratagusMap (const std::string &mapName, CMap &map, int writeTerrain, Vec2i newSize, Vec2i offset) |
Save a stratagus map (smp format) More... | |
static void | LoadMap (const std::string &filename, CMap &map) |
void | SetGamePaused (bool paused) |
Set the game paused or unpaused. More... | |
bool | GetGamePaused () |
Get the game paused or unpaused. More... | |
void | SetGameSpeed (int speed) |
Set the game speed. More... | |
int | GetGameSpeed () |
Get the game speed. More... | |
static void | GameTypeFreeForAll () |
static void | GameTypeTopVsBottom () |
static void | GameTypeLeftVsRight () |
static void | GameTypeManVsMachine () |
static void | GameTypeManTeamVsMachine () |
static void | GameTypeMachineVsMachine () |
static void | GameTypeMachineVsMachineTraining () |
void | InitSettings () |
Game settings. More... | |
static void | CleanGame_Lua () |
static int | CclSetGameName (lua_State *l) |
static int | CclSetFullGameName (lua_State *l) |
static int | CclSetGodMode (lua_State *l) |
static int | CclGetGodMode (lua_State *l) |
static int | CclSetSpeedResourcesHarvest (lua_State *l) |
static int | CclSetSpeedResourcesReturn (lua_State *l) |
static int | CclSetSpeedBuild (lua_State *l) |
static int | CclGetSpeedBuild (lua_State *l) |
static int | CclSetSpeedTrain (lua_State *l) |
static int | CclGetSpeedTrain (lua_State *l) |
static int | CclSetSpeedUpgrade (lua_State *l) |
static int | CclSetSpeedResearch (lua_State *l) |
static int | CclSetSpeeds (lua_State *l) |
static int | CclDefineDefaultIncomes (lua_State *l) |
static int | CclDefineDefaultActions (lua_State *l) |
static int | CclDefineDefaultResourceNames (lua_State *l) |
static int | CclDefineDefaultResourceAmounts (lua_State *l) |
static int | CclDefineDefaultResourceMaxAmounts (lua_State *l) |
static int | ScriptSetUseHPForXp (lua_State *l) |
static int | CclSetLocalPlayerName (lua_State *l) |
static int | CclGetLocalPlayerName (lua_State *l) |
static int | CclGetStratagusVersion (lua_State *l) |
static int | CclGetStratagusHomepage (lua_State *l) |
static int | CclSetMenuRace (lua_State *l) |
static int | CclSavedGameInfo (lua_State *l) |
void | LuaRegisterModules () |
Initialize all modules. More... | |
|
static |
Define default action for the resources.
l | Lua state. |
|
static |
Define default incomes for a new player.
l | Lua state. |
|
static |
Define default names for the resources.
l | Lua state. |
|
static |
Define max amounts for the resources.
l | Lua state. |
|
static |
Define default names for the resources.
l | Lua state. |
|
static |
Description
Get God mode.
l | Lua state. |
Example:
g_mode = GetGodMode() print(g_mode)
|
static |
Description
Get the local player name
l | Lua state. |
Example:
GetLocalPlayerName()
|
static |
Get building speed (deprecated).
l | Lua state. |
|
static |
Get training speed (deprecated).
l | Lua state. |
|
static |
Description
Get Stratagus Homepage
Example:
url = GetStratagusHomepage() print(url)
|
static |
Description
Get Stratagus Version
Example:
version = GetStratagusVersion() print(version)
|
static |
Load the SavedGameInfo Header
l | Lua state. |
|
static |
|
static |
Description
Return of game name.
l | Lua state. |
Example:
SetGameName("Wargus Map - Chapter 1")
|
static |
Description
Set God mode.
l | Lua state. |
Example:
– God Mode enabled SetGodMode(true) – God Mode disabled SetGodMode(false)
|
static |
Description
Set the local player name
l | Lua state. |
Example:
SetLocalPlayerName("Stormreaver Clan")
|
static |
|
static |
Set building speed (deprecated).
l | Lua state. |
|
static |
For debug increase researching speed (deprecated).
l | Lua state. |
|
static |
Set resource harvesting speed (deprecated).
l | Lua state. |
|
static |
Set resource returning speed (deprecated).
l | Lua state. |
|
static |
For debug increase all speeds (deprecated).
l | Lua state. |
|
static |
Set training speed (deprecated).
l | Lua state. |
|
static |
For debug increase upgrading speed (deprecated).
l | Lua state. |
void CleanGame | ( | ) |
Cleanup game.
Call each module to clean up. Contrary to CleanModules, maps can be restarted without reloading all lua files.
|
static |
forward declaration
CreateGame.
Load map, graphics, sounds, etc
filename | map filename |
map | map loaded |
void FreeAllContainers | ( | ) |
Cleanup all modules.
|
static |
Free for all
|
static |
Left vs Right
|
static |
Machine vs Machine
|
static |
Machine vs Machine Training
|
static |
Man vs Machine with Humans on a Team
|
static |
Man vs Machine
|
static |
Top vs Bottom
bool GetGamePaused | ( | ) |
Get the game paused or unpaused.
Get the game paused or unpaused
int GetGameSpeed | ( | ) |
void InitSettings | ( | ) |
Load any map.
filename | map filename |
map | map loaded |
|
static |
Load a Stratagus map.
smpname | smp filename |
mapname | map filename |
map | map loaded |
void LuaRegisterModules | ( | ) |
Initialize all modules.
int SaveStratagusMap | ( | const std::string & | mapName, |
CMap & | map, | ||
int | writeTerrain, | ||
Vec2i | newSize, | ||
Vec2i | offset | ||
) |
Save a stratagus map (smp format)
Save a Stratagus map.
mapName | map filename |
map | map to save |
writeTerrain | write the tiles map in the .sms |
|
static |
Affect UseHPForXp.
l | Lua state. |
void SetGamePaused | ( | bool | paused | ) |
Set the game paused or unpaused.
Set the game paused or unpaused
paused | True to pause game, false to unpause. |
void SetGameSpeed | ( | int | speed | ) |
Set the game speed.
Set the game speed
speed | New game speed. |
void StartMap | ( | const std::string & | filename, |
bool | clean | ||
) |
int WriteMapSetup | ( | const char * | mapSetup, |
CMap & | map, | ||
int | writeTerrain, | ||
Vec2i | newSize, | ||
Vec2i | offset | ||
) |
Write the map setup file.
mapsetup | map filename |
map | map to save |
writeTerrain | write the tiles map in the .sms |
|
static |
unsigned long FastForwardCycle |
Game simulation cycle counter.
std::string FullGameName |
Name of the game.
unsigned long GameCycle |
std::string GameName |
Outcome of the game.
Save game settings.
GameResults GameResult |
prevent recursion through LoadGameMap
Game results.
Settings GameSettings |
gcn::Gui* Gui |
true if gain XP by dealing damage, false if by killing.
std::string PlayerTypeNames[static_cast< int >(PlayerTypes::PlayerRescueActive)+1] |
bool UseHPForXp = false |
Cycle to fastforward to in a replay.
Full Name of the game.