Troller0001
I've anxiously awaited your arrival!
@whoward69, Standard, my test mod was the only active mod.
my test mod was the only active mod.
Not nearly as much as I am!I'm confused right now
I'm missing something obvious.
--function that checks if WLTKD is active, and then activates the grand prix if it is
local iGrandPrix = GameInfoTypes.BUILDING_MON_GRAND_PRIX
local iMon_ID = GameInfoTypes.CIVILIZATION_MOROCCO --will be monaco once the civ is added in the game
function MonGrandPrix(iPlayer)
local pPlayer = Players[iPlayer]
if(pPlayer:GetCivilizationType() == iMon_ID)then
for pCity in pPlayer:Cities() do
if(pCity:GetWeLoveTheKingDayCounter() > 0) then
if(not pCity:IsHasBuilding(iGrandPrix))then--if the grand prix isn't already active, add a notification
if pPlayer:IsHuman() then
local description = ("Since 'We Love the King Day' is active, the citizens of "..pCity:GetName().." have organized a Grand Prix in their city, increasing Great People Generation by 15%")
local descriptionShort = ("A Grand Prix has been organized")
Players[Game.GetActivePlayer()]:AddNotification(NotificationTypes["NOTIFICATION_WONDER_BEATEN"], description, descriptionShort, pCity:GetX(), pCity:GetY(),iMonGrandPrix,Game.GetActivePlayer())
end
end
pCity:SetNumRealBuilding(iGrandPrix, 1)
else
pCity:SetNumRealBuilding(iGrandPrix, 0)
end
end
end
end
<GameData>
<BuildingClasses>
<Row>
<Type>BUILDINGCLASS_MON_GRAND_PRIX</Type>
<DefaultBuilding>BUILDING_MON_GRAND_PRIX</DefaultBuilding>
<Description>TXT_KEY_BUILDING_MON_GRAND_PRIX</Description>
</Row>
</BuildingClasses>
<Buildings>
<Row>
<Type>BUILDING_MON_GRAND_PRIX</Type>
<BuildingClass>BUILDINGCLASS_MON_GRAND_PRIX</BuildingClass>
<Cost>-1</Cost>
<PrereqTech>NULL</PrereqTech>
<MinAreaSize>-1</MinAreaSize>
<Description>TXT_KEY_BUILDING_MON_GRAND_PRIX</Description>
<Civilopedia>TXT_KEY_BUILDING_MON_GRAND_PRIX_PEDIA</Civilopedia>
<Strategy>TXT_KEY_BUILDING_MON_GRAND_PRIX_STRATEGY</Strategy>
<Help>TXT_KEY_BUILDING_MON_GRAND_PRIX_HELP</Help>
<GreatPeopleRateModifier>15</GreatPeopleRateModifier>
<AllowsRangeStrike>true</AllowsRangeStrike>
<HurryCostModifier>-1</HurryCostModifier>
<IconAtlas>BW_ATLAS_1</IconAtlas>
<NeverCapture>true</NeverCapture>
<PortraitIndex>26</PortraitIndex>
<Nukeimmune>true</Nukeimmune>
</Row>
</Buildings>
</GameData>
<AlphaAnim ID="WonderConstructedAlphaAnim" Anchor="C,C" Offset="0,-1"
Size="80,80"
TextureOffset="0,80"
Texture="assets\UI\Art\Notification\WonderAtlas640.dds"/>
<Context>
<Update>
<Where Name="WonderConstructedItem">
<Set Texture="NewAtlas640.dds">
</Update>
</Context>
I still don't get why Hagia Sophia is the default
"Weird" is Firaxis' middle name (along with "pointless", "inconsistent", ...)(Though, what's the point of having such a 'weird' offset?)
Surely they must love spaghetti with that kind of inconsistency!"Weird" is Firaxis' middle name (along with "pointless", "inconsistent", ...)
local iDemakCiv = GameInfoTypes.CIVILIZATION_MOROCCO --ignore this one; I was still testing
local tValidUnits = { [GameInfoTypes.UNIT_PROPHET] = true, [GameInfoTypes.UNIT_MISSIONARY] = true}
local tValidUnitPromotions = { [GameInfoTypes.PROMOTION_SIGHT_PENALTY] = GameInfoTypes.PROMOTION_SIGHT_PENALTY_DUMMY }
function CountDemakBonusUnits(iPlayer,iUnit)
local pPlayer = Players[iPlayer]
if pPlayer:GetCivilizationType() == iDemakCiv then
local pUnit = pPlayer:GetUnitByID(iUnit)
if tValidUnits[pUnit:GetUnitType()] then
print("A unit applicable for a Swap-promotion was moved/created/destroyed")
for iPromotion, iSwapPromotion in pairs(tValidUnitPromotions) do
if pUnit:IsHasPromotion(iPromotion) then
local iPromotionName = GameInfo.UnitPromotions[iPromotion].Type
local iSwapPromotionName = GameInfo.UnitPromotions[iSwapPromotion].Type
print("The unit has a valid Swap-Promotion: "..iPromotionName)
if pUnit then
pUnit:SetHasPromotion(iPromotion,false)
pUnit:SetHasPromotion(iSwapPromotion,true)
print("The Swap-Promotion ("..iSwapPromotionName..") has been given instead of the normal Promotion ("..iPromotionName..")")
else
print("The Unit was destroyed. R.I.P.")
end
else
print("Unit didnt'have the promotion")
end
end
end
end
end
GameEvents.UnitSetXY.Add(CountDemakBonusUnits)
for iPlayer = 0, GameDefines.MAX_MAJOR_CIVS-1, 1 do
local pPlayer = Players[iPlayer];
if pPlayer:IsAlive() then
if pPlayer:GetCivilizationType()== iDemakCiv then
print("The Game loaded/started and the Demak-civilization was found")
local pCapital = pPlayer:GetCapitalCity()
[COLOR="DarkRed"]if not pCapital == nil then[/COLOR]
print("Demak has settled its Capital: "..pCapital:GetName())
[COLOR="darkred"]else
print("Demak has not settled its capital yet")
end[/COLOR]
end
end
end