1 -- Freeciv - Copyright (C) 2007 - The Freeciv Project
2 -- This program is free software; you can redistribute it and/or modify
3 -- it under the terms of the GNU General Public License as published by
4 -- the Free Software Foundation; either version 2, or (at your option)
7 -- This program is distributed in the hope that it will be useful,
8 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
9 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 -- GNU General Public License for more details.
12 function city_destroyed_callback(city
, loser
, destroyer
)
13 city
.tile
:create_base("Ruins", NIL
)
14 -- continue processing
18 signal
.connect("city_destroyed", "city_destroyed_callback")
20 function place_map_labels()
25 local selected_mountain
= 0
26 local selected_ocean
= 0
27 local selected_desert
= 0
28 local selected_glacier
= 0
30 for place
in whole_map_iterate() do
31 local terr
= place
.terrain
32 local tname
= terr
:rule_name()
33 if tname
== "Mountains" then
34 mountains
= mountains
+ 1
35 elseif tname
== "Deep Ocean" then
36 deep_oceans
= deep_oceans
+ 1
37 elseif tname
== "Desert" then
39 elseif tname
== "Glacier" then
40 glaciers
= glaciers
+ 1
44 if random(1, 100) <= 75 then
45 selected_mountains
= random(1, mountains
)
47 if random(1, 100) <= 75 then
48 selected_ocean
= random(1, deep_oceans
)
50 if random(1, 100) <= 75 then
51 selected_desert
= random(1, deserts
)
53 if random(1, 100) <= 75 then
54 selected_glacier
= random(1, glaciers
)
57 for place
in whole_map_iterate() do
58 local terr
= place
.terrain
59 local tname
= terr
:rule_name()
61 if tname
== "Mountains" then
62 selected_mountain
= selected_mountain
- 1
63 if selected_mountain
== 0 then
64 place
:set_label(_("Highest Peak"))
66 elseif tname
== "Deep Ocean" then
67 selected_ocean
= selected_ocean
- 1
68 if selected_ocean
== 0 then
69 place
:set_label(_("Deep Trench"))
71 elseif tname
== "Desert" then
72 selected_desert
= selected_desert
- 1
73 if selected_desert
== 0 then
74 place
:set_label(_("Scorched Spot"))
76 elseif tname
== "Glacier" then
77 selected_glacier
= selected_glacier
- 1
78 if selected_glacier
== 0 then
79 place
:set_label(_("Frozen Lake"))
87 signal
.connect("map_generated", "place_map_labels")