Skip to content

Commit

Permalink
[FIX] small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mbanasik committed Dec 21, 2021
1 parent 2fe4cf8 commit a60bd25
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 62 deletions.
Binary file removed CvGameCore_Expansion2.dll
Binary file not shown.
Binary file removed CvGameCore_Expansion2.pdb
Binary file not shown.
Binary file modified loveMod/CvGameCore_Expansion2.dll
Binary file not shown.
Binary file modified loveMod/CvGameCore_Expansion2.pdb
Binary file not shown.
47 changes: 34 additions & 13 deletions loveMod/Mods/Lua/Moors.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include( "Utility");

local iCiv = GameInfoTypes["CIVILIZATION_MC_LITE_MOOR"]
local iBuilding = GameInfoTypes["BUILDING_MOORS_TRAIT"]
local iBuilding = GameInfoTypes["BUILDING_MOORS_TRAIT_MEDIEVAL"]
local iEra = GameInfoTypes["ERA_MEDIEVAL"]
local bIsActive = JFD_IsCivilisationActive(iCiv)

Expand All @@ -23,43 +23,64 @@ function Moors_CityCaptured(oldPlayerID, bCapital, iPlotX, iPlotY, newPlayerID)
end
end

function Moors_TechLeave(iTeam, iTech, bAdopted)
function Moors_TechEnter_Medival(iTeam, iTech, bAdopted)
for playerID, player in pairs(Players) do
local player = Players[playerID];

if player:GetCivilizationType() == iCiv then
if player:GetCurrentEra() > iEra then
if player:GetCivilizationType() == iCiv then
if player:GetCurrentEra() == iEra then
for pCity in player:Cities() do
pCity:SetNumRealBuilding(iBuilding, 0);
pCity:SetNumRealBuilding(iBuilding, 1);
end
GameEvents.PlayerCityFounded.Remove(Moors_CityFounded)
GameEvents.CityCaptureComplete.Remove(Moors_CityCaptured)
GameEvents.TeamSetHasTech.Remove(Moors_TechLeave)
GameEvents.PlayerCityFounded.Add(Moors_CityFounded)
GameEvents.CityCaptureComplete.Add(Moors_CityCaptured)
GameEvents.TeamSetHasTech.Add(Moors_TechEnter_Renaissance)

iEra = GameInfoTypes["ERA_RENAISSANCE"]
GameEvents.TeamSetHasTech.Remove(Moors_TechEnter_Medival)
end
end
end
end

function Moors_TechEnter(iTeam, iTech, bAdopted)
function Moors_TechEnter_Renaissance(iTeam, iTech, bAdopted)
for playerID, player in pairs(Players) do
local player = Players[playerID];

if player:GetCivilizationType() == iCiv then
if player:GetCurrentEra() == iEra then
for pCity in player:Cities() do
pCity:SetNumRealBuilding(iBuilding, 0);
end
iBuilding = GameInfoTypes["BUILDING_MOORS_TRAIT_RENAISSANCE"]
for pCity in player:Cities() do
pCity:SetNumRealBuilding(iBuilding, 1);
end
GameEvents.PlayerCityFounded.Add(Moors_CityFounded)
GameEvents.CityCaptureComplete.Add(Moors_CityCaptured)
GameEvents.TeamSetHasTech.Add(Moors_TechLeave)

GameEvents.TeamSetHasTech.Remove(Moors_TechEnter)
GameEvents.TeamSetHasTech.Remove(Moors_TechEnter_Renaissance)
end
end
end
end

function Moors_TechLeave(iTeam, iTech, bAdopted)
for playerID, player in pairs(Players) do
local player = Players[playerID];

if player:GetCivilizationType() == iCiv then
if player:GetCurrentEra() > iEra then
for pCity in player:Cities() do
pCity:SetNumRealBuilding(iBuilding, 0);
end
GameEvents.PlayerCityFounded.Remove(Moors_CityFounded)
GameEvents.CityCaptureComplete.Remove(Moors_CityCaptured)
GameEvents.TeamSetHasTech.Remove(Moors_TechLeave)
end
end
end
end

if bIsActive then
GameEvents.TeamSetHasTech.Add(Moors_TechEnter)
GameEvents.TeamSetHasTech.Add(Moors_TechEnter_Medival)
end
Loading

0 comments on commit a60bd25

Please sign in to comment.