mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 07:48:31 +07:00
First step into unifying strength bonuses using conditionals (#5345)
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 1005 KiB After Width: | Height: | Size: 1010 KiB |
@ -89,7 +89,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Honor",
|
"name": "Honor",
|
||||||
"era": "Ancient era",
|
"era": "Ancient era",
|
||||||
"uniques": ["+[33]% Strength vs [Barbarians]", "Earn [100]% of killed [Barbarian] unit's [Strength] as [Culture]",
|
"uniques": ["[+33]% Strength <vs [Barbarian] units>", "Earn [100]% of killed [Barbarian] unit's [Strength] as [Culture]",
|
||||||
"Notified of new Barbarian encampments"],
|
"Notified of new Barbarian encampments"],
|
||||||
"policies": [
|
"policies": [
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Volley",
|
"name": "Volley",
|
||||||
"prerequisites": ["Accuracy I","Barrage I"],
|
"prerequisites": ["Accuracy I","Barrage I"],
|
||||||
"uniques": ["+[50]% Strength vs [City]"],
|
"uniques": ["[+50]% Strength <vs cities>"],
|
||||||
"unitTypes": ["Archery","Ranged Gunpowder","Siege"]
|
"unitTypes": ["Archery","Ranged Gunpowder","Siege"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -101,25 +101,25 @@
|
|||||||
{
|
{
|
||||||
"name": "Charge",
|
"name": "Charge",
|
||||||
"prerequisites": ["Shock II","Drill II"],
|
"prerequisites": ["Shock II","Drill II"],
|
||||||
"uniques": ["+[33]% Strength vs [wounded units]"],
|
"uniques": ["[+33]% Strength <vs [Wounded] units>"],
|
||||||
"unitTypes": ["Mounted","Armored"]
|
"unitTypes": ["Mounted","Armored"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Besiege", // Not called "Siege" in order to not conflict with siege type units for translations
|
"name": "Besiege", // Not called "Siege" in order to not conflict with siege type units for translations
|
||||||
"prerequisites": ["Shock II","Drill II"],
|
"prerequisites": ["Shock II","Drill II"],
|
||||||
"uniques": ["+[50]% Strength vs [City]"],
|
"uniques": ["[+50]% Strength <vs cities>"],
|
||||||
"unitTypes": ["Sword","Gunpowder"]
|
"unitTypes": ["Sword","Gunpowder"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Formation I",
|
"name": "Formation I",
|
||||||
"prerequisites": ["Shock II","Drill II"], // G&K also has Accuracy II & Barrage II as possible prerequisites for this, but I couldn't find a source for the unittypes
|
"prerequisites": ["Shock II","Drill II"], // G&K also has Accuracy II & Barrage II as possible prerequisites for this, but I couldn't find a source for the unittypes
|
||||||
"uniques": ["+[33]% Strength vs [Mounted]"],
|
"uniques": ["[+33]% Strength <vs [Mounted] units>"],
|
||||||
"unitTypes": ["Sword","Gunpowder","Mounted"]
|
"unitTypes": ["Sword","Gunpowder","Mounted"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Formation II",
|
"name": "Formation II",
|
||||||
"prerequisites": ["Formation I"],
|
"prerequisites": ["Formation I"],
|
||||||
"uniques": ["+[33]% Strength vs [Mounted]"],
|
"uniques": ["[+33]% Strength <vs [Mounted] units>"],
|
||||||
"unitTypes": ["Sword","Gunpowder","Mounted"]
|
"unitTypes": ["Sword","Gunpowder","Mounted"]
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -194,56 +194,56 @@
|
|||||||
// Water melee
|
// Water melee
|
||||||
{
|
{
|
||||||
"name": "Boarding Party I",
|
"name": "Boarding Party I",
|
||||||
"uniques": ["+[15]% Strength vs [water units]"],
|
"uniques": ["[+15]% Strength <vs [Water] units>"],
|
||||||
"unitTypes": ["Melee Water"]
|
"unitTypes": ["Melee Water"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Boarding Party II",
|
"name": "Boarding Party II",
|
||||||
"prerequisites": ["Boarding Party I"],
|
"prerequisites": ["Boarding Party I"],
|
||||||
"uniques": ["+[15]% Strength vs [water units]"],
|
"uniques": ["[+15]% Strength <vs [Water] units>"],
|
||||||
"unitTypes": ["Melee Water"]
|
"unitTypes": ["Melee Water"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Boarding Party III",
|
"name": "Boarding Party III",
|
||||||
"prerequisites": ["Boarding Party II"],
|
"prerequisites": ["Boarding Party II"],
|
||||||
"uniques": ["+[15]% Strength vs [water units]"],
|
"uniques": ["+[15]% Strength <vs [Water] units>"],
|
||||||
"unitTypes": ["Melee Water"]
|
"unitTypes": ["Melee Water"]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Coastal Raider I",
|
"name": "Coastal Raider I",
|
||||||
"uniques": ["+[20]% Strength vs [City]", "Earn [33]% of the damage done to [City] units as [Gold]"],
|
"uniques": ["[+20]% Strength <vs cities>", "Earn [33]% of the damage done to [City] units as [Gold]"],
|
||||||
"unitTypes": ["Melee Water"]
|
"unitTypes": ["Melee Water"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Coastal Raider II",
|
"name": "Coastal Raider II",
|
||||||
"prerequisites": ["Coastal Raider I"],
|
"prerequisites": ["Coastal Raider I"],
|
||||||
"uniques": ["+[20]% Strength vs [City]", "Earn [33]% of the damage done to [City] units as [Gold]"],
|
"uniques": ["[+20]% Strength <vs cities>", "Earn [33]% of the damage done to [City] units as [Gold]"],
|
||||||
"unitTypes": ["Melee Water"]
|
"unitTypes": ["Melee Water"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Coastal Raider III",
|
"name": "Coastal Raider III",
|
||||||
"prerequisites": ["Coastal Raider II"],
|
"prerequisites": ["Coastal Raider II"],
|
||||||
"uniques": ["+[20]% Strength vs [City]", "Earn [33]% of the damage done to [City] units as [Gold]"],
|
"uniques": ["[+20]% Strength <vs cities>", "Earn [33]% of the damage done to [City] units as [Gold]"],
|
||||||
"unitTypes": ["Melee Water"]
|
"unitTypes": ["Melee Water"]
|
||||||
},
|
},
|
||||||
|
|
||||||
// Water Ranged
|
// Water Ranged
|
||||||
{
|
{
|
||||||
"name": "Targeting I",
|
"name": "Targeting I",
|
||||||
"uniques": ["+[15]% Strength vs [water units]"],
|
"uniques": ["[+15]% Strength <vs [Water] units>"],
|
||||||
"unitTypes": ["Ranged Water"]
|
"unitTypes": ["Ranged Water"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Targeting II",
|
"name": "Targeting II",
|
||||||
"prerequisites": ["Targeting I"],
|
"prerequisites": ["Targeting I"],
|
||||||
"uniques": ["+[15]% Strength vs [water units]"],
|
"uniques": ["[+15]% Strength <vs [Water] units>"],
|
||||||
"unitTypes": ["Ranged Water"]
|
"unitTypes": ["Ranged Water"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Targeting III",
|
"name": "Targeting III",
|
||||||
"prerequisites": ["Targeting II"],
|
"prerequisites": ["Targeting II"],
|
||||||
"uniques": ["+[15]% Strength vs [water units]"],
|
"uniques": ["[+15]% Strength <vs [Water] units>"],
|
||||||
"unitTypes": ["Ranged Water"]
|
"unitTypes": ["Ranged Water"]
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -313,19 +313,19 @@
|
|||||||
// Bomber
|
// Bomber
|
||||||
{
|
{
|
||||||
"name": "Siege I",
|
"name": "Siege I",
|
||||||
"uniques": ["+[33]% Strength vs [City]"],
|
"uniques": ["[+33]% Strength <vs cities>"],
|
||||||
"unitTypes": ["Bomber"]
|
"unitTypes": ["Bomber"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Siege II",
|
"name": "Siege II",
|
||||||
"prerequisites": ["Siege I"],
|
"prerequisites": ["Siege I"],
|
||||||
"uniques": ["+[33]% Strength vs [City]"],
|
"uniques": ["[+33]% Strength <vs cities>"],
|
||||||
"unitTypes": ["Bomber"]
|
"unitTypes": ["Bomber"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Siege III",
|
"name": "Siege III",
|
||||||
"prerequisites": ["Siege II"],
|
"prerequisites": ["Siege II"],
|
||||||
"uniques": ["+[34]% Strength vs [City]"],
|
"uniques": ["[+34]% Strength <vs cities>"],
|
||||||
"unitTypes": ["Bomber"]
|
"unitTypes": ["Bomber"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -376,13 +376,13 @@
|
|||||||
{
|
{
|
||||||
"name": "Air Targeting I",
|
"name": "Air Targeting I",
|
||||||
"prerequisites": ["Interception I","Dogfighting I", "Siege I","Bombardment I"],
|
"prerequisites": ["Interception I","Dogfighting I", "Siege I","Bombardment I"],
|
||||||
"uniques": ["+[33]% Strength vs [water units]"],
|
"uniques": ["[+33]% Strength <vs [Water] units>"],
|
||||||
"unitTypes": ["Fighter","Bomber"]
|
"unitTypes": ["Fighter","Bomber"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Air Targeting II",
|
"name": "Air Targeting II",
|
||||||
"prerequisites": ["Air Targeting I"],
|
"prerequisites": ["Air Targeting I"],
|
||||||
"uniques": ["+[33]% Strength vs [water units]"],
|
"uniques": ["[+33]% Strength <vs [Water] units>"],
|
||||||
"unitTypes": ["Fighter","Bomber"]
|
"unitTypes": ["Fighter","Bomber"]
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -420,13 +420,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Anti-Armor I",
|
"name": "Anti-Armor I",
|
||||||
"uniques": ["+[25]% Strength vs [Armored]"],
|
"uniques": ["[+25]% Strength <vs [Armored] units>"],
|
||||||
"unitTypes": ["Helicopter"]
|
"unitTypes": ["Helicopter"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Anti-Armor II",
|
"name": "Anti-Armor II",
|
||||||
"prerequisites": ["Anti-Armor I"],
|
"prerequisites": ["Anti-Armor I"],
|
||||||
"uniques": ["+[25]% Strength vs [Armored]"],
|
"uniques": ["[+25]% Strength <vs [Armored] units>"],
|
||||||
"unitTypes": ["Helicopter"]
|
"unitTypes": ["Helicopter"]
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -472,13 +472,13 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Ambush I",
|
"name": "Ambush I",
|
||||||
"uniques": ["+[33]% Strength vs [Armored]"],
|
"uniques": ["[+33]% Strength <vs [Armored] units>"],
|
||||||
"unitTypes": ["Sword","Gunpowder","Fighter","Bomber"]
|
"unitTypes": ["Sword","Gunpowder","Fighter","Bomber"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Ambush II",
|
"name": "Ambush II",
|
||||||
"prerequisites": ["Ambush I"],
|
"prerequisites": ["Ambush I"],
|
||||||
"uniques": ["+[33]% Strength vs [Armored]"],
|
"uniques": ["[+33]% Strength <vs [Armored] units>"],
|
||||||
"unitTypes": ["Sword","Gunpowder","Fighter","Bomber"]
|
"unitTypes": ["Sword","Gunpowder","Fighter","Bomber"]
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -486,26 +486,26 @@
|
|||||||
// Water ranged and air units
|
// Water ranged and air units
|
||||||
{
|
{
|
||||||
"name": "Bombardment I",
|
"name": "Bombardment I",
|
||||||
"uniques": ["+[33]% Strength vs [land units]"],
|
"uniques": ["[+33]% Strength <vs [Land] units>"],
|
||||||
"unitTypes": ["Ranged Water","Fighter","Bomber"]
|
"unitTypes": ["Ranged Water","Fighter","Bomber"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Bombardment II",
|
"name": "Bombardment II",
|
||||||
"prerequisites": ["Bombardment I"],
|
"prerequisites": ["Bombardment I"],
|
||||||
"uniques": ["+[33]% Strength vs [land units]"],
|
"uniques": ["[+33]% Strength <vs [Land] units>"],
|
||||||
"unitTypes": ["Ranged Water","Fighter","Bomber"]
|
"unitTypes": ["Ranged Water","Fighter","Bomber"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Bombardment III",
|
"name": "Bombardment III",
|
||||||
"prerequisites": ["Bombardment II"],
|
"prerequisites": ["Bombardment II"],
|
||||||
"uniques": ["+[34]% Strength vs [land units]"],
|
"uniques": ["[+34]% Strength <vs [Land] units>"],
|
||||||
"unitTypes": ["Ranged Water","Fighter","Bomber"]
|
"unitTypes": ["Ranged Water","Fighter","Bomber"]
|
||||||
},
|
},
|
||||||
|
|
||||||
// Uniques that should be kept on upgrades
|
// Uniques that should be kept on upgrades
|
||||||
{
|
{
|
||||||
"name": "Morale", // Heroic Epic
|
"name": "Morale", // Heroic Epic
|
||||||
"uniques": ["+[15]% Combat Strength"]
|
"uniques": ["[+15]% Strength"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Great Generals I", // only for Companion Cavalry, Keshik and their subsequent upgrades
|
"name": "Great Generals I", // only for Companion Cavalry, Keshik and their subsequent upgrades
|
||||||
|
@ -185,7 +185,7 @@
|
|||||||
"rangedStrength": 10,
|
"rangedStrength": 10,
|
||||||
"cost": 56,
|
"cost": 56,
|
||||||
"requiredTech": "Sailing",
|
"requiredTech": "Sailing",
|
||||||
"uniques": ["Cannot enter ocean tiles", "+[50]% Strength vs [Water] units"],
|
"uniques": ["Cannot enter ocean tiles", "[+50]% Strength <vs [Water] units>"],
|
||||||
"upgradesTo": "Galleass",
|
"upgradesTo": "Galleass",
|
||||||
"obsoleteTech": "Astronomy",
|
"obsoleteTech": "Astronomy",
|
||||||
"attackSound": "arrow"
|
"attackSound": "arrow"
|
||||||
@ -273,7 +273,7 @@
|
|||||||
"requiredTech": "Bronze Working",
|
"requiredTech": "Bronze Working",
|
||||||
"obsoleteTech": "Civil Service",
|
"obsoleteTech": "Civil Service",
|
||||||
"upgradesTo": "Pikeman",
|
"upgradesTo": "Pikeman",
|
||||||
"uniques": ["+[50]% Strength vs [Mounted]"],
|
"uniques": ["[+50]% Strength <vs [Mounted] units>"],
|
||||||
"attackSound": "metalhit"
|
"attackSound": "metalhit"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -287,7 +287,7 @@
|
|||||||
"requiredTech": "Bronze Working",
|
"requiredTech": "Bronze Working",
|
||||||
"obsoleteTech": "Civil Service",
|
"obsoleteTech": "Civil Service",
|
||||||
"upgradesTo": "Pikeman",
|
"upgradesTo": "Pikeman",
|
||||||
"uniques": ["+[50]% Strength vs [Mounted]"],
|
"uniques": ["[+50]% Strength <vs [Mounted] units>"],
|
||||||
"attackSound": "metalhit"
|
"attackSound": "metalhit"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -301,7 +301,7 @@
|
|||||||
"requiredTech": "Bronze Working",
|
"requiredTech": "Bronze Working",
|
||||||
"obsoleteTech": "Civil Service",
|
"obsoleteTech": "Civil Service",
|
||||||
"upgradesTo": "Pikeman",
|
"upgradesTo": "Pikeman",
|
||||||
"uniques": ["+[50]% Strength vs [Mounted]","[+10] HP when healing"],
|
"uniques": ["[+50]% Strength <vs [Mounted] units>","[+10] HP when healing"],
|
||||||
"attackSound": "metalhit"
|
"attackSound": "metalhit"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -315,7 +315,7 @@
|
|||||||
"requiredTech": "Bronze Working",
|
"requiredTech": "Bronze Working",
|
||||||
"obsoleteTech": "Physics",
|
"obsoleteTech": "Physics",
|
||||||
"upgradesTo": "Trebuchet",
|
"upgradesTo": "Trebuchet",
|
||||||
"uniques": ["+[300]% Strength vs [City]", "No defensive terrain bonus", "+[-33]% Strength when defending",
|
"uniques": ["[+300]% Strength <vs cities>", "No defensive terrain bonus", "+[-33]% Strength when defending",
|
||||||
"-[1] Visibility Range", "Can only attack [City] units"],
|
"-[1] Visibility Range", "Can only attack [City] units"],
|
||||||
"promotions": ["Cover I"],
|
"promotions": ["Cover I"],
|
||||||
"attackSound": "throw"
|
"attackSound": "throw"
|
||||||
@ -330,7 +330,7 @@
|
|||||||
"requiredTech": "Bronze Working",
|
"requiredTech": "Bronze Working",
|
||||||
"obsoleteTech": "Civil Service",
|
"obsoleteTech": "Civil Service",
|
||||||
"upgradesTo": "Pikeman",
|
"upgradesTo": "Pikeman",
|
||||||
"uniques": ["+[50]% Strength vs [Mounted]"],
|
"uniques": ["[+50]% Strength <vs [Mounted] units>"],
|
||||||
"attackSound": "metalhit"
|
"attackSound": "metalhit"
|
||||||
// Barbarian unique Spearman. Has same icon and name but slightly different 3d texture
|
// Barbarian unique Spearman. Has same icon and name but slightly different 3d texture
|
||||||
},
|
},
|
||||||
@ -347,7 +347,7 @@
|
|||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"upgradesTo": "Knight",
|
"upgradesTo": "Knight",
|
||||||
"obsoleteTech": "Chivalry",
|
"obsoleteTech": "Chivalry",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","-[33]% Strength vs [City]" ],
|
"uniques": ["Can move after attacking","No defensive terrain bonus","[-33]% Strength <vs cities>" ],
|
||||||
"hurryCostModifier": 20,
|
"hurryCostModifier": 20,
|
||||||
"attackSound": "horse"
|
"attackSound": "horse"
|
||||||
},
|
},
|
||||||
@ -364,7 +364,7 @@
|
|||||||
"obsoleteTech": "Chivalry",
|
"obsoleteTech": "Chivalry",
|
||||||
"promotions": ["Great Generals I"],
|
"promotions": ["Great Generals I"],
|
||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"uniques": ["Can move after attacking", "No defensive terrain bonus", "-[33]% Strength vs [City]"],
|
"uniques": ["Can move after attacking", "No defensive terrain bonus", "[-33]% Strength <vs cities>"],
|
||||||
"hurryCostModifier": 20,
|
"hurryCostModifier": 20,
|
||||||
"attackSound": "horse"
|
"attackSound": "horse"
|
||||||
},
|
},
|
||||||
@ -380,7 +380,7 @@
|
|||||||
"upgradesTo": "Knight",
|
"upgradesTo": "Knight",
|
||||||
"obsoleteTech": "Chivalry",
|
"obsoleteTech": "Chivalry",
|
||||||
"promotions": ["Great Generals II"],
|
"promotions": ["Great Generals II"],
|
||||||
"uniques": ["Can move after attacking", "No defensive terrain bonus", "-[33]% Strength vs [City]",
|
"uniques": ["Can move after attacking", "No defensive terrain bonus", "[-33]% Strength <vs cities>",
|
||||||
"[-10]% Strength for enemy [Military] units in adjacent [All] tiles"],
|
"[-10]% Strength for enemy [Military] units in adjacent [All] tiles"],
|
||||||
"hurryCostModifier": 20,
|
"hurryCostModifier": 20,
|
||||||
"attackSound": "elephant"
|
"attackSound": "elephant"
|
||||||
@ -396,7 +396,7 @@
|
|||||||
"requiredTech": "Horseback Riding",
|
"requiredTech": "Horseback Riding",
|
||||||
"upgradesTo": "Knight",
|
"upgradesTo": "Knight",
|
||||||
"obsoleteTech": "Chivalry",
|
"obsoleteTech": "Chivalry",
|
||||||
"uniques": ["Can move after attacking", "-[25]% Strength vs [City]"],
|
"uniques": ["Can move after attacking", "[-25]% Strength <vs cities>"],
|
||||||
"hurryCostModifier": 20,
|
"hurryCostModifier": 20,
|
||||||
"attackSound": "horse"
|
"attackSound": "horse"
|
||||||
},
|
},
|
||||||
@ -410,7 +410,7 @@
|
|||||||
"requiredTech": "Mathematics",
|
"requiredTech": "Mathematics",
|
||||||
"obsoleteTech": "Physics",
|
"obsoleteTech": "Physics",
|
||||||
"upgradesTo": "Trebuchet",
|
"upgradesTo": "Trebuchet",
|
||||||
"uniques": ["+[200]% Strength vs [City]", "No defensive terrain bonus",
|
"uniques": ["[+200]% Strength <vs cities>", "No defensive terrain bonus",
|
||||||
"Must set up to ranged attack", "Limited Visibility"],
|
"Must set up to ranged attack", "Limited Visibility"],
|
||||||
"hurryCostModifier": 20,
|
"hurryCostModifier": 20,
|
||||||
"attackSound": "throw"
|
"attackSound": "throw"
|
||||||
@ -427,7 +427,7 @@
|
|||||||
"requiredTech": "Mathematics",
|
"requiredTech": "Mathematics",
|
||||||
"obsoleteTech": "Physics",
|
"obsoleteTech": "Physics",
|
||||||
"upgradesTo": "Trebuchet",
|
"upgradesTo": "Trebuchet",
|
||||||
"uniques": ["+[200]% Strength vs [City]", "No defensive terrain bonus",
|
"uniques": ["[+200]% Strength <vs cities>", "No defensive terrain bonus",
|
||||||
"Must set up to ranged attack", "Limited Visibility"],
|
"Must set up to ranged attack", "Limited Visibility"],
|
||||||
"hurryCostModifier": 20,
|
"hurryCostModifier": 20,
|
||||||
"attackSound": "throw"
|
"attackSound": "throw"
|
||||||
@ -513,7 +513,7 @@
|
|||||||
"strength": 16,
|
"strength": 16,
|
||||||
"cost": 90,
|
"cost": 90,
|
||||||
"requiredTech": "Civil Service",
|
"requiredTech": "Civil Service",
|
||||||
"uniques": ["+[50]% Strength vs [Mounted]"],
|
"uniques": ["[+50]% Strength <vs [Mounted] units>"],
|
||||||
"upgradesTo": "Lancer",
|
"upgradesTo": "Lancer",
|
||||||
"obsoleteTech": "Gunpowder",
|
"obsoleteTech": "Gunpowder",
|
||||||
"attackSound": "metalhit"
|
"attackSound": "metalhit"
|
||||||
@ -527,7 +527,7 @@
|
|||||||
"strength": 16,
|
"strength": 16,
|
||||||
"cost": 45,
|
"cost": 45,
|
||||||
"requiredTech": "Civil Service",
|
"requiredTech": "Civil Service",
|
||||||
"uniques": ["+[50]% Strength vs [Mounted]", "Can move immediately once bought" ],
|
"uniques": ["[+50]% Strength <vs [Mounted] units>", "Can move immediately once bought" ],
|
||||||
"upgradesTo": "Lancer",
|
"upgradesTo": "Lancer",
|
||||||
"obsoleteTech": "Gunpowder",
|
"obsoleteTech": "Gunpowder",
|
||||||
"attackSound": "metalhit"
|
"attackSound": "metalhit"
|
||||||
@ -556,7 +556,7 @@
|
|||||||
"obsoleteTech": "Military Science",
|
"obsoleteTech": "Military Science",
|
||||||
"upgradesTo": "Cavalry",
|
"upgradesTo": "Cavalry",
|
||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","-[33]% Strength vs [City]" ],
|
"uniques": ["Can move after attacking","No defensive terrain bonus","[-33]% Strength <vs cities>" ],
|
||||||
"attackSound": "horse"
|
"attackSound": "horse"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -604,7 +604,7 @@
|
|||||||
"requiredTech": "Chivalry",
|
"requiredTech": "Chivalry",
|
||||||
"obsoleteTech": "Military Science",
|
"obsoleteTech": "Military Science",
|
||||||
"upgradesTo": "Cavalry",
|
"upgradesTo": "Cavalry",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","+[50]% Strength vs [Mounted]","-[33]% Strength vs [City]"],
|
"uniques": ["Can move after attacking","No defensive terrain bonus","[+50]% Strength <vs [Mounted] units>","[-33]% Strength <vs cities>"],
|
||||||
"attackSound": "elephant"
|
"attackSound": "elephant"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -694,7 +694,7 @@
|
|||||||
"requiredTech": "Physics",
|
"requiredTech": "Physics",
|
||||||
"obsoleteTech": "Chemistry",
|
"obsoleteTech": "Chemistry",
|
||||||
"upgradesTo": "Cannon",
|
"upgradesTo": "Cannon",
|
||||||
"uniques": ["+[200]% Strength vs [City]","No defensive terrain bonus","Must set up to ranged attack","Limited Visibility"],
|
"uniques": ["[+200]% Strength <vs cities>","No defensive terrain bonus","Must set up to ranged attack","Limited Visibility"],
|
||||||
"attackSound": "throw"
|
"attackSound": "throw"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -852,7 +852,7 @@
|
|||||||
"requiredTech": "Gunpowder",
|
"requiredTech": "Gunpowder",
|
||||||
"upgradesTo": "Rifleman",
|
"upgradesTo": "Rifleman",
|
||||||
"obsoleteTech": "Rifling",
|
"obsoleteTech": "Rifling",
|
||||||
"uniques": ["+[50]% Strength vs [Mounted]"],
|
"uniques": ["[+50]% Strength <vs [Mounted] units>"],
|
||||||
"attackSound": "shot"
|
"attackSound": "shot"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -920,7 +920,7 @@
|
|||||||
"cost": 185,
|
"cost": 185,
|
||||||
"requiredTech": "Metallurgy",
|
"requiredTech": "Metallurgy",
|
||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","-[33]% Strength vs [City]"],
|
"uniques": ["Can move after attacking","No defensive terrain bonus","[-33]% Strength <vs cities>"],
|
||||||
"promotions": ["Formation I"],
|
"promotions": ["Formation I"],
|
||||||
"upgradesTo": "Anti-Tank Gun",
|
"upgradesTo": "Anti-Tank Gun",
|
||||||
"obsoleteTech": "Combined Arms",
|
"obsoleteTech": "Combined Arms",
|
||||||
@ -936,7 +936,7 @@
|
|||||||
"cost": 185,
|
"cost": 185,
|
||||||
"requiredTech": "Metallurgy",
|
"requiredTech": "Metallurgy",
|
||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","-[33]% Strength vs [City]",
|
"uniques": ["Can move after attacking","No defensive terrain bonus","[-33]% Strength <vs cities>",
|
||||||
"[+1] Visibility Range", "No movement cost to pillage"],
|
"[+1] Visibility Range", "No movement cost to pillage"],
|
||||||
"promotions": ["Formation I"],
|
"promotions": ["Formation I"],
|
||||||
"upgradesTo": "Anti-Tank Gun",
|
"upgradesTo": "Anti-Tank Gun",
|
||||||
@ -953,7 +953,7 @@
|
|||||||
"cost": 185,
|
"cost": 185,
|
||||||
"requiredTech": "Metallurgy",
|
"requiredTech": "Metallurgy",
|
||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","-[33]% Strength vs [City]",
|
"uniques": ["Can move after attacking","No defensive terrain bonus","[-33]% Strength <vs cities>",
|
||||||
"Transfer Movement to [Great General]", "[+15]% Strength when stacked with [Great General]"],
|
"Transfer Movement to [Great General]", "[+15]% Strength when stacked with [Great General]"],
|
||||||
"promotions": ["Formation I"],
|
"promotions": ["Formation I"],
|
||||||
"upgradesTo": "Anti-Tank Gun",
|
"upgradesTo": "Anti-Tank Gun",
|
||||||
@ -970,7 +970,7 @@
|
|||||||
"requiredTech": "Chemistry",
|
"requiredTech": "Chemistry",
|
||||||
"upgradesTo": "Artillery",
|
"upgradesTo": "Artillery",
|
||||||
"obsoleteTech": "Dynamite",
|
"obsoleteTech": "Dynamite",
|
||||||
"uniques": ["+[200]% Strength vs [City]","No defensive terrain bonus","Must set up to ranged attack","Limited Visibility"],
|
"uniques": ["[+200]% Strength <vs cities>","No defensive terrain bonus","Must set up to ranged attack","Limited Visibility"],
|
||||||
"attackSound": "cannon"
|
"attackSound": "cannon"
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1043,7 +1043,7 @@
|
|||||||
"obsoleteTech": "Combustion",
|
"obsoleteTech": "Combustion",
|
||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"upgradesTo": "Landship",
|
"upgradesTo": "Landship",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","-[33]% Strength vs [City]" ],
|
"uniques": ["Can move after attacking","No defensive terrain bonus","[-33]% Strength <vs cities>" ],
|
||||||
"attackSound": "horse"
|
"attackSound": "horse"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1059,7 +1059,7 @@
|
|||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"upgradesTo": "Landship",
|
"upgradesTo": "Landship",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus",
|
"uniques": ["Can move after attacking","No defensive terrain bonus",
|
||||||
"-[33]% Strength vs [City]", "+[50]% Strength vs [wounded units]"],
|
"[-33]% Strength <vs cities>", "[+50]% Strength <vs [Wounded] units>"],
|
||||||
"attackSound": "horse"
|
"attackSound": "horse"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1074,7 +1074,7 @@
|
|||||||
"obsoleteTech": "Combustion",
|
"obsoleteTech": "Combustion",
|
||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"upgradesTo": "Landship",
|
"upgradesTo": "Landship",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","-[33]% Strength vs [City]" ,
|
"uniques": ["Can move after attacking","No defensive terrain bonus","[-33]% Strength <vs cities>" ,
|
||||||
"[+1] Visibility Range", "[+50]% to Flank Attack bonuses" ],
|
"[+1] Visibility Range", "[+50]% to Flank Attack bonuses" ],
|
||||||
"attackSound": "horse"
|
"attackSound": "horse"
|
||||||
},
|
},
|
||||||
@ -1088,7 +1088,7 @@
|
|||||||
"requiredResource": "Coal",
|
"requiredResource": "Coal",
|
||||||
"upgradesTo": "Destroyer",
|
"upgradesTo": "Destroyer",
|
||||||
"obsoleteTech": "Combustion",
|
"obsoleteTech": "Combustion",
|
||||||
"uniques": ["+[33]% Strength vs [City]","Double movement in [Coast]"],
|
"uniques": ["[+33]% Strength <vs cities>","Double movement in [Coast]"],
|
||||||
"attackSound": "shipguns"
|
"attackSound": "shipguns"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1101,7 +1101,7 @@
|
|||||||
"cost": 320,
|
"cost": 320,
|
||||||
"requiredTech": "Dynamite",
|
"requiredTech": "Dynamite",
|
||||||
"upgradesTo": "Rocket Artillery",
|
"upgradesTo": "Rocket Artillery",
|
||||||
"uniques": ["+[200]% Strength vs [City]","No defensive terrain bonus",
|
"uniques": ["[+200]% Strength <vs cities>","No defensive terrain bonus",
|
||||||
"Must set up to ranged attack","Limited Visibility","Ranged attacks may be performed over obstacles"],
|
"Must set up to ranged attack","Limited Visibility","Ranged attacks may be performed over obstacles"],
|
||||||
"attackSound": "artillery"
|
"attackSound": "artillery"
|
||||||
},
|
},
|
||||||
@ -1158,7 +1158,7 @@
|
|||||||
"requiredResource": "Oil",
|
"requiredResource": "Oil",
|
||||||
"upgradesTo": "Fighter",
|
"upgradesTo": "Fighter",
|
||||||
"obsoleteTech": "Radar",
|
"obsoleteTech": "Radar",
|
||||||
"uniques": ["[50]% chance to intercept air attacks", "+[150]% Strength vs [Bomber]", "+[150]% Strength vs [Helicopter]"],
|
"uniques": ["[50]% chance to intercept air attacks", "[+150]% Strength <vs [Bomber] units>", "[+150]% Strength <vs [Helicopter] units>"],
|
||||||
"attackSound": "machinegun"
|
"attackSound": "machinegun"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1232,7 +1232,7 @@
|
|||||||
"requiredTech": "Ballistics",
|
"requiredTech": "Ballistics",
|
||||||
"upgradesTo": "Mobile SAM",
|
"upgradesTo": "Mobile SAM",
|
||||||
"obsoleteTech": "Rocketry",
|
"obsoleteTech": "Rocketry",
|
||||||
"uniques": ["[100]% chance to intercept air attacks", "+[150]% Strength vs [air units]", "+[150]% Strength vs [Helicopter]"],
|
"uniques": ["[100]% chance to intercept air attacks", "[+150]% Strength <vs [Air] units>", "[+150]% Strength <vs [Helicopter] units>"],
|
||||||
"attackSound": "machinegun"
|
"attackSound": "machinegun"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1257,7 +1257,7 @@
|
|||||||
"cost": 375,
|
"cost": 375,
|
||||||
"requiredTech": "Combustion",
|
"requiredTech": "Combustion",
|
||||||
"uniques": ["Can see invisible [Submarine] units", "[40]% chance to intercept air attacks",
|
"uniques": ["Can see invisible [Submarine] units", "[40]% chance to intercept air attacks",
|
||||||
"May withdraw before melee ([80]%)", "+[100]% Strength vs [submarine units]"],
|
"May withdraw before melee ([80]%)", "[+100]% Strength <vs [Submarine] units>"],
|
||||||
"attackSound": "shipguns"
|
"attackSound": "shipguns"
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1286,7 +1286,7 @@
|
|||||||
"requiredTech": "Radar",
|
"requiredTech": "Radar",
|
||||||
"requiredResource": "Oil",
|
"requiredResource": "Oil",
|
||||||
"upgradesTo": "Jet Fighter",
|
"upgradesTo": "Jet Fighter",
|
||||||
"uniques": ["[100]% chance to intercept air attacks", "+[150]% Strength vs [Bomber]", "+[150]% Strength vs [Helicopter]"],
|
"uniques": ["[100]% chance to intercept air attacks", "[+150]% Strength <vs [Bomber] units>", "[+150]% Strength <vs [Helicopter] units>"],
|
||||||
"attackSound": "machinegun"
|
"attackSound": "machinegun"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1302,8 +1302,8 @@
|
|||||||
"cost": 375,
|
"cost": 375,
|
||||||
"requiredTech": "Radar",
|
"requiredTech": "Radar",
|
||||||
"upgradesTo": "Jet Fighter",
|
"upgradesTo": "Jet Fighter",
|
||||||
"uniques": ["[100]% chance to intercept air attacks", "+[150]% Strength vs [Bomber]", "+[150]% Strength vs [Helicopter]",
|
"uniques": ["[100]% chance to intercept air attacks", "[+150]% Strength <vs [Bomber] units>", "[+150]% Strength <vs [Helicopter] units>",
|
||||||
"+[33]% Strength vs [Fighter]"],
|
"[+33]% Strength <vs [Fighter] units>"],
|
||||||
"attackSound": "machinegun"
|
"attackSound": "machinegun"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1381,7 +1381,7 @@
|
|||||||
"cost": 300,
|
"cost": 300,
|
||||||
"requiredTech": "Combined Arms",
|
"requiredTech": "Combined Arms",
|
||||||
"upgradesTo": "Helicopter Gunship",
|
"upgradesTo": "Helicopter Gunship",
|
||||||
"uniques": ["+[100]% Strength vs [Armored]"],
|
"uniques": ["[+100]% Strength <vs [Armored] units>"],
|
||||||
"attackSound": "machinegun"
|
"attackSound": "machinegun"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1411,7 +1411,7 @@
|
|||||||
"cost": 425,
|
"cost": 425,
|
||||||
"requiredTech": "Rocketry",
|
"requiredTech": "Rocketry",
|
||||||
"requiredResource": "Aluminum",
|
"requiredResource": "Aluminum",
|
||||||
"uniques": ["+[200]% Strength vs [City]","No defensive terrain bonus",
|
"uniques": ["[+200]% Strength <vs cities>","No defensive terrain bonus",
|
||||||
"Limited Visibility","Ranged attacks may be performed over obstacles"],
|
"Limited Visibility","Ranged attacks may be performed over obstacles"],
|
||||||
"attackSound": "artillery"
|
"attackSound": "artillery"
|
||||||
},
|
},
|
||||||
@ -1423,7 +1423,7 @@
|
|||||||
"strength": 65,
|
"strength": 65,
|
||||||
"cost": 425,
|
"cost": 425,
|
||||||
"requiredTech": "Rocketry",
|
"requiredTech": "Rocketry",
|
||||||
"uniques": ["[100]% chance to intercept air attacks", "+[150]% Strength vs [air units]", "+[150]% Strength vs [Helicopter]"],
|
"uniques": ["[100]% chance to intercept air attacks", "[+150]% Strength <vs [Air] units>", "[+150]% Strength <vs [Helicopter] units>"],
|
||||||
"attackSound": "missile"
|
"attackSound": "missile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1460,7 +1460,7 @@
|
|||||||
"cost": 425,
|
"cost": 425,
|
||||||
"requiredTech": "Computers",
|
"requiredTech": "Computers",
|
||||||
"requiredResource": "Aluminum",
|
"requiredResource": "Aluminum",
|
||||||
"uniques": ["+[100]% Strength vs [Armored]", "No defensive terrain bonus", "Can move after attacking",
|
"uniques": ["[+100]% Strength <vs [Armored] units>", "No defensive terrain bonus", "Can move after attacking",
|
||||||
"All tiles cost 1 movement", "Ignores Zone of Control", "Unable to capture cities"],
|
"All tiles cost 1 movement", "Ignores Zone of Control", "Unable to capture cities"],
|
||||||
"attackSound": "machinegun"
|
"attackSound": "machinegun"
|
||||||
},
|
},
|
||||||
@ -1499,7 +1499,7 @@
|
|||||||
"requiredTech": "Robotics",
|
"requiredTech": "Robotics",
|
||||||
"uniques": ["[100]% chance to intercept air attacks", "Can see invisible [Submarine] units",
|
"uniques": ["[100]% chance to intercept air attacks", "Can see invisible [Submarine] units",
|
||||||
"Ranged attacks may be performed over obstacles", "Can carry [3] [Missile] units",
|
"Ranged attacks may be performed over obstacles", "Can carry [3] [Missile] units",
|
||||||
"+[100]% Strength vs [submarine units]"],
|
"[+100]% Strength <vs [Submarine] units>"],
|
||||||
"attackSound": "shipguns"
|
"attackSound": "shipguns"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1525,7 +1525,7 @@
|
|||||||
"cost": 425,
|
"cost": 425,
|
||||||
"requiredTech": "Lasers",
|
"requiredTech": "Lasers",
|
||||||
"requiredResource": "Aluminum",
|
"requiredResource": "Aluminum",
|
||||||
"uniques": ["[100]% chance to intercept air attacks", "+[150]% Strength vs [Bomber]", "+[150]% Strength vs [Helicopter]"],
|
"uniques": ["[100]% chance to intercept air attacks", "[+150]% Strength <vs [Bomber] units>", "[+150]% Strength <vs [Helicopter] units>"],
|
||||||
"attackSound": "jetgun"
|
"attackSound": "jetgun"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,8 @@ package com.unciv.logic.battle
|
|||||||
|
|
||||||
import com.unciv.logic.map.TileInfo
|
import com.unciv.logic.map.TileInfo
|
||||||
import com.unciv.models.Counter
|
import com.unciv.models.Counter
|
||||||
|
import com.unciv.models.ruleset.unique.StateForConditionals
|
||||||
|
import com.unciv.models.ruleset.unique.UniqueType
|
||||||
import com.unciv.ui.utils.toPercent
|
import com.unciv.ui.utils.toPercent
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.collections.set
|
import kotlin.collections.set
|
||||||
@ -21,23 +23,30 @@ object BattleDamage {
|
|||||||
|
|
||||||
val civInfo = combatant.getCivInfo()
|
val civInfo = combatant.getCivInfo()
|
||||||
if (combatant is MapUnitCombatant) {
|
if (combatant is MapUnitCombatant) {
|
||||||
for (unique in
|
for (unique in combatant.unit.getMatchingUniques(
|
||||||
combatant.unit.getMatchingUniques("+[]% Strength vs []") +
|
UniqueType.Strength,
|
||||||
civInfo.getMatchingUniques("+[]% Strength vs []")
|
StateForConditionals(civInfo, defender = enemy))
|
||||||
) {
|
) {
|
||||||
if (enemy.matchesCategory(unique.params[1]))
|
modifiers.add("${unique.sourceObjectName} (${unique.sourceObjectType})", unique.params[0].toInt())
|
||||||
modifiers.add("vs [${unique.params[1]}]", unique.params[0].toInt())
|
|
||||||
}
|
}
|
||||||
for (unique in combatant.unit.getMatchingUniques("-[]% Strength vs []")+
|
|
||||||
civInfo.getMatchingUniques("-[]% Strength vs []")
|
// Deprecated since 3.17.3
|
||||||
) {
|
for (unique in
|
||||||
if (enemy.matchesCategory(unique.params[1]))
|
combatant.unit.getMatchingUniques("+[]% Strength vs []")
|
||||||
modifiers.add("vs [${unique.params[1]}]", -unique.params[0].toInt())
|
) {
|
||||||
}
|
if (enemy.matchesCategory(unique.params[1]))
|
||||||
|
modifiers.add("vs [${unique.params[1]}]", unique.params[0].toInt())
|
||||||
for (unique in combatant.unit.getMatchingUniques("+[]% Combat Strength"))
|
}
|
||||||
modifiers.add("Combat Strength", unique.params[0].toInt())
|
for (unique in combatant.unit.getMatchingUniques("-[]% Strength vs []")
|
||||||
|
) {
|
||||||
|
if (enemy.matchesCategory(unique.params[1]))
|
||||||
|
modifiers.add("vs [${unique.params[1]}]", -unique.params[0].toInt())
|
||||||
|
}
|
||||||
|
|
||||||
|
for (unique in combatant.unit.getMatchingUniques("+[]% Combat Strength"))
|
||||||
|
modifiers.add("Combat Strength", unique.params[0].toInt())
|
||||||
|
//
|
||||||
|
|
||||||
//https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php
|
//https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php
|
||||||
val civHappiness = if (civInfo.isCityState() && civInfo.getAllyCiv() != null)
|
val civHappiness = if (civInfo.isCityState() && civInfo.getAllyCiv() != null)
|
||||||
// If we are a city state with an ally we are vulnerable to their unhappiness.
|
// If we are a city state with an ally we are vulnerable to their unhappiness.
|
||||||
|
@ -14,6 +14,7 @@ import com.unciv.models.ruleset.Ruleset
|
|||||||
import com.unciv.models.ruleset.tile.TerrainType
|
import com.unciv.models.ruleset.tile.TerrainType
|
||||||
import com.unciv.models.ruleset.unique.Unique
|
import com.unciv.models.ruleset.unique.Unique
|
||||||
import com.unciv.models.ruleset.tile.TileImprovement
|
import com.unciv.models.ruleset.tile.TileImprovement
|
||||||
|
import com.unciv.models.ruleset.unique.StateForConditionals
|
||||||
import com.unciv.models.ruleset.unique.UniqueType
|
import com.unciv.models.ruleset.unique.UniqueType
|
||||||
import com.unciv.models.ruleset.unit.BaseUnit
|
import com.unciv.models.ruleset.unit.BaseUnit
|
||||||
import com.unciv.models.ruleset.unit.UnitType
|
import com.unciv.models.ruleset.unit.UnitType
|
||||||
@ -228,9 +229,12 @@ class MapUnit {
|
|||||||
tempUniques.asSequence().filter { it.placeholderText == placeholderText } +
|
tempUniques.asSequence().filter { it.placeholderText == placeholderText } +
|
||||||
civInfo.getMatchingUniques(placeholderText)
|
civInfo.getMatchingUniques(placeholderText)
|
||||||
|
|
||||||
fun getMatchingUniques(uniqueType: UniqueType): Sequence<Unique> =
|
fun getMatchingUniques(uniqueType: UniqueType, stateForConditionals: StateForConditionals? = null) = sequence {
|
||||||
tempUniques.asSequence().filter { it.type == uniqueType } +
|
yieldAll(tempUniques.asSequence()
|
||||||
civInfo.getMatchingUniques(uniqueType)
|
.filter { it.type == uniqueType && it.conditionalsApply(stateForConditionals)}
|
||||||
|
)
|
||||||
|
yieldAll(civInfo.getMatchingUniques(uniqueType, stateForConditionals))
|
||||||
|
}
|
||||||
|
|
||||||
fun hasUnique(unique: String): Boolean {
|
fun hasUnique(unique: String): Boolean {
|
||||||
return tempUniques.any { it.placeholderText == unique } || civInfo.hasUnique(unique)
|
return tempUniques.any { it.placeholderText == unique } || civInfo.hasUnique(unique)
|
||||||
|
@ -1,9 +1,21 @@
|
|||||||
package com.unciv.models.ruleset.unique
|
package com.unciv.models.ruleset.unique
|
||||||
|
|
||||||
|
import com.unciv.logic.battle.ICombatant
|
||||||
import com.unciv.logic.city.CityInfo
|
import com.unciv.logic.city.CityInfo
|
||||||
import com.unciv.logic.civilization.CivilizationInfo
|
import com.unciv.logic.civilization.CivilizationInfo
|
||||||
|
import com.unciv.logic.map.TileInfo
|
||||||
|
|
||||||
data class StateForConditionals(
|
data class StateForConditionals(
|
||||||
val civInfo: CivilizationInfo? = null,
|
val civInfo: CivilizationInfo? = null,
|
||||||
val cityInfo: CityInfo? = null,
|
val cityInfo: CityInfo? = null,
|
||||||
)
|
val defender: ICombatant? = null,
|
||||||
|
// val attacker: ICombatant? = null,
|
||||||
|
// val attackedTile: TileInfo? = null,
|
||||||
|
// val combatAction: CombatAction? = null,
|
||||||
|
)
|
||||||
|
|
||||||
|
//enum class CombatAction() {
|
||||||
|
// Attack,
|
||||||
|
// Defend,
|
||||||
|
// Intercept,
|
||||||
|
//}
|
@ -50,6 +50,10 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
|
|||||||
state.cityInfo != null && state.cityInfo.population.getNumberOfSpecialists() >= condition.params[0].toInt()
|
state.cityInfo != null && state.cityInfo.population.getNumberOfSpecialists() >= condition.params[0].toInt()
|
||||||
UniqueType.ConditionalHappy.placeholderText ->
|
UniqueType.ConditionalHappy.placeholderText ->
|
||||||
state.civInfo != null && state.civInfo.statsForNextTurn.happiness >= 0
|
state.civInfo != null && state.civInfo.statsForNextTurn.happiness >= 0
|
||||||
|
UniqueType.ConditionalVsCity.placeholderText ->
|
||||||
|
state.defender != null && state.defender.matchesCategory("City")
|
||||||
|
UniqueType.ConditionalVsUnits.placeholderText ->
|
||||||
|
state.defender != null && state.defender.matchesCategory(condition.params[0])
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,6 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
|||||||
|
|
||||||
TileProvidesYieldWithoutPopulation("Tile provides yield without assigned population", UniqueTarget.Improvement),
|
TileProvidesYieldWithoutPopulation("Tile provides yield without assigned population", UniqueTarget.Improvement),
|
||||||
|
|
||||||
|
|
||||||
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
||||||
DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs"), // No conditional support
|
DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs"), // No conditional support
|
||||||
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
||||||
@ -88,6 +87,20 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
|||||||
@Deprecated("As of 3.16.16", ReplaceWith("[stats] <if this city has at least [amount] specialists>"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.16.16", ReplaceWith("[stats] <if this city has at least [amount] specialists>"), DeprecationLevel.WARNING)
|
||||||
StatBonusForNumberOfSpecialists("[stats] if this city has at least [amount] specialists"), // No conditional support
|
StatBonusForNumberOfSpecialists("[stats] if this city has at least [amount] specialists"), // No conditional support
|
||||||
|
|
||||||
|
Strength("[amount]% Strength", UniqueTarget.Unit, UniqueTarget.Global),
|
||||||
|
|
||||||
|
@Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING)
|
||||||
|
StrengthPlus("+[amount]% Strength"),
|
||||||
|
@Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING)
|
||||||
|
StrengthMin("-[amount]% Strength"),
|
||||||
|
@Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength <vs [unitFilter] units> OR [amount]% Strength <vs cities>"), DeprecationLevel.WARNING)
|
||||||
|
StrengthPlusVs("+[amount]% Strength vs [combatantFilter]"),
|
||||||
|
@Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength <vs [unitFilter] units> OR [amount]% Strength <vs cities>"), DeprecationLevel.WARNING)
|
||||||
|
StrengthMinVs("-[amount]% Strength vs [combatantFilter]"),
|
||||||
|
@Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING)
|
||||||
|
CombatBonus("+[amount]% Combat Strength"),
|
||||||
|
|
||||||
|
|
||||||
// TODO: Unify these (I'm in favor of "gain a free" above "provides" because it fits more cases)
|
// TODO: Unify these (I'm in favor of "gain a free" above "provides" because it fits more cases)
|
||||||
ProvidesFreeBuildings("Provides a free [buildingName] [cityFilter]", UniqueTarget.Global),
|
ProvidesFreeBuildings("Provides a free [buildingName] [cityFilter]", UniqueTarget.Global),
|
||||||
GainFreeBuildings("Gain a free [buildingName] [cityFilter]", UniqueTarget.Global),
|
GainFreeBuildings("Gain a free [buildingName] [cityFilter]", UniqueTarget.Global),
|
||||||
@ -134,12 +147,18 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
|||||||
CannotEnterOceanUntilAstronomy("Cannot enter ocean tiles until Astronomy", UniqueTarget.Unit),
|
CannotEnterOceanUntilAstronomy("Cannot enter ocean tiles until Astronomy", UniqueTarget.Unit),
|
||||||
|
|
||||||
|
|
||||||
///// CONDITIONALS
|
// Conditionals
|
||||||
|
|
||||||
ConditionalWar("when at war", UniqueTarget.Conditional),
|
ConditionalWar("when at war", UniqueTarget.Conditional),
|
||||||
ConditionalNotWar("when not at war", UniqueTarget.Conditional),
|
ConditionalNotWar("when not at war", UniqueTarget.Conditional),
|
||||||
ConditionalSpecialistCount("if this city has at least [amount] specialists", UniqueTarget.Conditional),
|
ConditionalSpecialistCount("if this city has at least [amount] specialists", UniqueTarget.Conditional),
|
||||||
ConditionalHappy("while the empire is happy", UniqueTarget.Conditional),
|
ConditionalHappy("while the empire is happy", UniqueTarget.Conditional),
|
||||||
|
ConditionalVsCity("vs cities", UniqueTarget.Conditional),
|
||||||
|
ConditionalVsUnits("vs [mapUnitFilter] units", UniqueTarget.Conditional),
|
||||||
|
// ConditionalInTiles("fighting in [tileFilter] tiles", UniqueTarget.Conditional),
|
||||||
|
// ConditionalAttacking("when attacking", UniqueTarget.Conditional),
|
||||||
|
// ConditionalDefending("when defending", UniqueTarget.Conditional),
|
||||||
|
// ConditionalIntercepting("when intercepting", UniqueTarget.Conditional),
|
||||||
;
|
;
|
||||||
|
|
||||||
/** For uniques that have "special" parameters that can accept multiple types, we can override them manually
|
/** For uniques that have "special" parameters that can accept multiple types, we can override them manually
|
||||||
|
@ -556,7 +556,10 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
|||||||
(
|
(
|
||||||
isRanged()
|
isRanged()
|
||||||
&& (uniqueObjects + getType().uniqueObjects)
|
&& (uniqueObjects + getType().uniqueObjects)
|
||||||
.any { it.placeholderText == "+[]% Strength vs []" && it.params[1] == "City" }
|
.any { it.isOfType(UniqueType.Strength)
|
||||||
|
&& it.params[0].toInt() > 0
|
||||||
|
&& it.conditionals.any { conditional -> conditional.isOfType(UniqueType.ConditionalVsCity) }
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
fun getForceEvaluation(): Int {
|
fun getForceEvaluation(): Int {
|
||||||
@ -593,10 +596,18 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
|||||||
for (unique in uniqueObjects) {
|
for (unique in uniqueObjects) {
|
||||||
|
|
||||||
when {
|
when {
|
||||||
unique.placeholderText == "+[]% Strength vs []" && unique.params[1] == "City" // City Attack - half the bonus
|
unique.isOfType(UniqueType.Strength) && unique.params[0].toInt() > 0 -> {
|
||||||
-> power += (power * unique.params[0].toInt()) / 200
|
if (unique.conditionals.any { it.isOfType(UniqueType.ConditionalVsCity) })
|
||||||
unique.placeholderText == "+[]% Strength vs []" && unique.params[1] != "City" // Bonus vs something else - a quarter of the bonus
|
power += (power * unique.params[0].toInt()) / 200
|
||||||
-> power += (power * unique.params[0].toInt()) / 400
|
else if (unique.conditionals.any { it.isOfType(UniqueType.ConditionalVsUnits) })
|
||||||
|
power += (power * unique.params[0].toInt()) / 400
|
||||||
|
}
|
||||||
|
// Deprecated since 3.17.3
|
||||||
|
unique.placeholderText == "+[]% Strength vs []" && unique.params[1] == "City" // City Attack - half the bonus
|
||||||
|
-> power += (power * unique.params[0].toInt()) / 200
|
||||||
|
unique.placeholderText == "+[]% Strength vs []" && unique.params[1] != "City" // Bonus vs something else - a quarter of the bonus
|
||||||
|
-> power += (power * unique.params[0].toInt()) / 400
|
||||||
|
//
|
||||||
unique.placeholderText == "+[]% Strength when attacking" // Attack - half the bonus
|
unique.placeholderText == "+[]% Strength when attacking" // Attack - half the bonus
|
||||||
-> power += (power * unique.params[0].toInt()) / 200
|
-> power += (power * unique.params[0].toInt()) / 200
|
||||||
unique.placeholderText == "+[]% Strength when defending" // Defense - half the bonus
|
unique.placeholderText == "+[]% Strength when defending" // Defense - half the bonus
|
||||||
@ -614,10 +625,18 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
|||||||
for (promotionName in promotions) {
|
for (promotionName in promotions) {
|
||||||
for (unique in ruleset.unitPromotions[promotionName]!!.uniqueObjects) {
|
for (unique in ruleset.unitPromotions[promotionName]!!.uniqueObjects) {
|
||||||
when {
|
when {
|
||||||
|
unique.isOfType(UniqueType.Strength) && unique.params[0].toInt() > 0 -> {
|
||||||
|
if (unique.conditionals.any { it.isOfType(UniqueType.ConditionalVsCity) })
|
||||||
|
power += (power * unique.params[0].toInt()) / 200
|
||||||
|
else if (unique.conditionals.any { it.isOfType(UniqueType.ConditionalVsUnits) })
|
||||||
|
power += (power * unique.params[0].toInt()) / 400
|
||||||
|
}
|
||||||
|
// Deprecated since 3.17.3
|
||||||
unique.placeholderText == "+[]% Strength vs []" && unique.params[1] == "City" // City Attack - half the bonus
|
unique.placeholderText == "+[]% Strength vs []" && unique.params[1] == "City" // City Attack - half the bonus
|
||||||
-> power += (power * unique.params[0].toInt()) / 200
|
-> power += (power * unique.params[0].toInt()) / 200
|
||||||
unique.placeholderText == "+[]% Strength vs []" && unique.params[1] != "City" // Bonus vs something else - a quarter of the bonus
|
unique.placeholderText == "+[]% Strength vs []" && unique.params[1] != "City" // Bonus vs something else - a quarter of the bonus
|
||||||
-> power += (power * unique.params[0].toInt()) / 400
|
-> power += (power * unique.params[0].toInt()) / 400
|
||||||
|
//
|
||||||
unique.placeholderText == "+[]% Strength when attacking" // Attack - half the bonus
|
unique.placeholderText == "+[]% Strength when attacking" // Attack - half the bonus
|
||||||
-> power += (power * unique.params[0].toInt()) / 200
|
-> power += (power * unique.params[0].toInt()) / 200
|
||||||
unique.placeholderText == "+[]% Strength when defending" // Defense - half the bonus
|
unique.placeholderText == "+[]% Strength when defending" // Defense - half the bonus
|
||||||
|
Reference in New Issue
Block a user