Sell all buildings in a single turn
Sell all buildings in a single turn
Now you can only sell one building/city improvement per turn. Sometimes you want to disband the city if the city is not viable but sell the city improvements before disband to not lose the value of the buildings. Sell all city improvements in a single turn would make it easier and faster.
Re: Sell all buildings in a single turn
It is disabled to sell all buildings in 1 turn due to obvious reasons - attacking player should get some loot.
Augmented2 ruleset/modpack for freeciv2.6: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
Re: Sell all buildings in a single turn
We can attach a script that provides a player with all the cost of the buildings of a disbanded city.
Re: Sell all buildings in a single turn
Excellent idea!Ignatus wrote:We can attach a script that provides a player with all the cost of the buildings of a disbanded city.
Re: Sell all buildings in a single turn
Something like this (not tested), put in your_ruleset_dir/script.lua (don't apply to a pre-installed ruleset, make a copy to play with it):
Code: Select all
--Destroying city by a non-military action, return buildings cost to the owner
function sell_city_buildings(c,owner,oplayer)
if not oplayer then
local cost = 0;
for b in buildings_iterate() do
if c:has_building(b) and not b:is_wonder() then
cost = cost + b.build_cost -- * game.info.shieldbox / 100 and rounded if needed
end
end
if c > 0 then
owner:change_gold(cost)
notify.event(owner, c.tile, E.IMP_SOLD, _("Improvements of %s sold for %d gold"), c.name, gold)
end
end
signal.connect("city_destroyed", "sell_city_buildings")