Merge lp:~widelands-dev/widelands/sphinx-buildings into lp:widelands
- sphinx-buildings
- Merge into trunk
Proposed by
GunChleoc
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 8175 | ||||
Proposed branch: | lp:~widelands-dev/widelands/sphinx-buildings | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
1323 lines (+516/-321) 31 files modified
data/tribes/atlanteans.lua (+3/-1) data/tribes/buildings/militarysites/atlanteans/castle/helptexts.lua (+1/-40) data/tribes/buildings/militarysites/atlanteans/castle/init.lua (+29/-41) data/tribes/buildings/partially_finished/constructionsite/init.lua (+4/-20) data/tribes/buildings/partially_finished/dismantlesite/init.lua (+4/-20) data/tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua (+62/-48) data/tribes/buildings/trainingsites/atlanteans/dungeon/init.lua (+58/-29) data/tribes/buildings/warehouses/atlanteans/headquarters/init.lua (+19/-33) data/tribes/immovables/ashes/init.lua (+2/-0) data/tribes/scripting/help/global_helptexts.lua (+2/-0) data/tribes/ships/atlanteans/init.lua (+2/-0) data/tribes/wares/armor/init.lua (+2/-0) doc/sphinx/extract_rst.py (+6/-6) doc/sphinx/source/animations.rst (+34/-0) doc/sphinx/source/lua_tribes.rst (+2/-0) doc/sphinx/source/lua_tribes_buildings.rst.org (+142/-0) doc/sphinx/source/lua_tribes_units.rst.org (+1/-0) doc/sphinx/source/map_objects.rst (+9/-0) doc/sphinx/source/reference.rst (+1/-2) src/logic/map_objects/immovable.cc (+3/-0) src/logic/map_objects/tribes/building.cc (+3/-1) src/logic/map_objects/tribes/constructionsite.cc (+4/-0) src/logic/map_objects/tribes/dismantlesite.cc (+5/-0) src/logic/map_objects/tribes/militarysite.cc (+4/-0) src/logic/map_objects/tribes/productionsite.cc (+4/-0) src/logic/map_objects/tribes/ship.cc (+4/-0) src/logic/map_objects/tribes/trainingsite.cc (+4/-0) src/logic/map_objects/tribes/tribe_descr.cc (+4/-0) src/logic/map_objects/tribes/ware_descr.cc (+4/-0) src/logic/map_objects/tribes/warehouse.cc (+4/-0) src/scripting/lua_root.cc (+90/-80) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/sphinx-buildings | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Widelands Developers | Pending | ||
Review via email: mp+308704@code.launchpad.net |
Commit message
Restructured and enhanced the Buildings documentation.
Description of the change
To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote : | # |
Revision history for this message
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 1443. State: passed. Details: https:/
Appveyor build 1286. State: failed. Details: https:/
Revision history for this message
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 1571. State: failed. Details: https:/
Appveyor build 1409. State: success. Details: https:/
Revision history for this message
GunChleoc (gunchleoc) wrote : | # |
I need this for other branches, so I'm gonna merge.
@bunnybot merge
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'data/tribes/atlanteans.lua' |
2 | --- data/tribes/atlanteans.lua 2016-09-27 06:30:47 +0000 |
3 | +++ data/tribes/atlanteans.lua 2016-11-03 07:38:41 +0000 |
4 | @@ -1,4 +1,6 @@ |
5 | -- RST |
6 | +-- .. _lua_tribes_<tribename>.lua: |
7 | +-- |
8 | -- <tribename>.lua |
9 | -- --------------------- |
10 | -- |
11 | @@ -7,7 +9,7 @@ |
12 | dirname = path.dirname(__file__) |
13 | |
14 | -- RST |
15 | --- .. function:: new_tribe(table) |
16 | +-- .. function:: new_tribe{table} |
17 | -- |
18 | -- This function adds all units to a tribe. |
19 | -- |
20 | |
21 | === modified file 'data/tribes/buildings/militarysites/atlanteans/castle/helptexts.lua' |
22 | --- data/tribes/buildings/militarysites/atlanteans/castle/helptexts.lua 2016-09-02 08:27:34 +0000 |
23 | +++ data/tribes/buildings/militarysites/atlanteans/castle/helptexts.lua 2016-11-03 07:38:41 +0000 |
24 | @@ -1,68 +1,29 @@ |
25 | --- RST |
26 | --- Building Helptexts |
27 | --- ------------------ |
28 | --- |
29 | --- Each building has a ``helptexts.lua`` script, which is located in the same directory as its ``init.lua`` script. |
30 | --- The functions in this file return texts that are used for buildings by the Tribal Encyclopedia. |
31 | --- |
32 | --- See also the helper functions in ``scripting/help/global_helptexts.lua`` |
33 | --- |
34 | +-- The helptext documentation is located in /doc/sphinx/lua_tribes_buildings_rst.org |
35 | |
36 | -- This include can be removed when all help texts have been defined. |
37 | include "tribes/scripting/help/global_helptexts.lua" |
38 | |
39 | --- RST |
40 | --- .. function:: building_helptext_lore() |
41 | --- |
42 | --- Returns a localized string with a lore helptext for this building. |
43 | --- If you don't have a lore text yet, use ``no_lore_text_yet()`` from the ``global_helptexts.lua`` script. |
44 | --- |
45 | --- :returns: Localized lore text |
46 | function building_helptext_lore() |
47 | -- TRANSLATORS#: Lore helptext for a building |
48 | return no_lore_text_yet() |
49 | end |
50 | |
51 | --- RST |
52 | --- .. function:: building_helptext_lore_author() |
53 | --- |
54 | --- Returns a localized string with a fictional author for the lore helptext for this building. The returned string can be empty. |
55 | --- If you don't have an author yet, use ``no_lore_author_text_yet()`` from the ``global_helptexts.lua`` script. |
56 | --- |
57 | -- :returns: Localized lore author or empty string. |
58 | function building_helptext_lore_author() |
59 | -- TRANSLATORS#: Lore author helptext for a building |
60 | return no_lore_author_text_yet() |
61 | end |
62 | |
63 | --- RST |
64 | --- .. function:: building_helptext_purpose() |
65 | --- |
66 | --- Returns a localized string with a purpose helptext for this building. This should be individually defined for all buildings. You can use ``no_purpose_text_yet()`` from the ``global_helptexts.lua`` script if you're not ready to define this yet. |
67 | --- |
68 | --- :returns: Localized purpose text |
69 | function building_helptext_purpose() |
70 | -- TRANSLATORS: Purpose helptext for a building |
71 | return pgettext("building", "Garrisons soldiers to expand your territory.") |
72 | end |
73 | |
74 | --- RST |
75 | --- .. function:: building_helptext_note() |
76 | --- |
77 | --- Returns a localized string with a note that is added to the purpose. This can be empty. |
78 | --- |
79 | --- :returns: Localized note text or empty string. |
80 | function building_helptext_note() |
81 | -- TRANSLATORS: Note helptext for a building |
82 | return pgettext("building", "If you’re low on soldiers to occupy new military sites, use the downward arrow button to decrease the capacity. You can also click on a soldier to send him away.") |
83 | end |
84 | |
85 | --- RST |
86 | --- .. function:: building_helptext_performance() |
87 | --- |
88 | --- Returns a localized string with a performance helptext for this building. You can use ``no_purpose_text_yet()`` from the ``global_helptexts.lua`` script if the performance hasn't been calculated yet. Leave empty when this isn't applicable (e.g. for militarysites or warehouses). |
89 | --- |
90 | --- :returns: Localized performance text or empty string. |
91 | function building_helptext_performance() |
92 | -- TRANSLATORS#: Performance helptext for a building |
93 | return "" |
94 | |
95 | === modified file 'data/tribes/buildings/militarysites/atlanteans/castle/init.lua' |
96 | --- data/tribes/buildings/militarysites/atlanteans/castle/init.lua 2016-09-22 16:45:02 +0000 |
97 | +++ data/tribes/buildings/militarysites/atlanteans/castle/init.lua 2016-11-03 07:38:41 +0000 |
98 | @@ -1,4 +1,6 @@ |
99 | -- RST |
100 | +-- .. _lua_tribes_buildings_militarysites: |
101 | +-- |
102 | -- Military Sites |
103 | -- -------------- |
104 | -- |
105 | @@ -13,51 +15,37 @@ |
106 | dirname = path.dirname(__file__) |
107 | |
108 | -- RST |
109 | --- .. function:: new_militarysite_type(table) |
110 | +-- .. function:: new_militarysite_type{table} |
111 | -- |
112 | -- This function adds the definition of a military site building to the engine. |
113 | -- |
114 | -- :arg table: This table contains all the data that the game engine will add to this building. |
115 | --- It contains the following entries: |
116 | --- |
117 | --- **msgctxt**: The context that Gettext will use to disambiguate the translations for strings in this table. |
118 | --- |
119 | --- **name**: A string containing the internal name of this building. |
120 | --- |
121 | --- **descname**: The translatable display name. Use ``pgettext`` with the ``msgctxt`` above to fetch the string. |
122 | --- |
123 | --- **helptext_script**: The full path to the ``helptexts.lua`` script for this building. |
124 | --- |
125 | --- **icon**: The full path to the menu icon for this building. |
126 | --- |
127 | --- **size**: The size of this building: ``"small"``, ``"medium"``, or ``"big"``. |
128 | --- |
129 | --- **buildcost**: A table with the wares used to build this building, containing warename - amount pairs, e.g. ``buildcost = { log = 4, granite = 2 }``. |
130 | --- |
131 | --- **return_on_dismantle**: The wares that this building will give back to the player when it is dismantled, e.g. ``buildcost = { log = 2, granite = 1 }``. |
132 | --- |
133 | --- **enhancement_cost**: The wares needed to upgrade this building, e.g. ``enhancement_cost = { log = 1, granite = 1 }``. |
134 | --- |
135 | --- **return_on_dismantle_on_enhanced**: The wares that this enhanced building will give back to the player when it is dismantled, e.g. ``return_on_dismantle_on_enhanced = { granite = 1 }``. |
136 | --- |
137 | --- **animations**: A table containing all animations for this building. |
138 | --- |
139 | --- **aihints**: A list of name - value pairs with hints for the AI. |
140 | --- |
141 | --- **max_soldiers**: The maximum number of solders that can be garrisoned at this building. |
142 | --- |
143 | --- **heal_per_second**: The number of health points that a garrisoned soldier will heal each second. |
144 | --- |
145 | --- **conquers**: The conquer radius for this building. |
146 | --- |
147 | --- **prefer_heroes**: Whether this building prefers heroes or rookies per default. Set to ``true`` or ``false``. |
148 | --- |
149 | --- **messages**: Messages that this building will send to the user. The following messages need to ne defined: |
150 | --- * *occupied*: Shown when your soldiers occupy a new building |
151 | --- * *aggressor*: Shown when this building sees enemy soldiers |
152 | --- * *attack*: Shown when this building is being attacked by an enemy |
153 | --- * *defeated_enemy*: Shown when you lose this building to an enemy |
154 | --- * *defeated_you*: Shown when you take this building from an enemy |
155 | +-- In addition to the :ref:`lua_tribes_buildings_common`, it contains the following entries: |
156 | +-- |
157 | +-- **max_soldiers** |
158 | +-- *Mandatory*. The maximum number of solders that can be garrisoned at this building. |
159 | +-- |
160 | +-- **heal_per_second** |
161 | +-- *Mandatory*. The number of health points that a garrisoned soldier will heal each second. |
162 | +-- |
163 | +-- **conquers** |
164 | +-- *Mandatory*. The conquer radius for this building. |
165 | +-- |
166 | +-- **prefer_heroes** |
167 | +-- *Mandatory*. Whether this building prefers heroes or rookies per default. |
168 | +-- Set to ``true`` or ``false``. |
169 | +-- |
170 | +-- **messages** |
171 | +-- *Mandatory*. Messages that this building will send to the user. There are 5 messages, |
172 | +-- defined like this:: |
173 | +-- |
174 | +-- messages = { |
175 | +-- occupied = _"Your soldiers have occupied your fortress.", |
176 | +-- aggressor = _"Your fortress discovered an aggressor.", |
177 | +-- attack = _"Your fortress is under attack.", |
178 | +-- defeated_enemy = _"The enemy defeated your soldiers at the fortress.", |
179 | +-- defeated_you = _"Your soldiers defeated the enemy at the fortress." |
180 | +-- } |
181 | tribes:new_militarysite_type { |
182 | msgctxt = "atlanteans_building", |
183 | name = "atlanteans_castle", |
184 | |
185 | === modified file 'data/tribes/buildings/partially_finished/constructionsite/init.lua' |
186 | --- data/tribes/buildings/partially_finished/constructionsite/init.lua 2016-09-22 16:45:02 +0000 |
187 | +++ data/tribes/buildings/partially_finished/constructionsite/init.lua 2016-11-03 07:38:41 +0000 |
188 | @@ -1,4 +1,6 @@ |
189 | -- RST |
190 | +-- .. _lua_tribes_buildings_constructionsites: |
191 | +-- |
192 | -- Construction Sites |
193 | -- ------------------ |
194 | -- |
195 | @@ -14,30 +16,12 @@ |
196 | dirname = path.dirname(__file__) |
197 | |
198 | -- RST |
199 | --- .. function:: new_constructionsite_type(table) |
200 | +-- .. function:: new_constructionsite_type{table} |
201 | -- |
202 | -- This function adds the definition of the construction site building to the engine. |
203 | -- |
204 | -- :arg table: This table contains all the data that the game engine will add to this building. |
205 | --- It contains the following entries: |
206 | --- |
207 | --- **msgctxt**: The context that Gettext will use to disambiguate the translations for strings in this table. |
208 | --- |
209 | --- **name**: A string containing the internal name of this building. |
210 | --- |
211 | --- **descname**: The translatable display name. Use ``pgettext`` with the ``msgctxt`` above to fetch the string. |
212 | --- |
213 | --- **helptext_script**: The full path to the ``helptexts.lua`` script for this building. |
214 | --- |
215 | --- **icon**: The full path to the menu icon for this building. |
216 | --- |
217 | --- **vision_range**: The size of the radious that the building sees. |
218 | --- |
219 | --- **size**: The size of this building: ``"small"``, ``"medium"``, or ``"big"``. |
220 | --- |
221 | --- **animations**: A table containing all animations for this building. |
222 | --- |
223 | --- **aihints**: A list of name - value pairs with hints for the AI. |
224 | +-- It only contains :ref:`lua_tribes_buildings_common`. |
225 | -- |
226 | tribes:new_constructionsite_type { |
227 | msgctxt = "building", |
228 | |
229 | === modified file 'data/tribes/buildings/partially_finished/dismantlesite/init.lua' |
230 | --- data/tribes/buildings/partially_finished/dismantlesite/init.lua 2016-09-22 16:45:02 +0000 |
231 | +++ data/tribes/buildings/partially_finished/dismantlesite/init.lua 2016-11-03 07:38:41 +0000 |
232 | @@ -1,4 +1,6 @@ |
233 | -- RST |
234 | +-- .. _lua_tribes_buildings_dismantlesites: |
235 | +-- |
236 | -- Dismantle Sites |
237 | -- --------------- |
238 | -- |
239 | @@ -14,30 +16,12 @@ |
240 | dirname = path.dirname(__file__) |
241 | |
242 | -- RST |
243 | --- .. function:: new_dismantlesite_type(table) |
244 | +-- .. function:: new_dismantlesite_type{table} |
245 | -- |
246 | -- This function adds the definition of the dismantle site building to the engine. |
247 | -- |
248 | -- :arg table: This table contains all the data that the game engine will add to this building. |
249 | --- It contains the following entries: |
250 | --- |
251 | --- **msgctxt**: The context that Gettext will use to disambiguate the translations for strings in this table. |
252 | --- |
253 | --- **name**: A string containing the internal name of this building. |
254 | --- |
255 | --- **descname**: The translatable display name. Use ``pgettext`` with the ``msgctxt`` above to fetch the string. |
256 | --- |
257 | --- **helptext_script**: The full path to the ``helptexts.lua`` script for this building. |
258 | --- |
259 | --- **icon**: The full path to the menu icon for this building. |
260 | --- |
261 | --- **vision_range**: The size of the radious that the building sees. |
262 | --- |
263 | --- **size**: The size of this building: ``"small"``, ``"medium"``, or ``"big"``. |
264 | --- |
265 | --- **animations**: A table containing all animations for this building. |
266 | --- |
267 | --- **aihints**: A list of name - value pairs with hints for the AI. |
268 | +-- It only contains :ref:`lua_tribes_buildings_common`. |
269 | -- |
270 | tribes:new_dismantlesite_type { |
271 | msgctxt = "building", |
272 | |
273 | === modified file 'data/tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua' |
274 | --- data/tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua 2016-10-30 19:06:01 +0000 |
275 | +++ data/tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua 2016-11-03 07:38:41 +0000 |
276 | @@ -1,4 +1,6 @@ |
277 | -- RST |
278 | +-- .. _lua_tribes_buildings_productionsites: |
279 | +-- |
280 | -- Production Sites |
281 | -- ---------------- |
282 | -- |
283 | @@ -15,58 +17,70 @@ |
284 | dirname = path.dirname(__file__) |
285 | |
286 | -- RST |
287 | --- .. function:: new_productionsite_type(table) |
288 | +-- .. function:: new_productionsite_type{table} |
289 | -- |
290 | -- This function adds the definition of a production site building to the engine. |
291 | -- |
292 | -- :arg table: This table contains all the data that the game engine will add to this building. |
293 | --- It contains the following entries: |
294 | --- |
295 | --- **msgctxt**: The context that Gettext will use to disambiguate the translations for strings in this table. |
296 | --- |
297 | --- **name**: A string containing the internal name of this building. |
298 | --- |
299 | --- **descname**: The translatable display name. Use ``pgettext`` with the ``msgctxt`` above to fetch the string. |
300 | --- |
301 | --- **helptext_script**: The full path to the ``helptexts.lua`` script for this building. |
302 | --- |
303 | --- **icon**: The full path to the menu icon for this building. |
304 | --- |
305 | --- **size**: The size of this building: ``"small"``, ``"medium"``, ``"big"`` or ``"mine"``. |
306 | --- |
307 | --- **buildcost**: A table with the wares used to build this building, containing warename - amount pairs, e.g. ``buildcost = { log = 4, granite = 2 }``. |
308 | --- |
309 | --- **return_on_dismantle**: The wares that this building will give back to the player when it is dismantled, e.g. ``buildcost = { log = 2, granite = 1 }``. |
310 | --- |
311 | --- **enhancement_cost**: The wares needed to upgrade this building, e.g. ``enhancement_cost = { log = 1, granite = 1 }``. |
312 | --- |
313 | --- **return_on_dismantle_on_enhanced**: The wares that this enhanced building will give back to the player when it is dismantled, e.g. ``return_on_dismantle_on_enhanced = { granite = 1 }``. |
314 | --- |
315 | --- **animations**: A table containing all animations for this building. |
316 | --- |
317 | --- **aihints**: A list of name - value pairs with hints for the AI. |
318 | --- |
319 | --- **working_positions**: The name and amount for each worker type working at this building. |
320 | --- |
321 | --- **inputs**: The name and amount for each ware input queue. |
322 | --- |
323 | --- **outputs**: The wares/workers produced by this building. |
324 | --- |
325 | --- **programs**: The production site programs that define what preconditions |
326 | --- a building needs to fulfil in order to produce its wares and how it's done, |
327 | --- including any animations and sounds played. See also :doc:`productionsite_program`. |
328 | --- |
329 | --- **out_of_resource_notification**: This optional table defines the message |
330 | --- sent by the productionsite to the player if it has run out of a resource to |
331 | --- collect. Table keys are: |
332 | --- |
333 | --- *title*: A concise message title for the list in the inbox. |
334 | --- |
335 | --- *heading*: A longer version of the title, shown in the message body. |
336 | --- |
337 | --- *message*: The actual message. Translation needs to be fetched with pgettext. |
338 | --- |
339 | --- *productivity_threshold*: An optional int value in percent to trigger the message. |
340 | +-- In addition to the :ref:`lua_tribes_buildings_common`, it contains the following entries: |
341 | +-- |
342 | +-- **size** |
343 | +-- *Mandatory*. In addition to the common size values ``"small"``, |
344 | +-- ``"medium"``, or ``"big"``, production sites can also have size ``"mine"`` |
345 | +-- for defining a mine building to be built on mountains. |
346 | +-- |
347 | +-- **working_positions** |
348 | +-- *Mandatory*. The name and amount for each worker type working at this |
349 | +-- building, e.g.:: |
350 | +-- |
351 | +-- working_positions = { atlanteans_armorsmith = 1 }, |
352 | +-- |
353 | +-- **inputs** |
354 | +-- *Optional*. The name and amount for each ware input queue, e.g.:: |
355 | +-- |
356 | +-- inputs = { |
357 | +-- { name = "coal", amount = 10 }, |
358 | +-- { name = "iron", amount = 8 }, |
359 | +-- { name = "gold", amount = 8 } |
360 | +-- }, |
361 | +-- |
362 | +-- **outputs** |
363 | +-- *Optional*. The wares/workers produced by this building, e.g.:: |
364 | +-- |
365 | +-- outputs = { "shield_advanced", "shield_steel" }, |
366 | +-- |
367 | +-- **programs**. |
368 | +-- *Mandatory*. The production site programs that define what preconditions |
369 | +-- a building needs to fulfil in order to produce its wares and how it's |
370 | +-- done, including any animations and sounds played. |
371 | +-- See :doc:`productionsite_program`. |
372 | +-- |
373 | +-- **out_of_resource_notification**. |
374 | +-- *Optional*. This table defines the message sent by the productionsite |
375 | +-- to the player if it has run out of a resource to collect. There are 4 |
376 | +-- entries: |
377 | +-- |
378 | +-- **title** |
379 | +-- *Mandatory*. A concise message title for the list in the inbox. |
380 | +-- |
381 | +-- **heading** |
382 | +-- *Mandatory*. A longer version of the title, shown in the message body. |
383 | +-- |
384 | +-- **message** |
385 | +-- *Mandatory*. The actual message. Translation needs to be fetched with pgettext. |
386 | +-- |
387 | +-- **productivity_threshold** |
388 | +-- *Optional. Default:* ``100``. An int value in percent to trigger the message. |
389 | +-- |
390 | +-- Example:: |
391 | +-- |
392 | +-- out_of_resource_notification = { |
393 | +-- -- Translators: Short for "Out of ..." for a resource |
394 | +-- title = _"No Fields", |
395 | +-- heading = _"Out of Fields", |
396 | +-- message = pgettext("atlanteans_building", "The farmer working at this farm has no cleared soil to plant his seeds."), |
397 | +-- productivity_threshold = 30 |
398 | +-- }, |
399 | -- |
400 | tribes:new_productionsite_type { |
401 | msgctxt = "atlanteans_building", |
402 | |
403 | === modified file 'data/tribes/buildings/trainingsites/atlanteans/dungeon/init.lua' |
404 | --- data/tribes/buildings/trainingsites/atlanteans/dungeon/init.lua 2016-09-10 16:50:51 +0000 |
405 | +++ data/tribes/buildings/trainingsites/atlanteans/dungeon/init.lua 2016-11-03 07:38:41 +0000 |
406 | @@ -1,4 +1,6 @@ |
407 | -- RST |
408 | +-- .. _lua_tribes_buildings_trainingsites: |
409 | +-- |
410 | -- Training Sites |
411 | -- -------------- |
412 | -- |
413 | @@ -14,39 +16,66 @@ |
414 | dirname = path.dirname(__file__) |
415 | |
416 | -- RST |
417 | --- .. function:: new_trainingsite_type(table) |
418 | +-- .. function:: new_trainingsite_type{table} |
419 | -- |
420 | -- This function adds the definition of a training site building to the engine. |
421 | -- |
422 | -- :arg table: This table contains all the data that the game engine will add to this building. |
423 | --- It contains everything that a productionsite contains, plus the following entries: |
424 | --- |
425 | --- **soldier_capacity**: An int describing how many soldiers this building can house. |
426 | --- |
427 | --- **trainer_patience**: An int describing how patient the trainer is. |
428 | --- If trainer patience runs out, a soldier will be kicked out. |
429 | --- |
430 | --- **soldier attack**: A table describing what is needed to train a soldier in attack. |
431 | --- It contains the following entries: |
432 | --- |
433 | --- *min_level*: The minimum attack level that a soldier needs before it |
434 | --- can be trained in attack at this training site. |
435 | --- |
436 | --- *max_level*: The maximum level of attack that a soldier can be trained in. |
437 | --- |
438 | --- *food*: A table with the types food needed to train a soldier in attack. |
439 | --- It contains subtables with alternatives, e.g. ``{"fish", "meat"}`` |
440 | --- means that fish OR meat is needed, ``{"fish"}, {"meat"}`` means that fish |
441 | --- AND meat are needed. |
442 | --- |
443 | --- *weapons*: A table with the list of weapons that are used for attack |
444 | --- training at the various levels. |
445 | --- |
446 | --- **soldier defense**: Just like ``soldier attack``, but for defense training |
447 | --- |
448 | --- **soldier health**: Just like ``soldier attack``, but for health training |
449 | --- |
450 | --- **soldier evade**: Just like ``soldier attack``, but for evade training |
451 | +-- It is a special type of production site, so it has all the entries that :ref:`lua_tribes_buildings_productionsites` can have, plus the following entries: |
452 | +-- |
453 | +-- **soldier_capacity** |
454 | +-- *Mandatory*. An int describing how many soldiers this building can house. |
455 | +-- |
456 | +-- **trainer_patience** |
457 | +-- *Mandatory*. An int describing how patient the trainer is. |
458 | +-- If trainer patience runs out, a soldier will be kicked out. |
459 | +-- |
460 | +-- **soldier attack** |
461 | +-- *Optional*. A table describing what is needed to train a soldier in attack. |
462 | +-- It contains the following entries: |
463 | +-- |
464 | +-- **min_level** |
465 | +-- *Mandatory*. The minimum attack level that a soldier needs before it |
466 | +-- can be trained in attack at this training site. |
467 | +-- |
468 | +-- **max_level** |
469 | +-- *Mandatory*. The maximum level of attack that a soldier can be trained in. |
470 | +-- |
471 | +-- **food** |
472 | +-- *Optional*. A table with the types of food needed to train a |
473 | +-- soldier in attack. It contains subtables with alternatives, e.g. |
474 | +-- ``{"fish", "meat"}`` means that fish OR meat is needed, |
475 | +-- ``{"fish"}, {"meat"}`` means that fish AND meat are needed. |
476 | +-- |
477 | +-- **weapons** |
478 | +-- *Optional*. A table with the list of weapons that are used for |
479 | +-- attack training at the various levels. |
480 | +-- |
481 | +-- Example:: |
482 | +-- |
483 | +-- ["soldier attack"] = { |
484 | +-- min_level = 0, |
485 | +-- max_level = 3, |
486 | +-- food = { |
487 | +-- {"smoked_fish", "smoked_meat"}, |
488 | +-- {"atlanteans_bread"} |
489 | +-- }, |
490 | +-- weapons = { |
491 | +-- "trident_long", |
492 | +-- "trident_steel", |
493 | +-- "trident_double", |
494 | +-- "trident_heavy_double" |
495 | +-- } |
496 | +-- }, |
497 | +-- |
498 | +-- **soldier defense** |
499 | +-- *Optional*. Just like ``soldier attack``, but for defense training. |
500 | +-- |
501 | +-- **soldier health** |
502 | +-- *Optional*. Just like ``soldier attack``, but for health training. |
503 | +-- |
504 | +-- **soldier evade** |
505 | +-- *Optional*. Just like ``soldier attack``, but for evade training. |
506 | -- |
507 | tribes:new_trainingsite_type { |
508 | msgctxt = "atlanteans_building", |
509 | |
510 | === modified file 'data/tribes/buildings/warehouses/atlanteans/headquarters/init.lua' |
511 | --- data/tribes/buildings/warehouses/atlanteans/headquarters/init.lua 2016-09-22 16:45:02 +0000 |
512 | +++ data/tribes/buildings/warehouses/atlanteans/headquarters/init.lua 2016-11-03 07:38:41 +0000 |
513 | @@ -1,4 +1,6 @@ |
514 | -- RST |
515 | +-- .. _lua_tribes_buildings_warehouses: |
516 | +-- |
517 | -- Headquarters, Warehouses and Ports |
518 | -- ---------------------------------- |
519 | -- |
520 | @@ -17,43 +19,27 @@ |
521 | dirname = path.dirname(__file__) |
522 | |
523 | -- RST |
524 | --- .. function:: new_warehouse_type(table) |
525 | +-- .. function:: new_warehouse_type{table} |
526 | -- |
527 | -- This function adds the definition of a warehouse building to the engine. |
528 | -- |
529 | -- :arg table: This table contains all the data that the game engine will add to this building. |
530 | --- It contains the following entries: |
531 | --- |
532 | --- **msgctxt**: The context that Gettext will use to disambiguate the translations for strings in this table. |
533 | --- |
534 | --- **name**: A string containing the internal name of this building. |
535 | --- |
536 | --- **descname**: The translatable display name. Use ``pgettext`` with the ``msgctxt`` above to fetch the string. |
537 | --- |
538 | --- **helptext_script**: The full path to the ``helptexts.lua`` script for this building. |
539 | --- |
540 | --- **icon**: The full path to the menu icon for this building. |
541 | --- |
542 | --- **size**: The size of this building: ``"small"``, ``"medium"``, ``"big"`` or ``"port"``. |
543 | --- |
544 | --- **destructible**: Set this to ``false`` for headquarters, leave blank otherwise. |
545 | --- |
546 | --- **buildcost**: A table with the wares used to build this building, containing warename - amount pairs, e.g. ``buildcost = { log = 4, granite = 2 }``. If this table isn't defined, the building will be a headquarters. |
547 | --- |
548 | --- **return_on_dismantle**: The wares that this building will give back to the player when it is dismantled, e.g. ``buildcost = { log = 2, granite = 1 }``. If this table isn't defined, the building will be a headquarters. |
549 | --- |
550 | --- **enhancement_cost**: The wares needed to upgrade this building, e.g. ``enhancement_cost = { log = 1, granite = 1 }``. If this table isn't defined, the building will be a headquarters. |
551 | --- |
552 | --- **return_on_dismantle_on_enhanced**: The wares that this enhanced building will give back to the player when it is dismantled, e.g. ``return_on_dismantle_on_enhanced = { granite = 1 }``. If this table isn't defined, the building will be a headquarters. |
553 | --- |
554 | --- **animations**: A table containing all animations for this building. |
555 | --- |
556 | --- **aihints**: A list of name - value pairs with hints for the AI. |
557 | --- |
558 | --- **heal_per_second**: The number of health points that a garrisoned soldier will heal each second. |
559 | --- |
560 | --- **conquers**: The conquer radius for this building. This is used for headquarters and ports. |
561 | --- |
562 | +-- In addition to the :ref:`lua_tribes_buildings_common`, it contains the following entries: |
563 | +-- |
564 | +-- **size** |
565 | +-- *Mandatory*. In addition to the common size values ``"small"``, |
566 | +-- ``"medium"``, or ``"big"``, warehouses can also have size ``"port"`` |
567 | +-- for defining a port building. |
568 | +-- |
569 | +-- **heal_per_second** |
570 | +-- *Mandatory*. The number of health points that a garrisoned soldier will heal each second. |
571 | +-- |
572 | +-- **conquers** |
573 | +-- *Optional. Default:* ``0``. The conquer radius for this building. |
574 | +-- |
575 | +-- **destructible** |
576 | +-- *Optional. Default:* ``true``. Set this to ``false`` for headquarters. |
577 | + |
578 | tribes:new_warehouse_type { |
579 | msgctxt = "atlanteans_building", |
580 | name = "atlanteans_headquarters", |
581 | |
582 | === modified file 'data/tribes/immovables/ashes/init.lua' |
583 | --- data/tribes/immovables/ashes/init.lua 2016-09-26 11:37:54 +0000 |
584 | +++ data/tribes/immovables/ashes/init.lua 2016-11-03 07:38:41 +0000 |
585 | @@ -1,4 +1,6 @@ |
586 | -- RST |
587 | +-- .. _lua_tribes_immovables: |
588 | +-- |
589 | -- Tribe Immovables |
590 | -- ---------------- |
591 | -- |
592 | |
593 | === modified file 'data/tribes/scripting/help/global_helptexts.lua' |
594 | --- data/tribes/scripting/help/global_helptexts.lua 2016-09-01 15:23:25 +0000 |
595 | +++ data/tribes/scripting/help/global_helptexts.lua 2016-11-03 07:38:41 +0000 |
596 | @@ -3,6 +3,8 @@ |
597 | -- ======================================================= |
598 | |
599 | -- RST |
600 | +-- .. _lua_tribes_global_helptexts.lua: |
601 | +-- |
602 | -- global_helptexts.lua |
603 | -- -------------------- |
604 | -- |
605 | |
606 | === modified file 'data/tribes/ships/atlanteans/init.lua' |
607 | --- data/tribes/ships/atlanteans/init.lua 2016-09-26 11:37:54 +0000 |
608 | +++ data/tribes/ships/atlanteans/init.lua 2016-11-03 07:38:41 +0000 |
609 | @@ -1,4 +1,6 @@ |
610 | -- RST |
611 | +-- .. _lua_tribes_ships: |
612 | +-- |
613 | -- Ships |
614 | -- ----- |
615 | -- |
616 | |
617 | === modified file 'data/tribes/wares/armor/init.lua' |
618 | --- data/tribes/wares/armor/init.lua 2016-09-22 16:45:48 +0000 |
619 | +++ data/tribes/wares/armor/init.lua 2016-11-03 07:38:41 +0000 |
620 | @@ -1,4 +1,6 @@ |
621 | -- RST |
622 | +-- .. _lua_tribes_wares: |
623 | +-- |
624 | -- Wares |
625 | -- ----- |
626 | -- |
627 | |
628 | === modified file 'doc/sphinx/extract_rst.py' |
629 | --- doc/sphinx/extract_rst.py 2016-09-22 16:45:48 +0000 |
630 | +++ doc/sphinx/extract_rst.py 2016-11-03 07:38:41 +0000 |
631 | @@ -36,17 +36,17 @@ |
632 | ('data/tribes/scripting/mapobject_info', '', 'lua_tribes_other'), |
633 | ('data/tribes/scripting/help', '', 'lua_tribes_other'), |
634 | ('data/tribes/buildings/militarysites/atlanteans/castle', |
635 | - 'militarysite', 'lua_tribes_units'), |
636 | + 'militarysite', 'lua_tribes_buildings'), |
637 | ('data/tribes/buildings/productionsites/atlanteans/armorsmithy', |
638 | - 'productionsite', 'lua_tribes_units'), |
639 | + 'productionsite', 'lua_tribes_buildings'), |
640 | ('data/tribes/buildings/trainingsites/atlanteans/dungeon', |
641 | - 'trainingsite', 'lua_tribes_units'), |
642 | + 'trainingsite', 'lua_tribes_buildings'), |
643 | ('data/tribes/buildings/warehouses/atlanteans/headquarters', |
644 | - 'warehouse', 'lua_tribes_units'), |
645 | + 'warehouse', 'lua_tribes_buildings'), |
646 | ('data/tribes/buildings/partially_finished/constructionsite', |
647 | - 'constructionsite', 'lua_tribes_units'), |
648 | + 'constructionsite', 'lua_tribes_buildings'), |
649 | ('data/tribes/buildings/partially_finished/dismantlesite', |
650 | - 'dismantlesite', 'lua_tribes_units'), |
651 | + 'dismantlesite', 'lua_tribes_buildings'), |
652 | ('data/tribes/immovables/ashes', |
653 | 'immovables', 'lua_tribes_units'), |
654 | ('data/tribes/ships/atlanteans', |
655 | |
656 | === added file 'doc/sphinx/source/animations.rst' |
657 | --- doc/sphinx/source/animations.rst 1970-01-01 00:00:00 +0000 |
658 | +++ doc/sphinx/source/animations.rst 2016-11-03 07:38:41 +0000 |
659 | @@ -0,0 +1,34 @@ |
660 | +Animations |
661 | +========== |
662 | + |
663 | +Animations are defined as Lua tables. They look like this:: |
664 | + |
665 | + animations = { |
666 | + idle = { |
667 | + pictures = path.list_files(path.dirname(__file__) .. "idle_??.png"), |
668 | + hotspot = { 5, 7 }, |
669 | + fps = 4, |
670 | + sound_effect = { |
671 | + directory = "sound/foo", |
672 | + name = "bar", |
673 | + }, |
674 | + }, |
675 | + working = ... |
676 | + } |
677 | + |
678 | +Let's have a detailed look at the ``idle`` animation: |
679 | + |
680 | +idle |
681 | + *Mandatory*. This is the name of the animation. It can be referenced by this name e.g. if you want to call it in a production program. |
682 | + |
683 | +pictures |
684 | + *Mandatory*. A template for the image names. Our example will pick up any image from ``idle_00.png`` through ``idle_99.png`` in the specified directory path – the current path in our example. These images can optionally have corresponding player color mask images called ``idle_00_pc.png`` through ``idle_99_pc.png``. |
685 | + |
686 | +hotspot |
687 | + *Mandatory*. The x, y coordinates for adjusting the placement of the animation. Increase ``x`` to shift the animation to the left and ``y`` to shift it upwards. |
688 | + |
689 | +fps |
690 | + *Optional*. The frames per second for this animation if you want to deviate from the default fps. Do not specify this value if you have only 1 animation frame. |
691 | + |
692 | +sound_effect |
693 | + *Optional*. Our example will look for the sound files ``bar_00.ogg`` through ``bar_99.ogg`` in the directory ``data/sound/foo`` and play them in sequence. |
694 | |
695 | === modified file 'doc/sphinx/source/lua_tribes.rst' |
696 | --- doc/sphinx/source/lua_tribes.rst 2016-09-01 18:32:58 +0000 |
697 | +++ doc/sphinx/source/lua_tribes.rst 2016-11-03 07:38:41 +0000 |
698 | @@ -1,3 +1,5 @@ |
699 | +.. _lua_tribes: |
700 | + |
701 | Scripts for Tribes |
702 | ================== |
703 | |
704 | |
705 | === added file 'doc/sphinx/source/lua_tribes_buildings.rst.org' |
706 | --- doc/sphinx/source/lua_tribes_buildings.rst.org 1970-01-01 00:00:00 +0000 |
707 | +++ doc/sphinx/source/lua_tribes_buildings.rst.org 2016-11-03 07:38:41 +0000 |
708 | @@ -0,0 +1,142 @@ |
709 | +Buildings |
710 | +========= |
711 | + |
712 | +Buildings are defined in their ``init.lua`` file. They also have a corresponding ``helptexts.lua`` file that contains their help texts. |
713 | + |
714 | +Types of Buildings |
715 | +------------------ |
716 | + |
717 | +Widelands knows about the following types of buildings: |
718 | + |
719 | +.. toctree:: |
720 | + :maxdepth: 3 |
721 | + |
722 | +REPLACE_ME |
723 | + |
724 | +.. _lua_tribes_buildings_common: |
725 | + |
726 | +Common Building Properties |
727 | +-------------------------- |
728 | + |
729 | +Buildings are defined with Lua functions called ``new_<building_type>_type{table}``. The contents of ``table`` depend on the type of building that you are defining. The common properties shared by all buildings are: |
730 | + |
731 | + |
732 | +**msgctxt** |
733 | + *Mandatory*. The context that Gettext will use to disambiguate the translations for |
734 | + strings in this table, e.g.:: |
735 | + |
736 | + msgctxt = "atlanteans_building", |
737 | + |
738 | +**name** |
739 | + *Mandatory*. A string containing the internal name of this building, e.g.:: |
740 | + |
741 | + name = "atlanteans_fortress", |
742 | + |
743 | +**descname** |
744 | + *Mandatory*. The translatable display name. Use ``pgettext`` with the ``msgctxt`` |
745 | + above to fetch the string, e.g.:: |
746 | + |
747 | + descname = pgettext("atlanteans_building", "Fortress"), |
748 | + |
749 | +**helptext_script** |
750 | + *Mandatory*. The full path to the ``helptexts.lua`` script for this building. |
751 | + |
752 | +**icon** |
753 | + *Mandatory*. The full path to the menu icon for this building. |
754 | + |
755 | +**size** |
756 | + *Mandatory*. The size of this building: ``"small"``, ``"medium"``, or ``"big"``. |
757 | + |
758 | +**vision_range** |
759 | + *Optional. Default:* ``0``. The size of the radius that the building sees. |
760 | + |
761 | +**buildcost** |
762 | + *Optional*. A table with the wares used to build this building, containing |
763 | + warename - amount pairs, e.g.:: |
764 | + |
765 | + buildcost = { log = 4, granite = 2 } |
766 | + |
767 | + When ``buildcost`` is defined, you also need to define ``return_on_dismantle``. |
768 | + |
769 | +**return_on_dismantle** |
770 | + *Optional*. The wares that this building will give back to the player when it is |
771 | + dismantled, e.g.:: |
772 | + |
773 | + buildcost = { log = 2, granite = 1 } |
774 | + |
775 | +**enhancement** |
776 | + *Optional*. The name of a building that this building can be enhanced to, e.g.:: |
777 | + |
778 | + enhancement = "atlanteans_fancy_building", |
779 | + |
780 | + If ``enhancement`` is defined, the building that this building enhances |
781 | + to will need to define ``enhancement_cost`` and |
782 | + ``return_on_dismantle_on_enhanced``. |
783 | + |
784 | +**enhancement_cost** |
785 | + *Optional*. The wares needed to upgrade this building, e.g.:: |
786 | + |
787 | + enhancement_cost = { log = 1, granite = 1 } |
788 | + |
789 | +**return_on_dismantle_on_enhanced** |
790 | + *Optional*. The wares that this enhanced building will give back to the player |
791 | + when it is dismantled, e.g.:: |
792 | + |
793 | + return_on_dismantle_on_enhanced = { granite = 1 } |
794 | + |
795 | +**animations** |
796 | + *Mandatory*. A table containing all animations for this building. Every building |
797 | + needs to have an ``idle`` animation. Other animations that a building |
798 | + can have are ``build``, ``working``, ``unoccupied``. Mines also have |
799 | + an ``unoccupied`` animation. |
800 | + See :doc:`animations` for a detailed description of the animation format. |
801 | + |
802 | +**needs_seafaring** |
803 | + *Optional. Default:* ``false``. Set to ``true`` if this building will only be available on seafaring maps. |
804 | + |
805 | +**aihints** |
806 | + *Mandatory*. A list of name - value pairs with hints for the AI. Can be empty. |
807 | + |
808 | + |
809 | +Help Texts |
810 | +---------- |
811 | + |
812 | +Each building has a ``helptexts.lua`` script, which is located in the same directory as its ``init.lua`` script. |
813 | +The functions in this file return texts that are used for buildings by the Tribal Encyclopedia. |
814 | + |
815 | +See also the helper functions in :ref:`lua_tribes_global_helptexts.lua`. |
816 | + |
817 | + |
818 | +.. function:: building_helptext_lore() |
819 | + |
820 | + Returns a localized string with a lore helptext for this building. |
821 | + If you don't have a lore text yet, use ``no_lore_text_yet()`` from the ``lua_tribes_global_helptexts.lua`` script. |
822 | + |
823 | + |
824 | +.. function:: building_helptext_lore_author() |
825 | + |
826 | + Returns a localized string with a fictional author for the lore helptext for this building. The returned string can be empty. |
827 | + If you don't have an author yet, use ``no_lore_author_text_yet()`` from the :ref:`lua_tribes_global_helptexts.lua` script. |
828 | + |
829 | + :returns: Localized lore text |
830 | + |
831 | + |
832 | +.. function:: building_helptext_purpose() |
833 | + |
834 | + Returns a localized string with a purpose helptext for this building. This should be individually defined for all buildings. You can use ``no_purpose_text_yet()`` from the :ref:`lua_tribes_global_helptexts.lua` script if you're not ready to define this yet. |
835 | + |
836 | + :returns: Localized purpose text |
837 | + |
838 | + |
839 | +.. function:: building_helptext_note() |
840 | + |
841 | + Returns a localized string with a note that is added to the purpose. This can be empty. |
842 | + |
843 | + :returns: Localized note text or empty string. |
844 | + |
845 | + |
846 | +.. function:: building_helptext_performance() |
847 | + |
848 | + Returns a localized string with a performance helptext for this building. You can use ``no_purpose_text_yet()`` from the :ref:`lua_tribes_global_helptexts.lua` script if the performance hasn't been calculated yet. Leave empty when this isn't applicable (e.g. for militarysites or warehouses). |
849 | + |
850 | + :returns: Localized performance text or empty string. |
851 | |
852 | === modified file 'doc/sphinx/source/lua_tribes_units.rst.org' |
853 | --- doc/sphinx/source/lua_tribes_units.rst.org 2016-09-01 18:32:58 +0000 |
854 | +++ doc/sphinx/source/lua_tribes_units.rst.org 2016-11-03 07:38:41 +0000 |
855 | @@ -15,4 +15,5 @@ |
856 | .. toctree:: |
857 | :maxdepth: 3 |
858 | |
859 | + autogen_toc_lua_tribes_buildings |
860 | REPLACE_ME |
861 | |
862 | === added file 'doc/sphinx/source/map_objects.rst' |
863 | --- doc/sphinx/source/map_objects.rst 1970-01-01 00:00:00 +0000 |
864 | +++ doc/sphinx/source/map_objects.rst 2016-11-03 07:38:41 +0000 |
865 | @@ -0,0 +1,9 @@ |
866 | +World and Tribes |
867 | +================ |
868 | + |
869 | +.. toctree:: |
870 | + :maxdepth: 3 |
871 | + |
872 | + animations |
873 | + autogen_toc_lua_world |
874 | + lua_tribes |
875 | |
876 | === modified file 'doc/sphinx/source/reference.rst' |
877 | --- doc/sphinx/source/reference.rst 2016-09-01 18:32:58 +0000 |
878 | +++ doc/sphinx/source/reference.rst 2016-11-03 07:38:41 +0000 |
879 | @@ -5,6 +5,5 @@ |
880 | :maxdepth: 3 |
881 | |
882 | core |
883 | - autogen_toc_lua_world |
884 | - lua_tribes |
885 | + map_objects |
886 | autogen_toc_auxiliary |
887 | |
888 | === modified file 'src/logic/map_objects/immovable.cc' |
889 | --- src/logic/map_objects/immovable.cc 2016-11-03 07:20:57 +0000 |
890 | +++ src/logic/map_objects/immovable.cc 2016-11-03 07:38:41 +0000 |
891 | @@ -265,6 +265,9 @@ |
892 | |
893 | /** |
894 | * Parse a tribes immovable from its init file. |
895 | + * |
896 | + * The contents of 'table' are documented in |
897 | + * /data/tribes/immovables/ashes/init.lua |
898 | */ |
899 | ImmovableDescr::ImmovableDescr(const std::string& init_descname, |
900 | const LuaTable& table, |
901 | |
902 | === modified file 'src/logic/map_objects/tribes/building.cc' |
903 | --- src/logic/map_objects/tribes/building.cc 2016-11-03 07:20:57 +0000 |
904 | +++ src/logic/map_objects/tribes/building.cc 2016-11-03 07:38:41 +0000 |
905 | @@ -50,7 +50,9 @@ |
906 | namespace Widelands { |
907 | |
908 | static const int32_t BUILDING_LEAVE_INTERVAL = 1000; |
909 | - |
910 | +/** |
911 | + * The contents of 'table' are documented in doc/sphinx/source/lua_tribes_buildings.rst.org |
912 | + */ |
913 | BuildingDescr::BuildingDescr(const std::string& init_descname, |
914 | const MapObjectType init_type, |
915 | const LuaTable& table, |
916 | |
917 | === modified file 'src/logic/map_objects/tribes/constructionsite.cc' |
918 | --- src/logic/map_objects/tribes/constructionsite.cc 2016-11-03 07:20:57 +0000 |
919 | +++ src/logic/map_objects/tribes/constructionsite.cc 2016-11-03 07:38:41 +0000 |
920 | @@ -41,6 +41,10 @@ |
921 | |
922 | namespace Widelands { |
923 | |
924 | +/** |
925 | + * The contents of 'table' are documented in |
926 | + * /data/tribes/buildings/partially_finished/constructionsite/init.lua |
927 | + */ |
928 | ConstructionSiteDescr::ConstructionSiteDescr(const std::string& init_descname, |
929 | const LuaTable& table, |
930 | const EditorGameBase& egbase) |
931 | |
932 | === modified file 'src/logic/map_objects/tribes/dismantlesite.cc' |
933 | --- src/logic/map_objects/tribes/dismantlesite.cc 2016-10-26 19:43:40 +0000 |
934 | +++ src/logic/map_objects/tribes/dismantlesite.cc 2016-11-03 07:38:41 +0000 |
935 | @@ -39,6 +39,11 @@ |
936 | |
937 | namespace Widelands { |
938 | |
939 | +/** |
940 | + * The contents of 'table' are documented in |
941 | + * /data/tribes/buildings/partially_finished/dismantlesite/init.lua |
942 | + */ |
943 | + |
944 | DismantleSiteDescr::DismantleSiteDescr(const std::string& init_descname, |
945 | const LuaTable& table, |
946 | const EditorGameBase& egbase) |
947 | |
948 | === modified file 'src/logic/map_objects/tribes/militarysite.cc' |
949 | --- src/logic/map_objects/tribes/militarysite.cc 2016-08-04 15:49:05 +0000 |
950 | +++ src/logic/map_objects/tribes/militarysite.cc 2016-11-03 07:38:41 +0000 |
951 | @@ -43,6 +43,10 @@ |
952 | |
953 | namespace Widelands { |
954 | |
955 | +/** |
956 | + * The contents of 'table' are documented in |
957 | + * /data/tribes/buildings/militarysites/atlanteans/castle/init.lua |
958 | + */ |
959 | MilitarySiteDescr::MilitarySiteDescr(const std::string& init_descname, |
960 | const LuaTable& table, |
961 | const EditorGameBase& egbase) |
962 | |
963 | === modified file 'src/logic/map_objects/tribes/productionsite.cc' |
964 | --- src/logic/map_objects/tribes/productionsite.cc 2016-09-02 11:48:37 +0000 |
965 | +++ src/logic/map_objects/tribes/productionsite.cc 2016-11-03 07:38:41 +0000 |
966 | @@ -53,6 +53,10 @@ |
967 | ============================================================================== |
968 | */ |
969 | |
970 | +/** |
971 | + * The contents of 'table' are documented in |
972 | + * /data/tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua |
973 | + */ |
974 | ProductionSiteDescr::ProductionSiteDescr(const std::string& init_descname, |
975 | const std::string& msgctxt, |
976 | MapObjectType init_type, |
977 | |
978 | === modified file 'src/logic/map_objects/tribes/ship.cc' |
979 | --- src/logic/map_objects/tribes/ship.cc 2016-11-03 07:20:57 +0000 |
980 | +++ src/logic/map_objects/tribes/ship.cc 2016-11-03 07:38:41 +0000 |
981 | @@ -105,6 +105,10 @@ |
982 | |
983 | } // namespace |
984 | |
985 | +/** |
986 | + * The contents of 'table' are documented in |
987 | + * /data/tribes/ships/atlanteans/init.lua |
988 | + */ |
989 | ShipDescr::ShipDescr(const std::string& init_descname, const LuaTable& table) |
990 | : BobDescr(init_descname, MapObjectType::SHIP, MapObjectDescr::OwnerType::kTribe, table) { |
991 | |
992 | |
993 | === modified file 'src/logic/map_objects/tribes/trainingsite.cc' |
994 | --- src/logic/map_objects/tribes/trainingsite.cc 2016-08-04 15:49:05 +0000 |
995 | +++ src/logic/map_objects/tribes/trainingsite.cc 2016-11-03 07:38:41 +0000 |
996 | @@ -41,6 +41,10 @@ |
997 | |
998 | const uint32_t TrainingSite::training_state_multiplier_ = 12; |
999 | |
1000 | +/** |
1001 | + * The contents of 'table' are documented in |
1002 | + * /data/tribes/buildings/trainingsites/atlanteans/dungeon/init.lua |
1003 | + */ |
1004 | TrainingSiteDescr::TrainingSiteDescr(const std::string& init_descname, |
1005 | const LuaTable& table, |
1006 | const EditorGameBase& egbase) |
1007 | |
1008 | === modified file 'src/logic/map_objects/tribes/tribe_descr.cc' |
1009 | --- src/logic/map_objects/tribes/tribe_descr.cc 2016-08-04 15:49:05 +0000 |
1010 | +++ src/logic/map_objects/tribes/tribe_descr.cc 2016-11-03 07:38:41 +0000 |
1011 | @@ -51,6 +51,10 @@ |
1012 | |
1013 | namespace Widelands { |
1014 | |
1015 | +/** |
1016 | + * The contents of 'table' are documented in |
1017 | + * /data/tribes/atlanteans.lua |
1018 | + */ |
1019 | TribeDescr::TribeDescr(const LuaTable& table, const TribeBasicInfo& info, const Tribes& init_tribes) |
1020 | : name_(table.get_string("name")), descname_(info.descname), tribes_(init_tribes) { |
1021 | |
1022 | |
1023 | === modified file 'src/logic/map_objects/tribes/ware_descr.cc' |
1024 | --- src/logic/map_objects/tribes/ware_descr.cc 2016-08-04 15:49:05 +0000 |
1025 | +++ src/logic/map_objects/tribes/ware_descr.cc 2016-11-03 07:38:41 +0000 |
1026 | @@ -31,6 +31,10 @@ |
1027 | |
1028 | namespace Widelands { |
1029 | |
1030 | +/** |
1031 | + * The contents of 'table' are documented in |
1032 | + * /data/tribes/wares/armor/init.lua |
1033 | + */ |
1034 | WareDescr::WareDescr(const std::string& init_descname, const LuaTable& table) |
1035 | : MapObjectDescr(MapObjectType::WARE, table.get_string("name"), init_descname, table) { |
1036 | |
1037 | |
1038 | === modified file 'src/logic/map_objects/tribes/warehouse.cc' |
1039 | --- src/logic/map_objects/tribes/warehouse.cc 2016-08-04 15:49:05 +0000 |
1040 | +++ src/logic/map_objects/tribes/warehouse.cc 2016-11-03 07:38:41 +0000 |
1041 | @@ -231,6 +231,10 @@ |
1042 | ============================== |
1043 | */ |
1044 | |
1045 | +/** |
1046 | + * The contents of 'table' are documented in |
1047 | + * /data/tribes/buildings/warehouses/atlanteans/headquarters/init.lua |
1048 | + */ |
1049 | WarehouseDescr::WarehouseDescr(const std::string& init_descname, |
1050 | const LuaTable& table, |
1051 | const EditorGameBase& egbase) |
1052 | |
1053 | === modified file 'src/scripting/lua_root.cc' |
1054 | --- src/scripting/lua_root.cc 2016-09-27 06:30:47 +0000 |
1055 | +++ src/scripting/lua_root.cc 2016-11-03 07:38:41 +0000 |
1056 | @@ -518,8 +518,8 @@ |
1057 | |
1058 | .. class:: Tribes |
1059 | |
1060 | - This offers access to the objects available for the tribes and allows to add |
1061 | - new objects. |
1062 | + This offers access to the objects available for the tribes and allows to add |
1063 | + new objects. See :ref:`lua_tribes` for detailed documentation. |
1064 | */ |
1065 | |
1066 | const char LuaTribes::className[] = "Tribes"; |
1067 | @@ -568,12 +568,13 @@ |
1068 | */ |
1069 | |
1070 | /* RST |
1071 | - .. method:: new_constructionsite_type(table) |
1072 | - |
1073 | - Adds a new constructionsite building type. Takes a single argument, a table with |
1074 | - the descriptions. See the files in tribes/ for usage examples. |
1075 | - |
1076 | - :returns: :const:`nil` |
1077 | + .. method:: new_constructionsite_type{table} |
1078 | + |
1079 | + Adds a new constructionsite building type. Takes a single argument, a table with |
1080 | + the descriptions. See :ref:`lua_tribes_buildings_constructionsites` for detailed |
1081 | + documentation. |
1082 | + |
1083 | + :returns: :const:`0` |
1084 | */ |
1085 | int LuaTribes::new_constructionsite_type(lua_State* L) { |
1086 | if (lua_gettop(L) != 2) { |
1087 | @@ -591,12 +592,13 @@ |
1088 | } |
1089 | |
1090 | /* RST |
1091 | - .. method:: new_dismantlesite_type(table) |
1092 | - |
1093 | - Adds a new disnamtlesite building type. Takes a single argument, a table with |
1094 | - the descriptions. See the files in tribes/ for usage examples. |
1095 | - |
1096 | - :returns: :const:`nil` |
1097 | + .. method:: new_dismantlesite_type{table} |
1098 | + |
1099 | + Adds a new disnamtlesite building type. Takes a single argument, a table with |
1100 | + the descriptions. See :ref:`lua_tribes_buildings_dismantlesites` for detailed |
1101 | + documentation. |
1102 | + |
1103 | + :returns: :const:`0` |
1104 | */ |
1105 | int LuaTribes::new_dismantlesite_type(lua_State* L) { |
1106 | if (lua_gettop(L) != 2) { |
1107 | @@ -614,12 +616,13 @@ |
1108 | } |
1109 | |
1110 | /* RST |
1111 | - .. method:: new_militarysite_type(table) |
1112 | - |
1113 | - Adds a new militarysite building type. Takes a single argument, a table with |
1114 | - the descriptions. See the files in tribes/ for usage examples. |
1115 | - |
1116 | - :returns: :const:`nil` |
1117 | + .. method:: new_militarysite_type{table} |
1118 | + |
1119 | + Adds a new militarysite building type. Takes a single argument, a table with |
1120 | + the descriptions. See :ref:`lua_tribes_buildings_militarysites` for detailed |
1121 | + documentation. |
1122 | + |
1123 | + :returns: :const:`0` |
1124 | */ |
1125 | int LuaTribes::new_militarysite_type(lua_State* L) { |
1126 | if (lua_gettop(L) != 2) { |
1127 | @@ -637,12 +640,13 @@ |
1128 | } |
1129 | |
1130 | /* RST |
1131 | - .. method:: new_productionsite_type(table) |
1132 | - |
1133 | - Adds a new productionsite building type. Takes a single argument, a table with |
1134 | - the descriptions. See the files in tribes/ for usage examples. |
1135 | - |
1136 | - :returns: :const:`nil` |
1137 | + .. method:: new_productionsite_type{table} |
1138 | + |
1139 | + Adds a new productionsite building type. Takes a single argument, a table with |
1140 | + the descriptions. See :ref:`lua_tribes_buildings_productionsites` for detailed |
1141 | + documentation. |
1142 | + |
1143 | + :returns: :const:`0` |
1144 | */ |
1145 | int LuaTribes::new_productionsite_type(lua_State* L) { |
1146 | if (lua_gettop(L) != 2) { |
1147 | @@ -660,12 +664,13 @@ |
1148 | } |
1149 | |
1150 | /* RST |
1151 | - .. method:: new_trainingsite_type(table) |
1152 | - |
1153 | - Adds a new trainingsite building type. Takes a single argument, a table with |
1154 | - the descriptions. See the files in tribes/ for usage examples. |
1155 | - |
1156 | - :returns: :const:`nil` |
1157 | + .. method:: new_trainingsite_type{table} |
1158 | + |
1159 | + Adds a new trainingsite building type. Takes a single argument, a table with |
1160 | + the descriptions. See :ref:`lua_tribes_buildings_trainingsites` for detailed |
1161 | + documentation. |
1162 | + |
1163 | + :returns: :const:`0` |
1164 | */ |
1165 | int LuaTribes::new_trainingsite_type(lua_State* L) { |
1166 | if (lua_gettop(L) != 2) { |
1167 | @@ -683,12 +688,13 @@ |
1168 | } |
1169 | |
1170 | /* RST |
1171 | - .. method:: new_warehouse_type(table) |
1172 | - |
1173 | - Adds a new warehouse building type. Takes a single argument, a table with |
1174 | - the descriptions. See the files in tribes/ for usage examples. |
1175 | - |
1176 | - :returns: :const:`nil` |
1177 | + .. method:: new_warehouse_type{table} |
1178 | + |
1179 | + Adds a new warehouse building type. Takes a single argument, a table with |
1180 | + the descriptions. See :ref:`lua_tribes_buildings_warehouses` for detailed |
1181 | + documentation. |
1182 | + |
1183 | + :returns: :const:`0` |
1184 | */ |
1185 | int LuaTribes::new_warehouse_type(lua_State* L) { |
1186 | if (lua_gettop(L) != 2) { |
1187 | @@ -706,12 +712,13 @@ |
1188 | } |
1189 | |
1190 | /* RST |
1191 | - .. method:: new_immovable_type(table) |
1192 | - |
1193 | - Adds a new immovable type. Takes a single argument, a table with |
1194 | - the descriptions. See the files in tribes/ for usage examples. |
1195 | - |
1196 | - :returns: :const:`nil` |
1197 | + .. method:: new_immovable_type{table} |
1198 | + |
1199 | + Adds a new immovable type. Takes a single argument, a table with |
1200 | + the descriptions. See :ref:`lua_tribes_immovables` for detailed |
1201 | + documentation. |
1202 | + |
1203 | + :returns: :const:`0` |
1204 | */ |
1205 | int LuaTribes::new_immovable_type(lua_State* L) { |
1206 | if (lua_gettop(L) != 2) { |
1207 | @@ -728,12 +735,13 @@ |
1208 | } |
1209 | |
1210 | /* RST |
1211 | - .. method:: new_ship_type(table) |
1212 | - |
1213 | - Adds a new ship type. Takes a single argument, a table with |
1214 | - the descriptions. See the files in tribes/ for usage examples. |
1215 | - |
1216 | - :returns: :const:`nil` |
1217 | + .. method:: new_ship_type{table} |
1218 | + |
1219 | + Adds a new ship type. Takes a single argument, a table with |
1220 | + the descriptions. See :ref:`lua_tribes_ships` for detailed |
1221 | + documentation. |
1222 | + |
1223 | + :returns: :const:`0` |
1224 | */ |
1225 | int LuaTribes::new_ship_type(lua_State* L) { |
1226 | if (lua_gettop(L) != 2) { |
1227 | @@ -750,12 +758,13 @@ |
1228 | } |
1229 | |
1230 | /* RST |
1231 | - .. method:: new_ware_type(table) |
1232 | - |
1233 | - Adds a new ware type. Takes a single argument, a table with |
1234 | - the descriptions. See the files in tribes/ for usage examples. |
1235 | - |
1236 | - :returns: :const:`nil` |
1237 | + .. method:: new_ware_type{table} |
1238 | + |
1239 | + Adds a new ware type. Takes a single argument, a table with |
1240 | + the descriptions. See :ref:`lua_tribes_wares` for detailed |
1241 | + documentation. |
1242 | + |
1243 | + :returns: :const:`0` |
1244 | */ |
1245 | int LuaTribes::new_ware_type(lua_State* L) { |
1246 | if (lua_gettop(L) != 2) { |
1247 | @@ -772,12 +781,12 @@ |
1248 | } |
1249 | |
1250 | /* RST |
1251 | - .. method:: new_carrier_type(table) |
1252 | - |
1253 | - Adds a new carrier worker type. Takes a single argument, a table with |
1254 | - the descriptions. See the files in tribes/ for usage examples. |
1255 | - |
1256 | - :returns: :const:`nil` |
1257 | + .. method:: new_carrier_type{table} |
1258 | + |
1259 | + Adds a new carrier worker type. Takes a single argument, a table with |
1260 | + the descriptions. See the files in tribes/ for usage examples. |
1261 | + |
1262 | + :returns: :const:`nil` |
1263 | */ |
1264 | int LuaTribes::new_carrier_type(lua_State* L) { |
1265 | if (lua_gettop(L) != 2) { |
1266 | @@ -795,12 +804,12 @@ |
1267 | } |
1268 | |
1269 | /* RST |
1270 | - .. method:: new_soldier_type(table) |
1271 | - |
1272 | - Adds a new soldier worker type. Takes a single argument, a table with |
1273 | - the descriptions. See the files in tribes/ for usage examples. |
1274 | - |
1275 | - :returns: :const:`nil` |
1276 | + .. method:: new_soldier_type{table} |
1277 | + |
1278 | + Adds a new soldier worker type. Takes a single argument, a table with |
1279 | + the descriptions. See the files in tribes/ for usage examples. |
1280 | + |
1281 | + :returns: :const:`nil` |
1282 | */ |
1283 | int LuaTribes::new_soldier_type(lua_State* L) { |
1284 | if (lua_gettop(L) != 2) { |
1285 | @@ -818,12 +827,12 @@ |
1286 | } |
1287 | |
1288 | /* RST |
1289 | - .. method:: new_worker_type(table) |
1290 | - |
1291 | - Adds a new worker type. Takes a single argument, a table with |
1292 | - the descriptions. See the files in tribes/ for usage examples. |
1293 | - |
1294 | - :returns: :const:`nil` |
1295 | + .. method:: new_worker_type{table} |
1296 | + |
1297 | + Adds a new worker type. Takes a single argument, a table with |
1298 | + the descriptions. See the files in tribes/ for usage examples. |
1299 | + |
1300 | + :returns: :const:`nil` |
1301 | */ |
1302 | int LuaTribes::new_worker_type(lua_State* L) { |
1303 | if (lua_gettop(L) != 2) { |
1304 | @@ -841,12 +850,13 @@ |
1305 | } |
1306 | |
1307 | /* RST |
1308 | - .. method:: new_tribe(table) |
1309 | - |
1310 | - Adds a new tribe. Takes a single argument, a table with |
1311 | - the descriptions. See the files in tribes/ for usage examples. |
1312 | - |
1313 | - :returns: :const:`nil` |
1314 | + .. method:: new_tribe{table} |
1315 | + |
1316 | + Adds a new tribe. Takes a single argument, a table with |
1317 | + the descriptions. See :ref:`lua_tribes_<tribename>.lua` for detailed |
1318 | + documentation. |
1319 | + |
1320 | + :returns: :const:`0` |
1321 | */ |
1322 | int LuaTribes::new_tribe(lua_State* L) { |
1323 | if (lua_gettop(L) != 2) { |
Continuous integration builds have changed state:
Travis build 1417. State: passed. Details: https:/ /travis- ci.org/ widelands/ widelands/ builds/ 168569023. /ci.appveyor. com/project/ widelands- dev/widelands/ build/_ widelands_ dev_widelands_ sphinx_ buildings- 1258.
Appveyor build 1258. State: success. Details: https:/