diff --git a/data/multiplayer/scenarios/5p_The_Wilderlands.cfg b/data/multiplayer/scenarios/5p_The_Wilderlands.cfg index e3b986706a0..c7b01925e50 100644 --- a/data/multiplayer/scenarios/5p_The_Wilderlands.cfg +++ b/data/multiplayer/scenarios/5p_The_Wilderlands.cfg @@ -195,6 +195,61 @@ [/then] [/if] + + # Objectives + # Wether the side is defeated can apparently only be checked with Lua. + + [objectives] + [objective] + description= _ "Defeat the enemy leaders" + condition=win + [show_if] + [lua] + # workaround: when the objectives are first shown, sides with controller=null + # are not yet considered defeated, thus also checking the controller + code = << local alive = 0 + if not wesnoth.sides[1].lost then if not wesnoth.sides[1].controller == "null" then alive = alive + 1 end end + if not wesnoth.sides[2].lost then if not wesnoth.sides[2].controller == "null" then alive = alive + 1 end end + if not wesnoth.sides[3].lost then if not wesnoth.sides[3].controller == "null" then alive = alive + 1 end end + if not wesnoth.sides[4].lost then if not wesnoth.sides[4].controller == "null" then alive = alive + 1 end end + if alive > 1 then return true else return false end >> + [/lua] + [/show_if] + [/objective] + + [objective] + description= _ "Defeat all monsters" + condition=win + [show_if] + [have_unit] + side=5 + [/have_unit] + [/show_if] + [/objective] + + [objective] + description= _ "Death of your leader" + condition=lose + [/objective] + [/objectives] + + [objectives] + side=5 + [objective] + description= _ "Defeat the enemy leaders" + condition=win + [/objective] + + [objective] + description= _ "Death of all your units" + condition=lose + [/objective] + + [note] + description= _ "You cannot recruit units." + [/note] + [/objectives] + [/event] [/multiplayer]