_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
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.
42 #ifndef __UNITTYPE_H__
85 #define PRIORITY_FACTOR 0x00080000
86 #define HEALTH_FACTOR 0x00000001
87 #define DISTANCE_FACTOR 0x00010000
88 #define INRANGE_FACTOR 0x00008000
89 #define INRANGE_BONUS 0x01000000
90 #define CANATTACK_BONUS 0x00080000
91 #define AIPRIORITY_BONUS 0x04000000
97 #define AT_ATTACKED_BY_FACTOR 0x40000000
98 #define AT_THREAT_FACTOR 0x20000000
99 #define AT_PRIORITY_OFFSET 15
100 #define AT_DISTANCE_OFFSET 7
101 #define AT_PRIORITY_MASK_HI 0xFFFF8000
103 #define AT_FARAWAY_REDUCE_OFFSET 14
131 #define NextDirection 32
132 #define UnitNotSeen 0x7fffffff
181 void Release(
bool final =
false);
277 bool IsUnusable(
bool ignore_built_state =
false)
const;
434 #define NoUnitP (CUnit *)0
439 #define UnitNumber(unit) ((unit).UnitManagerData.GetUnitId())
492 bool AiExplores =
true;
493 bool SimplifiedAutoTargeting =
false;
494 bool AiChecksDependencies =
false;
527 extern std::vector<CUnit *>
Selected;
697 extern void SetGroup(
CUnit **units,
unsigned int nunits,
int num);
762 #endif // !__UNIT_H__
COrder * NewOrder
order to continue after current
Definition: unit.h:425
Diplomacy states for CommandDiplomacy.
Definition: player.h:83
unsigned int CurrentAction() const
Definition: unit.cpp:582
unsigned AiExplores
if game uses interior tileset or is generally "inside" for the purpose of obstacles
Definition: settings.h:250
int Threshold
action counter
Definition: unit.h:412
@ LookingNE
Unit looking north.
Definition: unit.h:122
int ToggleUnitsByType(CUnit &base)
Toggle units from the same type (if selectable by rectangle)
Definition: selection.cpp:431
CBuildRestrictionOnTop * OnTopDetails(const CUnit &unit, const CUnitType *parent)
Return the rule used to build this building.
Definition: build.cpp:60
int ToggleSelectUnit(CUnit &unit)
Add a unit to selected if not already selected, remove it otherwise.
Definition: selection.cpp:310
Unit visibility counts.
Definition: unit.h:390
void DrawSelectionRectangle(IntColor, int, int, int, int)
Draw rectangle around unit.
Definition: unit_draw.cpp:225
bool CanMove() const
Definition: unittype.cpp:622
int SelectGroupFromUnit(CUnit &unit)
Select the units from the same group as the one in parameter.
Definition: selection.cpp:585
PixelPos GetMapPixelPosTopLeft() const
Definition: unit.cpp:2441
@ LookingE
Unit looking north east.
Definition: unit.h:123
void ClearGroup(int num)
Remove all units from a group.
Definition: groups.cpp:172
int AddGroupFromUnitToSelection(CUnit &unit)
Add the units from the same group as the one in parameter.
Definition: selection.cpp:549
constexpr unsigned short UpgradeMax
How many unit types supported.
Definition: settings.h:64
Definition: pathfinder.h:115
int CurrentSightRange
Current unit stats.
Definition: unit.h:348
unsigned char DamagedType
Resources Held by a unit.
Definition: unit.h:364
bool MineNotifications
Enables/disables stereo sound effects.
Definition: unit.h:466
bool PauseOnLeave
If true, shows the big screen(without panels)
Definition: unit.h:462
unsigned Selected
unit is removed (not on map)
Definition: unit.h:375
int ResourcesMultiBuildersMultiplier
Config: reveal attacker enabled.
Definition: unit.cpp:360
std::vector< CUnit * > Selected
How many units could be selected.
Definition: selection.cpp:57
int AddSelectedGroundUnitsInRectangle(const PixelPos &corner_topleft, const PixelPos &corner_bottomright)
Add ground units in the selection rectangle to the current selection.
Definition: selection.cpp:940
bool IndividualUpgrades[UpgradeMax]
custom colors
Definition: unit.h:356
int UnderAttack
The counter while ai unit couldn't change target.
Definition: unit.h:413
int GetDrawLevel() const
Definition: unit.cpp:607
bool CanBuildOn(const Vec2i &pos, int mask)
Definition: build.cpp:487
void CleanDecorations()
Clean the decorations (health,mana) of units.
Definition: unit_draw.cpp:387
bool IsUnusable(bool ignore_built_state=false) const
Definition: unit.cpp:3440
std::vector< BoolFlags > BoolFlag
Definition: unittype.h:646
COrder * CriticalOrder
order for new trained units
Definition: unit.h:426
void DestroyAllInside(CUnit &source)
Destroy all units inside another unit.
Definition: unit.cpp:2563
unsigned Active
Unit is in construction.
Definition: unit.h:378
void CleanSelections()
Clean up selections.
Definition: selection.cpp:1092
void AssignToPlayer(CPlayer &player)
Assign unit to player.
Definition: unit.cpp:742
bool IsOnlySelected(const CUnit &unit)
Check if unit is the currently only selected.
Definition: selection.cpp:69
CUnit * UnitInside
Number of units transported inside.
Definition: unit.h:329
unsigned int MaxSelectable
Definition: selection.cpp:55
bool CanStoreOrder(COrder *order)
Definition: unit.cpp:724
int ResourcesHeld
Definition: unit.h:362
unsigned CacheLock
Unit is on board a transporter.
Definition: unit.h:380
void AssignWorkerToMine(CUnit &mine)
Definition: unit.cpp:1952
void CleanGroups()
Cleanup groups.
Definition: groups.cpp:141
void UnSelectAll()
Clear current selection.
Definition: selection.cpp:106
unsigned TeamSelected
This mine got a notification about its resources being low.
Definition: unit.h:385
bool get_AiChecksDependencies()
Definition: unit.h:502
unsigned long Attacked
Index of damage type of unit which damaged this unit.
Definition: unit.h:365
void UpdateUnitSightRange(CUnit &unit)
Update unit->CurrentSightRange.
Definition: unit.cpp:989
const std::vector< CUnit * > & GetUnitsOfGroup(int num)
Get the array of units of a particular group.
Definition: groups.cpp:161
void HitUnit(CUnit *attacker, CUnit &target, int damage, const Missile *missile=NULL)
Hit unit with damage, if destroyed give attacker the points.
Definition: unit.cpp:3080
void UnitUpdateHeading(CUnit &unit)
Update frame from heading.
Definition: unit.cpp:2161
int AddSelectedUnitsInRectangle(const PixelPos &corner_topleft, const PixelPos &corner_bottomright)
Add the units in the selection rectangle to the current selection.
Definition: selection.cpp:783
@ PERMANENTCLOAK_INDEX
Unit is visible under fog of war.
Definition: unittype.h:152
void Remove(CUnit *host)
Remove unit from map/groups/...
Definition: unit.cpp:1321
bool EnableTrainingQueue
Show unit's name for some time.
Definition: unit.cpp:357
PlayerTypes Type
name of non computer
Definition: player.h:111
unsigned ByPlayer
Unit seen destroyed or not.
Definition: unit.h:401
Definition: unittype.h:118
uint32_t IntColor
Definition: color.h:37
bool IsAliveOnMap() const
Definition: unit.h:216
unsigned MineLow
Unit is waiting and playing its still animation.
Definition: unit.h:383
const CAnimation * CurrAnim
Anim.
Definition: unit.h:417
void UnitGoesUnderFog(CUnit &unit, const CPlayer &player)
Call when an Unit goes under fog.
Definition: unit.cpp:1640
void Init()
Definition: unit.cpp:404
void InitUnits()
Initialize unit module.
Definition: unit.cpp:3484
const CUnitStats * Stats
Owner of this unit.
Definition: unit.h:347
void(CCONV *lazyGlBegin)(GLenum)
bool HardwareCursor
Don't show messages on status line.
Definition: unit.h:469
Vec2i tilePos
Pointer to last seen unit-type.
Definition: unit.h:395
int SelectGroundUnitsInRectangle(const PixelPos &corner_topleft, const PixelPos &corner_bottomright)
Select ground units in the selection rectangle.
Definition: selection.cpp:841
@ LookingNW
Unit looking west.
Definition: unit.h:128
size_t PlayerSlot
Definition: unit.h:325
@ VISIBLEUNDERFOG_INDEX
Definition: unittype.h:151
@ REVEALER_INDEX
Definition: unittype.h:146
signed char IX
Last unit->tilePos Seen.
Definition: unit.h:396
bool ShowNoSelectionStats
Show messages.
Definition: unit.h:460
int SelectGroup(int group_number, GroupSelectionMode mode=SELECTABLE_BY_RECTANGLE_ONLY)
Select the units belonging to a particular group.
Definition: selection.cpp:515
unsigned int Offset
Map position X.
Definition: unit.h:343
unsigned Moving
Let selection rectangle blink.
Definition: unit.h:368
int Index
Definition: player.h:108
void UnitLost(CUnit &unit)
Handle the loss of a unit (food,...)
Definition: unit.cpp:1371
bool InAttackRange(const CUnit &unit, const CUnit &target)
Is target within attack range of this unit?
Definition: unit.cpp:2753
void DrawSelectionCircleWithTrans(IntColor, int, int, int, int)
Draw circle filled with alpha around unit.
Definition: unit_draw.cpp:210
void(*)(IntColor, int, int, int, int) DrawSelectionEllipse(float factor)
Draw ellipse around unit.
Definition: unit_draw.cpp:286
int Value
Maximum for the variable. (Assume min is 0.)
Definition: unittype.h:135
int Frame
Definition: unit.h:354
int GetUnitId() const
Definition: unit.h:315
void SelectSingleUnit(CUnit &unit)
Select one unit as selection.
Definition: selection.cpp:247
signed char IY
Seen X image displacement to map position.
Definition: unit.h:397
bool RestoreOrder()
Definition: unit.cpp:694
~CUnit()
Definition: unit.cpp:486
void SaveUnit(const CUnit &unit, CFile &file)
save unit-structure
Definition: unit_save.cpp:124
Vec2i GetRndPosInDirection(const Vec2i &srcPos, const CUnit &dirUnit, const bool dirFrom, const int minRange, const int devRadius, const int rangeDev=3)
Return randomly selected position in direction (to/from) dirUnit from srcPos.
Definition: unit.cpp:2800
const CAnimation * Anim
Definition: unit.h:416
_seen_stuff_()
Definition: unit.h:391
int ViewPointDistance(const Vec2i &pos)
Calculate the distance from current view point to coordinate.
Definition: unit.cpp:3276
void UnitGoesOutOfFog(CUnit &unit, const CPlayer &player)
Call when an Unit goes out of fog.
Definition: unit.cpp:1681
void set_AiChecksDependencies(bool v)
Definition: unit.h:503
Definition: viewport.h:63
unsigned int ReleaseCycle
Reference counter.
Definition: unit.h:323
Definition: unittype.h:508
unsigned State
Unit seen construction.
Definition: unit.h:399
_directions_
Definition: unit.h:120
CVariable * Variable
Definition: unit.h:404
unsigned char CurrentResource
Definition: unit.h:361
bool IsAllied(const CPlayer &player) const
Definition: unit.cpp:3401
unsigned AiChecksDependencies
Use alternate target choosing algorithm for auto attack mode (idle, attack-move, patrol,...
Definition: settings.h:252
@ LookingSW
Unit looking south.
Definition: unit.h:126
void UpdateForNewUnit(const CUnit &unit, int upgrade)
Definition: unit.cpp:1501
unsigned Waiting
Unit is on lock by unitcache operations.
Definition: unit.h:382
bool IsGroupTainted(int num)
Definition: groups.cpp:148
CUnit * MakeUnitAndPlace(const Vec2i &pos, const CUnitType &type, CPlayer *player)
Create a new unit and place on map.
Definition: unit.cpp:1242
int Unbreakable
Wait.
Definition: unit.h:419
void LetUnitDie(CUnit &unit, bool suicide=false)
Let a unit die.
Definition: unit.cpp:2457
int CanTransport(const CUnit &transporter, const CUnit &unit)
Can transporter transport the other unit.
Definition: unit.cpp:3342
bool IsTeamed(const CPlayer &player) const
Definition: unit.cpp:3421
void ShowOrder(const CUnit &unit)
Show a unit's orders.
Definition: unit_draw.cpp:735
unsigned long Summoned
gamecycle unit was last attacked
Definition: unit.h:366
bool IsIdle() const
Definition: unit.cpp:597
COrder * SavedOrder
orders to process
Definition: unit.h:424
bool ShowAttackRange
Show reaction range.
Definition: unit.h:458
unsigned Burning
True if unit tries to repair on still action.
Definition: unit.h:372
Vec2i tilePos
Resource still.
Definition: unit.h:341
signed char IY
X image displacement to map position.
Definition: unit.h:359
@ LookingSE
Unit looking east.
Definition: unit.h:124
void UnitCclRegister()
register CCL units features
Definition: script_unit.cpp:1592
bool IsAttackRanged(CUnit *goal, const Vec2i &goalPos)
Definition: unit.cpp:3448
bool ShowReactionRange
Show sight range.
Definition: unit.h:457
bool IsVisibleOnMap(const CPlayer &player) const
Definition: unit.h:256
unsigned int Refs
Definition: unit.h:322
void DrawShadow(const CUnitType &type, int frame, const PixelPos &screenPos)
Draw unit's shadow.
Definition: unit_draw.cpp:694
void DeAssignWorkerFromMine(CUnit &mine)
Definition: unit.cpp:1973
void RefsIncrease()
Increase a unit's reference count.
Definition: unit.cpp:378
void ChangeTeamSelectedUnits(CPlayer &player, const std::vector< CUnit * > &units)
Changed TeamUnit Selection.
Definition: selection.cpp:181
CPreference()
Definition: unit.h:447
Definition: upgrade_structs.h:154
@ COWARD_INDEX
Definition: unittype.h:143
int SelectUnitsByType(CUnit &base)
Select units from the same type (if selectable by rectangle)
Definition: selection.cpp:339
void UnitCountSeen(CUnit &unit)
Does a recount for VisCount.
Definition: unit.cpp:1702
bool IsEnemy(const CPlayer &player) const
Definition: unit.cpp:3381
int ViewPointDistanceToUnit(const CUnit &dest)
Calculate the distance from current view point to unit.
Definition: unit.cpp:3292
void RescueUnits()
Check for rescue each second.
Definition: unit.cpp:2038
CUnit * CanBuildUnitType(const CUnit *unit, const CUnitType &type, const Vec2i &pos, int real)
FIXME: more docu.
Definition: build.cpp:503
void ChangeOwner(CPlayer &newplayer)
Change owner of unit.
Definition: unit.cpp:1871
PixelPos GetMapPixelPosCenter() const
Definition: unit.cpp:2447
unsigned long ShowNameTime
Delay to show unit's name.
Definition: unit_draw.cpp:100
@ LookingS
Unit looking south east.
Definition: unit.h:125
int FrameSkip
If true, the selection rectangle interpolates color to indicate damage.
Definition: unit.h:472
CUnit * Workers
Definition: unit.h:336
void MarkUnitFieldFlags(const CUnit &unit)
currently selected units
Definition: unit.cpp:1018
void UnSelectUnit(CUnit &unit)
Remove a unit from selection.
Definition: selection.cpp:259
char * AutoCastSpell
order to do as possible in breakable animation.
Definition: unit.h:428
CUnit * PrevContained
Next unit in the container.
Definition: unit.h:332
void Release(bool final=false)
Release a unit.
Definition: unit.cpp:500
bool BigScreen
Show stats when no selection is active.
Definition: unit.h:461
const CConstructionFrame * CFrame
Definition: unit.h:392
PathFinderData * pathFinderData
Unit's Current Sight Range.
Definition: unit.h:351
ENUM_CLASS PlayerComputer
unused slot
Definition: settings.h:122
int AddSelectedAirUnitsInRectangle(const PixelPos &corner_topleft, const PixelPos &corner_bottomright)
Add flying units in the selection rectangle to the current selection.
Definition: selection.cpp:1010
int AutosaveMinutes
How many cycles need to show unit's name popup.
Definition: unit.h:477
constexpr unsigned char PlayerMax
Definition: settings.h:62
Definition: unit_manager.h:50
bool get_SimplifiedAutoTargeting()
Definition: unit.h:500
void SelectedUnitChanged()
Called whenever the selected unit was updated.
Definition: script_ui.cpp:1210
CUnit * MakeUnit(const CUnitType &type, CPlayer *player)
Create a new unit.
Definition: unit.cpp:794
bool IsInvisibile(const CPlayer &player) const
Definition: unit.h:196
CUnitManagerData UnitManagerData
When this unit could be recycled.
Definition: unit.h:324
void Place(const Vec2i &pos)
Place a unit on map.
Definition: unit.cpp:1203
int SelectAirUnitsInRectangle(const PixelPos &corner_topleft, const PixelPos &corner_bottomright)
Select flying units in the selection rectangle.
Definition: selection.cpp:891
void DecorationCclRegister()
Register CCL decorations features.
Definition: unit_draw.cpp:363
unsigned Boarded
Unit is active for AI.
Definition: unit.h:379
int DirectionToHeading(const Vec2i &dir)
Convert direction (dx,dy) to heading (0-255)
Definition: unit.cpp:2125
bool NoStatusLineTooltips
Deselect peasants in mines.
Definition: unit.h:468
COrder * CurrentOrder() const
Definition: unit.h:144
int Wait
CurrAnim.
Definition: unit.h:418
void SaveGroups(CFile &file)
Save groups.
Definition: groups.cpp:124
void RestoreSelection()
Restore selection.
Definition: selection.cpp:88
unsigned Destroyed
unit is burning
Definition: unit.h:373
signed char IX
individual upgrades which the unit has
Definition: unit.h:358
int Colors
Image frame: <0 is mirrored.
Definition: unit.h:355
CPlayer * RescuedFrom
unit is selected by a team member.
Definition: unit.h:386
CUnit * NextWorker
Previous unit in the container.
Definition: unit.h:334
void DrawSelectionRectangleWithTrans(IntColor, int, int, int, int)
Draw rectangle filled with alpha around unit.
Definition: unit_draw.cpp:237
struct CUnit::_seen_stuff_ Seen
COrder * COrderPtr
Definition: unit.h:74
bool IsAgressive() const
Definition: unit.h:187
unsigned Destroyed
Unit seen build/upgrade state.
Definition: unit.h:400
CPlayer * Player
Pointer to unit-type (peon,...)
Definition: unit.h:346
int BoardCount
Number of units inside.
Definition: unit.h:328
int CanTarget(const CUnitType &type, const CUnitType &dest)
Can this unit-type attack the other (destination)
Definition: unit.cpp:3309
unsigned ReCast
The unit is moving.
Definition: unit.h:369
The counter while small ai can ignore non aggressive targets if searching attacker.
Definition: unit.h:415
bool HasSharedVisionWith(const CPlayer &player) const
Definition: player.h:271
unsigned int GroupId
time to live
Definition: unit.h:408
int ThreatCalculate(const CUnit &unit, const CUnit &dest)
Calculate some value to measure the unit's priority for AI.
Definition: unit.cpp:2584
void DrawSelectionNone(IntColor, int, int, int, int)
Draw nothing around unit.
Definition: unit_draw.cpp:186
void DrawSelectionCircle(IntColor, int, int, int, int)
Draw circle around unit.
Definition: unit_draw.cpp:197
int InsideCount
index in Player->Units
Definition: unit.h:327
void set_SimplifiedAutoTargeting(bool v)
Definition: unit.h:501
int * SpellCoolDownTimers
spells to auto cast
Definition: unit.h:429
std::vector< COrder * > Orders
Definition: unit.h:423
int FindAndSortUnits(const CViewport &vp, std::vector< CUnit * > &table)
Draw all units visible on map in viewport.
Definition: unit_draw.cpp:1068
void CorrectWallDirections(CUnit &unit)
Correct directions for placed wall.
Definition: unit.cpp:1572
bool IsVisibleAsGoal(const CPlayer &player) const
Definition: unit.h:228
void SelectionCclRegister()
Register CCL selection features.
Definition: selection.cpp:1146
@ CANATTACK_INDEX
Building must be built on coast.
Definition: unittype.h:158
unsigned int Wait
unit belongs to this last group
Definition: unit.h:411
Definition: settings.h:230
int VisCount[PlayerMax]
NULL if the unit was not rescued.
Definition: unit.h:389
std::string UnitReference(const CUnit &unit)
Generate a unit reference, a printable unique string for unit.
Definition: unit_save.cpp:61
bool RevealAttacker
Config: building capture enabled.
Definition: unit.cpp:359
int ShowNameTime
How many cycles need to wait until unit's name popup will appear.
Definition: unit.h:476
void RemoveUnitFromGroups(CUnit &unit)
Remove a unit from a group.
Definition: groups.cpp:228
void CorrectWallNeighBours(CUnit &unit)
Correct the surrounding walls.
Definition: unit.cpp:1612
void FindNearestDrop(const CUnitType &type, const Vec2i &goalPos, Vec2i &resPos, int heading)
Find the nearest position at which unit can be placed.
Definition: unit.cpp:1260
CGraphic * IconFrameG
Autosave the game every X minutes; autosave is disabled if the value is 0.
Definition: unit.h:478
void Draw(const CViewport &vp) const
Draw a single unit.
Definition: unit_draw.cpp:917
Definition: animation.h:94
struct CUnit::@41 Resource
bool get_AiExplores()
Definition: unit.h:498
unsigned int LastGroup
unit belongs to this group id
Definition: unit.h:409
void DropOutNearest(CUnit &unit, const Vec2i &goalPos, const CUnit *container)
Definition: unit.cpp:2298
int MapDistanceTo(const CUnit &dst) const
Definition: unit.h:286
@ LookingN
Definition: unit.h:121
int SelectUnitsInRectangle(const PixelPos &corner_topleft, const PixelPos &corner_bottomright)
Select the units in the selection rectangle.
Definition: selection.cpp:704
unsigned Constructed
seen Y image displacement to map position
Definition: unit.h:398
bool IsVisibleOnMinimap() const
Returns true if unit is visible on minimap. Only for ThisPlayer.
Definition: unit.cpp:1800
void AddToGroup(CUnit **units, unsigned int nunits, int num)
Add the array of units to the group.
Definition: groups.cpp:192
void SaveSelections(CFile &file)
Save current selection state.
Definition: selection.cpp:1076
void ClearAction()
Definition: unit.cpp:587
const CViewport * CurrentViewport
Config: spend resources for building with multiple workers.
Definition: unit_draw.cpp:121
void set_AiExplores(bool v)
Definition: unit.h:499
Definition: upgrade_structs.h:129
struct CUnit::_unit_anim_ WaitBackup
int Assigned
pointer to first assigned worker to this resource.
Definition: unit.h:337
Settings GameSettings
Definition: game.cpp:87
int Frame
Seen construction frame.
Definition: unit.h:393
bool IsVisibleInViewport(const CViewport &vp) const
Returns true if unit is visible in a viewport. Only for ThisPlayer.
Definition: unit.cpp:1826
const CUnitType * Type
Map position as flat index offset (x + y * w)
Definition: unit.h:345
unsigned long ShowNameDelay
Show orders for some time.
Definition: unit_draw.cpp:99
@ LookingW
Unit looking south west.
Definition: unit.h:127
bool IconsShift
Use grayscaled icons for unavailable units, upgrades, etc.
Definition: unit.h:464
int Active
how many units are assigned to harvesting from the resource.
Definition: unit.h:338
bool IsVisible(const CPlayer &player) const
Returns true, if unit is directly seen by an allied unit.
Definition: unit.cpp:1778
struct CUnit::_unit_anim_ Anim
int MapDistanceBetweenTypes(const CUnitType &src, const Vec2i &pos1, const CUnitType &dst, const Vec2i &pos2)
Returns the map distance between to unittype as locations.
Definition: unit.cpp:3251
void(* DrawSelection)(IntColor, int, int, int, int)
Show unit's name for some time.
Definition: unit_draw.cpp:112
GroupSelectionMode
Definition: unittype.h:80
int SelectUnit(CUnit &unit)
Add a unit to selection.
Definition: selection.cpp:210
void RefsDecrease()
Decrease a unit's reference count.
Definition: unit.cpp:389
CUnitManagerData()
Definition: unit.h:313
int ExtraDeathIndex(const char *death)
Get the suitable animation frame depends of unit's damaged type.
Definition: script_unittype.cpp:216
CUnit * UnitOnScreen(int x, int y)
Get unit under cursor.
Definition: unit.cpp:2404
bool ShowSightRange
Definition: unit.h:454
void DrawUnitSelection(const CViewport &vp, const CUnit &unit)
CurrentViewport.
Definition: unit_draw.cpp:130
bool StereoSound
Shift icons slightly when you press on them.
Definition: unit.h:465
Construction frame.
Definition: construct.h:112
void DropOutOnSide(CUnit &unit, int heading, const CUnit *container)
Definition: unit.cpp:2213
unsigned Removed
unit is destroyed pending reference
Definition: unit.h:374
bool EnableBuildingCapture
Config: training queues enabled.
Definition: unit.cpp:358
bool SelectionRectangleIndicatesDamage
If true, uses the hardware to draw the cursor. Shaders do no longer apply to the cursor,...
Definition: unit.h:470
unsigned SimplifiedAutoTargeting
If true, AI sends explorers to search for resources (almost useless thing)
Definition: settings.h:251
unsigned Blink
GameCycle unit was summoned using spells.
Definition: unit.h:367
Definition: unittype.h:432
CUnit()
Definition: unit.h:138
int ShowOrders
Mask used to skip rendering frames (useful for slow renderers that keep up with the game logic,...
Definition: unit.h:474
bool IsAlive() const
Definition: unit.cpp:602
CUnit * Container
Pointer to one of the units inside.
Definition: unit.h:330
const CUnitType * Type
last seen frame/stage of buildings
Definition: unit.h:394
bool DeselectInMine
Show mine is running low/depleted messages.
Definition: unit.h:467
void AddInContainer(CUnit &host)
Add a unit inside a container. Only deal with list stuff.
Definition: unit.cpp:1092
unsigned AutoRepair
Recast again next cycle.
Definition: unit.h:370
void InitializeSettingsFromPreferences(Settings &s)
Definition: unit.h:486
unsigned char Direction
Y image displacement to map position.
Definition: unit.h:360
void GroupCclRegister()
Register CCL group features.
Definition: groups.cpp:271
CUnit * Goal
how much time unit need to wait before spell will be ready
Definition: unit.h:431
bool InReactRange(const CUnit &unit, const CUnit &target)
Is target within reaction range of this unit?
Definition: unit.cpp:2735
bool GrayscaleIcons
If true, game pauses when cursor is gone.
Definition: unit.h:463
int TargetPriorityCalculate(const CUnit *const attacker, const CUnit *const dest)
Definition: unit.cpp:2638
unsigned long ShowOrdersCount
All sprite's infos.
Definition: unit_draw.cpp:97
void UnitHeadingFromDeltaXY(CUnit &unit, const Vec2i &delta)
Heading and frame from delta direction.
Definition: unit.cpp:2196
bool IsVisibleOnRadar(const CPlayer &pradar) const
Definition: map_radar.cpp:86
bool CanMove() const
Definition: unit.h:299
void LoadDecorations()
Load the decorations (health,mana) of units.
Definition: unit_draw.cpp:374
CGraphic * PressedIconFrameG
Definition: unit.h:479
void UnmarkUnitFieldFlags(const CUnit &unit)
Unmark the field with the FieldFlags.
Definition: unit.cpp:1062
void MoveToXY(const Vec2i &pos)
Move unit to tile(pos). (Do special stuff : vision, cachelist, pathfinding)
Definition: unit.cpp:1181
unsigned Constructed
unit is selected
Definition: unit.h:377
void CleanUnits()
Clean unit module.
Definition: unit.cpp:3494
@ INVISIBLE_INDEX
Definition: unittype.h:215
int ShowNameDelay
How many second show orders of unit on map.
Definition: unit.h:475
CUnit * CanBuildHere(const CUnit *unit, const CUnitType &type, const Vec2i &pos)
Definition: build.cpp:399
CPreference Preference
Lua handler count.
Definition: script_ui.cpp:66
void SaveSelection()
Save selection to restore after.
Definition: selection.cpp:77
void DropOutAll(const CUnit &unit)
Drop out all units in the unit.
Definition: unit.cpp:2376
Describes a field of the map.
Definition: tile.h:186
void SetGroup(CUnit **units, unsigned int nunits, int num)
Set the contents of a particular group with an array of units.
Definition: groups.cpp:215
void DrawSelectionCorners(IntColor, int, int, int, int)
Draw corners around unit.
Definition: unit_draw.cpp:251
unsigned long TTL
array of User Defined variables.
Definition: unit.h:406
bool ShowMessages
Show attack range.
Definition: unit.h:459
The big unit structure.
Definition: unit.h:135
CUnit * GetFirstContainer(const CUnit &unit)
Definition: unit.cpp:856
Missile on the map.
Definition: missile.h:413
@ SELECTABLE_BY_RECTANGLE_ONLY
Definition: unittype.h:81
void NearestOfUnit(const CUnit &unit, const Vec2i &pos, Vec2i *dpos)
Definition: unit.cpp:1530
CUnit * NextContained
Pointer to the unit containing it (or 0)
Definition: unit.h:331
void UnitClearOrders(CUnit &unit)
Remove the Orders of a Unit.
Definition: unit.cpp:1486
(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.