_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
Go to the documentation of this file.
30 #ifndef __UNITTYPE_H__
31 #define __UNITTYPE_H__
39 #ifndef __UPGRADE_STRUCTS_H__
43 #ifndef __UNITSOUND_H__
76 #define MaxAttackPos 5
125 return this->
Max == rhs.
Max
326 virtual void Draw(
int x,
int y,
390 for (std::vector<CBuildRestriction *>::const_iterator i =
_or_list.begin();
398 for (std::vector<CBuildRestriction *>::const_iterator i =
_or_list.begin();
416 inline bool operator()(
const CUnit *
const unit)
const;
438 inline bool operator()(
CUnit *
const unit);
597 #define InfiniteRepairRange INT_MAX
615 #define MouseActionNone 0
616 #define MouseActionAttack 1
617 #define MouseActionMove 2
618 #define MouseActionHarvest 3
619 #define MouseActionSpellCast 5
620 #define MouseActionSail 6
622 #define CanTargetLand 1
623 #define CanTargetSea 2
624 #define CanTargetAir 4
677 extern std::vector<CUnitType *>
UnitTypes;
690 template <const
unsigned int SIZE>
708 std::map<std::string, int>
user;
718 for (
unsigned int i = 0; i < SIZE; ++i) {
719 if (
buildin[i].offset == index) {
723 for (std::map<std::string, int>::iterator
726 if ((*it).second == index) {
727 return ((*it).first).c_str();
744 k.keylen = strlen(key);
747 if ((p !=
buildin + SIZE) && p->keylen == k.keylen &&
748 0 == strcmp(p->key, key)) {
751 std::map<std::string, int>::iterator
753 if (ret !=
user.end()) {
754 return (*ret).second;
820 int colorIndex,
int frame,
const PixelPos &screenPos);
835 extern void SetMapStat(std::string ident, std::string variable_key,
int value, std::string variable_type);
836 extern void SetMapSound(std::string ident, std::string sound, std::string sound_type, std::string sound_subtype =
"");
839 #endif // !__UNITTYPE_H__
CUnitType * CorpseType
Corpse type name.
Definition: unittype.h:577
int OffsetY
Offset in X coord.
Definition: unittype.h:257
@ BUILDEROUTSIDE_INDEX
Definition: unittype.h:159
int Num
Definition: unittype.h:552
struct CUnitType::_portrait_ Portrait
char NSprite
Definition: unittype.h:355
unsigned int Index
Definition: unittype.h:254
char ShadowSpriteFrame
Shadow scale-down factor.
Definition: unittype.h:541
#define _C_
Definition: stratagus.h:120
CDecoVarBar()
Definition: unittype.h:282
int MinValue
if true, invert length
Definition: unittype.h:291
virtual void Init()
Definition: unittype.h:493
CVariableKeys()
Definition: script_unittype.cpp:172
virtual bool Check(const CUnit *builder, const CUnitType &type, const Vec2i &pos, CUnit *&ontoptarget) const =0
Base structure of missile-types.
Definition: missile.h:343
bool CanMove() const
Definition: unittype.cpp:622
unsigned WaitAtDepot
Max amount of resources to carry.
Definition: unittype.h:100
Definition: unittype.h:693
@ GreaterThanEqual
Definition: unittype.h:374
unsigned char HarvestFromOutside
The unit will lose it's resource when distracted.
Definition: unittype.h:105
char AiPriorityTarget
Flag needed to target with missile.
Definition: unittype.h:644
int Width
Shadow file.
Definition: unittype.h:531
@ SHIELD_INDEX
Definition: unittype.h:218
@ AIRUNIT_INDEX
Definition: unittype.h:148
int BoxOffsetY
Selected box size horizontal offset.
Definition: unittype.h:589
@ SHIELDPIERCE_INDEX
Can teleport other units.
Definition: unittype.h:168
CPlayerColorGraphic * Sprite
Unit status for each player.
Definition: unittype.h:668
CGraphic * ShadowSprite
Alternative sprite images.
Definition: unittype.h:670
@ MaxCosts
resource 6
Definition: upgrade_structs.h:70
int AiAdjacentRange
How much this annoys the computer.
Definition: unittype.h:613
int ShadowWidth
Level to Draw UnitType at.
Definition: unittype.h:536
int ReactRangeComputer
Minimal attack range.
Definition: unittype.h:592
unsigned int GetNumberVariable() const
Definition: unittype.h:798
CUnitType * UnitTypeHumanWall
All unit-types.
Definition: unittype.cpp:463
void LoadUnitTypes()
Load the sprite for a unittype.
Definition: unittype.cpp:1059
int Distance
Definition: unittype.h:464
CBuildRestrictionDistance()
Definition: unittype.h:459
Vec2i Offset
Definition: unittype.h:427
@ MANA_INDEX
Definition: unittype.h:187
virtual void Init()
Definition: unittype.h:381
int RandomMovementProbability
The rate at which the building builds itself.
Definition: unittype.h:601
Definition: unitsound.h:73
CBuildRestrictionHasUnit()
Definition: unittype.h:476
@ ALWAYSTHREAT_INDEX
Definition: unittype.h:176
@ SHIELDPERMEABILITY_INDEX
Definition: unittype.h:222
unsigned MovementMask
Unit map field flags.
Definition: unittype.h:663
CUnitStats Stats[PlayerMax]
Unit check this map flags for move.
Definition: unittype.h:666
CUnitType * RestrictType
Definition: unittype.h:502
std::vector< BoolFlags > BoolFlag
Definition: unittype.h:646
use to show specific frame in a sprite.
Definition: unittype.h:348
@ ORGANIC_INDEX
Don't use random frame rotation.
Definition: unittype.h:173
std::string AltFile
Sprite files.
Definition: unittype.h:528
CBoolKeys()
Definition: script_unittype.cpp:150
@ HASTE_INDEX
Definition: unittype.h:213
CPlayerColorGraphic * AltSprite
Sprite images.
Definition: unittype.h:669
@ SUPPLY_INDEX
Definition: unittype.h:196
virtual ~CBuildRestrictionOnTop()
Definition: unittype.h:446
int ResourceCapacity
Resources the unit gains per mining cycle.
Definition: unittype.h:99
@ VANISHES_INDEX
Can attack from transporter.
Definition: unittype.h:155
std::vector< CBuildRestriction * > _or_list
Definition: unittype.h:407
int NumDirections
Selected box size vertical offset.
Definition: unittype.h:590
IconConfig Icon
Still frame.
Definition: unittype.h:548
Definition: unittype.h:488
@ BUILDERLOST_INDEX
The builder stays outside during the construction.
Definition: unittype.h:160
int RandomMovementDistance
Probability to move randomly.
Definition: unittype.h:602
CUnitType * UnitTypeByIdent(const std::string &ident)
Update unit stats.
Definition: unittype.cpp:846
unsigned Skirmisher
Unit turns for attack (used for ships)
Definition: unittype.h:636
std::vector< CVariable > Variable
Container of names of user defined variables.
Definition: unittype.h:790
int operator[](const char *const key)
Definition: unittype.h:740
LuaCallback * TeleportEffectOut
lua function to create effects before teleportation
Definition: unittype.h:572
char * CanCastSpell
Definition: unittype.h:598
DataKey buildin[SIZE]
Definition: unittype.h:707
std::string File
Type as number.
Definition: unittype.h:527
@ PERMANENTCLOAK_INDEX
Unit is visible under fog of war.
Definition: unittype.h:152
@ GIVERESOURCE_INDEX
Definition: unittype.h:192
Definition: unittype.h:309
bool HideNeutral
if true, show only for selected units.
Definition: unittype.h:271
@ AUTOREPAIRRANGE_INDEX
Definition: unittype.h:211
Icon reference (used in config tables)
Definition: icons.h:172
Definition: unittype.h:118
@ BUILDING_INDEX
Unit will only attack if instructed.
Definition: unittype.h:144
uint32_t IntColor
Definition: color.h:37
int MaxValue
show only above percent
Definition: unittype.h:292
LuaCallback * OnReady
lua function called on unit init
Definition: unittype.h:568
bool Invert
if true, show background like value equal to max.
Definition: unittype.h:290
@ TARGETPOSX_INDEX
Definition: unittype.h:207
virtual void Draw(int x, int y, const CUnitType &type, const CVariable &var) const
function to draw the decorations.
Definition: unit_draw.cpp:600
Definition: unittype.h:773
int ShadowOffsetX
Shadow sprite height.
Definition: unittype.h:538
int OffsetX
Sprite height.
Definition: unittype.h:533
int PoisonDrain
Sounds for events, map-specific.
Definition: unittype.h:658
CBuildRestrictionAddOn()
Definition: unittype.h:422
PixelPos MissileOffsets[UnitSides][MaxAttackPos]
Definition: unittype.h:543
@ VISIBLEUNDERFOG_INDEX
Definition: unittype.h:151
bool CanSelect(GroupSelectionMode mode=SELECTABLE_BY_RECTANGLE_ONLY) const
Definition: unittype.cpp:627
int MouseAction
Min radius for AI build surroundings checking.
Definition: unittype.h:614
int BurnPercent
Reacts on enemy for person player.
Definition: unittype.h:594
int Talking
Definition: unittype.h:553
int MinAttackRange
Number of directions unit can face.
Definition: unittype.h:591
@ REVEALER_INDEX
Definition: unittype.h:146
CUnitType * Parent
building that is unit is an addon too.
Definition: unittype.h:429
virtual void Draw(int x, int y, const CUnitType &type, const CVariable &var) const =0
function to draw the decorations.
Definition: unittype.h:299
virtual void Init()
Definition: unittype.h:447
@ ELEVATED_INDEX
Unit always considered as threat for auto targeting algorihm, useful for unit without main attack abi...
Definition: unittype.h:177
std::vector< CDecoVar * > DecoVar
Array of user defined variables (default value for unittype).
Definition: unittype.h:791
@ CANHARVEST_INDEX
The builder is lost after the construction.
Definition: unittype.h:161
@ SLOW_INDEX
Definition: unittype.h:214
@ TRANSPORT_INDEX
Definition: unittype.h:188
@ PLAYER_INDEX
Definition: unittype.h:225
unsigned WaitAtResource
Change the graphic when the unit is empty.
Definition: unittype.h:97
virtual ~CBuildRestrictionAnd()
Definition: unittype.h:388
unsigned ExplodeWhenKilled
Sea animated.
Definition: unittype.h:630
virtual void Init()
Definition: unittype.h:461
std::string RestrictTypeName
Definition: unittype.h:483
void SetMapSound(std::string ident, std::string sound, std::string sound_type, std::string sound_subtype="")
Definition: script_unittype.cpp:2479
@ DEMAND_INDEX
Food supply.
Definition: unittype.h:197
bool HideHalf
if false, don't show if var is null (F.E poison)
Definition: unittype.h:267
@ MAXHARVESTERS_INDEX
Definition: unittype.h:220
bool ShowIfNotEnable
if true, use center of deco instead of upper border
Definition: unittype.h:265
@ SIDEATTACK_INDEX
Organic unit (used for death coil spell)
Definition: unittype.h:174
int Value
Maximum for the variable. (Assume min is 0.)
Definition: unittype.h:135
bool SEToNW
if true, vertical bar, else horizontal.
Definition: unittype.h:286
int ReplaceOnDie
building that is unit is an addon too.
Definition: unittype.h:452
DistanceTypeType DistanceType
Definition: unittype.h:497
@ BUILD_INDEX
Definition: unittype.h:186
int ClicksToExplode
Quantity of tiles to move randomly.
Definition: unittype.h:603
std::string ParentName
Definition: unittype.h:450
~CUnitType()
Definition: unittype.cpp:550
@ TRAINING_INDEX
Definition: unittype.h:190
CUnitType()
Definition: unittype.cpp:519
void LoadUnitTypeSprite(CUnitType &unittype)
Init unit-type table.
Definition: unittype.cpp:986
int CanStore[MaxCosts]
Definition: unittype.h:648
@ NORANDOMPLACING_INDEX
Use special logic for Direction field.
Definition: unittype.h:172
@ GreaterThan
Definition: unittype.h:373
CVariableKeys VariableNameLookup
Container of name of user defined bool flag.
Definition: unittype.h:787
unsigned FieldFlags
How much health is drained every second when poisoned.
Definition: unittype.h:662
@ SLOT_INDEX
Definition: unittype.h:217
virtual ~CBuildRestrictionHasUnit()
Definition: unittype.h:477
int Thickness
Definition: unittype.h:305
int Distance
Definition: unittype.h:496
unsigned Neutral
Unit can attack.
Definition: unittype.h:633
int StartingResources
On which button level game will show units inside transporter.
Definition: unittype.h:607
Vec2i GetHalfTileSize() const
Definition: unittype.h:514
Definition: unittype.h:508
bool CanTransport() const
Definition: unittype.h:518
int ShadowHeight
Shadow sprite width.
Definition: unittype.h:537
CUnitTypeVar()
Definition: unittype.h:781
@ RADAR_INDEX
Definition: unittype.h:209
static bool key_pred(const DataKey &lhs, const DataKey &rhs)
Definition: unittype.h:694
DistanceTypeType DistanceType
distance to build (circle)
Definition: unittype.h:465
Definition: unittype.h:473
DistanceTypeType CountType
Definition: unittype.h:499
std::string FileWhenLoaded
Definition: unittype.h:95
@ KILL_INDEX
Definition: unittype.h:195
std::string Ident
Definition: unittype.h:524
CUnitType * CclGetUnitType(lua_State *l)
Definition: script_unittype.cpp:1555
@ EXPLODEWHENKILLED_INDEX
Definition: unittype.h:150
int DrawLevel
Sprite vertical offset.
Definition: unittype.h:535
virtual void Draw(int x, int y, const CUnitType &type, const CVariable &var) const
Definition: unit_draw.cpp:420
std::string ShadowFile
Alternative sprite files.
Definition: unittype.h:529
bool ShowFullBackground
Width of the bar.
Definition: unittype.h:289
int Count
Definition: unittype.h:481
CVariable()
Definition: unittype.h:121
@ FLIP_INDEX
Definition: unittype.h:145
virtual void Init()
Definition: unittype.h:396
CDecoVarFrame()
Definition: unittype.h:302
char ShadowScale
Shadow vertical offset.
Definition: unittype.h:540
void UpdateStats(int reset_to_default)
Update unit stats.
Definition: unittype.cpp:756
int OffsetY
Sprite horizontal offset.
Definition: unittype.h:534
std::string DamageType
lua function to create effects after teleportation
Definition: unittype.h:574
@ SIGHTRANGE_INDEX
Definition: unittype.h:199
CDecoVarAnimatedSprite()
Definition: unittype.h:351
unsigned FinalResource
Id of the resource harvested. Redundant.
Definition: unittype.h:102
int TeleportCost
lua function called when unit ready/built
Definition: unittype.h:570
virtual bool Check(const CUnit *builder, const CUnitType &type, const Vec2i &pos, CUnit *&ontoptarget) const
Definition: build.cpp:232
int AutoBuildRate
Default value for autocast.
Definition: unittype.h:600
std::vector< CUnitType * > UnitTypes
Definition: unittype.cpp:455
bool ShowOnlySelected
if false, don't show if var is to max. (Like mana)
Definition: unittype.h:269
PixelSize GetPixelSize() const
Definition: unittype.cpp:606
IntColor Color
Size of the border, 0 for no border.
Definition: unittype.h:295
int BoardSize
Number of Transporter slots.
Definition: unittype.h:605
void push_back(CBuildRestriction *restriction)
Definition: unittype.h:405
int StillFrame
Animation scripts.
Definition: unittype.h:546
Definition: unittype.h:385
@ SELECT_ALL
Definition: unittype.h:83
int Height
Sprite width.
Definition: unittype.h:532
Definition: missileconfig.h:44
#define UnitSides
Definition: unittype.h:75
virtual bool Check(const CUnit *builder, const CUnitType &type, const Vec2i &pos, CUnit *&ontoptarget) const
Definition: build.cpp:356
virtual void Draw(int x, int y, const CUnitType &type, const CVariable &var) const
Definition: unit_draw.cpp:493
unsigned SeaUnit
Air animated.
Definition: unittype.h:629
int OffsetX
Index of the variable.
Definition: unittype.h:256
UnitTypeType
Definition: unittype.h:362
unsigned char IncreaseFrequency
Number to increase(decrease) Value by second.
Definition: unittype.h:137
A platform independent color.
Definition: color.h:43
CUnitType * RestrictType
Definition: unittype.h:468
bool IsVertical
Definition: unittype.h:285
DistanceTypeType CountType
Definition: unittype.h:482
@ COWARD_INDEX
Definition: unittype.h:143
int ColorIndex
Definition: unittype.h:306
CBuildRestrictionOnTop()
Definition: unittype.h:445
virtual bool Check(const CUnit *builder, const CUnitType &type, const Vec2i &pos, CUnit *&ontoptarget) const
Definition: build.cpp:100
Definition: unittype.h:640
std::string RestrictTypeOwner
Definition: unittype.h:485
Definition: unittype.h:86
Orc wall.
Definition: unittype.h:686
unsigned int GetNumberBoolFlag() const
Array to describe how showing variable.
Definition: unittype.h:793
@ ISALIVE_INDEX
Definition: unittype.h:224
LuaCallback * TeleportEffectIn
mana used for teleportation
Definition: unittype.h:571
bool BoolFlagInvert
if true, show for opponent unit.
Definition: unittype.h:275
void SetMapStat(std::string ident, std::string variable_key, int value, std::string variable_type)
Definition: script_unittype.cpp:2413
unsigned LandUnit
Flip image when facing left.
Definition: unittype.h:627
@ UPGRADINGTO_INDEX
Definition: unittype.h:191
Mng ** Mngs
offset into portraits for talking portraits
Definition: unittype.h:554
MissileConfig Impact[ANIMATIONS_DEATHTYPES+2]
Missile for unit explosion.
Definition: unittype.h:561
Definition: unittype.h:777
virtual void Draw(int x, int y, const CUnitType &type, const CVariable &var) const
function to draw the decorations.
Definition: unit_draw.cpp:539
int AnnoyComputerFactor
Decay rate in 1/6 seconds.
Definition: unittype.h:612
int RepairHP
What is shown in construction phase.
Definition: unittype.h:581
virtual ~CBuildRestrictionSurroundedBy()
Definition: unittype.h:492
unsigned char RefineryHarvester
Unit harvests without entering the building.
Definition: unittype.h:106
void Init()
Definition: unittype.cpp:1089
@ SHOREBUILDING_INDEX
Can do ground attack command.
Definition: unittype.h:157
@ DECORATION_INDEX
Definition: unittype.h:165
int Max
Definition: unittype.h:134
@ SELECTABLEBYRECTANGLE_INDEX
Unit is a resource harvester.
Definition: unittype.h:163
constexpr unsigned char PlayerMax
Definition: settings.h:62
CUnitStats DefaultStat
Unit will try to shoot from max range.
Definition: unittype.h:638
char CanTargetFlag
Can transport units with this flag.
Definition: unittype.h:643
int FadeValue
identifiant in SpellSprite
Definition: unittype.h:344
@ INDESTRUCTIBLE_INDEX
Unit is a decoration (act as tile).
Definition: unittype.h:166
void SaveUnitTypes(CFile &file)
Get unit-type by ident.
Definition: unittype.cpp:818
bool ShowWhenMax
if true, don't show when 0 < var < max.
Definition: unittype.h:268
std::string * Files
Definition: unittype.h:551
bool value
Definition: unittype.h:641
virtual void Draw(int x, int y, const CUnitType &type, const CVariable &var) const
function to draw the decorations.
Definition: unit_draw.cpp:570
CUnitSound MapSound
Sounds for events.
Definition: unittype.h:656
Construction shown during construction of a building.
Definition: construct.h:125
int BoxHeight
Selected box size width.
Definition: unittype.h:587
CBoolKeys BoolFlagNameLookup
Definition: unittype.h:786
bool BoolFlagMatches(const CUnitType &type) const
Check if this decoration defines a condition on boolean flags and if so, if that condition matches.
Definition: unit_draw.cpp:403
@ BASICDAMAGE_INDEX
Definition: unittype.h:202
virtual bool Check(const CUnit *builder, const CUnitType &type, const Vec2i &pos, CUnit *&ontoptarget) const
Definition: build.cpp:191
std::string CorpseName
DamageType (used for extra death animations and impacts)
Definition: unittype.h:576
@ PIERCINGDAMAGE_INDEX
Definition: unittype.h:201
#define DebugPrint(args)
Definition: stratagus.h:148
std::string Name
Identifier.
Definition: unittype.h:525
const char * operator[](int index)
Definition: unittype.h:716
int NumIterations
Definition: unittype.h:556
char Increase
Current (or initial) value of the variable (or initial value).
Definition: unittype.h:136
bool operator!=(const CVariable &rhs) const
Definition: unittype.h:131
Definition: unittype.h:691
Icon to display for this unit.
Definition: unittype.h:550
Definition: animation.h:108
@ Equal
Definition: unittype.h:369
bool Diagonal
Definition: unittype.h:470
@ SKIRMISHER_INDEX
Definition: unittype.h:175
unsigned Building
Death explosion animated.
Definition: unittype.h:631
use to show specific frame in a sprite.
Definition: unittype.h:334
int BoxOffsetX
Selected box size height.
Definition: unittype.h:588
CUnitType * UnitTypeOrcWall
Human wall.
Definition: unittype.cpp:464
virtual void Draw(int x, int y, const CUnitType &type, const CVariable &var) const
function to draw the decorations.
Definition: unit_draw.cpp:520
std::map< std::string, int > user
Definition: unittype.h:708
CColor NeutralMinimapColorRGB
Rules list for for AI to build a building.
Definition: unittype.h:653
int Height
(SouthEastToNorthWest), if false value 0 is on the left or up of the bar.
Definition: unittype.h:287
unsigned char TerrainHarvester
Convert resource when delivered.
Definition: unittype.h:103
int AddKey(const char *const key)
Definition: unittype.h:760
CFont * Font
Definition: unittype.h:316
CConstruction * Construction
Corpse unit-type.
Definition: unittype.h:579
virtual bool Check(const CUnit *builder, const CUnitType &type, const Vec2i &pos, CUnit *&ontoptarget) const
Definition: build.cpp:313
@ POINTS_INDEX
Definition: unittype.h:219
DistanceTypeType
Definition: unittype.h:368
@ TARGETPOSY_INDEX
Definition: unittype.h:208
unsigned ResourceId
Cycles the unit waits while returning.
Definition: unittype.h:101
@ NONSOLID_INDEX
Unit unloads his passengers after death.
Definition: unittype.h:170
bool ShowOpponent
if true, don't show for allied unit. (but show own units)
Definition: unittype.h:273
int ReplaceOnBuild
recreate the parent on destruction
Definition: unittype.h:453
int TileHeight
Tile size on map width.
Definition: unittype.h:585
std::string FileWhenEmpty
Change the graphic when the unit is loaded.
Definition: unittype.h:96
char NSprite
Definition: unittype.h:342
@ DETECTCLOAK_INDEX
Is only visible by CloakDetectors.
Definition: unittype.h:153
MissileConfig Explosion
Missile weapon.
Definition: unittype.h:560
ResourceInfo * ResInfo[MaxCosts]
The resource this unit gives.
Definition: unittype.h:650
int ButtonLevelForTransporter
How much "cells" unit occupies inside transporter.
Definition: unittype.h:606
@ CANATTACK_INDEX
Building must be built on coast.
Definition: unittype.h:158
CBuildRestrictionSurroundedBy()
Definition: unittype.h:491
LuaCallback * OnEachSecond
lua function called every cycle
Definition: unittype.h:566
@ ATTACKRANGE_INDEX
Definition: unittype.h:200
@ NON_SELECTABLE_BY_RECTANGLE_ONLY
Definition: unittype.h:82
LuaCallback * OnDeath
Missiles spawned if unit is hit(+shield)
Definition: unittype.h:563
int ReactRangePerson
Reacts on enemy for computer.
Definition: unittype.h:593
@ POS_BOTTOM_INDEX
Definition: unittype.h:206
unsigned CanAttack
Building.
Definition: unittype.h:632
virtual void Init()
Definition: unittype.h:478
@ TELEPORTER_INDEX
Unit is indestructible (take no damage).
Definition: unittype.h:167
#define MaxAttackPos
Definition: unittype.h:76
LuaCallback * OnEachCycle
lua function called when unit is hit
Definition: unittype.h:565
int MaxOnBoard
Number of consecutive clicks until unit suicides.
Definition: unittype.h:604
void UnitTypeCclRegister()
Access unit-type object.
Definition: script_unittype.cpp:2522
int OffsetXPercent
Offset in Y coord.
Definition: unittype.h:259
@ NotEqual
Definition: unittype.h:370
@ GROUNDATTACK_INDEX
Corpses & destroyed places.
Definition: unittype.h:156
std::string ParentName
offset from the main building to place this
Definition: unittype.h:428
Definition: luacallback.h:41
@ ISNOTSELECTABLE_INDEX
Selectable with mouse rectangle.
Definition: unittype.h:164
ResourceInfo()
Definition: unittype.h:89
unsigned SideAttack
Unit is neutral, used by the editor.
Definition: unittype.h:635
int RepairRange
HP burn rate per sec.
Definition: unittype.h:596
char NSprite
Definition: unittype.h:329
virtual void Init()
Definition: unittype.h:424
void DefineVariableField(lua_State *l, CVariable *var, int lua_index)
Cleanup unit-type module.
Definition: script_unittype.cpp:1916
@ RESEARCH_INDEX
Definition: unittype.h:189
Definition: upgrade_structs.h:129
CPlayerColorGraphic * SpriteWhenEmpty
The graphic corresponding to FileWhenLoaded.
Definition: unittype.h:109
@ NVARALREADYDEFINED
Definition: unittype.h:227
CPlayerColorGraphic * SpriteWhenLoaded
Unit have to build Refinery buildings for harvesting.
Definition: unittype.h:108
Definition: unittype.h:240
int ShadowOffsetY
Shadow horizontal offset.
Definition: unittype.h:539
@ HP_INDEX
Definition: unittype.h:185
@ NBARALREADYDEFINED
Unit is a main building (Town Hall f. ex.)
Definition: unittype.h:180
LuaCallback * OnInit
lua function called every second
Definition: unittype.h:567
@ UnitTypeFly
Unit lives on land.
Definition: unittype.h:364
@ POISON_INDEX
Definition: unittype.h:221
CUnitType * NewUnitTypeSlot(const std::string &ident)
Save the unit-type table.
Definition: unittype.cpp:862
bool IsCenteredInX
Percent offset (TileHeight) in Y coord.
Definition: unittype.h:262
@ LessThan
Definition: unittype.h:371
int Slot
Pretty name shown from the engine.
Definition: unittype.h:526
LuaCallback * OnHit
lua function called when unit is about to die, receives x,y,unit
Definition: unittype.h:564
@ UNHOLYARMOR_INDEX
Definition: unittype.h:216
std::vector< CBuildRestriction * > BuildingRules
Resource information.
Definition: unittype.h:651
@ NOFRIENDLYFIRE_INDEX
Unit is elevated and can see over opaque tiles placed in the same ground level with the unit.
Definition: unittype.h:178
Sprite contains frame from full (left)to empty state (right).
Definition: unittype.h:321
GroupSelectionMode
Definition: unittype.h:80
unsigned char Enable
Every how many seconds we should apply the increase.
Definition: unittype.h:138
unsigned Flip
Definition: unittype.h:626
CKeys()
Definition: unittype.h:705
@ BLOODLUST_INDEX
Definition: unittype.h:212
int RepairCosts[MaxCosts]
Amount of HP per repair.
Definition: unittype.h:582
int Width
Height of the bar.
Definition: unittype.h:288
std::string RestrictTypeOwner
Definition: unittype.h:501
int Count
Definition: unittype.h:498
int DecayRate
Land / fly / naval.
Definition: unittype.h:610
MissileConfig Missile
Definition: unittype.h:559
@ ATTACKFROMTRANSPORTER_INDEX
Can see Cloaked units.
Definition: unittype.h:154
bool ShowWhenNull
if false, Show only if var is enable
Definition: unittype.h:266
void Clear()
Definition: unittype.cpp:1099
void UpdateUnitStats(CUnitType &type, int reset_to_default)
Register ccl features.
Definition: unittype.cpp:642
@ ARMOR_INDEX
Food demand.
Definition: unittype.h:198
bool HideAllied
if true, don't show for neutral unit.
Definition: unittype.h:272
unsigned ResourceStep
Cycles the unit waits while mining.
Definition: unittype.h:98
@ WALL_INDEX
Unit can be entered by other units.
Definition: unittype.h:171
virtual ~CBuildRestrictionAddOn()
Definition: unittype.h:423
@ HARVESTER_INDEX
Resource can be harvested.
Definition: unittype.h:162
void InitUnitTypes(int reset_player_stats)
Definition: unittype.cpp:948
Definition: unittype.h:432
Definition: unittype.h:377
int CurrMng
Definition: unittype.h:555
CDecoVarStaticSprite()
Definition: unittype.h:337
std::string RestrictTypeName
Definition: unittype.h:500
CUnitTypeVar UnitTypeVar
Definition: script_unittype.cpp:61
void CleanUnitTypes()
Load the unit-type data.
Definition: unittype.cpp:1113
int n
Index of sprite. (.
Definition: unittype.h:343
CUnitType * RestrictType
Definition: unittype.h:484
@ RADARJAMMER_INDEX
Definition: unittype.h:210
@ SEAUNIT_INDEX
Definition: unittype.h:149
UnitTypeType UnitType
originally only visual effect, we do more with this!
Definition: unittype.h:609
unsigned int TotalKeys
Definition: unittype.h:709
Vec2T< short int > Vec2i
Definition: vec2i.h:162
unsigned AirUnit
Land animated.
Definition: unittype.h:628
char BorderSize
show only below percent
Definition: unittype.h:293
@ POSX_INDEX
Definition: unittype.h:203
@ MAINFACILITY_INDEX
Unit accepts friendly fire for splash attacks.
Definition: unittype.h:179
std::vector< CBuildRestriction * > AiBuildingRules
Rules list for building a building.
Definition: unittype.h:652
@ CARRYRESOURCE_INDEX
Definition: unittype.h:193
void DrawUnitType(const CUnitType &type, CPlayerColorGraphic *sprite, int colorIndex, int frame, const PixelPos &screenPos)
Draw the sprite frame of unit-type.
Definition: unittype.cpp:896
int GivesResource
Resources that we can store here.
Definition: unittype.h:649
@ POS_RIGHT_INDEX
Definition: unittype.h:205
char CanTransport
User defined flag. Used for (dis)allow target.
Definition: unittype.h:642
virtual bool Check(const CUnit *builder, const CUnitType &type, const Vec2i &pos, CUnit *&ontoptarget) const
Definition: build.cpp:113
@ SHIELDPIERCING_INDEX
Definition: unittype.h:223
std::string RestrictTypeName
Definition: unittype.h:466
CUnitStats MapDefaultStat
Definition: unittype.h:639
bool CheckBuilder
Definition: unittype.h:469
bool CheckUserBoolFlags(const char *BoolFlags) const
Definition: unittype.cpp:611
IntColor BColor
Color of bar.
Definition: unittype.h:296
@ INVISIBLE_INDEX
Definition: unittype.h:215
int TileWidth
How much it costs to repair.
Definition: unittype.h:584
Definition: unittype.h:279
virtual ~CBuildRestriction()
Definition: unittype.h:380
@ UnitTypeLand
Definition: unittype.h:363
@ UnitTypeNaval
Unit lives in air.
Definition: unittype.h:365
CUnitType * Parent
building that is unit is an addon too.
Definition: unittype.h:451
Definition: unittype.h:410
@ LessThanEqual
Definition: unittype.h:372
int BoxWidth
Tile size on map height.
Definition: unittype.h:586
unsigned char LoseResources
Unit will harvest terrain.
Definition: unittype.h:104
CDecoVarSpriteBar()
Definition: unittype.h:324
unsigned int keylen
Definition: unittype.h:701
char * AutoCastActive
Unit is able to use spells.
Definition: unittype.h:599
virtual ~CDecoVar()
Definition: unittype.h:245
The big unit structure.
Definition: unit.h:135
void UpdateUnitVariables(CUnit &unit)
Update custom Variables with other variable (like Hp, ...)
Definition: script_unittype.cpp:2305
@ SAVECARGO_INDEX
Definition: unittype.h:169
bool IsCenteredInY
if true, use center of deco instead of left border
Definition: unittype.h:263
CDecoVar()
Definition: unittype.h:244
@ SELECTABLE_BY_RECTANGLE_ONLY
Definition: unittype.h:81
std::string RestrictTypeOwner
Definition: unittype.h:467
Font definition.
Definition: font.h:73
int offset
Definition: unittype.h:700
const char * key
Definition: unittype.h:702
@ POSY_INDEX
Definition: unittype.h:204
Definition: unittype.h:456
@ XP_INDEX
Definition: unittype.h:194
CUnitSound Sound
Minimap Color for Neutral Units.
Definition: unittype.h:655
int BoolFlag
if 1, invert the bool flag check
Definition: unittype.h:276
int OffsetYPercent
Percent offset (TileWidth) in X coord.
Definition: unittype.h:260
@ PRIORITY_INDEX
Definition: unittype.h:226
char WaitFrames
Index of sprite. (.
Definition: unittype.h:356
#define ANIMATIONS_DEATHTYPES
Definition: animation.h:39
bool operator==(const CVariable &rhs) const
Definition: unittype.h:123
@ LANDUNIT_INDEX
reveal the fog of war
Definition: unittype.h:147
virtual ~CBuildRestrictionDistance()
Definition: unittype.h:460
int BurnDamageRate
Burning percent.
Definition: unittype.h:595
bool CheckBuilder
Definition: unittype.h:503
CAnimations * Animations
Attack offsets for missiles.
Definition: unittype.h:545
void Init()
Definition: unittype.h:711
CDecoVarText()
Definition: unittype.h:312
(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.