MP: 5P The Wildlands

Fix Shuffling Sides with side 5 (which has no leader)
and refactor.
[ci skip]
This commit is contained in:
Severin Glöckner 2020-08-09 00:41:37 +02:00
parent 4c899d73d6
commit c0d05dcce6

View file

@ -45,9 +45,11 @@
# Takes better care of healing / retreating
# Has a CA for castle switch
ai_algorithm=experimental_ai
# Default aggression is 0.4
# Default caution is 0.25
caution=0.45
# Default aggression is 0.4
grouping=defensive
support_villages=yes
#enddef
[multiplayer]
@ -108,12 +110,13 @@
[side]
[ai]
{SET_AI_PARAMETERS}
village_value=0
village_value=0.5
{MODIFY_AI_DELETE_CANDIDATE_ACTION 5 main_loop villages}
[/ai]
# use a different flag
{FLAG_VARIANT loyalist}
defeat_condition=no_units_left
disallow_shuffle=yes
faction=Custom
recruit=""
faction_lock=yes
@ -237,21 +240,22 @@
[/if]
# Objectives
# Whether the side is defeated can apparently only be checked with Lua.
[objectives]
[objective]
description= _ "Defeat all enemy leaders"
condition=win
# Don't show this anymore when the others are defeated.
[show_if]
[lua]
# workaround: when the objectives are first shown, sides with controller=null
# are not yet considered defeated, thus also checking the controller
# Whether the side is defeated can apparently only be checked with 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 wesnoth.sides[1].controller ~= "null" then alive = alive + 1 end end
if not wesnoth.sides[2].lost then if wesnoth.sides[2].controller ~= "null" then alive = alive + 1 end end
if not wesnoth.sides[3].lost then if wesnoth.sides[3].controller ~= "null" then alive = alive + 1 end end
if not wesnoth.sides[4].lost then if wesnoth.sides[4].controller ~= "null" then alive = alive + 1 end end
if not wesnoth.sides[1].lost and (wesnoth.sides[1].controller ~= 'null') then alive = alive + 1 end
if not wesnoth.sides[2].lost and (wesnoth.sides[2].controller ~= 'null') then alive = alive + 1 end
if not wesnoth.sides[3].lost and (wesnoth.sides[3].controller ~= 'null') then alive = alive + 1 end
if not wesnoth.sides[4].lost and (wesnoth.sides[4].controller ~= 'null') then alive = alive + 1 end
if alive > 1 then return true else return false end >>
[/lua]
[/show_if]