$treeview $search $mathjax
Stratagus  2.2.7
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

src/unit/script_unittype.cpp File Reference

#include "stratagus.h"
#include "unittype.h"
#include "actions.h"
#include "animation.h"
#include "construct.h"
#include "font.h"
#include "luacallback.h"
#include "map.h"
#include "player.h"
#include "script.h"
#include "sound.h"
#include "spells.h"
#include "tileset.h"
#include "unit.h"
#include "unitsound.h"
#include "unit_manager.h"
#include "video.h"

script_unittype.cpp - The unit-type ccl functions.

CUnitTypeVar UnitTypeVar
static const char COWARD_KEY [] = "Coward"
 Variables for UnitType and unit.
static const char BUILDING_KEY [] = "Building"
static const char FLIP_KEY [] = "Flip"
static const char REVEALER_KEY [] = "Revealer"
static const char LANDUNIT_KEY [] = "LandUnit"
static const char AIRUNIT_KEY [] = "AirUnit"
static const char SEAUNIT_KEY [] = "SeaUnit"
static const char EXPLODEWHENKILLED_KEY [] = "ExplodeWhenKilled"
static const char VISIBLEUNDERFOG_KEY [] = "VisibleUnderFog"
static const char PERMANENTCLOACK_KEY [] = "PermanentCloack"
static const char DETECTCLOAK_KEY [] = "DetectCloak"
static const char ATTACKFROMTRANSPORTER_KEY [] = "AttackFromTransporter"
static const char VANISHES_KEY [] = "Vanishes"
static const char GROUNDATTACK_KEY [] = "GroundAttack"
static const char SHOREBUILDING_KEY [] = "ShoreBuilding"
static const char CANATTACK_KEY [] = "CanAttack"
static const char BUILDEROUTSIDE_KEY [] = "BuilderOutside"
static const char BUILDERLOST_KEY [] = "BuilderLost"
static const char CANHARVEST_KEY [] = "CanHarvest"
static const char HARVESTER_KEY [] = "Harvester"
static const char SELECTABLEBYRECTANGLE_KEY [] = "SelectableByRectangle"
static const char ISNOTSELECTABLE_KEY [] = "IsNotSelectable"
static const char DECORATION_KEY [] = "Decoration"
static const char INDESTRUCTIBLE_KEY [] = "Indestructible"
static const char TELEPORTER_KEY [] = "Teleporter"
static const char SHIELDPIERCE_KEY [] = "ShieldPiercing"
static const char SAVECARGO_KEY [] = "LoseCargo"
static const char NONSOLID_KEY [] = "NonSolid"
static const char WALL_KEY [] = "Wall"
static const char HITPOINTS_KEY [] = "HitPoints"
static const char BUILD_KEY [] = "Build"
static const char MANA_KEY [] = "Mana"
static const char TRANSPORT_KEY [] = "Transport"
static const char RESEARCH_KEY [] = "Research"
static const char TRAINING_KEY [] = "Training"
static const char UPGRADETO_KEY [] = "UpgradeTo"
static const char GIVERESOURCE_KEY [] = "GiveResource"
static const char CARRYRESOURCE_KEY [] = "CarryResource"
static const char XP_KEY [] = "Xp"
static const char KILL_KEY [] = "Kill"
static const char SUPPLY_KEY [] = "Supply"
static const char DEMAND_KEY [] = "Demand"
static const char ARMOR_KEY [] = "Armor"
static const char SIGHTRANGE_KEY [] = "SightRange"
static const char ATTACKRANGE_KEY [] = "AttackRange"
static const char PIERCINGDAMAGE_KEY [] = "PiercingDamage"
static const char BASICDAMAGE_KEY [] = "BasicDamage"
static const char POSX_KEY [] = "PosX"
static const char POSY_KEY [] = "PosY"
static const char RADARRANGE_KEY [] = "RadarRange"
static const char RADARJAMMERRANGE_KEY [] = "RadarJammerRange"
static const char AUTOREPAIRRANGE_KEY [] = "AutoRepairRange"
static const char BLOODLUST_KEY [] = "Bloodlust"
static const char HASTE_KEY [] = "Haste"
static const char SLOW_KEY [] = "Slow"
static const char INVISIBLE_KEY [] = "Invisible"
static const char UNHOLYARMOR_KEY [] = "UnholyArmor"
static const char SLOT_KEY [] = "Slot"
static const char SHIELD_KEY [] = "ShieldPoints"
static const char POINTS_KEY [] = "Points"
static const char MAXHARVESTERS_KEY [] = "MaxHarvesters"
static const char AITHRESHOLD_KEY [] = "AiThreshold"
int GetSpriteIndex (const char *SpriteName)
unsigned CclGetResourceByName (lua_State *l)
 Get resource by name.
int ExtraDeathIndex (const char *death)
 Get the suitable animation frame depends of unit's damaged type.
static void ParseBuildingRules (lua_State *l, std::vector< CBuildRestriction * > &blist)
static void UpdateDefaultBoolFlags (CUnitType &type)
static int CclDefineUnitType (lua_State *l)
static int CclDefineUnitStats (lua_State *l)
CUnitTypeCclGetUnitType (lua_State *l)
static int CclUnitType (lua_State *l)
static int CclUnitTypeArray (lua_State *l)
static int CclGetUnitTypeIdent (lua_State *l)
static int CclGetUnitTypeName (lua_State *l)
static int CclSetUnitTypeName (lua_State *l)
void DefineVariableField (lua_State *l, CVariable *var, int lua_index)
 Cleanup unit-type module.
static int CclDefineVariables (lua_State *l)
static int CclDefineBoolFlags (lua_State *l)
static int CclDefineDecorations (lua_State *l)
static int CclDefineExtraDeathTypes (lua_State *l)
void UpdateUnitVariables (CUnit &unit)
 Update custom Variables with other variable (like Hp, ...).
void UnitTypeCclRegister ()
 Access unit-type object.

Function Documentation

static int CclDefineBoolFlags ( lua_State *  l  )  [static]

Define boolean flag.

Parameters:
l Lua state.

static int CclDefineDecorations ( lua_State *  l  )  [static]

Define Decorations for user variables

Parameters:
l Lua state.
Todo:
modify Assert with luastate with User Error.
Todo:
continue to add configuration.

static int CclDefineExtraDeathTypes ( lua_State *  l  )  [static]

Define default extra death types.

Parameters:
l Lua state.

static int CclDefineUnitStats ( lua_State *  l  )  [static]

Parse unit-stats.

Parameters:
l Lua state.

static int CclDefineUnitType ( lua_State *  l  )  [static]

Parse unit-type.

Parameters:
l Lua state.

static int CclDefineVariables ( lua_State *  l  )  [static]

Define user variables.

Parameters:
l Lua state.

unsigned CclGetResourceByName ( lua_State *  l  ) 

Get resource by name.

Get the resource ID from a SCM object.

Parameters:
l Lua state.
Returns:
the resource id

CUnitType* CclGetUnitType ( lua_State *  l  ) 

Access unit-type object

Parameters:
l Lua state.

static int CclGetUnitTypeIdent ( lua_State *  l  )  [static]

Get the ident of the unit-type structure.

Parameters:
l Lua state.
Returns:
The identifier of the unit-type.

static int CclGetUnitTypeName ( lua_State *  l  )  [static]

Get the name of the unit-type structure.

Parameters:
l Lua state.
Returns:
The name of the unit-type.

static int CclSetUnitTypeName ( lua_State *  l  )  [static]

Set the name of the unit-type structure.

Parameters:
l Lua state.
Returns:
The name of the unit-type.

static int CclUnitType ( lua_State *  l  )  [static]

Get unit-type structure.

Parameters:
l Lua state.
Returns:
Unit-type structure.

static int CclUnitTypeArray ( lua_State *  l  )  [static]

Get all unit-type structures.

Parameters:
l Lua state.
Returns:
An array of all unit-type structures.

void DefineVariableField ( lua_State *  l,
CVariable var,
int  lua_index 
)

Cleanup unit-type module.

Define the field of the UserDefined variables.

Parameters:
l Lua state.
var Variable to set.
lua_index Index of the table where are the infos

int ExtraDeathIndex ( const char *  death  ) 

Get the suitable animation frame depends of unit's damaged type.

Find the index of a extra death type

int GetSpriteIndex ( const char *  SpriteName  ) 

Return the index of the sprite named SpriteName.

Parameters:
SpriteName Name of the sprite.
Returns:
Index of the sprite. -1 if not found.

static void ParseBuildingRules ( lua_State *  l,
std::vector< CBuildRestriction * > &  blist 
) [static]

Parse BuildingRules

Parameters:
l Lua state.
blist BuildingRestriction to fill in

void UnitTypeCclRegister (  ) 

Access unit-type object.

Register CCL features for unit-type.

static void UpdateDefaultBoolFlags ( CUnitType type  )  [static]

void UpdateUnitVariables ( CUnit unit  ) 

Update custom Variables with other variable (like Hp, ...).

Update unit variables which are not user defined.


Variable Documentation

const char AIRUNIT_KEY[] = "AirUnit" [static]

const char AITHRESHOLD_KEY[] = "AiThreshold" [static]

const char ARMOR_KEY[] = "Armor" [static]

const char ATTACKFROMTRANSPORTER_KEY[] = "AttackFromTransporter" [static]

const char ATTACKRANGE_KEY[] = "AttackRange" [static]

const char AUTOREPAIRRANGE_KEY[] = "AutoRepairRange" [static]

const char BASICDAMAGE_KEY[] = "BasicDamage" [static]

const char BLOODLUST_KEY[] = "Bloodlust" [static]

const char BUILD_KEY[] = "Build" [static]

const char BUILDERLOST_KEY[] = "BuilderLost" [static]

const char BUILDEROUTSIDE_KEY[] = "BuilderOutside" [static]

const char BUILDING_KEY[] = "Building" [static]

const char CANATTACK_KEY[] = "CanAttack" [static]

const char CANHARVEST_KEY[] = "CanHarvest" [static]

const char CARRYRESOURCE_KEY[] = "CarryResource" [static]

const char COWARD_KEY[] = "Coward" [static]

Variables for UnitType and unit.

const char DECORATION_KEY[] = "Decoration" [static]

const char DEMAND_KEY[] = "Demand" [static]

const char DETECTCLOAK_KEY[] = "DetectCloak" [static]

const char EXPLODEWHENKILLED_KEY[] = "ExplodeWhenKilled" [static]

const char FLIP_KEY[] = "Flip" [static]

const char GIVERESOURCE_KEY[] = "GiveResource" [static]

const char GROUNDATTACK_KEY[] = "GroundAttack" [static]

const char HARVESTER_KEY[] = "Harvester" [static]

const char HASTE_KEY[] = "Haste" [static]

const char HITPOINTS_KEY[] = "HitPoints" [static]

const char INDESTRUCTIBLE_KEY[] = "Indestructible" [static]

const char INVISIBLE_KEY[] = "Invisible" [static]

const char ISNOTSELECTABLE_KEY[] = "IsNotSelectable" [static]

const char KILL_KEY[] = "Kill" [static]

const char LANDUNIT_KEY[] = "LandUnit" [static]

const char MANA_KEY[] = "Mana" [static]

const char MAXHARVESTERS_KEY[] = "MaxHarvesters" [static]

const char NONSOLID_KEY[] = "NonSolid" [static]

const char PERMANENTCLOACK_KEY[] = "PermanentCloack" [static]

const char PIERCINGDAMAGE_KEY[] = "PiercingDamage" [static]

const char POINTS_KEY[] = "Points" [static]

const char POSX_KEY[] = "PosX" [static]

const char POSY_KEY[] = "PosY" [static]

const char RADARJAMMERRANGE_KEY[] = "RadarJammerRange" [static]

const char RADARRANGE_KEY[] = "RadarRange" [static]

const char RESEARCH_KEY[] = "Research" [static]

const char REVEALER_KEY[] = "Revealer" [static]

const char SAVECARGO_KEY[] = "LoseCargo" [static]

const char SEAUNIT_KEY[] = "SeaUnit" [static]

const char SELECTABLEBYRECTANGLE_KEY[] = "SelectableByRectangle" [static]

const char SHIELD_KEY[] = "ShieldPoints" [static]

const char SHIELDPIERCE_KEY[] = "ShieldPiercing" [static]

const char SHOREBUILDING_KEY[] = "ShoreBuilding" [static]

const char SIGHTRANGE_KEY[] = "SightRange" [static]

const char SLOT_KEY[] = "Slot" [static]

const char SLOW_KEY[] = "Slow" [static]

const char SUPPLY_KEY[] = "Supply" [static]

const char TELEPORTER_KEY[] = "Teleporter" [static]

const char TRAINING_KEY[] = "Training" [static]

const char TRANSPORT_KEY[] = "Transport" [static]

const char UNHOLYARMOR_KEY[] = "UnholyArmor" [static]

const char UPGRADETO_KEY[] = "UpgradeTo" [static]

const char VANISHES_KEY[] = "Vanishes" [static]

const char VISIBLEUNDERFOG_KEY[] = "VisibleUnderFog" [static]

const char WALL_KEY[] = "Wall" [static]

const char XP_KEY[] = "Xp" [static]

(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.