$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_unit.cpp File Reference

#include "stratagus.h"
#include "unit.h"
#include "actions.h"
#include "animation.h"
#include "commands.h"
#include "construct.h"
#include "map.h"
#include "pathfinder.h"
#include "player.h"
#include "script.h"
#include "spells.h"
#include "trigger.h"
#include "unit_find.h"
#include "unit_manager.h"
#include "unittype.h"
#include "upgrade.h"

Classes

class  HasSameUnitTypeAs

Functions

script_unit.cpp - The unit ccl functions.
unsigned CclGetResourceByName (lua_State *l)
 Get resource by name.
static int CclSetTrainingQueue (lua_State *l)
static int CclSetBuildingCapture (lua_State *l)
static int CclSetRevealAttacker (lua_State *l)
static int CclResourcesMultiBuildersMultiplier (lua_State *l)
static CUnitCclGetUnit (lua_State *l)
CUnitCclGetUnitFromRef (lua_State *l)
 For saving lua state.
static void CclParseOrders (lua_State *l, CUnit &unit)
static int CclUnit (lua_State *l)
static int CclMoveUnit (lua_State *l)
static int CclCreateUnit (lua_State *l)
static int CclSetResourcesHeld (lua_State *l)
static int CclOrderUnit (lua_State *l)
static int CclKillUnit (lua_State *l)
static int CclKillUnitAt (lua_State *l)
static int CclGetUnits (lua_State *l)
static int CclGetUnitBoolFlag (lua_State *l)
static int CclGetUnitVariable (lua_State *l)
static int CclSetUnitVariable (lua_State *l)
static int CclSlotUsage (lua_State *l)
void UnitCclRegister ()
 register CCL units features

Function Documentation

static int CclCreateUnit ( lua_State *  l  )  [static]

Create a unit and place it on the map

Parameters:
l Lua state.
Returns:
Returns the slot number of the made unit.

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

static CUnit* CclGetUnit ( lua_State *  l  )  [static]

Get a unit pointer

Parameters:
l Lua state.
Returns:
The unit pointer

static int CclGetUnitBoolFlag ( lua_State *  l  )  [static]

Get the value of the unit bool-flag.

Parameters:
l Lua state.
Returns:
The value of the bool-flag of the unit.

CUnit* CclGetUnitFromRef ( lua_State *  l  ) 

For saving lua state.

Get a unit pointer from ref string

Parameters:
l Lua state.
Returns:
The unit pointer

static int CclGetUnits ( lua_State *  l  )  [static]

Get a player's units

Parameters:
l Lua state.
Returns:
Array of units.

static int CclGetUnitVariable ( lua_State *  l  )  [static]

Get the value of the unit variable.

Parameters:
l Lua state.
Returns:
The value of the variable of the unit.

static int CclKillUnit ( lua_State *  l  )  [static]

Kill a unit

Parameters:
l Lua state.
Returns:
Returns true if a unit was killed.

static int CclKillUnitAt ( lua_State *  l  )  [static]

Kill a unit at a location

Parameters:
l Lua state.
Returns:
Returns the number of units killed.

static int CclMoveUnit ( lua_State *  l  )  [static]

Move a unit on map.

Parameters:
l Lua state.
Returns:
Returns the slot number of the made placed.

static int CclOrderUnit ( lua_State *  l  )  [static]

Order a unit

Parameters:
l Lua state.
OrderUnit(player, unit-type, sloc, dloc, order)

static void CclParseOrders ( lua_State *  l,
CUnit unit 
) [static]

Parse orders.

Parameters:
l Lua state.
unit Unit pointer which should get the orders.

static int CclResourcesMultiBuildersMultiplier ( lua_State *  l  )  [static]

Set cost multiplier to RepairCost for buildings additional workers helping (0 = no additional cost)

Parameters:
l Lua state.

static int CclSetBuildingCapture ( lua_State *  l  )  [static]

Set capture buildings

Parameters:
l Lua state.
Returns:
The old state of the flag

static int CclSetResourcesHeld ( lua_State *  l  )  [static]

Set resources held by a unit

Parameters:
l Lua state.

static int CclSetRevealAttacker ( lua_State *  l  )  [static]

Set reveal attacker

Parameters:
l Lua state.
Returns:
The old state of the flag

static int CclSetTrainingQueue ( lua_State *  l  )  [static]

Set training queue

Parameters:
l Lua state.
Returns:
The old state of the training queue

static int CclSetUnitVariable ( lua_State *  l  )  [static]

Set the value of the unit variable.

Parameters:
l Lua state.
Returns:
The new value of the unit.

static int CclSlotUsage ( lua_State *  l  )  [static]

Get the usage of unit slots during load to allocate memory

Parameters:
l Lua state.

static int CclUnit ( lua_State *  l  )  [static]

Parse unit

Parameters:
l Lua state.
Todo:
Verify that vision table is always correct (transporter)
Todo:
(PlaceUnit() and host-info).

void UnitCclRegister (  ) 

register CCL units features

Register CCL features for unit.

(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.