Advertisement
GPuzzle

KentDecisions

Feb 4th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.38 KB | None | 0 0
  1. -- Aethelbert_Decisions
  2. -- Author: GPuzzle
  3. -- DateCreated: 1/28/2017 2:39:42 PM
  4. --------------------------------------------------------------
  5. --=======================================================================================================================
  6. -- DECISIONS
  7. --=======================================================================================================================
  8. -- Aethelbert: Create the Archbishop of Canterbury
  9. --------------------------------------------------------------
  10. local Decisions_GPuz_Archbishop_Canterbury = {}
  11.     Decisions_GPuz_Archbishop_Canterbury.Name = "TXT_KEY_DECISIONS_GPUZ_ARCHBISHOP_OF_CANTERBURY"
  12.     Decisions_GPuz_Archbishop_Canterbury.Desc = "TXT_KEY_DECISIONS_GPUZ_ARCHBISHOP_OF_CANTERBURY_DESC"
  13.     HookDecisionCivilizationIcon(Decisions_GPuz_Archbishop_Canterbury, "CIVILIZATION_GPUZ_KENT")
  14.     Decisions_GPuz_Archbishop_Canterbury.CanFunc = (
  15.     function(player)
  16.         if (player:GetCivilizationType() ~= GameInfoTypes["CIVILIZATION_GPUZ_KENT"]) then
  17.             return false, false
  18.         end
  19.         if load(player, "Decisions_GPuz_Archbishop_Canterbury") == true then
  20.             Decisions_GPuz_Archbishop_Canterbury.Desc = Locale.ConvertTextKey("TXT_KEY_DECISIONS_GPUZ_ARCHBISHOP_OF_CANTERBURY_ENACTED_DESC")
  21.             return false, false, true
  22.         end
  23.         local cost = math.ceil(1500 * iMod)
  24.         Decisions_GPuz_Archbishop_Canterbury.Desc = Locale.ConvertTextKey("TXT_KEY_DECISIONS_GPUZ_ARCHBISHOP_OF_CANTERBURY_DESC", cost)
  25.         if (player:GetNumResourceAvailable(iMagistrate, false) < 2) then return true, false end
  26.         if (Teams[player:GetTeam()]:IsHasTech(GameInfoTypes["TECH_THEOLOGY"])) and (player:GetGold() >= cost) then
  27.             return true, true
  28.         else
  29.             return true, false
  30.         end
  31.     end
  32.     )
  33.    
  34.     Decisions_GPuz_Archbishop_Canterbury.DoFunc = (
  35.     function(player)
  36.         local cost = math.ceil(1500 * iMod)
  37.         player:ChangeNumResourceTotal(iMagistrate, -2)
  38.         player:ChangeGold(-cost)
  39.         player:SetNumFreePolicies(1)
  40.         player:SetNumFreePolicies(0)
  41.         player:SetHasPolicy(GameInfoTypes["POLICY_DECISIONS_GPUZ_ARCHBISHOP_OF_CANTERBURY"], true)
  42.         save(player, "Decisions_GPuz_Archbishop_Canterbury", true)
  43.     end
  44.     )
  45.  
  46.  
  47. Decisions_AddCivilisationSpecific(GameInfoTypes["CIVILIZATION_GPUZ_KENT"], "Decisions_GPuz_Archbishop_Canterbury", Decisions_GPuz_Archbishop_Canterbury)
  48. --------------------------------------------------------------
  49. -- Aethelbert: Mint New Coins
  50. --------------------------------------------------------------
  51. local Decisions_GPuz_Mint_New_Coins = {}
  52.     Decisions_GPuz_Mint_New_Coins.Name = "TXT_KEY_DECISIONS_GPUZ_MINT_NEW_COINS"
  53.     Decisions_GPuz_Mint_New_Coins.Desc = "TXT_KEY_DECISIONS_GPUZ_MINT_NEW_COINS_DESC"
  54.     HookDecisionCivilizationIcon(Decisions_GPuz_Mint_New_Coins, "CIVILIZATION_GPUZ_KENT")
  55.     Decisions_GPuz_Mint_New_Coins.CanFunc = (
  56.     function(player)
  57.         if player:GetCivilizationType() ~= GameInfoTypes["CIVILIZATION_GPUZ_KENT"] then return false, false end
  58.         if load(player, "Decisions_GPuz_Mint_New_Coins") == true then
  59.             Decisions_GPuz_Mint_New_Coins.Desc = Locale.ConvertTextKey("TXT_KEY_DECISIONS_GPUZ_MINT_NEW_COINS_ENACTED_DESC")
  60.             return false, false, true
  61.         end
  62.         local cost = math.ceil(player:CountNumBuildings(GameInfoTypes["BUILDING_GPUZ_MYNET"]) * 250 * iMod)
  63.         local reward = math.ceil(player:CountNumBuildings(GameInfoTypes["BUILDING_GPUZ_MYNET"])* 50 * iMod)
  64.         Decisions_GPuz_Mint_New_Coins.Desc = Locale.ConvertTextKey("TXT_KEY_DECISIONS_GPUZ_MINT_NEW_COINS_DESC", cost, reward)
  65.         if (player:GetNumResourceAvailable(iMagistrate, false) < 1) then return true, false end
  66.         if (Teams[player:GetTeam()]:IsHasTech(GameInfoTypes["TECH_GUILDS"])) and (player:GetGold() >= cost) then
  67.             return true, true
  68.         else
  69.             return true, false
  70.         end
  71.     end
  72.     )
  73.    
  74.     Decisions_GPuz_Mint_New_Coins.DoFunc = (
  75.     function(player)
  76.         local cost = math.ceil(player:CountNumBuildings(GameInfoTypes["BUILDING_GPUZ_MYNET"]) * 250 * iMod)
  77.         local reward = math.ceil(player:CountNumBuildings(GameInfoTypes["BUILDING_GPUZ_MYNET"])* 50 * iMod)
  78.         player:ChangeNumResourceTotal(iMagistrate, -1)
  79.         player:ChangeGold(-cost)
  80.         player:SetNumFreePolicies(1)
  81.         player:SetNumFreePolicies(0)
  82.         player:SetHasPolicy(GameInfoTypes["POLICY_DECISIONS_GPUZ_MINT_NEW_COINS"], true)
  83.         player:ChangeJONSCulture(reward)
  84.         save(player, "Decisions_GPuz_Mint_New_Coins", true)
  85.     end
  86.     )
  87.    
  88. Decisions_AddCivilisationSpecific(GameInfoTypes["CIVILIZATION_GPUZ_KENT"], "Decisions_GPuz_Mint_New_Coins", Decisions_GPuz_Mint_New_Coins)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement