WC2 Plot: make it independent of player sides

This commit is contained in:
Severin Glöckner 2021-10-22 20:44:50 +02:00
parent 29cc34d00f
commit 8d89950249

View file

@ -8,7 +8,7 @@
local _ = wesnoth.textdomain "wesnoth-wc"
-- speechs need be rewritten
-- todo: speechs need be rewritten
function add_plot(scenario, scenario_num, nplayers)
scenario.event = scenario.event or {}
local start_event = { name = "start" }
@ -29,6 +29,16 @@ function add_plot(scenario, scenario_num, nplayers)
side = side
})
end
-- With > 3 players, ai sides have different side numbers.
local ai1 = math.max(nplayers, 3) + 1
local ai2 = math.max(nplayers, 3) + 2
local ai3 = math.max(nplayers, 3) + 3
local ai4 = math.max(nplayers, 3) + 4
-- local ai5 = math.max(nplayers, 3) + 5
-- local ai6 = math.max(nplayers, 3) + 6
-- Experienced players determine from the ai speakers their faction.
if scenario_num == 1 then
if nplayers > 1 then
start_message("2", true, _ "To war! Prepare to defend yourselves!")
@ -37,32 +47,32 @@ function add_plot(scenario, scenario_num, nplayers)
else
start_message("1", true, _ "To war! Prepare to defend yourselves!")
end
start_message("4", true, _ "Foolish upstarts. You will never defeat us! Come, my allies. Let us crush them!")
start_message("4", false, _ "Yes! We will drive them into the sea!")
start_message(ai1, true, _ "Foolish upstarts. You will never defeat us! Come, my allies. Let us crush them!")
start_message(ai1, false, _ "Yes! We will drive them into the sea!")
start_message("1,2,3", false, _ "Never fear! Your trusted friends stand beside you!")
end_message("1,2,3", true, _ "Victory is ours! Let us set sail in search of new lands to conquer!")
elseif scenario_num == 2 then
local r = mathx.random(nplayers)
start_message(r, true, _ "Ahhh. Just look at these fertile lands, ripe for conquest!")
start_message("4", true, _ "Whats this?! Foreign invaders have set foot upon our shores!")
start_message("5", true, _ "Well send them back to where they came from quick enough. All troops, to me!")
start_message(ai1, true, _ "Whats this?! Foreign invaders have set foot upon our shores!")
start_message(ai2, true, _ "Well send them back to where they came from quick enough. All troops, to me!")
end_message("1,2,3", false, _ "We win! Truly ours will be a glorious empire!")
end_message("1,2,3", true, _ "Do not get hasty! To reach the great continents of the east we must subdue the savage coast of Moragdu, notorious for its corsairs, before we can advance further.")
elseif scenario_num == 3 then
start_message("4", true, _ "Whats this? It is a long time since strangers have set foot upon Moragdu — and in such great numbers too!")
start_message("5", true, _ "The time of prophecies is upon us! The destroyers have arrived from beyond the sea!")
start_message("6", true, _ "I dont know what the lizard is babbling about, but well sort these destroyers out quickly enough.")
start_message(ai1, true, _ "Whats this? It is a long time since strangers have set foot upon Moragdu — and in such great numbers too!")
start_message(ai2, true, _ "The time of prophecies is upon us! The destroyers have arrived from beyond the sea!")
start_message(ai3, true, _ "I dont know what the lizard is babbling about, but well sort these destroyers out quickly enough.")
end_message("1,2,3", true, _ "Victory is ours! Let us set sail in search of new lands to conquer!")
elseif scenario_num == 4 then
local r = mathx.random(nplayers)
start_message("5", true, _ "Ready yourselves, men! The conquering hordes are upon us!")
start_message("4", true, _ "Word has come to our island of your victories. Your army is impressive, but it will avail you not.")
start_message("6", true, _ "Indeed. You come this far, and no farther!")
start_message(ai2, true, _ "Ready yourselves, men! The conquering hordes are upon us!")
start_message(ai1, true, _ "Word has come to our island of your victories. Your army is impressive, but it will avail you not.")
start_message(ai3, true, _ "Indeed. You come this far, and no farther!")
start_message(r, true, _ "Hah! We didnt come all this way just to give up and go home. We will destroy you as we have destroyed all that have stood before us!")
start_message("7", true, _ "So be it. We stand squarely behind our allies.")
start_message(ai4, true, _ "So be it. We stand squarely behind our allies.")
start_message("2,3", true, _ "You are not the only ones with allies! Well push on till the end!")
end_message("1,2,3", true, _ "Onwards to the ships!")
@ -72,8 +82,8 @@ function add_plot(scenario, scenario_num, nplayers)
local r = mathx.random(nplayers)
start_message(r, true, _ "Finally we come to the shores of the last continent. Here at the edge of the world our empire shall be made complete.")
start_message("4", true, _ "Never! Your mad quest ends here, tyrant.")
start_message("5", false, _ "All the peoples of the world stand against you. Though we would be enemies otherwise, we are united in our cause. We must stop you!")
start_message(ai1, true, _ "Never! Your mad quest ends here, tyrant.")
start_message(ai2, false, _ "All the peoples of the world stand against you. Though we would be enemies otherwise, we are united in our cause. We must stop you!")
start_message("1,2,3", false, _ "No, not all of them. Today our full strength stands behind our allies!")
end_message("1", true, _ "Thats it, our work is done here!")