widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #13586
[Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
hessenfarmer has proposed merging lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands.
Commit message:
fixes bug #1770901
removed sentry
added Temple of vesta (warehouse with HQ properties)
set AI of P3 (julia/vesta) to "empty"
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1770901 in widelands: "monastery AI random misbehavior"
https://bugs.launchpad.net/widelands/+bug/1770901
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/empire04_bugfix/+merge/347308
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands.
=== modified file 'data/campaigns/emp04.wmf/player_names'
--- data/campaigns/emp04.wmf/player_names 2018-01-10 21:08:05 +0000
+++ data/campaigns/emp04.wmf/player_names 2018-06-01 18:15:27 +0000
@@ -12,11 +12,11 @@
[player_2]
name="Runeth"
tribe="barbarians"
-ai=
+ai="normal"
closeable="false"
[player_3]
name="Vesta"
tribe="empire"
-ai=
+ai="empty"
closeable="false"
=== modified file 'data/campaigns/emp04.wmf/scripting/helper_functions.lua'
--- data/campaigns/emp04.wmf/scripting/helper_functions.lua 2017-12-27 15:19:45 +0000
+++ data/campaigns/emp04.wmf/scripting/helper_functions.lua 2018-06-01 18:15:27 +0000
@@ -28,7 +28,7 @@
for x=32, 90 do
for y=20, 175 do
local field = map:get_field(x,y)
- if field.owner == p2 and p1:sees_field(field) then
+ if field.owner == p2 and p1:sees_field(field) then
return field
end
end
=== modified file 'data/campaigns/emp04.wmf/scripting/init.lua'
--- data/campaigns/emp04.wmf/scripting/init.lua 2018-05-15 04:52:49 +0000
+++ data/campaigns/emp04.wmf/scripting/init.lua 2018-06-01 18:15:27 +0000
@@ -20,3 +20,4 @@
map = wl.Game().map
mv = wl.ui.MapView()
sf = map.player_slots[1].starting_field
+
=== modified file 'data/campaigns/emp04.wmf/scripting/mission_thread.lua'
--- data/campaigns/emp04.wmf/scripting/mission_thread.lua 2017-12-24 16:09:44 +0000
+++ data/campaigns/emp04.wmf/scripting/mission_thread.lua 2018-06-01 18:15:27 +0000
@@ -24,6 +24,7 @@
p1:allow_buildings("all")
p1:forbid_buildings{"empire_farm", "empire_mill", "empire_brewery", "empire_trainingcamp", "empire_colosseum"}
o.done = true
+
campaign_message_box(amalea_3)
run(clear_roads)
run(quarries_lumberjacks)
@@ -395,21 +396,6 @@
sleep(2500)
end
- local field_well = map:get_field(17, 182)
- place_building_in_region(p3, "empire_well", {field_well})
-
- local field_brewery = map:get_field(19, 183)
- place_building_in_region(p3, "empire_brewery", {field_brewery})
-
- local fiel_mill = map:get_field(18, 184)
- place_building_in_region(p3, "empire_mill", {fiel_mill})
-
- local field_warehouse = map:get_field(21, 186)
- place_building_in_region(p3, "empire_warehouse", {field_warehouse}, {workers = {empire_carrier = 0, empire_recruit = 0}})
-
- local field_sentry = map:get_field(19, 185)
- place_building_in_region(p3, "empire_sentry", {field_sentry}, {soldiers = {[{0,0,0,0}] = 1}})
-
o.done = true
sleep(4000)
@@ -425,7 +411,7 @@
scroll_to_map_pixel(prior_center)
local hq = p1:get_buildings("empire_headquarters")
- local wh = p3:get_buildings("empire_warehouse")
+ local wh = p3:get_buildings("empire_temple_of_vesta")
while not ((hq[1]:get_wares("wheat") > 34 and hq[1]:get_wares("wine") > 14) or p3.defeated) do sleep(4000) end
if p3.defeated then
o1.done = true
@@ -446,17 +432,30 @@
p1:allow_buildings{"empire_mill", "empire_brewery"}
campaign_message_box(julia_1)
- -- replace Julias buildings with similar ones of the player
+ --remove all workers from p3 to avoid having them wandering around
+ field_brewery.immovable:set_workers("empire_brewer", 0)
+ field_mill.immovable:set_workers("empire_miller", 0)
+ wh[1]:set_workers("empire_carrier", 0)
+ wh[1]:set_workers("empire_recruit", 0)
+ field_well.immovable:set_workers("empire_carrier", 0)
+ r1:set_workers("empire_carrier", 0)
+ r2:set_workers("empire_carrier", 0)
+ r3:set_workers("empire_carrier", 0)
+ r4:set_workers("empire_carrier", 0)
+ --replace Julias buildings with similar ones of the player
field_well.immovable:remove()
field_brewery.immovable:remove()
- fiel_mill.immovable:remove()
+ field_mill.immovable:remove()
field_warehouse.immovable:remove()
- field_sentry.immovable:remove()
place_building_in_region(p1, "empire_well", {field_well})
place_building_in_region(p1, "empire_brewery", {field_brewery})
- place_building_in_region(p1, "empire_mill", {fiel_mill})
- place_building_in_region(p1, "empire_warehouse", {field_warehouse}, {wares = {water = 30, flour = 30, beer = 40,}})
- place_building_in_region(p1, "empire_sentry", {field_sentry})
+ place_building_in_region(p1, "empire_mill", {field_mill})
+ place_building_in_region(p1, "empire_temple_of_vesta", {field_warehouse}, {wares = {water = 30, flour = 30, beer = 40,}})
+ connected_road(p1, field_warehouse.immovable.flag, "l, tl", true)
+ connected_road(p1, field_mill.immovable.flag, "tr, r", true)
+ connected_road(p1, field_mill.immovable.flag, "l, tl, tr", true)
+ connected_road(p1, field_mill.immovable.flag, "br, r", true)
+
campaign_message_box(amalea_12)
campaign_message_box(saledus_3)
=== modified file 'data/campaigns/emp04.wmf/scripting/starting_conditions.lua'
--- data/campaigns/emp04.wmf/scripting/starting_conditions.lua 2017-12-18 06:26:49 +0000
+++ data/campaigns/emp04.wmf/scripting/starting_conditions.lua 2018-06-01 18:15:27 +0000
@@ -1,10 +1,27 @@
-- =======================================================================
-- Player 3
-- =======================================================================
--- Player 3 (Vesta) will be introduced to the game when discovered
--- So, for the beginning we forbid everything and do not place any buildings
+-- AI for P3 is set to "empty" therefore we place the buildings and the roads and let the economy flow a bit
+field_well = map:get_field(17, 182)
+place_building_in_region(p3, "empire_well", {field_well})
+
+field_brewery = map:get_field(19, 183)
+place_building_in_region(p3, "empire_brewery", {field_brewery})
+
+field_mill = map:get_field(18, 184)
+place_building_in_region(p3, "empire_mill", {field_mill})
+
+field_warehouse = map:get_field(21, 186)
+place_building_in_region(p3, "empire_temple_of_vesta", {field_warehouse}, {workers = {empire_carrier = 0, empire_recruit = 0}, wares = {wheat = 200}})
+
+ r1 = p3:place_road(field_warehouse.immovable.flag, "l", "tl", true)
+ r2 = p3:place_road(field_mill.immovable.flag, "tr", "r", true)
+ r3 = p3:place_road(field_mill.immovable.flag, "l", "tl", "tr", true)
+ r4 = p3:place_road(field_mill.immovable.flag, "br", "r", true)
p3:forbid_buildings("all")
+local eco = field_warehouse.brn.immovable.economy
+eco:set_ware_target_quantity("beer", 180)
-- =======================================================================
-- Player 1
=== modified file 'data/campaigns/emp04.wmf/scripting/tribes/init.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/init.lua 2017-12-17 13:25:46 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/init.lua 2018-06-01 18:15:27 +0000
@@ -18,6 +18,7 @@
include "map:scripting/tribes/trainingcamp1.lua"
include "map:scripting/tribes/well2.lua"
include "map:scripting/tribes/well1.lua"
+ include "map:scripting/tribes/temple_of_vesta.lua"
end)
tribes:add_custom_building {
@@ -54,3 +55,8 @@
tribename = "empire",
buildingname = "empire_well2",
}
+
+tribes:add_custom_building {
+ tribename = "empire",
+ buildingname = "empire_temple_of_vesta",
+}
\ No newline at end of file
=== added file 'data/campaigns/emp04.wmf/scripting/tribes/temple_of_vesta.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/temple_of_vesta.lua 1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/temple_of_vesta.lua 2018-06-01 18:15:27 +0000
@@ -0,0 +1,30 @@
+dirname = "tribes/buildings/warehouses/empire/warehouse/"
+
+tribes:new_warehouse_type {
+ msgctxt = "empire_building",
+ name = "empire_temple_of_vesta",
+ -- TRANSLATORS: This is a building name used in lists of buildings
+ descname = pgettext("empire_building", "Temple of Vesta"),
+ helptext_script = "campaigns/emp04.wmf/scripting/tribes/vesta_helptexts.lua",
+ icon = dirname .. "menu.png",
+ size = "medium",
+
+ return_on_dismantle = {
+ planks = 1,
+ granite = 2,
+ marble = 2,
+ marble_column = 1
+ },
+
+ animations = {
+ idle = {
+ pictures = path.list_files(dirname .. "idle_??.png"),
+ hotspot = { 58, 55 },
+ },
+ },
+
+ aihints = {},
+
+ heal_per_second = 220,
+ conquers = 7,
+}
=== added file 'data/campaigns/emp04.wmf/scripting/tribes/vesta_helptexts.lua'
--- data/campaigns/emp04.wmf/scripting/tribes/vesta_helptexts.lua 1970-01-01 00:00:00 +0000
+++ data/campaigns/emp04.wmf/scripting/tribes/vesta_helptexts.lua 2018-06-01 18:15:27 +0000
@@ -0,0 +1,27 @@
+-- This include can be removed when all help texts have been defined.
+include "tribes/scripting/help/global_helptexts.lua"
+
+function building_helptext_lore()
+ -- TRANSLATORS#: Lore helptext for a building
+ return no_lore_text_yet()
+end
+
+function building_helptext_lore_author()
+ -- TRANSLATORS#: Lore author helptext for a building
+ return no_lore_author_text_yet()
+end
+
+function building_helptext_purpose()
+ -- TRANSLATORS: Purpose helptext for a building
+ return pgettext("building", "In the temple of Vesta the wares to worship are stored. It is the home of the priestesses and the guards of the goddess.")
+end
+
+function building_helptext_note()
+ -- TRANSLATORS#: Note helptext for a building
+ return ""
+end
+
+function building_helptext_performance()
+ -- TRANSLATORS#: Performance helptext for a building
+ return ""
+end
Follow ups
-
[Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: noreply, 2018-06-16
-
Re: [Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: GunChleoc, 2018-06-16
-
Re: [Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: hessenfarmer, 2018-06-14
-
Re: [Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: ypopezios, 2018-06-14
-
Re: [Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: hessenfarmer, 2018-06-14
-
Re: [Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: ypopezios, 2018-06-14
-
Re: [Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: hessenfarmer, 2018-06-14
-
[Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: bunnybot, 2018-06-14
-
[Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: bunnybot, 2018-06-04
-
Re: [Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: GunChleoc, 2018-06-04
-
Re: [Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: hessenfarmer, 2018-06-02
-
[Merge] lp:~widelands-dev/widelands/empire04_bugfix into lp:widelands
From: bunnybot, 2018-06-02