PromotionType (Civ5 Type)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


ID.png The PromotionType pseudo-type is actually a regular integer. Pseudo-types do not exist in Lua, they only serve a documentation purpose on the wiki!
  • DB.png Integers labeled as PromotionType corresponds to the ID column of the UnitPromotions XML table.


XML: the UnitPromotions table

Here are the ID and Type columns found in this table.

ID Type
0 PROMOTION_INSTA_HEAL
0 PROMOTION_NAVAL_BONUS
1 PROMOTION_SHOCK_1
1 PROMOTION_FEARED_ELEPHANT
2 PROMOTION_SHOCK_2
2 PROMOTION_FLANK_ATTACK_BONUS
3 PROMOTION_SHOCK_3
3 PROMOTION_DEFEND_NEAR_CAPITAL
4 PROMOTION_DRILL_1
4 PROMOTION_EMBARKED_SIGHT
5 PROMOTION_DRILL_2
5 PROMOTION_MOVEMENT_TO_GENERAL
6 PROMOTION_DRILL_3
6 PROMOTION_GENERAL_STACKING
7 PROMOTION_ACCURACY_1
7 PROMOTION_ONLY_ATTACKS_CITIES
8 PROMOTION_ACCURACY_2
8 PROMOTION_WAR_CANOES
9 PROMOTION_ACCURACY_3
9 PROMOTION_PRIZE_SHIPS
10 PROMOTION_BARRAGE_1
10 PROMOTION_GREAT_ADMIRAL
11 PROMOTION_BARRAGE_2
11 PROMOTION_UNWELCOME_EVANGELIST
12 PROMOTION_BARRAGE_3
13 PROMOTION_TARGETING_1
14 PROMOTION_TARGETING_2
15 PROMOTION_TARGETING_3
16 PROMOTION_SENTRY
17 PROMOTION_SIEGE
18 PROMOTION_VOLLEY
19 PROMOTION_MEDIC
20 PROMOTION_AMPHIBIOUS
20 PROMOTION_MEDIC_II
21 PROMOTION_COVER_1
22 PROMOTION_COVER_2
23 PROMOTION_INDIRECT_FIRE
24 PROMOTION_CHARGE
25 PROMOTION_FORMATION_1
26 PROMOTION_FORMATION_2
27 PROMOTION_AMBUSH_1
28 PROMOTION_AMBUSH_2
29 PROMOTION_SUPPLY
30 PROMOTION_MARCH
31 PROMOTION_BLITZ
32 PROMOTION_WOODSMAN
33 PROMOTION_LOGISTICS
34 PROMOTION_RANGE
35 PROMOTION_MOBILITY
36 PROMOTION_INTERCEPTION_1
37 PROMOTION_INTERCEPTION_2
38 PROMOTION_INTERCEPTION_3
39 PROMOTION_DOGFIGHTING_1
40 PROMOTION_DOGFIGHTING_2
41 PROMOTION_DOGFIGHTING_3
42 PROMOTION_AIR_SIEGE_1
43 PROMOTION_AIR_SIEGE_2
44 PROMOTION_AIR_SIEGE_3
45 PROMOTION_BOMBARDMENT_1
46 PROMOTION_BOMBARDMENT_2
47 PROMOTION_BOMBARDMENT_3
48 PROMOTION_AIR_TARGETING_1
49 PROMOTION_AIR_TARGETING_2
50 PROMOTION_AIR_AMBUSH_1
51 PROMOTION_AIR_AMBUSH_2
52 PROMOTION_AIR_RANGE
53 PROMOTION_SORTIE
54 PROMOTION_REPAIR
55 PROMOTION_AIR_REPAIR
56 PROMOTION_AIR_LOGISTICS
57 PROMOTION_EVASION
58 PROMOTION_SCOUTING_1
59 PROMOTION_SCOUTING_2
60 PROMOTION_SCOUTING_3
61 PROMOTION_SURVIVALISM_1
62 PROMOTION_SURVIVALISM_2
63 PROMOTION_SURVIVALISM_3
64 PROMOTION_HELI_AMBUSH_1
65 PROMOTION_HELI_AMBUSH_2
66 PROMOTION_HELI_MOBILITY_1
67 PROMOTION_HELI_MOBILITY_2
68 PROMOTION_HELI_REPAIR
69 PROMOTION_MORALE
70 PROMOTION_ADJACENT_BONUS
70 PROMOTION_COASTAL_RAIDER_1
71 PROMOTION_HIMEJI_CASTLE
71 PROMOTION_COASTAL_RAIDER_2
72 PROMOTION_NAVAL_TRADITION
72 PROMOTION_COASTAL_RAIDER_3
73 PROMOTION_GREAT_LIGHTHOUSE
73 PROMOTION_BOARDING_PARTY_1
74 PROMOTION_NATIONALISM
74 PROMOTION_BOARDING_PARTY_2
75 PROMOTION_EMBARKATION
75 PROMOTION_BOARDING_PARTY_3
76 PROMOTION_DEFENSIVE_EMBARKATION
77 PROMOTION_ALLWATER_EMBARKATION
78 PROMOTION_EXTRA_MOVES_I
79 PROMOTION_EXTRA_SIGHT_I
80 PROMOTION_EXTRA_SIGHT_II
81 PROMOTION_EXTRA_SIGHT_III
82 PROMOTION_EXTRA_SIGHT_IV
82 PROMOTION_FAST_GENERAL
83 PROMOTION_SIGHT_PENALTY
83 PROMOTION_FAST_ADMIRAL
84 PROMOTION_AIR_RECON
85 PROMOTION_ANTI_MOUNTED_I
86 PROMOTION_ANTI_MOUNTED_II
87 PROMOTION_CITY_SIEGE
88 PROMOTION_CITY_ASSAULT
89 PROMOTION_DEFENSE_PENALTY
90 PROMOTION_MOUNTED_PENALTY
91 PROMOTION_CITY_PENALTY
92 PROMOTION_SMALL_CITY_PENALTY
93 PROMOTION_INTERCEPTION_I
94 PROMOTION_INTERCEPTION_II
95 PROMOTION_INTERCEPTION_III
96 PROMOTION_INTERCEPTION_IV
97 PROMOTION_AIR_SWEEP
98 PROMOTION_WEAK_RANGED
99 PROMOTION_ANTI_AIR
100 PROMOTION_ANTI_HELICOPTER
101 PROMOTION_ANTI_FIGHTER
102 PROMOTION_ANTI_SUBMARINE_I
103 PROMOTION_ANTI_SUBMARINE_II
104 PROMOTION_ANTI_TANK
105 PROMOTION_EVASION_I
106 PROMOTION_EVASION_II
107 PROMOTION_NAVAL_PENALTY
108 PROMOTION_RIVAL_TERRITORY
109 PROMOTION_CARGO_I
109 PROMOTION_ANTI_AIR_II
110 PROMOTION_CARGO_II
111 PROMOTION_CARGO_III
112 PROMOTION_CARGO_IV
113 PROMOTION_FOLIAGE_IMPASSABLE
114 PROMOTION_ROUGH_TERRAIN_ENDS_TURN
115 PROMOTION_OCEAN_IMPASSABLE_UNTIL_ASTRONOMY
116 PROMOTION_OCEAN_IMPASSABLE
117 PROMOTION_INVISIBLE_SUBMARINE
118 PROMOTION_SEE_INVISIBLE_SUBMARINE
118 PROMOTION_HEAVY_PAYLOAD
119 PROMOTION_IGNORE_TERRAIN_COST
119 PROMOTION_FIRE_SUPPORT
120 PROMOTION_HOVERING_UNIT
120 PROMOTION_SILENT_HUNTER
121 PROMOTION_FLAT_MOVEMENT_COST
122 PROMOTION_CAN_MOVE_IMPASSABLE
123 PROMOTION_NO_CAPTURE
124 PROMOTION_ONLY_DEFENSIVE
125 PROMOTION_NO_DEFENSIVE_BONUSES
126 PROMOTION_PARADROP
127 PROMOTION_MUST_SET_UP
128 PROMOTION_RANGED_SUPPORT_FIRE
129 PROMOTION_CAN_MOVE_AFTER_ATTACKING
130 PROMOTION_OPEN_TERRAIN
130 PROMOTION_STEAM_POWERED
131 PROMOTION_SECOND_ATTACK
132 PROMOTION_OCEAN_MOVEMENT
133 PROMOTION_GREAT_GENERAL
134 PROMOTION_SPAWN_GENERALS_I
135 PROMOTION_SPAWN_GENERALS_II
136 PROMOTION_FREE_PILLAGE_MOVES
137 PROMOTION_HEAL_IF_DESTROY_ENEMY
138 PROMOTION_PARTIAL_HEAL_IF_DESTROY_ENEMY
139 PROMOTION_ATTACK_BONUS
140 PROMOTION_MOHAWK
141 PROMOTION_JAGUAR
142 PROMOTION_FOREIGN_LANDS
143 PROMOTION_FASTER_HEAL
144 PROMOTION_STRONGER_VS_DAMAGED


Examples

Here are different ways to query the database to retrieve the ID from the type. Those examples will return and assign the integer value 0. See also GameInfo.

local id = GameInfo.UnitPromotions.PROMOTION_NAVAL_BONUS.ID
local id = GameInfo["UnitPromotions"].["PROMOTION_NAVAL_BONUS"].ID
local id = GameInfo.UnitPromotions{Type="PROMOTION_NAVAL_BONUS"}().ID

Alternatively you could use the ID or the type to retrieve the value of the Description column. Those examples will return and assign the value TXT_KEY_PROMOTION_NAVAL_BONUS.

local description = GameInfo.UnitPromotions[0].Description
local description = GameInfo["UnitPromotions"][0]["Description"]
local description = GameInfo.UnitPromotions{ID=0}().Description


Used by

int City:GetFreePromotionCount(PromotionType index)
bool City:IsFreePromotion(PromotionType index)
bool Unit:CanAcquirePromotion(PromotionType promotion)
bool Unit:CanPromote(PromotionType promotion, int leaderUnitId)
bool Unit:IsHasPromotion(PromotionType promotion)
bool Unit:IsPromotionValid(PromotionType promotion)
Unit:Promote(PromotionType promotion, int leaderUnitId)
Unit:SetHasPromotion(PromotionType index, bool newValue)



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.