Merge lp:~widelands-dev/widelands/fh1-tutorial2 into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8558
Proposed branch: lp:~widelands-dev/widelands/fh1-tutorial2
Merge into: lp:widelands
Diff against target: 277 lines (+64/-70)
1 file modified
data/campaigns/tutorial02_warfare.wmf/scripting/texts.lua (+64/-70)
To merge this branch: bzr merge lp:~widelands-dev/widelands/fh1-tutorial2
Reviewer Review Type Date Requested Status
kaputtnik (community) testing Approve
Notabilis Approve
Review via email: mp+336055@code.launchpad.net

Commit message

Converted Tutorial 2 to new font renderer.

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

1 of the list bullets should be an arrow.

Revision history for this message
Notabilis (notabilis27) wrote :

Diff looks good. Testing with the modified file in trunk (and an added arrow) worked fine.

review: Approve
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 3042. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/328256837.
Appveyor build 2850. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fh1_tutorial2-2850.

Revision history for this message
kaputtnik (franku) wrote :

LGTM :-)

Anything against merging this?

review: Approve (testing)
Revision history for this message
GunChleoc (gunchleoc) wrote :

Thanks for the review :)

@bunnybot merge

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 3061. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/329616067.
Appveyor build 2868. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fh1_tutorial2-2868.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Refusing to merge, since Travis is not green. Use @bunnybot merge force for merging anyways.

Travis build 3061. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/329616067.

Revision history for this message
kaputtnik (franku) wrote :

now forcing

@bunnybot merge force

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 3071. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/330741796.
Appveyor build 2878. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fh1_tutorial2-2878.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/campaigns/tutorial02_warfare.wmf/scripting/texts.lua'
2--- data/campaigns/tutorial02_warfare.wmf/scripting/texts.lua 2017-01-06 14:17:42 +0000
3+++ data/campaigns/tutorial02_warfare.wmf/scripting/texts.lua 2018-01-19 09:25:30 +0000
4@@ -6,8 +6,7 @@
5 -- Some formating functions
6 -- =========================
7
8-include "scripting/formatting.lua"
9-include "scripting/format_scenario.lua"
10+include "scripting/richtext_scenarios.lua"
11
12 -- We want the soldier here so we can get some actual stats.
13 local tribe = wl.Game():get_tribe_description("barbarians")
14@@ -16,13 +15,22 @@
15 local empire_tribe = wl.Game():get_tribe_description("empire")
16 local empire_soldier = wl.Game():get_worker_description(empire_tribe.soldier)
17
18+function h2_image(imagepath, text)
19+ return
20+ div("width=100%",
21+ div(p(vspace(12) .. img(imagepath) .. space(6))) ..
22+ div(p(space(6))) ..
23+ div("width=*", h2(text))
24+ )
25+end
26+
27 -- =============
28 -- Texts below
29 -- =============
30
31 introduction = {
32 title = _"Introduction",
33- body = rt(
34+ body = (
35 h1(_"Soldiers, Training and Warfare") ..
36 p(_[[In this scenario, I’m going to tell you about soldiers, their training and their profession: warfare. Although Widelands is about building up, not burning down, there is an enemy you sometimes have to defeat. Yet warfare is mainly focused on economics, not on military strategies, and its mechanics deserve explanation.]]) ..
37 p(_[[I’ve set up a small village that contains the most important buildings. You also have enough wares, so you do not have to take care of your weapons production. In a real game, you will not have this luxury.]])
38@@ -33,91 +41,84 @@
39 abilities = {
40 position = "topright",
41 title = _"Soldiers’ abilities",
42- body = rt(
43+ body = (
44 p(_[[New soldiers are created differently from normal workers: recruits will walk from a warehouse (or your headquarters) to the barracks where they will receive some basic training and become soldiers. Basic Barbarian soldiers do not use armor, they only need an ax.]]) ..
45 p(_[[Take a look at the soldiers that are on their way to our military buildings. They look different from normal workers: they have a health bar over their head that displays their remaining health, and they have four symbols, which symbolize the individual soldier’s current levels in the four different categories: health, attack, defense and evade.]]) ..
46 -- TRANSLATORS: the current stats are: 3 health, 5 attack, 0 defense, 2 evade.
47- p((_[[If a Barbarian soldier is fully trained, he has level %1% health, level %2% attack, level %3% defense and level %4% evade. This is one fearsome warrior then! The individual abilities have the following meaning:]]):bformat(soldier.max_health_level, soldier.max_attack_level, soldier.max_defense_level, soldier.max_evade_level))
48- ) ..
49- rt("image=tribes/workers/barbarians/soldier/health_level0.png", h2(_"Health:")) ..
50- -- TRANSLATORS: the current stats are: 13000 health, 2800 health gain.
51- rt(p((_[[The total life of a soldier. A Barbarian soldier starts with %1% health, and he will gain %2% health with each health level.]]):bformat(soldier.base_health, soldier.health_incr_per_level))) ..
52- rt("image=tribes/workers/barbarians/soldier/attack_level0.png", h2(_"Attack:")) ..
53- -- TRANSLATORS: the current stats are: 1400 damage, gains 850 damage points.
54- rt(p(_[[The amount of damage a soldier will inflict on the enemy when an attack is successful. A Barbarian soldier with attack level 0 inflicts ~%1% points of health damage when he succeeds in hitting an enemy. For each attack level, he gains %2% damage points.]]):bformat(soldier.base_min_attack + (soldier.base_max_attack - soldier.base_min_attack) / 2, soldier.attack_incr_per_level)) ..
55- -- The Atlanteans' image, because the Barbarian one has a white background
56- rt("image=tribes/workers/atlanteans/soldier/defense_level0.png", h2(_"Defense:")) ..
57- -- TRANSLATORS: the current stats are: 3%. The calculated health value is 3395
58- -- TRANSLATORS: The last two %% after the placeholder are the percent symbol.
59- rt(p(_[[The defense is the percentage that is subtracted from the attack value. The Barbarians cannot train in this skill and therefore have always defense level 0, which means that the damage is always reduced by %1%%%. If an attacker with an attack value of 3500 points hits a Barbarian soldier, the Barbarian will lose 3500·%2%%% = %3% health.]]):bformat(soldier.base_defense, (100 - soldier.base_defense), 3500 * (100 - soldier.base_defense) / 100)) ..
60- rt("image=tribes/workers/barbarians/soldier/evade_level0.png", h2(_"Evade:")) ..
61- -- TRANSLATORS: the current stats are: 25% evade, increases in steps of 15%.
62- -- TRANSLATORS: The last two %% after the placeholder are the percent symbol.
63- rt(p(_[[Evade is the chance that the soldier is able to dodge an attack. A level 0 Barbarian has a %1%%% chance to evade an attack, and this increases in steps of %2%%% for each level.]]):bformat(soldier.base_evade, soldier.evade_incr_per_level))
64+ p((_[[If a Barbarian soldier is fully trained, he has level %1% health, level %2% attack, level %3% defense and level %4% evade. This is one fearsome warrior then! The individual abilities have the following meaning:]]):bformat(soldier.max_health_level, soldier.max_attack_level, soldier.max_defense_level, soldier.max_evade_level)) ..
65+ h2_image("tribes/workers/barbarians/soldier/health_level0.png", _"Health:") ..
66+ -- TRANSLATORS: the current stats are: 13000 health, 2800 health gain.
67+ p(_[[The total life of a soldier. A Barbarian soldier starts with %1% health, and he will gain %2% health with each health level.]]):bformat(soldier.base_health, soldier.health_incr_per_level) ..
68+ h2_image("tribes/workers/barbarians/soldier/attack_level0.png", _"Attack:") ..
69+ -- TRANSLATORS: the current stats are: 1400 damage, gains 850 damage points.
70+ p(_[[The amount of damage a soldier will inflict on the enemy when an attack is successful. A Barbarian soldier with attack level 0 inflicts ~%1% points of health damage when he succeeds in hitting an enemy. For each attack level, he gains %2% damage points.]]):bformat(soldier.base_min_attack + (soldier.base_max_attack - soldier.base_min_attack) / 2, soldier.attack_incr_per_level) ..
71+ -- The Atlanteans' image, because the Barbarian one has a white background
72+ h2_image("tribes/workers/atlanteans/soldier/defense_level0.png", _"Defense:") ..
73+ -- TRANSLATORS: the current stats are: 3%. The calculated health value is 3395
74+ -- TRANSLATORS: The last two %% after the placeholder are the percent symbol.
75+ p(_[[The defense is the percentage that is subtracted from the attack value. The Barbarians cannot train in this skill and therefore have always defense level 0, which means that the damage is always reduced by %1%%%. If an attacker with an attack value of 3500 points hits a Barbarian soldier, the Barbarian will lose 3500·%2%%% = %3% health.]]):bformat(soldier.base_defense, (100 - soldier.base_defense), 3500 * (100 - soldier.base_defense) / 100) ..
76+ h2_image("tribes/workers/barbarians/soldier/evade_level0.png", _"Evade:") ..
77+ -- TRANSLATORS: the current stats are: 25% evade, increases in steps of 15%.
78+ -- TRANSLATORS: The last two %% after the placeholder are the percent symbol.
79+ p(_[[Evade is the chance that the soldier is able to dodge an attack. A level 0 Barbarian has a %1%%% chance to evade an attack, and this increases in steps of %2%%% for each level.]]):bformat(soldier.base_evade, soldier.evade_incr_per_level))
80 }
81
82 battlearena1 = {
83 position = "topright",
84 title = _"The Battle Arena",
85- body = rt(
86+ body = (
87 p(_[[Now I have talked about training and levels. Let me elaborate on that.]]) ..
88 p(_[[A newly created soldier has no experience and is not very good at fighting. To make him stronger, you can build training sites.]]) ..
89 p(_[[One of these training sites is the battle arena. It is a big and expensive building, and it trains soldiers in evade. Since soldiers get very hungry during their workout, this building needs a lot of food and strong beer. In a real game, you should have a good infrastructure before you build it.]]) ..
90- paragraphdivider() ..
91- listitem_bullet(_[[To see evade training in action, build a battle arena.]]) ..
92- "</p><p font-size=8><br></p>" ..
93+ li(_[[To see evade training in action, build a battle arena.]]) ..
94 p(_[[While we’re waiting for the battle arena, you’ll probably notice some soldiers walking around. They are automatically exchanged from time to time. I’ll teach you about that later.]])
95 ),
96 h = 400,
97 obj_name = "build_battlearena",
98 obj_title = _"Build a battle arena",
99- obj_body = rt(
100- paragraphdivider() ..
101- listitem_bullet(_[[Build a battle arena. It is a big building.]]) ..
102- listitem_arrow(_[[Since the construction will take some time, you can change the game speed using Page Up and Page Down.]])
103+ obj_body = (
104+ li(_[[Build a battle arena. It is a big building.]]) ..
105+ li_arrow(_[[Since the construction will take some time, you can change the game speed using Page Up and Page Down.]])
106 )
107 }
108
109 battlearena2 = {
110 position = "topright",
111 title = _"The Battle Arena",
112- body = rt(
113+ body =
114 h1(_"The Battle Arena Has Been Constructed") ..
115 p(_[[Very good. Our battle arena has been finished, and the soldiers are already walking towards it.]]) ..
116 -- Not perfectly correct (some training steps need either bread or meat), but we do not want to confuse new players
117 p(_[[The needed wares are also delivered there. For successful training, you need pitta bread and strong beer, as well as either fish or meat.]] .. " " ..
118 _[[For more information, you can have a look at the building’s help window, accessible via the question mark in every building’s window.]]) ..
119- p(_[[To learn how far your soldiers have progressed in their training, you can have a look at their icons. They are modified by red dots:]])
120- ) ..
121- rt("image=tribes/workers/barbarians/soldier/evade_level0.png", p(_[[No red dots means that the soldier is not trained, so he has level 0. All your new recruits have this.]])) ..
122- rt("image=tribes/workers/barbarians/soldier/evade_level1.png", p(_[[With every successful training step, your soldier becomes stronger. This is indicated by a red dot. This soldier is on level 1 in evade training.]])) ..
123- rt("image=tribes/workers/barbarians/soldier/evade_level2.png", p(_[[When your soldier has reached the highest possible level (in this case level 2), this is indicated by a white background color.]])),
124+ p(_[[To learn how far your soldiers have progressed in their training, you can have a look at their icons. They are modified by red dots:]]) ..
125+ li_image("tribes/workers/barbarians/soldier/evade_level0.png", _[[No red dots means that the soldier is not trained, so he has level 0. All your new recruits have this.]]) ..
126+ li_image("tribes/workers/barbarians/soldier/evade_level1.png", _[[With every successful training step, your soldier becomes stronger. This is indicated by a red dot. This soldier is on level 1 in evade training.]]) ..
127+ li_image("tribes/workers/barbarians/soldier/evade_level2.png", _[[When your soldier has reached the highest possible level (in this case level 2), this is indicated by a white background color.]]),
128 h = 450
129 }
130
131 trainingcamp1 = {
132 position = "topright",
133 title = _"The Training Camp",
134- body = rt(
135+ body = (
136 h1(_"The Training Camp") ..
137 p(_[[There is a second training site: the training camp. It is a big building too, and to complement the battle arena, it trains attack and health (remember, the Barbarian soldiers cannot be trained in defense).]]) ..
138- paragraphdivider() ..
139- listitem_bullet(_[[Build a training camp.]])
140+ li(_[[Build a training camp.]])
141 ),
142 h = 300,
143 obj_name = "build_trainingcamp",
144 obj_title = _"Build a training camp",
145- obj_body = rt(
146+ obj_body = (
147 p(_[[The battle arena only trains the soldiers in evade. To get the strongest possible soldier, you also need to build a training camp, which trains them in attack and health.]]) ..
148- paragraphdivider() ..
149- listitem_bullet(_[[Build a training camp.]])
150+ li(_[[Build a training camp.]])
151 )
152 }
153
154 trainingcamp2 = {
155 position = "topright",
156 title = _"The Training Camp",
157- body = rt(
158+ body = (
159 p(_[[Great, our training camp has now been finished, too. Now nothing will hinder us from getting the strongest warriors the world has ever seen.]]) ..
160 p(_[[To train in the training camp, our soldiers need food like in the battle arena, but no strong beer. Instead, they need different axes for attack training and helmets for health training.]]) ..
161 p(_[[This equipment is produced in smithies out of coal, iron, and sometimes gold. You will learn more about this in the second scenario of the Barbarian campaign.]]) ..
162@@ -128,7 +129,7 @@
163 heroes_rookies = {
164 position = "topright",
165 title = _"Heroes and Rookies",
166- body = rt(
167+ body = (
168 h1(_"Heroes and Rookies") ..
169 p(_[[While our soldiers are training, let me tell you what we can do with them.]]) ..
170 p(_[[In every military building, you can set the preference for heroes (trained soldiers) or rookies. From time to time, a soldier will walk out of the building and be replaced by a stronger/weaker one automatically – this is what you saw earlier.]]) ..
171@@ -140,58 +141,53 @@
172 soldier_capacity = {
173 position = "topright",
174 title = _"Soldier capacity",
175- body = rt(
176+ body = (
177 h1(_"Adjusting the number of soldiers") ..
178 p(_[[There is another way how you can control the strength of a military building: by the number of soldiers stationed there. Just click on the arrow buttons to decrease or increase the desired number of soldiers. Every building has a maximum capacity. In case of the barrier, it is five, for example.]]) ..
179 p(_[[If you wish to send a certain soldier away, you can simply click on it. It will then be replaced by another soldier.]]) ..
180 p(_[[Let me also describe what the numbers in the statistics string mean. This string can contain up to three numbers, e.g. ‘1 (+5) soldier (+2)’.]]) ..
181- paragraphdivider() ..
182- listitem_bullet(_[[The first number describes how many soldiers are currently in this building. In this example, only one soldier is left inside (each military building is always guarded by at least one soldier).]]) ..
183- listitem_bullet(_[[The second number tells you how many additional soldiers reside in this building, but are currently outside. The five soldiers may be attacking an enemy. They will return when they have been successful.]]) ..
184- listitem_bullet(_[[The third number indicates the missing soldiers. From the eight soldiers (1 + 5 + 2) you wish to have here, two may have died. They will be replaced by new soldiers from your warehouse, if possible.]])
185+ li(_[[The first number describes how many soldiers are currently in this building. In this example, only one soldier is left inside (each military building is always guarded by at least one soldier).]]) ..
186+ li(_[[The second number tells you how many additional soldiers reside in this building, but are currently outside. The five soldiers may be attacking an enemy. They will return when they have been successful.]]) ..
187+ li(_[[The third number indicates the missing soldiers. From the eight soldiers (1 + 5 + 2) you wish to have here, two may have died. They will be replaced by new soldiers from your warehouse, if possible.]])
188 )
189 }
190
191 dismantle = {
192 position = "topright",
193 title = _"Dismantle your sentry",
194- body = rt(
195+ body = (
196 h1(_"Dismantling military buildings") ..
197 p(_[[You can only reduce the number of soldiers to one. The last soldier of a building will never come out (unless this building is attacked). If you want to have your soldier elsewhere, you will have to dismantle or burn down the building.]]) ..
198 p(_[[However, destroying a military building is always linked with a risk: the land is still yours, but it is no longer protected. Any enemy that builds his own military sites can take over that land without a fight, causing your buildings to burst into flames. Furthermore, some parts of the land can now be hidden under the fog of war. You should therefore only dismantle military buildings deep inside your territory where you are safe from enemies.]]) ..
199 p(_[[Have you seen your sentry? Since it cannot contain many soldiers and is next to a stronger barrier, it is rather useless.]]) ..
200- paragraphdivider() ..
201 -- TRANSLATORS: 'it' refers to the Barbarian sentry
202- listitem_bullet(_[[Dismantle it.]])
203- ) ..
204- rt(p(_[[You can also use this opportunity to become familiar with the other options: the heroes/rookies preference and the capacity.]])),
205+ li(_[[Dismantle it.]]) ..
206+ p(_[[You can also use this opportunity to become familiar with the other options: the heroes/rookies preference and the capacity.]])),
207 obj_name = "dismantle_sentry",
208 obj_title = _"Dismantle your north-western sentry",
209- obj_body = rt(
210+ obj_body = (
211 p(_[[You can control the number of soldiers stationed at a military site with the arrow buttons. If you want to get even your last soldier out, you will have to destroy it. However, it then will no longer protect your territory, which will make it vulnerable to hostile attacks.]]) ..
212- paragraphdivider() ..
213- listitem_bullet(_[[Dismantle your sentry in the north-west, next to the barrier.]])
214+ li(_[[Dismantle your sentry in the north-west, next to the barrier.]])
215 )
216 }
217
218 fortress_enhancement = {
219 position = "topright",
220 title = _"Enhance Your Fortress",
221- body = rt(
222+ body = (
223 h1(_"Enhancing Buildings") ..
224 p(_[[Well done. Now you know how to draw back your soldiers from the places where you don’t need them. It is time to tell you how to reinforce your front line.]]) ..
225 p(_[[Your fortress is already quite strong and conquers a lot of space. But there is an even bigger building: the citadel.]]) ..
226 p(_[[Citadels can’t be built directly. Instead, you’ll have to construct a fortress first and then enhance it to a citadel. To do so, click on the fortress, then choose the ‘Enhance to Citadel’ button.]]) ..
227 p(_[[Your soldiers will leave the fortress while the construction is going on. This means that your fortress will lose its military influence, as I described above.]]) ..
228- listitem_bullet(_[[Enhance your fortress to a citadel now.]])
229+ li(_[[Enhance your fortress to a citadel now.]])
230 ),
231 obj_name = "enhance_fortress",
232 obj_title = _"Enhance your fortress to a citadel",
233- obj_body = rt(
234+ obj_body = (
235 h1(_"Enhance Your Fortress") ..
236- paragraphdivider() ..
237- listitem_bullet(_[[Enhance your fortress to a mighty citadel.]]) ..
238- listitem_arrow(_[[The citadel can house 12 soldiers, and it is the biggest military building the Barbarians can build. It also costs a lot of resources and takes a long time to build. It is most suited to guard strategically important points like constricted points or mountains.]])
239+ li(_[[Enhance your fortress to a mighty citadel.]]) ..
240+ li_arrow(_[[The citadel can house 12 soldiers, and it is the biggest military building the Barbarians can build. It also costs a lot of resources and takes a long time to build. It is most suited to guard strategically important points like constricted points or mountains.]])
241 )
242 }
243
244@@ -199,27 +195,25 @@
245 position = "topright",
246 field = wl.Game().map:get_field(29,4), -- show the lost territory
247 title = _"Defeat your Enemy",
248- body = rt(
249+ body = (
250 h1(_"Defeat the Enemy") ..
251 p(_[[Great work, the citadel is finished. But what’s that? A hostile tribe has settled next to us while the citadel was under construction! Do you see how they took away a part of our land? And our lumberjack has now lost his place of work. This is what I was talking about. Let’s take our land back and defeat the enemy!]]) ..
252 p(_[[To attack a building, click on its doors, choose the number of soldiers that you wish to send and click on the ‘Attack’ button.]] .. " " .. _[[Your soldiers will come from all nearby military buildings. Likewise, the defenders will come from all nearby military buildings of the enemy and intercept your forces.]]) ..
253- paragraphdivider() ..
254- listitem_bullet(_[[Attack and conquer all military buildings of the enemy and destroy their headquarters.]])
255+ li(_[[Attack and conquer all military buildings of the enemy and destroy their headquarters.]])
256 ),
257 h = 350,
258 obj_name = "defeated_the_empire",
259 obj_title = _"Defeat the enemy tribe",
260- obj_body = rt(
261+ obj_body = (
262 h1(_"Defeat Your Enemy") ..
263- paragraphdivider() ..
264- listitem_bullet(_[[Defeat the nearby enemy.]]) ..
265- listitem_arrow(_[[To attack a building, click on its doors, choose the number of soldiers that you wish to send and click on the ‘Attack’ button.]])
266+ li(_[[Defeat the nearby enemy.]]) ..
267+ li_arrow(_[[To attack a building, click on its doors, choose the number of soldiers that you wish to send and click on the ‘Attack’ button.]])
268 )
269 }
270
271 conclude_tutorial = {
272 title = _"Conclusion",
273- body = rt(
274+ body = (
275 h1(_"Conclusion") ..
276 p(_[[Thank you for playing this tutorial. I hope you enjoyed it and you learned how to create and train soldiers, how to control where they go and how to defeat an enemy. Did you see how easily you could overwhelm your enemy? Having trained soldiers is a huge advantage.]]) ..
277 p(_[[But a war is expensive, and not always the path leading to the goal. When setting up a new game, you can also choose peaceful win conditions. You should definitely try them out, they’re worth it.]]) ..

Subscribers

People subscribed via source and target branches

to status/vote changes: