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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
upgrade.h File Reference

Go to the source code of this file.

upgrade.h - The upgrades headerfile.

#define UPGRADE_MODIFIERS_MAX   (UpgradeMax * 4)
 How many upgrades modifiers supported. More...
 
CUpgradeModifierUpgradeModifiers [UPGRADE_MODIFIERS_MAX]
 The main user useable upgrades. More...
 
int NumUpgradeModifiers
 Number of upgrades modifiers used. More...
 
void InitUpgrades ()
 init upgrade/allow structures More...
 
void SaveUpgrades (CFile &file)
 save the upgrades More...
 
void CleanUpgrades ()
 cleanup upgrade module More...
 
void UpgradesCclRegister ()
 Register CCL features for upgrades. More...
 
int UnitTypeIdByIdent (const std::string &sid)
 
int UpgradeIdByIdent (const std::string &sid)
 
void UpgradeAcquire (CPlayer &player, const CUpgrade *upgrade)
 Upgrade will be acquired. More...
 
void UpgradeLost (CPlayer &player, int id)
 Upgrade will be lost. More...
 
void ApplyUpgrades ()
 Apply researched upgrades when map is loading. More...
 
void ApplyIndividualUpgradeModifier (CUnit &unit, const CUpgradeModifier *um)
 
void IndividualUpgradeAcquire (CUnit &unit, const CUpgrade *upgrade)
 Apply upgrade modifier of an individual upgrade. More...
 
void IndividualUpgradeLost (CUnit &unit, const CUpgrade *upgrade)
 Make a unit acquire in individual upgrade. More...
 
int UnitIdAllowed (const CPlayer &player, int id)
 Make a unit lose in individual upgrade. More...
 
void AllowUpgradeId (CPlayer &player, int id, char af)
 
char UpgradeIdAllowed (const CPlayer &player, int id)
 
char UpgradeIdentAllowed (const CPlayer &player, const std::string &ident)
 

Macro Definition Documentation

#define UPGRADE_MODIFIERS_MAX   (UpgradeMax * 4)

How many upgrades modifiers supported.

Function Documentation

void AllowUpgradeId ( CPlayer player,
int  id,
char  af 
)

Change allow for an upgrade.

Parameters
playerPlayer to change
idupgrade id
afA'llow/F'orbid/`R'eseached
void ApplyIndividualUpgradeModifier ( CUnit unit,
const CUpgradeModifier um 
)

Apply the modifiers of an individual upgrade.

Parameters
unitUnit that will get the modifier applied
umUpgrade modifier that does the effects
void ApplyUpgrades ( )

Apply researched upgrades when map is loading.

Apply researched upgrades when map is loading

Returns
: void
void CleanUpgrades ( )

cleanup upgrade module

Cleanup the upgrade module.

void IndividualUpgradeAcquire ( CUnit unit,
const CUpgrade upgrade 
)

Apply upgrade modifier of an individual upgrade.

void IndividualUpgradeLost ( CUnit unit,
const CUpgrade upgrade 
)

Make a unit acquire in individual upgrade.

void InitUpgrades ( )

init upgrade/allow structures

Init upgrade/allow structures

void SaveUpgrades ( CFile file)

save the upgrades

Save state of the dependencies to file.

Parameters
fileOutput file.
int UnitIdAllowed ( const CPlayer player,
int  id 
)

Make a unit lose in individual upgrade.

Return the allow state of the unit.

Parameters
playerCheck state of this player.
idUnit identifier.
Returns
the allow state of the unit.
int UnitTypeIdByIdent ( const std::string &  ident)

UnitType ID by identifier.

Parameters
identThe unit-type identifier.
Returns
Unit-type ID (int) or -1 if not found.
void UpgradeAcquire ( CPlayer player,
const CUpgrade upgrade 
)

Upgrade will be acquired.

Handle that an upgrade was acquired.

Parameters
playerPlayer researching the upgrade.
upgradeUpgrade ready researched.
char UpgradeIdAllowed ( const CPlayer player,
int  id 
)

Return the allow state of an upgrade.

Parameters
playerCheck state for this player.
idUpgrade identifier.
Returns
the allow state of the upgrade.
int UpgradeIdByIdent ( const std::string &  ident)

Upgrade ID by identifier.

Parameters
identThe upgrade identifier.
Returns
Upgrade ID (int) or -1 if not found.
char UpgradeIdentAllowed ( const CPlayer player,
const std::string &  ident 
)

Return the allow state of an upgrade.

Parameters
playerCheck state for this player.
identUpgrade identifier.
Note
This function shouldn't be used during runtime, it is only for setup.
void UpgradeLost ( CPlayer player,
int  id 
)

Upgrade will be lost.

Upgrade will be lost

Parameters
playerPlayer researching the upgrade.
idUpgrade to be lost.
void UpgradesCclRegister ( )

Register CCL features for upgrades.

Register CCL features for upgrades.

Variable Documentation

int NumUpgradeModifiers

Number of upgrades modifiers used.

The main user useable upgrades.

Upgrades modifiers

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