UtBS::3: Fixed a bug with the calculation of the lost elvish villages.

This commit is contained in:
Fabian Müller 2008-12-20 17:22:25 +00:00
parent ba7945851f
commit 6b5d6a22d5

View File

@ -11,7 +11,7 @@
[scenario]
id="3_Stirring_in_the_Night"
next_scenario=4_Descending_into_Darkness
next_scenario="4_Descending_into_Darkness"
name= _ "A Stirring in the Night"
label= _ "A Stirring in the Night"
map_data="{campaigns/Under_the_Burning_Suns/maps/03_A_Stirring_in_the_Night.map}"
@ -249,8 +249,6 @@
{VARIABLE ambush_turn $random}
# give player 12 villages to protect
{VARIABLE elven_camps 12}
{VARIABLE sneak_up 0}
{VARIABLE killed_by_azkotep 0}
{VARIABLE killed_by_ystara 0}
@ -269,7 +267,7 @@
[time_area]
x=14,12,13,14,15,16,12,13,14,15,16,12,13,14,15,16,13,14,15
y=8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11,12,12,12
y= 8, 9, 9, 9, 9, 9,10,10,10,10,10,11,11,11,11,11,12,12,12
{DUSK}
[/time_area]
@ -294,8 +292,8 @@
name=start
#ifdef EASY
{NAMED_NOTRAIT_UNIT 2 (Revenant) 20 22 (Zur) ( _ "Zur")}
{NAMED_NOTRAIT_UNIT 3 (Wraith) 22 7 (Grak) ( _ "Grak")}
{NAMED_NOTRAIT_UNIT 2 (Revenant) 20 22 (Zur) ( _ "Zur") }
{NAMED_NOTRAIT_UNIT 3 (Wraith) 22 7 (Grak) ( _ "Grak")}
# On medium and hard change champions type to more menacing
# and give them some help
@ -308,13 +306,13 @@
#endif
#ifdef NORMAL
{NAMED_NOTRAIT_UNIT 2 (Deathblade) 20 22 (Zur) (_"Zur")}
{NAMED_NOTRAIT_UNIT 3 (Shadow) 22 7 (Grak) (_"Grak")}
{NAMED_NOTRAIT_UNIT 2 (Deathblade) 20 22 (Zur) (_"Zur") }
{NAMED_NOTRAIT_UNIT 3 (Shadow) 22 7 (Grak) (_"Grak")}
#endif
#ifdef HARD
{NAMED_NOTRAIT_UNIT 2 (Draug) 20 22 (Zur) (_"Zur")}
{NAMED_NOTRAIT_UNIT 3 (Nightgaunt) 22 7 (Grak) (_"Grak")}
{NAMED_NOTRAIT_UNIT 2 (Draug) 20 22 (Zur) (_"Zur") }
{NAMED_NOTRAIT_UNIT 3 (Nightgaunt) 22 7 (Grak) (_"Grak")}
#endif
[message]
@ -387,7 +385,7 @@
[/message]
[/event]
# At the end of the initial dialogue kaleh raises a war cry,
# At the end of the initial dialogue Kaleh raises a war cry,
# some elves will wake up and respond
# Recall a random number of troops among the tents to make the
# glorious victory achieveable on harder levels.
@ -509,117 +507,132 @@
[/if]
[/event]
# The first capture of an elven_camp has some speech
[event]
name=capture
first_time_only=yes
[filter]
side=2,3,4
[/filter]
[message]
speaker=Nym
message= _ "They're raising the corpses of our fallen! What a horrible fate!"
[/message]
[message]
speaker=Elyssa
message= _ "Then we shall have to give them a proper cremation."
[/message]
[/event]
# Count destroyed tents, each lost makes future scenarios harder
# Includes defeat by loss of tents
# Affects variables : $elven_camps
# Each tent lost to undead spawns a WC
[event]
name=capture
first_time_only=no
[filter]
side=2,3,4
[/filter]
[terrain]
x=$x1
y=$y1
terrain=Dd
[/terrain]
[if]
[variable]
name=unit.side
equals=2
[/variable]
[or]
[variable]
name=unit.side
equals=3
[/variable]
[/or]
[then]
name=prestart
[store_villages]
variable=camps
[/store_villages]
# give player villages to protect
{VARIABLE elven_camps $camps.length}
#This generates and stores an event for every camp.
#That way we can avoid to store information about each village
#by using the first_time_only feature.
{FOREACH camps camp}
[set_variables]
name=camp_event
mode=replace
[value]
name=capture
first_time_only=yes
[filter]
side=2,3,4
x=$camps[$camp].x
y=$camps[$camp].y
[/filter]
[if]
[variable]
name=unit.side
equals=2
[/variable]
[or]
[variable]
name=unit.side
equals=3
[/variable]
[/or]
[then]
#ifdef HARD
{NOTRAIT_UNIT $unit.side (Soulless) $x1 $y1}
{NOTRAIT_UNIT $|unit.side (Soulless) $|x1 $|y1}
#endif
#ifdef NORMAL
{RANDOM 0..100}
[if]
[variable]
name=random
less_than=51
[/variable]
[then]
{NOTRAIT_UNIT $unit.side (Walking Corpse) $x1 $y1}
[/then]
[else]
{NOTRAIT_UNIT $unit.side (Soulless) $x1 $y1}
[/else]
[/if]
{RANDOM 0..100}
[if]
[variable]
name=random
less_than=51
[/variable]
[then]
{NOTRAIT_UNIT $|unit.side (Walking Corpse) $|x1 $|y1}
[/then]
[else]
{NOTRAIT_UNIT $|unit.side (Soulless) $|x1 $|y1}
[/else]
[/if]
#endif
#ifdef EASY
{NOTRAIT_UNIT $unit.side (Walking Corpse) $x1 $y1}
{NOTRAIT_UNIT $unit.side (Walking Corpse) $|x1 $|y1}
#endif
[if]
[variable]
name=elven_camps
equals=12
[/variable]
[then]
[message]
speaker=Nym
message= _ "They're raising the corpses of our fallen! What a horrible fate!"
[/message]
[message]
speaker=Elyssa
message= _ "Then we shall have to give them a proper cremation."
[/message]
[/then]
[/if]
[/then]
[/if]
[gold]
[/then]
[/if]
[gold]
#ifdef EASY
amount=10
amount=10
#endif
#ifdef NORMAL
amount=20
amount=20
#endif
#ifdef HARD
amount=30
amount=30
#endif
side=$unit.side
[/gold]
{VARIABLE_OP elven_camps add -1}
[if]
[variable]
name=elven_camps
equals=5
[/variable]
[then]
[message]
speaker=Kaleh
message= _ "Too many of our people have been killed. We will surely be overwhelmed by the undead now. All is lost!"
[/message]
side=$unit.side
[/gold]
{VARIABLE_OP elven_camps add -1}
[if]
[variable]
name=elven_camps
equals=5
[/variable]
[then]
[message]
speaker=Kaleh
message= _ "Too many of our people have been killed. We will surely be overwhelmed by the undead now. All is lost!"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/then]
[/if]
[/value]
[/set_variables]
[insert_tag]
name=event
variable=camp_event
[/insert_tag]
[endlevel]
result=defeat
[/endlevel]
[/then]
[/if]
[/event]
# If the elves recapture a tent, make it no longer count against
# the loss threshold.
[event]
name=capture
first_time_only=no
[filter]
side=1
[/filter]
[terrain]
x=$x1
y=$y1
terrain=Dd
[/terrain]
{VARIABLE_OP elven_camps add 1}
{NEXT camp}
{CLEAR_VARIABLE camps}
{CLEAR_VARIABLE camp_event}
[/event]
# Instead with providing AI with higher lvl units on medium