MP 5p Wildlands: more tweaks

- use faction=custom
- no upkeep for side 5
- fix operator precedence in objectives

[ci skip]
This commit is contained in:
Severin Glöckner 2019-09-25 18:16:52 +02:00
parent 98a1b299fe
commit 5a51c56985

View file

@ -114,6 +114,12 @@
# use a different flag
{FLAG_VARIANT loyalist}
defeat_condition=no_units_left
faction=Custom
recruit=""
faction_lock=yes
leader_lock=yes
income_lock=yes
gold_lock=yes
side=5
team_name=Team 5
user_team_name= _ "teamname^Monsters"
@ -125,18 +131,49 @@
income=-2
[/side]
# set up side 5 (only if played)
[event]
name=prestart
[if]
[have_unit]
side=5
[/have_unit]
[lua]
code=<< return wesnoth.sides[5].controller ~= 'null' >>
[/lua]
[then]
# In case lock_settings are overridden, remove leader and recruit list
[kill]
animate=no
fire_event=no
side=5
[/kill]
[set_recruit]
side=5
recruit=""
[/set_recruit]
# visual change, don't turn the gold counter negative
[event]
name=unit placed
first_time_only=no
[filter]
side=5
[/filter]
[modify_unit]
[filter]
id=$unit.id
[/filter]
[object]
silent=yes
duration=scenario
[effect]
apply_to=loyal
[/effect]
[/object]
[/modify_unit]
[/event]
{MPWILD_UNIT 38 36 (Sea Serpent)}
{MPWILD_UNIT 6 20 (Cuttle Fish)}
{MPWILD_UNIT 58 42 (Cuttle Fish)}
@ -187,31 +224,25 @@
{MPWILD_SOULLESS 54 30 swimmer}
{MPWILD_SOULLESS 53 34 swimmer}
{MPWILD_WALKING_CORPSE 56 30 swimmer}
[set_recruit]
side=5
recruit=""
[/set_recruit]
[/then]
[/if]
# Objectives
# Wether the side is defeated can apparently only be checked with Lua.
# Whether the side is defeated can apparently only be checked with Lua.
[objectives]
[objective]
description= _ "Defeat the enemy leaders"
description= _ "Defeat all 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 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 alive > 1 then return true else return false end >>
[/lua]
[/show_if]