Unit (Civ5 Type)
This page is a part of the Lua and UI Reference (Civ5).
Instance Methods
Methods are functions that belong to an object. Instance methods are invoked through a colon, as in caller:SomeMethod(<args>)
, where caller is an instance of Unit.
A colon implictly passes the caller object as the first argument. That is, the former call is equivalent to this one: caller.SomeMethod(caller, <args>)
A
int
|
AirSweepCombatMod()
| ||||
bool
|
At(int x, int y)
| ||||
int
|
AtPlot(Plot plot)
| ||||
int
|
AttackFortifiedModifier()
| ||||
int
|
AttackWoundedModifier()
| ||||
int
|
AttackXPValue()
|
C
bool
|
CanAcquirePromotion(PromotionType promotion)
| ||||
bool
|
CanAcquirePromotionAny()
| ||||
bool
|
CanAirAttack()
| ||||
bool
|
CanAirDefend(Plot plot)
| ||||
bool
|
CanAirlift(Plot plot)
| ||||
bool
|
CanAirliftAt(Plot plot, int x, int y)
| ||||
bool
|
CanAirPatrol(Plot plot)
| ||||
bool
|
CanAutomate(AutomateType automate)
| ||||
bool
|
CanBuild(Plot plot, BuildActionType build, bool testVisible = false, bool testGold = true)
| ||||
bool
|
CanBuildRoute()
| ||||
bool
|
CanBuildSpaceship(Plot plot, bool visible)
| ||||
bool
|
CanCargoAllMove()
| ||||
bool
|
CanCoexistWithEnemyUnit(TeamID team)
| ||||
bool
|
CanConstruct(Plot plot, BuildingType building)
| ||||
bool
|
CanDiscover(Plot plot)
| ||||
bool
|
CanDisembark(Plot plot)
| ||||
bool
|
CanDisembarkOnto(Plot plot)
| ||||
bool
|
CanDistanceGift(TaskType toPlayer)
| ||||
bool
|
CanDoCommand(CommandType command, int data1, int data2, bool testVisible = false, bool testBusy = true)
| ||||
bool
|
CanEmbark(Plot plot)
| ||||
bool
|
CanEmbarkOnto(Plot plot, Plot targetPlot)
| ||||
bool
|
CanEnterTerritory(TeamID team, bool ignoreRightOfPassage = false, bool isCity = false)
| ||||
bool
|
CanFortify(Plot plot)
| ||||
bool
|
CanFound(Plot plot, bool testVisible = false)
| ||||
bool
|
CanGift(bool testVisible = false, bool testTransport = false)
| ||||
bool
|
CanGiveExperience(Plot plot)
| ||||
bool
|
CanGoldenAge(Plot plot, bool testVisible)
| ||||
int
|
CanHeal(Plot plot)
| ||||
bool
|
CanHold(Plot plot)
| ||||
bool
|
CanJoin(Plot plot, SpecialistType specialist)
| ||||
bool
|
CanLead(Plot plot, int unitId)
| ||||
bool
|
CanLoad(Plot plot)
| ||||
bool
|
CanLoadUnit(Unit unit, Plot plot)
| ||||
bool
|
CanMove()
| ||||
bool
|
CanMoveAllTerrain()
| ||||
bool
|
CanMoveImpassable()
| ||||
bool
|
CanMoveOrAttackInto(Plot plot, bool declareWar = false, bool destination = false)
| ||||
bool
|
CanMoveThrough(Plot plot)
| ||||
int
|
CanNuke(Plot plot)
| ||||
bool
|
CanNukeAt(Plot plot, int x, int y)
| ||||
bool
|
CanParadrop(Plot plot, bool arg1)
| ||||
bool
|
CanParadropAt(Plot plot, int x, int y)
| ||||
bool
|
CanPillage(Plot plot)
| ||||
bool
|
CanPromote(PromotionType promotion, int leaderUnitId)
| ||||
int
|
CanRangeStrike()
| ||||
int
|
CanRangeStrikeAt(int x, int y, bool arg2 = nil, bool noncombatAllowed = nil)
| ||||
bool
|
CanRebaseAt(Plot sourcePlot, int targetX, int targetY)
| ||||
|
CanRepairFleet
| ||||
bool
|
CanScrap()
| ||||
bool
|
CanSentry(Plot plot)
| ||||
bool
|
CanSetUpForRangedAttack()
| ||||
bool
|
CanSiege(TeamID team)
| ||||
bool
|
CanSleep(Plot plot)
| ||||
bool
|
CanStartMission(int mission, int data1, int data2, Plot plot = nil, bool testVisible = false)
| ||||
bool
|
CanTrade(Plot plot, bool testVisible)
| ||||
bool
|
CanUnload()
| ||||
bool
|
CanUnloadAll()
| ||||
int
|
CanUpgradeRightNow()
| ||||
int
|
CapitalDefenseFalloff()
| ||||
int
|
CapitalDefenseModifier()
| ||||
int
|
CargoSpace()
| ||||
int
|
CargoSpaceAvailable(SpecialUnitType specialCargo, DomainType domainCargo)
| ||||
int
|
ChanceFirstStrikes()
| ||||
|
ChangeCargoSpace(int change)
| ||||
|
ChangeDamage(int change, PlayerID player)
| ||||
|
ChangeExperience(int change, int max = -1, bool fromCombat = false, bool inBorders = false, bool updateGlobal = false)
| ||||
|
ChangeLevel(int change)
| ||||
|
ChangeMoves(int change)
| ||||
int
|
CityAttackModifier()
| ||||
int
|
CityDefenseModifier()
| ||||
|
Convert(Unit unit)
| ||||
int
|
CurrInterceptionProbability()
|
D
int
|
DefenseXPValue()
| ||||
|
DoCommand(CommandType command, int data1, int data2)
| ||||
DomainType
|
DomainCargo()
| ||||
int
|
DomainModifier(DomainType domain)
|
E
|
Embark(Plot plot)
| ||||
int
|
EvasionProbability()
| ||||
|
ExecuteSpecialExploreMove(Plot targetPlot)
| ||||
int
|
ExperienceNeeded()
|
F
int
|
FeatureAttackModifier(FeatureType feature)
| ||||
int
|
FeatureDefenseModifier(FeatureType feature)
| ||||
|
FinishMoves
| ||||
int
|
FirstStrikes()
| ||||
int
|
FlankAttackModifier()
| ||||
bool
|
FlatMovementCost()
| ||||
int
|
FlavorValue(FlavorType flavor)
| ||||
int
|
FortifyModifier()
|
G
H
bool
|
HasCargo()
| ||||
bool
|
HasMoved()
| ||||
bool
|
HasName()
| ||||
int
|
HillsAttackModifier()
| ||||
int
|
HillsDefenseModifier()
|
I
J
|
JumpToNearestValidPlot()
|
K
|
Kill(bool delay, PlayerID player = NO_PLAYER)
|
L
|
LastMissionPlot
| ||||
bool
|
Lead(int unitId)
|
M
int
|
MaxFirstStrikes()
| ||||
int
|
MaxInterceptionProbability()
| ||||
int
|
MaxMoves()
| ||||
int
|
MaxXPValue()
| ||||
int
|
MovesLeft()
|
N
bool
|
NoDefensiveBonus()
| ||||
int
|
NukeDamageLevel()
|
O
int
|
OpenAttackModifier()
| ||||
int
|
OpenDefenseModifier()
| ||||
int
|
OpenRangedAttackModifier()
|
P
|
PopMission
| ||||
|
Promote(PromotionType promotion, int leaderUnitId)
| ||||
|
PushMission(MissionType mission, int data1 = -1, int data2 = -1, int flags = 0, bool append = false, bool manual = fa;se, MissionType missionAI = NO_MISSIONAI, Plot missionAIPlot = nil, Unit missionAIUnit = nil)
|
R
int
|
Range()
| ||||
|
RangeStrike(int x, int y)
| ||||
|
RotateFacingDirectionClockwise
| ||||
|
RotateFacingDirectionCounterClockwise
| ||||
int
|
RoughAttackModifier()
| ||||
int
|
RoughDefenseModifier()
| ||||
int
|
RoughRangedAttackModifier()
|
S
|
SetBaseCombatStrength(int combat)
| ||||
|
SetDamage(int newValue, PlayerID player, bool notifyEntity = true)
| ||||
|
SetDeployFromOperationTurn(int arg0)
| ||||
|
SetEmbarked(bool newValue)
| ||||
|
SetExperience(int newValue, int max = -1)
| ||||
|
SetHasPromotion(PromotionType index, bool newValue)
| ||||
|
SetHotKeyNumber(int newValue)
| ||||
|
SetLeaderUnitType(UnitType leaderUnitType)
| ||||
|
SetLevel(int newLevel)
| ||||
|
SetMadeAttack(bool newValue)
| ||||
|
SetMadeInterception(bool newValue)
| ||||
|
SetMoves(int newValue)
| ||||
|
SetName(string newValue)
| ||||
|
SetOriginalOwner(PlayerID oldOwner)
| ||||
|
SetPromotionReady(bool newValue)
| ||||
|
SetReconPlot(Plot newValue)
| ||||
|
SetScenarioData
| ||||
|
SetScriptData(string newValue)
| ||||
|
SetXY(int x, int y, bool group = false, bool update = true, bool show = false, bool checkPlotVisible = false)
| ||||
|
SpecialCargo
|
T
int
|
TerrainAttackModifier(TerrainType terrain)
| ||||
int
|
TerrainDefenseModifier(TerrainType terrain)
|
U
int
|
UnitClassAttackModifier(UnitClassType unitClass)
| ||||
int
|
UnitClassDefenseModifier(UnitClassType unitClass)
| ||||
int
|
UnitCombatModifier(UnitCombatType unitCombat)
| ||||
int
|
UpgradePrice(UnitType unit)
|
V
int
|
VisibilityRange()
|
W
int
|
WithdrawalProbability()
| ||||
int
|
WorkRate(bool max, BuildActionType build = nil)
|
Used by
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.