From 9ec42a77a1a28cb0c5ba6bc6c830e845e412e46b Mon Sep 17 00:00:00 2001 From: elexis Date: Fri, 14 Jul 2017 18:57:33 +0000 Subject: [PATCH] Play more music tracks. Register the new track "Tale Of Warriors" from 11c6dec383 with the game. Register "Calm Before the Storm" and "Tavern in the Mist", which were not heard in the previous releases. Play some peace tracks for all civilizations, as intended by Omri (thus play some music for observers too, refs #4298). Add more background tracks to the menu as agreed with WhiteTreePaladin. Keep "Honor Bound" the first one, as proposed by Itms and leper. Add some tracks that are played only for one civ to other civs, to reduce the repetition. Remove duplicate, now unused music code. Differential Revision: https://code.wildfiregames.com/D732 Fixes #4565. This was SVN commit r19918. --- binaries/data/mods/public/gui/common/music.js | 29 ++++++++++--------- .../public/simulation/data/civs/athen.json | 1 + .../public/simulation/data/civs/brit.json | 1 + .../public/simulation/data/civs/cart.json | 1 + .../public/simulation/data/civs/gaul.json | 2 +- .../public/simulation/data/civs/iber.json | 1 + .../public/simulation/data/civs/mace.json | 1 + .../public/simulation/data/civs/maur.json | 2 ++ .../public/simulation/data/civs/pers.json | 2 ++ .../public/simulation/data/civs/ptol.json | 2 ++ .../public/simulation/data/civs/rome.json | 1 + .../public/simulation/data/civs/spart.json | 1 + 12 files changed, 29 insertions(+), 15 deletions(-) diff --git a/binaries/data/mods/public/gui/common/music.js b/binaries/data/mods/public/gui/common/music.js index 44e8532762..ada77a4ceb 100644 --- a/binaries/data/mods/public/gui/common/music.js +++ b/binaries/data/mods/public/gui/common/music.js @@ -51,8 +51,16 @@ function Music() Music.prototype.resetTracks = function() { this.tracks = { - MENU: ["Honor_Bound.ogg"], - PEACE: [], + "MENU": ["Honor_Bound.ogg"].concat(shuffleArray([ + "An_old_Warhorse_goes_to_Pasture.ogg", + "Calm_Before_the_Storm.ogg", + "Juno_Protect_You.ogg" + ])), + "PEACE": [ + "Tale_of_Warriors.ogg", + "Tavern_in_the_Mist.ogg", + "The_Road_Ahead.ogg" + ], BATTLE: ["Taiko_1.ogg", "Taiko_2.ogg"], VICTORY : ["You_are_Victorious!.ogg"], DEFEAT : ["Dried_Tears.ogg"] @@ -79,23 +87,23 @@ Music.prototype.updateState = function() break; case this.states.MENU: - this.switchMusic(pickRandom(this.tracks.MENU), 0, true); + this.startPlayList(this.tracks.MENU, 0, true); break; case this.states.PEACE: - this.startPlayList(this.tracks.PEACE, 3.0, true); + this.startPlayList(shuffleArray(this.tracks.PEACE), 3.0, true); break; case this.states.BATTLE: - this.startPlayList(this.tracks.BATTLE, 2.0, true); + this.startPlayList(shuffleArray(this.tracks.BATTLE), 2.0, true); break; case this.states.VICTORY: - this.startPlayList(this.tracks.VICTORY, 2.0, true); + this.startPlayList(shuffleArray(this.tracks.VICTORY), 2.0, true); break; case this.states.DEFEAT: - this.startPlayList(this.tracks.DEFEAT, 2.0, true); + this.startPlayList(shuffleArray(this.tracks.DEFEAT), 2.0, true); break; default: @@ -141,13 +149,6 @@ Music.prototype.startPlayList = function(tracks, fadeInPeriod, isLooping) Engine.StartPlaylist(isLooping); }; -Music.prototype.switchMusic = function(track, fadeInPeriod, isLooping) -{ - Engine.ClearPlaylist(); - Engine.AddPlaylistItem( this.RELATIVE_MUSIC_PATH + track ); - Engine.StartPlaylist(isLooping); -}; - Music.prototype.isPlaying = function() { return Engine.MusicPlaying(); diff --git a/binaries/data/mods/public/simulation/data/civs/athen.json b/binaries/data/mods/public/simulation/data/civs/athen.json index 9448690698..c1674bf3e4 100644 --- a/binaries/data/mods/public/simulation/data/civs/athen.json +++ b/binaries/data/mods/public/simulation/data/civs/athen.json @@ -7,6 +7,7 @@ "Music":[ {"File":"Harvest_Festival.ogg", "Type":"peace"}, {"File":"Forging_a_City-State.ogg", "Type":"peace"}, + {"File":"Highland_Mist.ogg", "Type":"peace"}, {"File":"The_Hellespont.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/brit.json b/binaries/data/mods/public/simulation/data/civs/brit.json index 471784fa76..9f63b07f05 100644 --- a/binaries/data/mods/public/simulation/data/civs/brit.json +++ b/binaries/data/mods/public/simulation/data/civs/brit.json @@ -8,6 +8,7 @@ {"File":"Highland_Mist.ogg", "Type":"peace"}, {"File":"Water's_Edge.ogg", "Type":"peace"}, {"File":"Celtic_Pride.ogg", "Type":"peace"}, + {"File":"Cisalpine_Gaul.ogg", "Type":"peace"}, {"File":"Celtica.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/cart.json b/binaries/data/mods/public/simulation/data/civs/cart.json index 232761c348..e76782db7e 100644 --- a/binaries/data/mods/public/simulation/data/civs/cart.json +++ b/binaries/data/mods/public/simulation/data/civs/cart.json @@ -6,6 +6,7 @@ "History": "Carthage, a city-state in modern-day Tunisia, was a formidable force in the western Mediterranean, eventually taking over much of North Africa and modern-day Spain in the third century B.C. The sailors of Carthage were among the fiercest contenders on the high seas, and masters of naval trade. They deployed towered War Elephants on the battlefield to fearsome effect, and had defensive walls so strong, they were never breached.", "Music":[ {"File":"Mediterranean_Waves.ogg", "Type":"peace"}, + {"File":"Harsh_Lands_Rugged_People.ogg", "Type":"peace"}, {"File":"Peaks_of_Atlas.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/gaul.json b/binaries/data/mods/public/simulation/data/civs/gaul.json index a99ce56972..076fba9caa 100644 --- a/binaries/data/mods/public/simulation/data/civs/gaul.json +++ b/binaries/data/mods/public/simulation/data/civs/gaul.json @@ -5,9 +5,9 @@ "Emblem": "session/portraits/emblems/emblem_celts.png", "History": "The Gauls were the Celtic tribes of continental Europe. Dominated by a priestly class of Druids, they featured a sophisticated culture of advanced metalworking, agriculture, trade and even road engineering. With heavy infantry and cavalry, Gallic warriors valiantly resisted Caesar's campaign of conquest and Rome's authoritarian rule.", "Music":[ - {"File":"The_Road_Ahead.ogg", "Type":"peace"}, {"File":"Celtic_Pride.ogg", "Type":"peace"}, {"File":"Cisalpine_Gaul.ogg", "Type":"peace"}, + {"File":"Harvest_Festival.ogg", "Type":"peace"}, {"File":"Water's_Edge.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/iber.json b/binaries/data/mods/public/simulation/data/civs/iber.json index 2aa72860cd..87dd418c29 100644 --- a/binaries/data/mods/public/simulation/data/civs/iber.json +++ b/binaries/data/mods/public/simulation/data/civs/iber.json @@ -6,6 +6,7 @@ "History": "The Iberians were a people of mysterious origins and language, with a strong tradition of horsemanship and metalworking. A relatively peaceful culture, they usually fought in other's battles only as mercenaries. However, they proved tenacious when Rome sought to take their land and freedom from them, and employed pioneering guerrilla tactics and flaming javelins as they fought back.", "Music":[ {"File":"An_old_Warhorse_goes_to_Pasture.ogg", "Type":"peace"}, + {"File":"Celtica.ogg", "Type":"peace"}, {"File":"Harsh_Lands_Rugged_People.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/mace.json b/binaries/data/mods/public/simulation/data/civs/mace.json index a29256ea94..6f4c3198c2 100644 --- a/binaries/data/mods/public/simulation/data/civs/mace.json +++ b/binaries/data/mods/public/simulation/data/civs/mace.json @@ -7,6 +7,7 @@ "Music":[ {"File":"Rise_of_Macedon.ogg", "Type":"peace"}, {"File":"In_the_Shadow_of_Olympus.ogg", "Type":"peace"}, + {"File":"Elysian_Fields.ogg", "Type":"peace"}, {"File":"The_Hellespont.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/maur.json b/binaries/data/mods/public/simulation/data/civs/maur.json index 7dd4b17b96..2a77f50377 100644 --- a/binaries/data/mods/public/simulation/data/civs/maur.json +++ b/binaries/data/mods/public/simulation/data/civs/maur.json @@ -5,7 +5,9 @@ "Emblem": "session/portraits/emblems/emblem_mauryans.png", "History": "Founded in 322 B.C. by Chandragupta Maurya, the Mauryan Empire was the first to rule most of the Indian subcontinent, and was one of the largest and most populous empires of antiquity. Its military featured bowmen who used the long-range bamboo longbow, fierce female warriors, chariots, and thousands of armored war elephants. Its philosophers, especially the famous Acharya Chanakya, contributed to such varied fields such as economics, religion, diplomacy, warfare, and good governance. Under the rule of Ashoka the Great, the empire saw 40 years of peace, harmony, and prosperity.", "Music":[ + {"File":"An_old_Warhorse_goes_to_Pasture.ogg", "Type":"peace"}, {"File":"Land_between_the_two_Seas.ogg", "Type":"peace"}, + {"File":"Eastern_Dreams.ogg", "Type":"peace"}, {"File":"Karmic_Confluence.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/pers.json b/binaries/data/mods/public/simulation/data/civs/pers.json index a42a140388..0585f27d43 100644 --- a/binaries/data/mods/public/simulation/data/civs/pers.json +++ b/binaries/data/mods/public/simulation/data/civs/pers.json @@ -6,6 +6,8 @@ "History": "The Persian Empire, when ruled by the Achaemenid dynasty, was one of the greatest empires of antiquity, stretching at its zenith from the Indus Valley in the east to Greece in the west. The Persians were the pioneers of empire-building of the ancient world, successfully imposing a centralized rule over various peoples with different customs, laws, religions and languages, and building a cosmopolitan army made up of contingents from each of these nations.", "Music":[ {"File":"Eastern_Dreams.ogg", "Type":"peace"}, + {"File":"Valley_of_the_Nile.ogg", "Type":"peace"}, + {"File":"Land_between_the_two_Seas.ogg", "Type":"peace"}, {"File":"Sands_of_Time.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/ptol.json b/binaries/data/mods/public/simulation/data/civs/ptol.json index 12b9cae3a5..0b3b827d4c 100644 --- a/binaries/data/mods/public/simulation/data/civs/ptol.json +++ b/binaries/data/mods/public/simulation/data/civs/ptol.json @@ -6,6 +6,8 @@ "History":"The Ptolemaic dynasty was a Macedonian Greek royal family which ruled the Ptolemaic Empire in Egypt during the Hellenistic period. Their rule lasted for 275 years, from 305 BC to 30 BC. They were the last dynasty of ancient Egypt.", "Music":[ {"File":"Ammon-Ra.ogg", "Type":"peace"}, + {"File":"Sands_of_Time.ogg", "Type":"peace"}, + {"File":"Land_between_the_two_Seas.ogg", "Type":"peace"}, {"File":"Valley_of_the_Nile.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/rome.json b/binaries/data/mods/public/simulation/data/civs/rome.json index c4fee66ff8..4429fb66e3 100644 --- a/binaries/data/mods/public/simulation/data/civs/rome.json +++ b/binaries/data/mods/public/simulation/data/civs/rome.json @@ -6,6 +6,7 @@ "History": "The Romans controlled one of the largest empires of the ancient world, stretching at its peak from southern Scotland to the Sahara Desert, and containing between 60 million and 80 million inhabitants, one quarter of the Earth's population at that time. Rome also remained one of the strongest nations on earth for almost 800 years. The Romans were the supreme builders of the ancient world, excelled at siege warfare and had an exquisite infantry and navy.", "Music":[ {"File":"Juno_Protect_You.ogg", "Type":"peace"}, + {"File":"Mediterranean_Waves.ogg", "Type":"peace"}, {"File":"Elysian_Fields.ogg", "Type":"peace"} ], "Factions": diff --git a/binaries/data/mods/public/simulation/data/civs/spart.json b/binaries/data/mods/public/simulation/data/civs/spart.json index 599ca9612d..59e15c36be 100644 --- a/binaries/data/mods/public/simulation/data/civs/spart.json +++ b/binaries/data/mods/public/simulation/data/civs/spart.json @@ -6,6 +6,7 @@ "History":"Sparta was a prominent city-state in ancient Greece, and its dominant military power on land from circa 650 B.C. Spartan culture was obsessed with military training and excellence, with rigorous training for boys beginning at age seven. Thanks to its military might, Sparta led a coalition of Greek forces during the Greco-Persian Wars, and won over Athens in the Peloponnesian Wars, though at great cost.", "Music":[ {"File":"Helen_Leaves_Sparta.ogg", "Type":"peace"}, + {"File":"Peaks_of_Atlas.ogg", "Type":"peace"}, {"File":"Forging_a_City-State.ogg", "Type":"peace"}, {"File":"The_Hellespont.ogg", "Type":"peace"} ],