Moddable victories (#6161)

* Added a moddable (but not yet functional) file for victories

* Spaceship parts are units now

* Fixed tests

* Added milestone objects

* Made 'our status' table in VictoryScreen dependend on file

* Updated VictoryManager to use the new Milestone system

* Fixed bug where in vanilla too many spaceship parts could beb uild

* Whoops

* Updated global victory table to use the jsons

* Updated the new game screen to show the new victory types
Also started with the deprecation of VictorType

* Did some translation stuff, also finally fixed the tests

* Removed VictoryType and reworked AI to use Milestones instead

* Add some checks for the victory file; tested that custom victories work
Also moves some code to a better spot and fixes compilation errors

* Fixed some things I thought about while falling asleep
Most notably: built -> build; fixed spaceship part construction 
priority; removed more code for the old system

* Fixed translation issues on the victory screen
This commit is contained in:
Xander Lenstra
2022-04-24 21:45:38 +02:00
committed by GitHub
parent 382707a6a5
commit 34105efdda
38 changed files with 691 additions and 388 deletions

View File

@ -0,0 +1,42 @@
[
{
"name": "Scientific",
"victoryScreenHeader": "Complete all the spaceship parts\nto win!",
"milestones": [
"Build [Apollo Program]", "Add all [spaceship parts] in capital"
],
"requiredSpaceshipParts": [
"SS Engine", "SS Stasis Chamber", "SS Cockpit", "SS Booster", "SS Booster", "SS Booster"
],
"victoryString": "You have achieved victory through mastery of Science! You have conquered the mysteries of nature and led your people on a voyage to a brave new world! Your triumph will be remembered as long as the stars burn in the night sky!",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
},
{
"name": "Cultural",
"victoryScreenHeader": "Complete 5 policy branches and\nbuild the Utopia Project to win!",
"milestones": ["Complete [5] Policy branches", "Build [Utopia Project]"],
"victoryString": "You have achieved victory through the awesome power of your Culture. Your civilization's greatness - the magnificence of its monuments and the power of its artists - have astounded the world! Poets will honor you as long as beauty brings gladness to a weary heart.",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
},
{
"name": "Domination",
"victoryScreenHeader": "Destroy all enemies\nto win!",
"milestones": ["Destroy all players"],
"victoryString": "The world has been convulsed by war. Many great and powerful civilizations have fallen, but you have survived - and emerged victorious! The world will long remember your glorious triumph!",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
},
{
"name": "Diplomatic",
"hiddenInVictoryScreen": true,
"milestones": ["[United Nations] build globally", "Win diplomatic vote"],
"victoryString": "You have triumphed over your foes through the art of diplomacy! Your cunning and wisdom have earned you great friends - and divided and sown confusion among your enemies! Forever will you be remembered as the leader who brought peace to this weary world!",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
},
{
"name": "Time",
"hiddenInVictoryScreen": true,
"milestones": ["Have highest score after max turns"],
"victoryString": "The world has been convulsed by war. Many great and powerful civilizations have fallen, but you have survived - and emerged victorious! The world will long remember your glorious triumph!",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
}
]

View File

@ -1356,7 +1356,7 @@
"cost": 500,
"requiredTech": "Robotics",
"requiredResource": "Aluminum",
"uniques": ["Spaceship part", "Cannot be purchased", "Only available <if [Apollo Program] is constructed>", "Uncapturable", "Can be added to [The Spaceship] in the Capital"]
"uniques": ["Spaceship part", "Cannot be purchased", "Only available <if [Apollo Program] is constructed>", "Uncapturable", "Can be added to [The Spaceship] in the Capital", "Limited to [3] per Civilization"]
// costs 1500 in BNW
},
{
@ -1366,7 +1366,7 @@
"cost": 750,
"requiredTech": "Satellites",
"requiredResource": "Aluminum",
"uniques": ["Spaceship part", "Cannot be purchased", "Only available <if [Apollo Program] is constructed>", "Uncapturable", "Can be added to [The Spaceship] in the Capital"]
"uniques": ["Spaceship part", "Cannot be purchased", "Only available <if [Apollo Program] is constructed>", "Uncapturable", "Can be added to [The Spaceship] in the Capital", "Limited to [1] per Civilization"]
// costs 1500 in BNW
},
{
@ -1376,7 +1376,7 @@
"cost": 750,
"requiredTech": "Particle Physics",
"requiredResource": "Aluminum",
"uniques": ["Spaceship part", "Cannot be purchased", "Only available <if [Apollo Program] is constructed>", "Uncapturable", "Can be added to [The Spaceship] in the Capital"]
"uniques": ["Spaceship part", "Cannot be purchased", "Only available <if [Apollo Program] is constructed>", "Uncapturable", "Can be added to [The Spaceship] in the Capital", "Limited to [1] per Civilization"]
// costs 1500 in BNW
},
{
@ -1386,7 +1386,7 @@
"cost": 750,
"requiredTech": "Nanotechnology",
"requiredResource": "Aluminum",
"uniques": ["Spaceship part", "Cannot be purchased", "Only available <if [Apollo Program] is constructed>", "Uncapturable", "Can be added to [The Spaceship] in the Capital"]
"uniques": ["Spaceship part", "Cannot be purchased", "Only available <if [Apollo Program] is constructed>", "Uncapturable", "Can be added to [The Spaceship] in the Capital", "Limited to [1] per Civilization"]
// costs 1500 in BNW
}
]

View File

@ -0,0 +1,42 @@
[
{
"name": "Scientific",
"victoryScreenHeader": "Complete all the spaceship parts\nto win!",
"milestones": [
"Build [Apollo Program]", "Add all [spaceship parts] in capital"
],
"requiredSpaceshipParts": [
"SS Engine", "SS Stasis Chamber", "SS Cockpit", "SS Booster", "SS Booster", "SS Booster"
],
"victoryString": "You have achieved victory through mastery of Science! You have conquered the mysteries of nature and led your people on a voyage to a brave new world! Your triumph will be remembered as long as the stars burn in the night sky!",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
},
{
"name": "Cultural",
"victoryScreenHeader": "Complete 5 policy branches and\nbuild the Utopia Project to win!",
"milestones": ["Complete [5] Policy branches", "Build [Utopia Project]"],
"victoryString": "You have achieved victory through the awesome power of your Culture. Your civilization's greatness - the magnificence of its monuments and the power of its artists - have astounded the world! Poets will honor you as long as beauty brings gladness to a weary heart.",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
},
{
"name": "Domination",
"victoryScreenHeader": "Destroy all enemies\nto win!",
"milestones": ["Destroy all players"],
"victoryString": "The world has been convulsed by war. Many great and powerful civilizations have fallen, but you have survived - and emerged victorious! The world will long remember your glorious triumph!",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
},
{
"name": "Diplomatic",
"hiddenInVictoryScreen": true,
"milestones": ["[United Nations] build globally", "Win diplomatic vote"],
"victoryString": "You have triumphed over your foes through the art of diplomacy! Your cunning and wisdom have earned you great friends - and divided and sown confusion among your enemies! Forever will you be remembered as the leader who brought peace to this weary world!",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
},
{
"name": "Time",
"hiddenInVictoryScreen": true,
"milestones": ["Have highest score after max turns"],
"victoryString": "The world has been convulsed by war. Many great and powerful civilizations have fallen, but you have survived - and emerged victorious! The world will long remember your glorious triumph!",
"defeatString": "You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory!"
}
]

View File

@ -415,6 +415,8 @@ Starting Era =
It looks like we can't make a map with the parameters you requested! =
Maybe you put too many players into too small a map? =
No human players selected! =
Invalid Player ID! =
No victory conditions were selected! =
Mods: =
Extension mods: =
Base ruleset: =
@ -1078,31 +1080,22 @@ Number of your cities\ndemanding this resource for\n'We Love The King Day' =
# Victory
Science victory =
Cultural victory =
Conquest victory =
Diplomatic victory =
Complete all the spaceship parts\n to win! =
Complete 5 policy branches\n to win! =
Complete 5 policy branches and build\n the Utopia Project to win! =
Destroy all enemies\n to win! =
[victoryType] Victory =
Built [building] =
Add all spaceship parts in capital =
Destroy all players =
Capture all capitals =
Complete [amount] Policy branche =
You have won a [victoryType] Victory! =
You have achieved victory through the awesome power of your Culture. Your civilization's greatness - the magnificence of its monuments and the power of its artists - have astounded the world! Poets will honor you as long as beauty brings gladness to a weary heart. =
The world has been convulsed by war. Many great and powerful civilizations have fallen, but you have survived - and emerged victorious! The world will long remember your glorious triumph! =
You have achieved victory through mastery of Science! You have conquered the mysteries of nature and led your people on a voyage to a brave new world! Your triumph will be remembered as long as the stars burn in the night sky! =
[civilization] has won a [victoryType] Victory! =
Your civilization stands above all others! The exploits of your people shall be remembered until the end of civilization itself! =
You have been defeated. Your civilization has been overwhelmed by its many foes. But your people do not despair, for they know that one day you shall return - and lead them forward to victory! =
You have triumphed over your foes through the art of diplomacy! Your cunning and wisdom have earned you great friends - and divided and sown confusion among your enemies! Forever will you be remembered as the leader who brought peace to this weary world! =
The world has been convulsed by war. Many great and powerful civilizations have fallen, but you have survived - and emerged victorious! The world will long remember your glorious triumph! =
One more turn...! =
Built Apollo Program =
Destroy [civName] =
Capture [cityName] =
Our status =
Global status =
Rankings =
Spaceship parts remaining =
Branches completed =
Undefeated civs =
# The \n here means: put a newline (enter) here. If this is omitted, the sidebox in the diplomacy overview will become _really_ wide.
# Feel free to replace it with a space and put it between other words in your translation
Turns until the next\ndiplomacy victory vote: [amount] =