UtBS: Rename ally_name to ally_id for clarity.

Justification: ally_name variable actually holds the ID attribute of the unit, not the name attribute.
This change was originally included in #6165, which has since been reverted, so reinstating the variable renaming here.
This commit is contained in:
Wedge009 2022-03-15 10:51:13 +11:00
parent f1a9420042
commit 170c124bcb
9 changed files with 62 additions and 62 deletions

View file

@ -144,14 +144,14 @@
[then]
[set_variable]
name=ally_name
name=ally_id
value=Rogrimir
[/set_variable]
[/then]
[else]
[set_variable]
name=ally_name
name=ally_id
value=Jarl
[/set_variable]
@ -365,7 +365,7 @@
[if]
[variable]
name=ally_name
name=ally_id
equals=Rogrimir
[/variable]
@ -404,7 +404,7 @@
[else]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "You did a great service for my brothers. In exchange, as much as I hate the light, I am the one who knows the upper tunnels the best, so Ill be your guide."
[/message]
[/else]
@ -413,7 +413,7 @@
[if]
[variable]
name=ally_name
name=ally_id
equals=Rogrimir
[/variable]

View file

@ -142,14 +142,14 @@
[then]
[set_variable]
name=ally_name
name=ally_id
value=Grog
[/set_variable]
[/then]
[else]
[set_variable]
name=ally_name
name=ally_id
value=Nog
[/set_variable]
@ -358,7 +358,7 @@
[if]
[variable]
name=ally_name
name=ally_id
equals=Grog
[/variable]
@ -406,7 +406,7 @@
[if]
[variable]
name=ally_name
name=ally_id
equals=Grog
[/variable]

View file

@ -318,7 +318,7 @@
# recall dwarf/troll ally
[recall]
id=$ally_name
id=$ally_id
x,y=51,43
[/recall]
@ -329,7 +329,7 @@
# put hero icon on troll/dwarf ally
[unit_overlay]
id=$ally_name
id=$ally_id
image=misc/hero-icon.png
[/unit_overlay]
@ -434,7 +434,7 @@
description= _ "Death of Grog"
condition=lose
[show_if]
{VARIABLE_CONDITIONAL ally_name equals "Grog"}
{VARIABLE_CONDITIONAL ally_id equals "Grog"}
{VARIABLE_CONDITIONAL ally_must_live boolean_equals yes}
[/show_if]
[/objective]
@ -442,7 +442,7 @@
description= _ "Death of Nog"
condition=lose
[show_if]
{VARIABLE_CONDITIONAL ally_name equals "Nog"}
{VARIABLE_CONDITIONAL ally_id equals "Nog"}
{VARIABLE_CONDITIONAL ally_must_live boolean_equals yes}
[/show_if]
[/objective]
@ -450,7 +450,7 @@
description= _ "Death of Rogrimir"
condition=lose
[show_if]
{VARIABLE_CONDITIONAL ally_name equals "Rogrimir"}
{VARIABLE_CONDITIONAL ally_id equals "Rogrimir"}
{VARIABLE_CONDITIONAL ally_must_live boolean_equals yes}
[/show_if]
[/objective]
@ -458,7 +458,7 @@
description= _ "Death of Jarl"
condition=lose
[show_if]
{VARIABLE_CONDITIONAL ally_name equals "Jarl"}
{VARIABLE_CONDITIONAL ally_id equals "Jarl"}
{VARIABLE_CONDITIONAL ally_must_live boolean_equals yes}
[/show_if]
[/objective]
@ -492,7 +492,7 @@
name=start
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Weve come far and were almost to the surface. But first we should stop and rest here for a while."
[/message]
@ -509,14 +509,14 @@
[then]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Yes, this time of year the snow melts from the mountains, and rivers like this often go deep underground. Sometimes the rivers break through and flood caverns, a deadly accident that has occasionally befallen my kind."
[/message]
[/then]
[else]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Deep and dark are the waters that flow in our caves. Sometimes raging waters flood tunnels without warning. A stream can sustain a village, a sudden flood can destroy it."
[/message]
[/else]
@ -708,7 +708,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Quick, the southern passage!"
[/message]
@ -800,7 +800,7 @@
# The ally has not seen the first set of ants, so has a different reaction.
[variable]
name=unit.id
equals=$ally_name
equals=$ally_id
[/variable]
[then]
[message]
@ -1055,7 +1055,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Curses, the water is rising too fast. That tunnel those humans were fleeing down was the fastest way out of here, but its already flooding."
[/message]
@ -1065,7 +1065,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "There might be, but I dont—"
[/message]
@ -1075,7 +1075,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Fine. Just keep going west, but be careful."
[/message]
[/event]
@ -1100,7 +1100,7 @@
[if]
[variable]
name=unit.id
not_equals=$ally_name
not_equals=$ally_id
[/variable]
[then]
@ -1112,14 +1112,14 @@
{CLEAR_VARIABLE explorer}
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "This is an ancient fortress. Who lived here I do not know, but it has been long since abandoned."
[/message]
[/then]
[else]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Behold, we come now to an ancient fortress. Who lived here I do not know, but it has been long since abandoned."
[/message]
[/else]
@ -1131,7 +1131,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Yes, but I didnt explore very far. This foul place is still protected by wards and guards. It reeks of dark magic."
[/message]
@ -1141,7 +1141,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Wait. The chamber in front of us is probably trapped and well guarded. There is another way. When I explored here before, I found a secret passage that bypassed the main gate. Search along the southern wall of this cave and you should find it. The only problem is that the passage is long and windy, and it will cost us precious minutes. With the water rising that may be time we dont have to spend. I leave the final decision up to you, Kaleh."
[/message]
[/event]
@ -1163,7 +1163,7 @@
[if]
[have_unit]
x,y=$x1,$y1
id=$ally_name
id=$ally_id
[/have_unit]
[then]
@ -1185,7 +1185,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Good, that should be the entrance to the secret tunnel. Now just push hard inwards."
[/message]
@ -1223,7 +1223,7 @@
[if]
[have_unit]
x,y=$x1,$y1
id=$ally_name
id=$ally_id
[/have_unit]
[then]
@ -1245,7 +1245,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "You didnt expect the other end to be left wide open did you? There should be another secret door hidden right in front of you."
[/message]
@ -1427,7 +1427,7 @@
[if]
[variable]
name=unit.id
not_equals=$ally_name
not_equals=$ally_id
[/variable]
[then]
@ -1458,7 +1458,7 @@
)}
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "I dont know. When I last came this way I got scared by all the runes and things moving in the shadows, and I explored no further."
[/message]
[/then]
@ -2174,7 +2174,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "I dont like the smell of this place."
[/message]
@ -2210,7 +2210,7 @@
)}
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "I never explored this deep into the complex. But every lair has to have a back door somewhere."
[/message]
@ -2417,7 +2417,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Were in luck, a fissure has opened up a crack in the northern wall. We may be able to escape that way."
[/message]
[/event]
@ -2886,7 +2886,7 @@
# remove hero icon from troll/dwarf ally
[remove_unit_overlay]
id=$ally_name
id=$ally_id
image=misc/hero-icon.png
[/remove_unit_overlay]
[/event]
@ -3188,7 +3188,7 @@
[if]
[have_unit]
x,y=$x1,$y1
id=$ally_name
id=$ally_id
[/have_unit]
[then]
@ -3391,10 +3391,10 @@
#troll/dwarf ally teleports to just outside of cave
{MOVE_UNIT (id=$ally_name) 21 23}
{MOVE_UNIT (id=$ally_id) 21 23}
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Kaleh, a quick question—"
[/message]
@ -3497,7 +3497,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Well, actually they were fleeing from—"
[/message]
@ -4500,7 +4500,7 @@
[teleport]
[filter]
id=$ally_name
id=$ally_id
[/filter]
x,y=60,6
[/teleport]
@ -4637,7 +4637,7 @@
[/message]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "He looks like a half-man half-fish."
[/message]

View file

@ -289,7 +289,7 @@
# recall dwarf/troll
[recall]
id=$ally_name
id=$ally_id
[/recall]
# wmllint: recognize Grog
# wmllint: recognize Nog

View file

@ -75,7 +75,7 @@
[/recall]
[recall]
id=$ally_name
id=$ally_id
x,y=13,15
[/recall]
@ -167,7 +167,7 @@
[if]
[have_unit]
id=$ally_name
id=$ally_id
[/have_unit]
[then]
@ -495,14 +495,14 @@
[then]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Yes, remember boy, the fight is not yet lost while we still draw breath."
[/message]
[/then]
[else]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Do not give up yet, little one. The battle is not yet lost while we still fight."
[/message]
[/else]

View file

@ -329,7 +329,7 @@
# recall dwarf/troll
[recall]
id=$ally_name
id=$ally_id
[/recall]
# wmllint: recognize Grog

View file

@ -90,7 +90,7 @@
[goal]
name=target
[criteria]
id=$ally_name
id=$ally_id
[/criteria]
value=3
[/goal]
@ -138,7 +138,7 @@
[goal]
name=target
[criteria]
id=$ally_name
id=$ally_id
[/criteria]
value=3
[/goal]
@ -188,7 +188,7 @@
[goal]
name=target
[criteria]
id=$ally_name
id=$ally_id
[/criteria]
value=3
[/goal]
@ -225,7 +225,7 @@
# recall dwarf/troll
[recall]
id=$ally_name
id=$ally_id
x,y=9,17
[/recall]
@ -340,7 +340,7 @@
# Ally runs to Kaleh's side
{MOVE_UNIT id=$ally_name 9 14}
{MOVE_UNIT id=$ally_id 9 14}
[delay]
time=300
@ -354,14 +354,14 @@
[then]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "Aye, theres still life in the boy. But where is the foul creature that did this to him?"
[/message]
[/then]
[else]
[message]
speaker=$ally_name
speaker=$ally_id
message= _ "The little one is not dead yet. But where is evil lady that did this to him?"
[/message]
[/else]
@ -411,7 +411,7 @@
[if]
[have_unit]
id=$ally_name
id=$ally_id
[/have_unit]
[then]
@ -1549,7 +1549,7 @@
[if]
[have_unit]
id=Nym,Zhul,$ally_name
id=Nym,Zhul,$ally_id
[/have_unit]
[then]

View file

@ -317,7 +317,7 @@
# if ally doesn't die
[if]
[have_unit]
id=$ally_name
id=$ally_id
search_recall_list=yes
[/have_unit]
@ -357,7 +357,7 @@
# if ally died before the final battle
[if]
[have_unit]
id=$ally_name
id=$ally_id
search_recall_list=yes
count=0
[/have_unit]

View file

@ -72,7 +72,7 @@
#define MESSAGE_DEPEND_ON_ALLY GROG_WML NOG_WML ROGRIMIR_WML JARL_WML
[switch]
variable=ally_name
variable=ally_id
[case]
value=Grog
{GROG_WML}