Single city challenge
Posted: Wed Apr 18, 2018 1:38 am
Does anyone besides me play single city challenge games? This was a popular thing back in the day of the original Civ 2. The challenge is to win at hard level while having only one city for the whole game. Obviously you go for a space win (I once did destroy all enemy cities but it was pretty tedious.) What I like is that it makes for a quicker game.
The problem is what to do when you get a free city from a hut - the accepted method is to give it away, and if you can't do that, have it make a settler and set the disband city option. While making my own custom ruleset I figured out a way to prevent getting a city from a hut by editing the "default.lua" script.
The problem is what to do when you get a free city from a hut - the accepted method is to give it away, and if you can't do that, have it make a settler and set the disband city option. While making my own custom ruleset I figured out a way to prevent getting a city from a hut by editing the "default.lua" script.
Code: Select all
-- Randomly choose a hut event
function _deflua_hut_enter_callback(unit)
local chance = random(0, 11)
local alive = true
local owner = unit.owner
if chance == 0 then
_deflua_hut_get_gold(unit, 25)
elseif chance == 1 or chance == 2 or chance == 3 then
_deflua_hut_get_gold(unit, 50)
elseif chance == 4 then
_deflua_hut_get_gold(unit, 100)
elseif chance == 5 or chance == 6 or chance == 7 then
_deflua_hut_get_tech(unit)
elseif chance == 8 or chance == 9 then
if not _deflua_hut_get_mercenaries(unit) then
_deflua_hut_consolation_prize(unit)
end
elseif chance == 10 then
alive = _deflua_hut_get_barbarians(unit)
elseif chance == 11 then
if unit.owner:is_human() then
notify.event(owner, unit.tile, E.HUT_BARB_CITY_NEAR,
_("An abandoned village is here."))
elseif not _deflua_hut_get_city(unit) then
_deflua_hut_consolation_prize(unit)
end
end
-- continue processing if unit is alive
return (not alive)
end