Plot (Civ5 Type)

From Civilization Modding Wiki
Jump to navigationJump to search

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

Plots apparently have an equality operator handler, i.e. two variables of plot type can be compared directly without having to compare both their X and Y coordinates.

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

Base game Gods & Kings ___________________________
AddFeatureDummyModel(string dummyTag, string modelTag)
Area Area()
bool At(int x, int y)

C

Base game Gods & Kings ___________________________
int CalculateBestNatureYield(YieldType index, TeamID team)
int CalculateImprovementYieldChange(ImprovementType improvement, YieldType yield, PlayerID player, bool optimal, RouteType assumeThisRoute)
int CalculateNatureYield(YieldType index, TeamID team, bool ignoreFeature = false)
int CalculateTotalBestNatureYield(TeamID team)
int CalculateYield(YieldType index, bool display)
bool CanBuild(BuildActionType build, PlayerID player, bool testVisible)
int CanHaveFeature(FeatureType featureForest)
bool CanHaveImprovement(ImprovementType improvement, TeamID team, bool potential)
bool CanHaveResource(ResourceType resource, bool ignoreLatitude)
bool CanSeePlot(Plot target, TeamID team, int range)
bool ChangeBuildProgress(BuildActionType build, int change, TeamID team)
ChangeExtraMovePathCost(int change)
ChangeImprovementDuration(int change)
ChangeInvisibleVisibilityCount(TeamID team, InvisibilityScopeType invisible, int change)
ChangeNumResource(int change)
ChangeOwnershipDuration(int change)
ChangeUpgradeProgress(int change)
ChangeVisibilityCount(TeamID team, int change, InvisibilityScopeType seeInvisibleType, bool informExplorationTracking, bool alwaysSeeInvisible)
int CountNumAirUnits(PlayerID player)

D

Base game Gods & Kings ___________________________
int DefenseModifier(TeamID defendTeam, bool ignoreBuilding, bool help)

E

Base game Gods & Kings ___________________________
Erase

G

Base game Gods & Kings ___________________________
GetActiveFogOfWarMode
AreaID GetArea()
unknown GetBestDefender(PlayerID owner, PlayerID attackingPlayer, Unit attacker, bool testAtWar, bool testPotentialEnemy, bool testCanMove)
int GetBuildProgress(BuildActionType build)
int GetBuildTime(BuildActionType build)
int GetBuildTurnsLeft(BuildActionType build, int nowExtra, int thenExtra)
int GetBuildTurnsTotal(BuildActionType build)
int GetCityRadiusCount()
ArtStyleType GetContinentArtType()
int GetCulture()
int GetExtraMovePathCost()
int GetFeatureProduction(BuildActionType build, TeamID team, City city)
FeatureType GetFeatureType()
int GetFeatureVariety()
int GetFoundValue(PlayerID index)
int GetImprovementDuration()
ImprovementType GetImprovementType()
Plot GetInlandCorner()
int GetInvisibleVisibilityCount(TeamID team, InvisibilityScopeType invisible)
int GetLatitude()
AreaID GetNearestLandArea()
Plot GetNearestLandPlot()
ResourceType GetNonObsoleteResourceType(TeamID team)
int GetNumDefenders(PlayerID player)
int GetNumFriendlyUnitsOfType(Unit unit)
int GetNumResource()
int GetNumUnits()
int GetNumVisibleEnemyDefenders(Unit unit)
int GetNumVisiblePotentialEnemyDefenders(Unit unit)
PlayerID GetOwner()
int GetOwnershipDuration()
int GetPlayerCityRadiusCount(PlayerID index)
int GetPlotCity()
PlotType GetPlotType()
int GetReconCount()
ResourceType GetResourceType(TeamID team)
ImprovementType GetRevealedImprovementType(TeamID team, bool debug)
PlayerID GetRevealedOwner(TeamID team, bool debug)
RouteType GetRevealedRouteType(TeamID team, bool debug)
TeamID GetRevealedTeam(TeamID team, bool debug)
int GetRiverCrossingCount()
FlowDirectionType GetRiverEFlowDirection()
FlowDirectionType GetRiverSEFlowDirection()
FlowDirectionType GetRiverSWFlowDirection()
RouteType GetRouteType()
string GetScriptData()
unknown GetSelectedUnit()
TeamID GetTeam()
TerrainType GetTerrainType()
Unit GetUnit(UnitID id)
int GetUnitPower(PlayerID owner)
int GetUpgradeProgress()
int GetUpgradeTimeLeft(ImprovementType improvement, PlayerID player)
int GetVisibilityCount(TeamID team)
City GetWorkingCity()
unknown GetWorkingCityOverride()
int GetX()
int GetY()
int GetYield(YieldType index)
int GetYieldWithBuild(BuildActionType build, YieldType yield, bool arg2, PlayerID activePlayer)

H

Base game Gods & Kings ___________________________
int HasBarbarianCamp()
bool HasYield(YieldType yield)

I

Base game Gods & Kings ___________________________
bool IsActiveVisible(bool debug)
bool IsAdjacentNonrevealed(TeamID team)
bool IsAdjacentNonvisible(TeamID team)
bool IsAdjacentOwned()
bool IsAdjacentPlayer(PlayerID player, bool landOnly)
bool IsAdjacentRevealed(TeamID team)
bool IsAdjacentTeam(TeamID team, bool landOnly)
bool IsAdjacentToArea(Area area)
bool IsAdjacentToLand()
int IsAdjacentToShallowWater()
bool IsAdjacentVisible(TeamID team, bool debug)
bool IsBarbarian()
bool IsBeingWorked()
bool IsBestAdjacentFound(PlayerID index)
bool IsBuildRemovesFeature(BuildActionType build)
int IsCity()
bool IsCityRadius()
bool IsCoastalLand()
int IsEnemyCity(Unit unit)
bool IsFighting()
int IsFlatlands()
int IsFreshWater()
bool IsFriendlyCity(Unit unit, bool checkImprovement)
bool IsFriendlyTerritory(PlayerID player)
bool IsGoody()
int IsHills()
bool IsImpassable()
bool IsImprovementPillaged()
bool IsInvisibleVisible(TeamID team, InvisibilityScopeType invisible)
int IsLake()
int IsMountain()
int IsNEOfRiver()
bool IsNone()
int IsNWOfRiver()
bool IsOpenGround()
bool IsOwned()
bool IsOwnershipScore()
bool IsPlayerCityRadius(PlayerID index)
bool IsPotentialCityWork()
bool IsPotentialCityWorkForArea(Area area)
bool IsResourceConnectedByImprovement(ImprovementType improvement)
int IsRevealed(TeamID team, bool debug)
bool IsRevealedBarbarian()
bool IsRevealedGoody(TeamID team)
int IsRiver()
bool IsRiverConnection(DirectionType direction)
bool IsRiverCrossing(DirectionType index)
bool IsRiverCrossingFlowClockwise()
bool IsRiverCrossingToPlot(DirectionType index)
bool IsRiverSide()
bool IsRoughGround()
bool IsRoute()
bool IsRoutePillaged()
bool IsStartingPlot()
int IsTradeRoute()
bool IsUnit()
bool IsValidDomainForAction(Unit unit)
bool IsValidDomainForLocation(Unit unit)
int IsVisible(TeamID team, bool debug)
int IsVisibleEnemyDefender(Unit unit)
int IsVisibleEnemyUnit(PlayerID player)
bool IsVisibleOtherUnit(PlayerID player)
bool IsVisibleToWatchingHuman()
int IsWater()
bool IsWithinTeamCityRadius(TeamID team, PlayerID ignorePlayer)
int IsWOfRiver()

M

Base game Gods & Kings ___________________________
int MovementCost(Unit unit, Plot fromPlot)

N

Base game Gods & Kings ___________________________
NukeExplosion(int range, Unit nukeUnit)

P

Base game Gods & Kings ___________________________
string PickFeatureDummyTag(int mouseX, int mouseY)

R

Base game Gods & Kings ___________________________
RemoveGoody
ResetFeatureModel

S

Base game Gods & Kings ___________________________
int SeeFromLevel(TeamID team)
int SeeThroughLevel()
SetArea(AreaID area)
SetContinentArtType(ArtStyleType style)
SetFeatureDummyTexture(string dummyTag, string textureTag)
SetFeatureDummyVisibility(string dummyTag, bool show)
SetFeatureType(int featureID, int arg1 = nil)
SetImprovementDuration(int newValue)
SetImprovementPillaged(bool pillaged)
SetImprovementType(int newValue)
SetNEOfRiver(bool newValue)
SetNumResource(int num)
SetNWOfRiver(bool newValue)
SetOwner(PlayerID newValue, int acquiringCityID, bool checkUnits = true, bool updateResources = true)
SetOwnershipDuration(int newValue)
SetPlotType(PlotType terrain, bool recalculateAreas = nil, bool rebuildGraphics) = nil)
SetResourceType(int newValue, ResourceType numResource)
SetRevealed(TeamID team, bool newValue, bool terrainOnly, TeamID fromTeam)
SetRouteType(int newValue)
SetScriptData(string newValue)
SetStartingPlot(bool newValue)
SetTerrainType(TerrainType terrain, bool recalculateAreas, bool rebuildGraphics))
SetUpgradeProgress(int newValue)
SetWOfRiver(bool newValue)
bool ShareAdjacentArea(Plot plot)

U

Base game Gods & Kings ___________________________
UpdateFog
UpdateVisibility

W

Base game Gods & Kings ___________________________
WaterArea


Used by

bool CanPlaceGoodyAt(ImprovementType improvement, Plot plot)
DoRiver(Plot startPlot, FlowDirectionType thisFlowDirection = nil, FlowDirectionType originalFlowDirection = nil, int riverID = nil)
string GetCivStateQuestString(Plot plot, bool shortVersion)
string GetImprovementString(Plot plot)
string GetNatureString(Plot plot)
string GetOwnerString(Plot plot)
string GetResourceString(Plot plot, bool longForm)
int GetRiverValueAtPlot(Plot plot)
string GetUnitsString(Plot plot)
string GetYieldString(Plot plot)
bool City:AtPlot(Plot plot)
int City:CanWork(Plot plot)
Plot City:GetCityIndexPlot(CityPlotID index)
CityPlotID City:GetCityPlotIndex(Plot plot)
int City:GetNumForcedWorkingPlots(Plot plot)
int City:IsForcedWorkingPlot(Plot plot)
int City:IsPlotBlockaded(Plot plot)
int City:IsWorkingPlot(Plot plot)
Plot City:Plot()
FeatureGenerator:AddForestsAtPlot(Plot plot, int x, int y, int lat)
FeatureGenerator:AddIceAtPlot(Plot plot, int x, int y, int lat)
FeatureGenerator:AddJunglesAtPlot(Plot plot, int x, int y, int lat)
FeatureGenerator:AddMarshAtPlot(Plot plot, int x, int y, int lat)
FeatureGenerator:AddOasisAtPlot(Plot plot, int x, int y, int lat)
bool Game.CanHandleAction(ActionType action, Plot plot = nil, bool testVisible = false)
bool Game.CyclePlotUnits(Plot plot, bool forward, bool auto, int count)
int Game.GetImprovementUpgradeTime(ImprovementType improvement, Plot plot)
Game.SelectionListMove(Plot plot, int alt, bool shift, int ctrl)
bool Map.FindWater(Plot plot, int range, bool isFreshWater)
Plot Map.GetPlot(int x, int y = nil)
Plot Map.GetPlotByIndex(PlotID index)
Plot Map.GetPlotXY(int x, int y, int xOffset, int yOffset)
Plot Map.PlotDirection(int x, int y)
Plot Map.PlotXYWithRangeCheck(int x, int y, int xOffset, int yOffset, int maxRange)
bool Player:CanBuild(Plot plot, BuildActionType build, bool testEra = false, bool testVisible = false, bool testGold = false)
bool Player:CanReceiveGoody(Plot plot, GoodyType goody, Unit unit)
Player:DoGoody(Plot plot, Unit unit)
int Player:GetAdvancedStartCityCost(bool add, Plot plot)
int Player:GetAdvancedStartImprovementCost(ImprovementType improvement, bool add, Plot plot)
int Player:GetAdvancedStartRouteCost(RouteType route, bool add, Plot plot)
int Player:GetAdvancedStartUnitCost(UnitType unit, bool add, Plot plot)
int Player:GetAdvancedStartVisibilityCost(bool add, Plot plot)
unknown Player:GetBestRoute(Plot plot)
Plot Player:GetClosestGoodyPlot(unknown void)
int Player:GetFoundedReligionEnemyCityCombatMod(Plot toPlot)
int Player:GetFoundedReligionFriendlyCityCombatMod(Plot toPlot)
int Player:GetPlotDanger(Plot plot)
bool Player:GetPlotHasOrder(Plot Plot)
Plot Player:GetStartingPlot()
Player:ReceiveGoody(Plot plot, GoodyType goody, Unit unit)
Player:SetStartingPlot(Plot plot)
bool Plot:CanSeePlot(Plot target, TeamID team, int range)
Plot Plot:GetInlandCorner()
Plot Plot:GetNearestLandPlot()
int Plot:MovementCost(Unit unit, Plot fromPlot)
bool Plot:ShareAdjacentArea(Plot plot)
bool UI.CanPlaceUnitAt(unknown unit, Plot plot)
UI.DoSelectCityAtPlot(Plot plot)
UI.HighlightCanPlacePlots(Unit unit, Plot arg1)
UI.LocationSelect(Plot plot, int ctrl, int alt, bool shift)
UI.LookAt(Plot plot, int arg1 = nil)
int Unit:AtPlot(Plot plot)
bool Unit:CanAirDefend(Plot plot)
bool Unit:CanAirlift(Plot plot)
bool Unit:CanAirliftAt(Plot plot, int x, int y)
bool Unit:CanAirPatrol(Plot plot)
bool Unit:CanBuild(Plot plot, BuildActionType build, bool testVisible = false, bool testGold = true)
bool Unit:CanBuildSpaceship(Plot plot, bool visible)
bool Unit:CanConstruct(Plot plot, BuildingType building)
bool Unit:CanDiscover(Plot plot)
bool Unit:CanDisembark(Plot plot)
bool Unit:CanDisembarkOnto(Plot plot)
bool Unit:CanEmbark(Plot plot)
bool Unit:CanEmbarkOnto(Plot plot, Plot targetPlot)
bool Unit:CanFortify(Plot plot)
bool Unit:CanFound(Plot plot, bool testVisible = false)
bool Unit:CanGiveExperience(Plot plot)
bool Unit:CanGoldenAge(Plot plot, bool testVisible)
int Unit:CanHeal(Plot plot)
bool Unit:CanHold(Plot plot)
bool Unit:CanJoin(Plot plot, SpecialistType specialist)
bool Unit:CanLead(Plot plot, int unitId)
bool Unit:CanLoad(Plot plot)
bool Unit:CanLoadUnit(Unit unit, Plot plot)
bool Unit:CanMoveOrAttackInto(Plot plot, bool declareWar = false, bool destination = false)
bool Unit:CanMoveThrough(Plot plot)
int Unit:CanNuke(Plot plot)
bool Unit:CanNukeAt(Plot plot, int x, int y)
bool Unit:CanParadrop(Plot plot, bool arg1)
bool Unit:CanParadropAt(Plot plot, int x, int y)
bool Unit:CanPillage(Plot plot)
bool Unit:CanRebaseAt(Plot sourcePlot, int targetX, int targetY)
bool Unit:CanSentry(Plot plot)
bool Unit:CanSleep(Plot plot)
bool Unit:CanStartMission(int mission, int data1, int data2, Plot plot = nil, bool testVisible = false)
bool Unit:CanTrade(Plot plot, bool testVisible)
Unit:Embark(Plot plot)
Unit:ExecuteSpecialExploreMove(Plot targetPlot)
bool Unit:GeneratePath(Plot toPlot, int flags = 0, bool reuse = false, unknown piPathTurns = nil)
unknown Unit:GetBestInterceptor(Plot plot)
unknown Unit:GetBestSeaPillageInterceptor(Plot plot)
TeamID Unit:GetDeclareWarRangeStrike(Plot plot)
int Unit:GetMaxAttackStrength(Plot fromPlot, Plot toPlot, Unit defender)
int Unit:GetMaxDefenseStrength(Plot inPlot, Unit attacker, bool arg2 = nil)
Plot Unit:GetPlot()
int Unit:GetTradeGold(Plot plot)
Unit Unit:GetUpgradeUnitFromPlot(Plot adjacentPlot)
bool Unit:IsCanDefend(Plot plot)
bool Unit:IsNukeVictim(Plot plot, TeamID team)
bool Unit:IsRangeAttackIgnoreLOS(Plot plot)
Unit: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)
Unit:SetReconPlot(Plot 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.