Player.IsPolicyBranchUnlocked (Civ5 API)

From Civilization Modding Wiki
Revision as of 09:06, 20 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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


Function.png This function is a member of Player.

This is an instance method, invoke it with a colon.


Usage

int Player:IsPolicyBranchUnlocked(PolicyBranchType policyBranchIndex)


Returned Value

No description available.

Parameters

policyBranchIndex: No description available.


Source code samples

Redundant occurences have been removed.

ChooseFaithGreatPerson.lua (G&K)

DLC/Expansion/UI/InGame/Popups/ChooseFaithGreatPerson.lua
0040
elseif (info.ID == GameInfo.Units["UNIT_MERCHANT"].ID and not player:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_COMMERCE"].ID)) then
0043
elseif (info.ID == GameInfo.Units["UNIT_SCIENTIST"].ID and not player:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_RATIONALISM"].ID)) then
0046
elseif (info.ID == GameInfo.Units["UNIT_ARTIST"].ID and not player:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_FREEDOM"].ID)) then
0049
elseif (info.ID == GameInfo.Units["UNIT_GREAT_GENERAL"].ID and not player:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_AUTOCRACY"].ID)) then
0052
elseif (info.ID == GameInfo.Units["UNIT_GREAT_ADMIRAL"].ID and not player:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_AUTOCRACY"].ID)) then
0055
elseif (info.ID == GameInfo.Units["UNIT_ENGINEER"].ID and not player:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_ORDER"].ID)) then


ReligionOverview.lua (G&K)

DLC/Expansion/UI/InGame/Popups/ReligionOverview.lua
0269
return (policy ~= nil and player:IsPolicyBranchUnlocked(policy.ID) and not player:IsPolicyBranchBlocked(policy.ID));


SocialPolicyPopup.lua

UI/InGame/Popups/SocialPolicyPopup.lua
0135
local bHasPolicyBranch = player:IsPolicyBranchUnlocked(policyBranchIndex);
0334
if not player:IsPolicyBranchUnlocked( i ) then


TopPanel.lua (G&K)

DLC/Expansion/UI/InGame/TopPanel.lua
0972
if (info.ID == GameInfo.Units["UNIT_MERCHANT"].ID and pPlayer:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_COMMERCE"].ID) and not pPlayer:IsPolicyBranchBlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_COMMERCE"].ID)) then
0977
if (info.ID == GameInfo.Units["UNIT_SCIENTIST"].ID and pPlayer:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_RATIONALISM"].ID) and not pPlayer:IsPolicyBranchBlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_RATIONALISM"].ID)) then
0982
if (info.ID == GameInfo.Units["UNIT_ARTIST"].ID and pPlayer:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_FREEDOM"].ID) and not pPlayer:IsPolicyBranchBlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_FREEDOM"].ID)) then
0987
if (info.ID == GameInfo.Units["UNIT_GREAT_GENERAL"].ID and pPlayer:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_AUTOCRACY"].ID) and not pPlayer:IsPolicyBranchBlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_AUTOCRACY"].ID)) then
0992
if (info.ID == GameInfo.Units["UNIT_GREAT_ADMIRAL"].ID and pPlayer:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_AUTOCRACY"].ID) and not pPlayer:IsPolicyBranchBlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_AUTOCRACY"].ID)) then
0997
if (info.ID == GameInfo.Units["UNIT_ENGINEER"].ID and pPlayer:IsPolicyBranchUnlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_ORDER"].ID) and not pPlayer:IsPolicyBranchBlocked(GameInfo.PolicyBranchTypes["POLICY_BRANCH_ORDER"].ID)) then



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.