Skip to content

Commit

Permalink
Refactor handling of allies in UtBS. Resolves wesnoth#6158.
Browse files Browse the repository at this point in the history
With four potential allies in the campaign, there is a lot of dialogue duplication. This refactoring attempts to consolidate the text.
Additionally, the ally ID was recorded in the variable ally_name which can be confusing, so rename it to ally_id instead.
  • Loading branch information
Wedge009 committed Oct 6, 2021
1 parent 8436700 commit 48c8d6b
Show file tree
Hide file tree
Showing 9 changed files with 437 additions and 758 deletions.
Expand Up @@ -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]

Expand Down Expand Up @@ -363,26 +363,11 @@
message= _ "That I may be able to help you with. We haven’t sent anyone to the surface in years, but we do know of a passage that leads to the ancient northern gate. Several generations ago we used to trade heavily with humans that lived north of the mountains, but then some new human came to power and decreed that all contact with us should be cut off. We sent messengers to find out why, but they never returned."
[/message]

[if]
[variable]
name=ally_name
equals=Rogrimir
[/variable]

[then]
[message]
speaker=King Thurongar
message= _ "But dwarves are excellent delvers, and we keep meticulous maps of all the tunnels we have explored. We should still have maps of the tunnels leading back to the surface. Of course I doubt you would be able to understand them, so, Rogrimir here has volunteered to lead you to the surface."
[/message]
[/then]

[else]
[message]
speaker=King Thurongar
message= _ "But dwarves are excellent delvers, and we keep meticulous maps of all the tunnels we have explored. We should still have maps of the tunnels leading back to the surface. Of course I doubt you would be able to understand them, so, Jarl here has volunteered to lead you to the surface."
[/message]
[/else]
[/if]
{SET_ALLY_UNIT}
[message]
speaker=King Thurongar
message= _ "But dwarves are excellent delvers, and we keep meticulous maps of all the tunnels we have explored. We should still have maps of the tunnels leading back to the surface. Of course I doubt you would be able to understand them, so, $ally_unit.name here has volunteered to lead you to the surface."
[/message]

[if]
[variable]
Expand All @@ -404,33 +389,18 @@

[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 I’ll be your guide."
[/message]
[/else]
[/if]
{CLEAR_VARIABLE saved_rogrimir}

[if]
[variable]
name=ally_name
equals=Rogrimir
[/variable]

[then]
[message]
speaker=Kaleh
message= _ "Thank you very much for your help. We were worried about getting lost in all these twisting tunnels. And we would be honored to have you come with us, Rogrimir."
[/message]
[/then]

[else]
[message]
speaker=Kaleh
message= _ "Thank you very much for your help. We were worried about getting lost in all these twisting tunnels. And we would be honored to have you come with us, Jarl."
[/message]
[/else]
[/if]
[message]
speaker=Kaleh
message= _ "Thank you very much for your help. We were worried about getting lost in all these twisting tunnels. And we would be honored to have you come with us, $ally_unit.name."
[/message]
{CLEAR_VARIABLE ally_unit}

[if]
[have_unit]
Expand Down
Expand Up @@ -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]

Expand Down Expand Up @@ -356,26 +356,11 @@
message= _ "Darmog has never been above ground, but Darmog understand your story. A leader must protect and care for his people. Every people deserve to find their own home. If we can help you we will."
[/message]

[if]
[variable]
name=ally_name
equals=Grog
[/variable]

[then]
[message]
speaker=Spiritual Advisor
message= _ "We may be able to help you find a way back to the sunlit lands. In our temples we do keep records of the past. We have not walked above the earth for many many generations, not since the darkness drove us underground. But we are masters of the underground lands, and we have explored many tunnels. Recently one of our scouts found a path that leads north back to the sunlit lands, I think it may be the way you are trying to go. In reward for your achievements, we will help you. Grog has volunteered to protect you and lead you back to the sunlight lands."
[/message]
[/then]

[else]
[message]
speaker=Spiritual Advisor
message= _ "We may be able to help you find a way back to the sunlit lands. In our temples we do keep records of the past. We have not walked above the earth for many many generations, not since the darkness drove us underground. But we are masters of the underground lands, and we have explored many tunnels. Recently one of our scouts found a path that leads north back to the sunlit lands, I think it may be the way you are trying to go. In reward for your achievements, we will help you. Nog has volunteered to protect you and lead you back to the sunlight lands."
[/message]
[/else]
[/if]
{SET_ALLY_UNIT}
[message]
speaker=Spiritual Advisor
message= _ "We may be able to help you find a way back to the sunlit lands. In our temples we do keep records of the past. We have not walked above the earth for many many generations, not since the darkness drove us underground. But we are masters of the underground lands, and we have explored many tunnels. Recently one of our scouts found a path that leads north back to the sunlit lands, I think it may be the way you are trying to go. In reward for your achievements, we will help you. $ally_unit.name has volunteered to protect you and lead you back to the sunlight lands."
[/message]

[if]
[variable]
Expand Down Expand Up @@ -404,26 +389,11 @@
[/if]
{CLEAR_VARIABLE saved_grog}

[if]
[variable]
name=ally_name
equals=Grog
[/variable]

[then]
[message]
speaker=Kaleh
message= _ "Thank you very much for your help. We were worried about getting lost in all these twisting tunnels. And we would be honored to have you come with us, Grog."
[/message]
[/then]

[else]
[message]
speaker=Kaleh
message= _ "Thank you very much for your help. We were worried about getting lost in all these twisting tunnels. And we would be honored to have you come with us, Nog."
[/message]
[/else]
[/if]
[message]
speaker=Kaleh
message= _ "Thank you very much for your help. We were worried about getting lost in all these twisting tunnels. And we would be honored to have you come with us, $ally_unit.name."
[/message]
{CLEAR_VARIABLE ally_unit}

[if]
[have_unit]
Expand Down

0 comments on commit 48c8d6b

Please sign in to comment.