← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/casern into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/casern into lp:widelands.

Commit message:
Added WIP Barracks (casern) buildings.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #669699 in widelands: "trainer is only a carrier"
  https://bugs.launchpad.net/widelands/+bug/669699
  Bug #1075562 in widelands: "Implement a casern for soldier recruting"
  https://bugs.launchpad.net/widelands/+bug/1075562
  Bug #1422158 in widelands: "A trainer should be created before soldiers"
  https://bugs.launchpad.net/widelands/+bug/1422158

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/casern/+merge/307647

This is another one that I would like to add early for Build 20.

In this branch, the Barracks work like the Cattle/Donkey/Horse farms. Notabilis is working on allowing worker input queues in a separate branch.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/casern into lp:widelands.
=== modified file 'data/tribes/atlanteans.lua'
--- data/tribes/atlanteans.lua	2016-09-01 15:43:01 +0000
+++ data/tribes/atlanteans.lua	2016-10-18 09:49:20 +0000
@@ -246,6 +246,7 @@
       "atlanteans_weaponsmithy",
       "atlanteans_armorsmithy",
       "atlanteans_shipyard",
+      "atlanteans_barracks",
 
       -- Big
       "atlanteans_horsefarm",

=== modified file 'data/tribes/barbarians.lua'
--- data/tribes/barbarians.lua	2016-01-31 21:03:15 +0000
+++ data/tribes/barbarians.lua	2016-10-18 09:49:20 +0000
@@ -201,6 +201,7 @@
       "barbarians_warmill",
       "barbarians_ax_workshop",
       "barbarians_shipyard",
+      "barbarians_barracks",
 
       -- Big
       "barbarians_cattlefarm",

=== added directory 'data/tribes/buildings/productionsites/atlanteans/barracks'
=== added file 'data/tribes/buildings/productionsites/atlanteans/barracks/helptexts.lua'
--- data/tribes/buildings/productionsites/atlanteans/barracks/helptexts.lua	1970-01-01 00:00:00 +0000
+++ data/tribes/buildings/productionsites/atlanteans/barracks/helptexts.lua	2016-10-18 09:49:20 +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 no_purpose_text_yet()
+end
+
+function building_helptext_note()
+	-- #TRANSLATORS: Note helptext for a building
+	return ""
+end
+
+function building_helptext_performance()
+	-- #TRANSLATORS: Performance helptext for a building
+	return no_performance_text_yet()
+end

=== added file 'data/tribes/buildings/productionsites/atlanteans/barracks/idle_00.png'
Binary files data/tribes/buildings/productionsites/atlanteans/barracks/idle_00.png	1970-01-01 00:00:00 +0000 and data/tribes/buildings/productionsites/atlanteans/barracks/idle_00.png	2016-10-18 09:49:20 +0000 differ
=== added file 'data/tribes/buildings/productionsites/atlanteans/barracks/idle_00_pc.png'
Binary files data/tribes/buildings/productionsites/atlanteans/barracks/idle_00_pc.png	1970-01-01 00:00:00 +0000 and data/tribes/buildings/productionsites/atlanteans/barracks/idle_00_pc.png	2016-10-18 09:49:20 +0000 differ
=== added file 'data/tribes/buildings/productionsites/atlanteans/barracks/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/barracks/init.lua	1970-01-01 00:00:00 +0000
+++ data/tribes/buildings/productionsites/atlanteans/barracks/init.lua	2016-10-18 09:49:20 +0000
@@ -0,0 +1,65 @@
+dirname = path.dirname(__file__)
+
+tribes:new_productionsite_type {
+   msgctxt = "atlanteans_building",
+   name = "atlanteans_barracks",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("atlanteans_building", "Barracks"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "medium",
+
+   buildcost = {
+		log = 2,
+		granite = 2,
+		planks = 2,
+		spidercloth = 3,
+	},
+	return_on_dismantle = {
+		log = 1,
+		granite = 1,
+		planks = 1,
+		spidercloth = 1,
+	},
+
+   animations = {
+		idle = {
+			pictures = path.list_files(dirname .. "idle_??.png"),
+			hotspot = { 44, 65 },
+		},
+		working = { -- TODO(GunChleoc): make animations
+			pictures = path.list_files(dirname .. "idle_??.png"),
+			hotspot = { 44, 65 },
+		}
+	},
+
+	aihints = {
+	},
+
+	working_positions = {
+		atlanteans_trainer = 1
+	},
+
+   inputs = {
+      { name = "tabard", amount = 8 },
+      { name = "trident_light", amount = 8 }
+   },
+	outputs = {
+		"atlanteans_soldier",
+   },
+
+	programs = {
+		work = {
+			-- TRANSLATORS: Completed/Skipped/Did not start recruiting soldier because ...
+			-- TODO(GunChleoc): this should cost us a carrier as well, or maybe a recruit.
+			descname = _"recruiting soldier",
+			actions = {
+				"sleep=15000",
+				"return=skipped unless economy needs atlanteans_soldier",
+				"consume=tabard trident_light",
+				"animate=working 15000",
+				"recruit=atlanteans_soldier"
+			}
+		},
+	}
+}

=== added file 'data/tribes/buildings/productionsites/atlanteans/barracks/menu.png'
Binary files data/tribes/buildings/productionsites/atlanteans/barracks/menu.png	1970-01-01 00:00:00 +0000 and data/tribes/buildings/productionsites/atlanteans/barracks/menu.png	2016-10-18 09:49:20 +0000 differ
=== added directory 'data/tribes/buildings/productionsites/barbarians/barracks'
=== added file 'data/tribes/buildings/productionsites/barbarians/barracks/helptexts.lua'
--- data/tribes/buildings/productionsites/barbarians/barracks/helptexts.lua	1970-01-01 00:00:00 +0000
+++ data/tribes/buildings/productionsites/barbarians/barracks/helptexts.lua	2016-10-18 09:49:20 +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 no_purpose_text_yet()
+end
+
+function building_helptext_note()
+	-- #TRANSLATORS: Note helptext for a building
+	return ""
+end
+
+function building_helptext_performance()
+	-- #TRANSLATORS: Performance helptext for a building
+	return no_performance_text_yet()
+end

=== added file 'data/tribes/buildings/productionsites/barbarians/barracks/idle_00.png'
Binary files data/tribes/buildings/productionsites/barbarians/barracks/idle_00.png	1970-01-01 00:00:00 +0000 and data/tribes/buildings/productionsites/barbarians/barracks/idle_00.png	2016-10-18 09:49:20 +0000 differ
=== added file 'data/tribes/buildings/productionsites/barbarians/barracks/init.lua'
--- data/tribes/buildings/productionsites/barbarians/barracks/init.lua	1970-01-01 00:00:00 +0000
+++ data/tribes/buildings/productionsites/barbarians/barracks/init.lua	2016-10-18 09:49:20 +0000
@@ -0,0 +1,63 @@
+dirname = path.dirname(__file__)
+
+tribes:new_productionsite_type {
+   msgctxt = "barbarians_building",
+   name = "barbarians_barracks",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("barbarians_building", "Barracks"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "medium",
+
+   buildcost = {
+		log = 4,
+		granite = 2,
+		grout = 4,
+		thatch_reed = 1
+	},
+	return_on_dismantle = {
+		log = 2,
+		granite = 1,
+		grout = 1
+	},
+
+   animations = {
+		idle = { -- TODO(GunChleoc): make animations
+			pictures = path.list_files(dirname .. "idle_??.png"),
+			hotspot = { 52, 64 },
+		},
+		working = { -- TODO(GunChleoc): make animations
+			pictures = path.list_files(dirname .. "idle_??.png"),
+			hotspot = { 52, 64 },
+		}
+	},
+
+	aihints = {
+	},
+
+	working_positions = {
+		barbarians_trainer = 1
+	},
+
+   inputs = {
+      { name = "ax", amount = 8 }
+   },
+	outputs = {
+		"barbarians_soldier",
+   },
+
+	programs = {
+		work = {
+			-- TRANSLATORS: Completed/Skipped/Did not start recruiting soldier because ...
+			descname = _"recruiting soldier",
+			-- TODO(GunChleoc): this should cost us a carrier as well, or maybe a recruit.
+			actions = {
+				"sleep=15000",
+				"return=skipped unless economy needs barbarians_soldier",
+				"consume=ax",
+				"animate=working 15000",
+				"recruit=barbarians_soldier"
+			}
+		},
+	}
+}

=== added file 'data/tribes/buildings/productionsites/barbarians/barracks/menu.png'
Binary files data/tribes/buildings/productionsites/barbarians/barracks/menu.png	1970-01-01 00:00:00 +0000 and data/tribes/buildings/productionsites/barbarians/barracks/menu.png	2016-10-18 09:49:20 +0000 differ
=== added directory 'data/tribes/buildings/productionsites/empire/barracks'
=== added file 'data/tribes/buildings/productionsites/empire/barracks/helptexts.lua'
--- data/tribes/buildings/productionsites/empire/barracks/helptexts.lua	1970-01-01 00:00:00 +0000
+++ data/tribes/buildings/productionsites/empire/barracks/helptexts.lua	2016-10-18 09:49:20 +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 no_purpose_text_yet()
+end
+
+function building_helptext_note()
+	-- #TRANSLATORS: Note helptext for a building
+	return ""
+end
+
+function building_helptext_performance()
+	-- #TRANSLATORS: Performance helptext for a building
+	return no_performance_text_yet()
+end

=== added file 'data/tribes/buildings/productionsites/empire/barracks/idle_00.png'
Binary files data/tribes/buildings/productionsites/empire/barracks/idle_00.png	1970-01-01 00:00:00 +0000 and data/tribes/buildings/productionsites/empire/barracks/idle_00.png	2016-10-18 09:49:20 +0000 differ
=== added file 'data/tribes/buildings/productionsites/empire/barracks/init.lua'
--- data/tribes/buildings/productionsites/empire/barracks/init.lua	1970-01-01 00:00:00 +0000
+++ data/tribes/buildings/productionsites/empire/barracks/init.lua	2016-10-18 09:49:20 +0000
@@ -0,0 +1,66 @@
+dirname = path.dirname(__file__)
+
+tribes:new_productionsite_type {
+   msgctxt = "empire_building",
+   name = "empire_barracks",
+   -- TRANSLATORS: This is a building name used in lists of buildings
+   descname = pgettext("empire_building", "Barracks"),
+   helptext_script = dirname .. "helptexts.lua",
+   icon = dirname .. "menu.png",
+   size = "medium",
+
+   buildcost = {
+		log = 1,
+		granite = 3,
+		planks = 2,
+		marble = 2,
+		marble_column = 2,
+		cloth = 1
+	},
+	return_on_dismantle = {
+		granite = 2,
+		planks = 1,
+		marble = 1
+	},
+
+   animations = {
+		idle = { -- TODO(GunChleoc): make animations
+			pictures = path.list_files(dirname .. "idle_??.png"),
+			hotspot = { 52, 64 },
+		},
+		working = { -- TODO(GunChleoc): make animations
+			pictures = path.list_files(dirname .. "idle_??.png"),
+			hotspot = { 52, 64 },
+		}
+	},
+
+	aihints = {
+	},
+
+	working_positions = {
+		empire_trainer = 1
+	},
+
+   inputs = {
+      { name = "armor_helmet", amount = 8 },
+      { name = "spear_wooden", amount = 8 }
+   },
+	outputs = {
+		"empire_soldier",
+   },
+
+	programs = {
+		work = {
+			-- TRANSLATORS: Completed/Skipped/Did not start recruiting soldier because ...
+			-- TODO(GunChleoc): this should cost us a carrier as well, or maybe a recruit.
+			descname = _"recruiting soldier",
+			actions = {
+				"sleep=15000",
+				"return=skipped unless economy needs empire_soldier",
+				"consume=armor_helmet spear_wooden",
+				"animate=working 15000",
+				"recruit=empire_soldier"
+			}
+		},
+	}
+}

=== added file 'data/tribes/buildings/productionsites/empire/barracks/menu.png'
Binary files data/tribes/buildings/productionsites/empire/barracks/menu.png	1970-01-01 00:00:00 +0000 and data/tribes/buildings/productionsites/empire/barracks/menu.png	2016-10-18 09:49:20 +0000 differ
=== modified file 'data/tribes/empire.lua'
--- data/tribes/empire.lua	2016-01-31 21:03:15 +0000
+++ data/tribes/empire.lua	2016-10-18 09:49:20 +0000
@@ -206,6 +206,7 @@
       "empire_toolsmithy",
       "empire_armorsmithy",
       "empire_shipyard",
+      "empire_barracks",
 
       -- Big
       "empire_donkeyfarm",

=== modified file 'data/tribes/init.lua'
--- data/tribes/init.lua	2016-10-15 07:29:09 +0000
+++ data/tribes/init.lua	2016-10-18 09:49:20 +0000
@@ -344,6 +344,8 @@
 include "tribes/buildings/productionsites/atlanteans/toolsmithy/init.lua"
 include "tribes/buildings/productionsites/atlanteans/weaponsmithy/init.lua"
 include "tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua"
+include "tribes/buildings/productionsites/atlanteans/barracks/init.lua"
+
 -- Atlanteans big
 include "tribes/buildings/productionsites/atlanteans/horsefarm/init.lua"
 include "tribes/buildings/productionsites/atlanteans/farm/init.lua"
@@ -381,6 +383,8 @@
 include "tribes/buildings/productionsites/barbarians/warmill/init.lua"
 include "tribes/buildings/productionsites/barbarians/ax_workshop/init.lua"
 include "tribes/buildings/productionsites/barbarians/metal_workshop/init.lua"
+include "tribes/buildings/productionsites/barbarians/barracks/init.lua"
+
 -- Barbarians big
 include "tribes/buildings/productionsites/barbarians/cattlefarm/init.lua"
 include "tribes/buildings/productionsites/barbarians/farm/init.lua"
@@ -427,6 +431,8 @@
 include "tribes/buildings/productionsites/empire/sheepfarm/init.lua"
 include "tribes/buildings/productionsites/empire/weaving_mill/init.lua"
 include "tribes/buildings/productionsites/empire/weaponsmithy/init.lua"
+include "tribes/buildings/productionsites/empire/barracks/init.lua"
+
 -- Empire mines
 include "tribes/buildings/productionsites/empire/coalmine_deep/init.lua"
 include "tribes/buildings/productionsites/empire/coalmine/init.lua"

=== modified file 'data/tribes/workers/atlanteans/trainer/init.lua'
--- data/tribes/workers/atlanteans/trainer/init.lua	2016-09-25 06:58:08 +0000
+++ data/tribes/workers/atlanteans/trainer/init.lua	2016-10-18 09:49:20 +0000
@@ -21,9 +21,8 @@
 
    buildcost = {
       atlanteans_carrier = 1,
-      -- TODO (GunChleoc): Add back in when we have a casern
-      --trident_light = 1,
-      --tabard = 1
+      trident_light = 1,
+      tabard = 1
    },
 
    animations = animations,

=== modified file 'data/tribes/workers/barbarians/trainer/init.lua'
--- data/tribes/workers/barbarians/trainer/init.lua	2016-09-25 06:58:08 +0000
+++ data/tribes/workers/barbarians/trainer/init.lua	2016-10-18 09:49:20 +0000
@@ -20,8 +20,7 @@
 
    buildcost = {
       barbarians_carrier = 1,
-      -- TODO (GunChleoc): Add back in when we have a casern
-      --ax = 1
+      ax = 1
    },
 
    animations = animations,

=== modified file 'data/tribes/workers/empire/trainer/init.lua'
--- data/tribes/workers/empire/trainer/init.lua	2016-09-25 06:58:08 +0000
+++ data/tribes/workers/empire/trainer/init.lua	2016-10-18 09:49:20 +0000
@@ -21,9 +21,8 @@
 
    buildcost = {
       empire_carrier = 1,
-      -- TODO (GunChleoc): Add back in when we have a casern
-      --armor_helmet = 1,
-      --spear_wooden = 1
+      armor_helmet = 1,
+      spear_wooden = 1
    },
 
    animations = animations,

=== modified file 'data/txts/developers.json'
--- data/txts/developers.json	2016-10-05 04:24:26 +0000
+++ data/txts/developers.json	2016-10-18 09:49:20 +0000
@@ -143,7 +143,8 @@
 						"Chuck Wilder (chuckw)",
 						"Astuur",
 						"Gerrit Familiegrosskopf (kingcreole)",
-						"Florian Angermeier (fraang)"
+						"Florian Angermeier (fraang)",
+						"DragonAtma"
 					]
 				}
 			]


Follow ups