$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 <ctype.h>
#include "stratagus.h"
#include <string>
#include <map>
#include "video.h"
#include "tileset.h"
#include "map.h"
#include "sound.h"
#include "unitsound.h"
#include "construct.h"
#include "unittype.h"
#include "animation.h"
#include "player.h"
#include "missile.h"
#include "script.h"
#include "spells.h"
#include "iolib.h"
#include "luacallback.h"
#include "util.h"
unittype.cpp - The unit types. | |
std::vector< CUnitType * > | UnitTypes |
std::map< std::string, CUnitType * > | UnitTypeMap |
unit-types definition | |
CUnitType * | UnitTypeHumanWall |
All unit-types. | |
CUnitType * | UnitTypeOrcWall |
Human wall. | |
int | DefaultIncomes [MaxCosts] |
Orc wall. | |
std::string | DefaultActions [MaxCosts] |
std::string | DefaultResourceNames [MaxCosts] |
int | DefaultResourceAmounts [MaxCosts] |
std::string | ExtraDeathTypes [ANIMATIONS_DEATHTYPES] |
void | UpdateStats (int reset) |
Register ccl features. | |
static void | SaveUnitStats (const CUnitStats *stats, const std::string &ident, int plynr, CFile *file) |
void | SaveUnitTypes (CFile *file) |
Get unit-type by ident. | |
CUnitType * | UnitTypeByIdent (const std::string &ident) |
Update unit stats. | |
CUnitType * | NewUnitTypeSlot (const std::string &ident) |
Save the unit-type table. | |
void | DrawUnitType (const CUnitType &type, CPlayerColorGraphic *sprite, int player, int frame, int x, int y) |
Draw the sprite frame of unit-type. | |
static int | GetStillFrame (CUnitType *type) |
void | InitUnitTypes (int reset_player_stats) |
void | LoadUnitTypeSprite (CUnitType &type) |
Init unit-type table. | |
void | LoadUnitTypes () |
Load the sprite for a unittype. | |
void | FreeAnimations () |
void | CleanUnitTypes () |
Load the unit-type data. |
void CleanUnitTypes | ( | ) |
Load the unit-type data.
Cleanup the unit-type module.
void DrawUnitType | ( | const CUnitType & | type, | |
CPlayerColorGraphic * | sprite, | |||
int | player, | |||
int | frame, | |||
int | x, | |||
int | y | |||
) |
Draw the sprite frame of unit-type.
Draw unit-type on map.
type | Unit-type pointer. | |
sprite | Sprite to use for drawing | |
player | Player number for color substitution. | |
frame | Animation frame of unit-type. | |
x | Screen X pixel postion to draw unit-type. | |
y | Screen Y pixel postion to draw unit-type. |
void FreeAnimations | ( | ) |
static int GetStillFrame | ( | CUnitType * | type | ) | [static] |
Get the still animation frame
void InitUnitTypes | ( | int | reset_player_stats | ) |
Init unit types.
void LoadUnitTypes | ( | ) |
Load the sprite for a unittype.
Load the graphics for the unit-types.
void LoadUnitTypeSprite | ( | CUnitType & | type | ) |
Init unit-type table.
Loads the Sprite for a unit type
type | type of unit to load |
CUnitType* NewUnitTypeSlot | ( | const std::string & | ident | ) |
Save the unit-type table.
Allocate an empty unit-type slot.
ident | Identifier to identify the slot (malloced by caller!). |
static void SaveUnitStats | ( | const CUnitStats * | stats, | |
const std::string & | ident, | |||
int | plynr, | |||
CFile * | file | |||
) | [static] |
Save state of an unit-stats to file.
stats | Unit-stats to save. | |
ident | Unit-type ident. | |
plynr | Player number. | |
file | Output file. |
void SaveUnitTypes | ( | CFile * | file | ) |
Get unit-type by ident.
Save state of the unit-type table to file.
file | Output file. |
CUnitType* UnitTypeByIdent | ( | const std::string & | ident | ) |
Update unit stats.
Find unit-type by identifier.
ident | The unit-type identifier. |
void UpdateStats | ( | int | reset | ) |
Register ccl features.
Update the player stats for changed unit types.
reset | indicates wether default value should be set to each stat (level, upgrades) |
std::string DefaultActions[MaxCosts] |
Default action for the resources.
int DefaultIncomes[MaxCosts] |
Orc wall.
Default incomes for a new player.
int DefaultResourceAmounts[MaxCosts] |
Default amounts for the resources.
std::string DefaultResourceNames[MaxCosts] |
Default names for the resources.
std::string ExtraDeathTypes[ANIMATIONS_DEATHTYPES] |
Default names for the resources.
All unit-types.
Next unit type are used hardcoded in the source.
std::map<std::string, CUnitType *> UnitTypeMap |
unit-types definition
Human wall.