Fix multiple bugs resulting from updating promotions and implementing missile cruisers (#4355)

* Fixed carriers in mods no longer working

* Fixed scouting prerequisites

* Fixed surivialism not having icon or prerequisites

* Fix logistics in mods not working

* Added image for supply promotion
This commit is contained in:
Xander Lenstra
2021-07-03 21:26:03 +02:00
committed by GitHub
parent d8340b9c1c
commit 6c221cd56b
7 changed files with 625 additions and 607 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -165,13 +165,13 @@
}, },
{ {
"name": "Scouting II", "name": "Scouting II",
"prerequisites": ["Scouting II"], "prerequisites": ["Scouting I"],
"effect": "[+1] Visibility Range", "effect": "[+1] Visibility Range",
"unitTypes": ["Scout"] "unitTypes": ["Scout"]
}, },
{ {
"name": "Scouting III", "name": "Scouting III",
"prerequisites": ["Scouting I"], "prerequisites": ["Scouting II"],
"effect": "[+1] Movement", "effect": "[+1] Movement",
"unitTypes": ["Scout"] "unitTypes": ["Scout"]
}, },
@ -182,11 +182,13 @@
}, },
{ {
"name": "Survivalism II", "name": "Survivalism II",
"prerequisites": ["Survivalism I"],
"uniques": ["[+5] HP when healing in [Foreign Land] tiles", "+[25]% Strength when defending"], "uniques": ["[+5] HP when healing in [Foreign Land] tiles", "+[25]% Strength when defending"],
"unitTypes": ["Scout"] "unitTypes": ["Scout"]
}, },
{ {
"name": "Survivalism III", "name": "Survivalism III",
"prerequisites": ["Survivalism II"],
"uniques": ["Unit will heal every turn, even if it performs an action", "May withdraw before melee ([75]%)"], // This number is not based on any source "uniques": ["Unit will heal every turn, even if it performs an action", "May withdraw before melee ([75]%)"], // This number is not based on any source
"unitTypes": ["Scout"] "unitTypes": ["Scout"]
}, },
@ -308,6 +310,7 @@
"name" : "Supply", "name" : "Supply",
"prerequisites": ["Bombardment III", "Targeting III", "Boarding Party III", "Coastal Raider III"], "prerequisites": ["Bombardment III", "Targeting III", "Boarding Party III", "Coastal Raider III"],
"uniques": ["May heal outside of friendly territory", "[+15] HP when healing in [Foreign Land] tiles"], "uniques": ["May heal outside of friendly territory", "[+15] HP when healing in [Foreign Land] tiles"],
"unitTypes": ["WaterMelee", "WaterRanged"]
}, },
// Bomber // Bomber

View File

@ -276,7 +276,7 @@ class MapUnit {
fun maxAttacksPerTurn(): Int { fun maxAttacksPerTurn(): Int {
var maxAttacksPerTurn = 1 + getMatchingUniques("[] additional attacks per turn").sumBy { it.params[0].toInt() } var maxAttacksPerTurn = 1 + getMatchingUniques("[] additional attacks per turn").sumBy { it.params[0].toInt() }
// Deprecated since 3.15.6 // Deprecated since 3.15.6
if (hasUnique("+1 additional attack per turn")) if (hasUnique("1 additional attack per turn"))
maxAttacksPerTurn++ maxAttacksPerTurn++
// //
return maxAttacksPerTurn return maxAttacksPerTurn
@ -864,8 +864,8 @@ class MapUnit {
var capacity = getMatchingUniques("Can carry [] [] units").filter { unit.matchesFilter(it.params[1]) }.sumBy { it.params[0].toInt() } var capacity = getMatchingUniques("Can carry [] [] units").filter { unit.matchesFilter(it.params[1]) }.sumBy { it.params[0].toInt() }
capacity += getMatchingUniques("Can carry [] extra [] units").filter { unit.matchesFilter(it.params[1]) }.sumBy { it.params[0].toInt() } capacity += getMatchingUniques("Can carry [] extra [] units").filter { unit.matchesFilter(it.params[1]) }.sumBy { it.params[0].toInt() }
// Deprecated since 3.15.5 // Deprecated since 3.15.5
capacity += getMatchingUniques("Can carry 2 air units").filter { unit.matchesFilter("Air") }.sumBy { 2 } capacity += getMatchingUniques("Can carry 2 aircraft").filter { unit.matchesFilter("Air") }.sumBy { 2 }
capacity += getMatchingUniques("Can carry 1 extra air units").filter { unit.matchesFilter("Air") }.sumBy { 1 } capacity += getMatchingUniques("Can carry 1 extra aircraft").filter { unit.matchesFilter("Air") }.sumBy { 1 }
return capacity return capacity
} }

View File

@ -545,6 +545,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
* Icon for Armor Plating is made by [JackRainy](https://github.com/JackRainy) * Icon for Armor Plating is made by [JackRainy](https://github.com/JackRainy)
* [Slingshot](https://thenounproject.com/term/slingshot/9106/) by James Keuning for Slinger Withdraw * [Slingshot](https://thenounproject.com/term/slingshot/9106/) by James Keuning for Slinger Withdraw
* [Anchor](https://thenounproject.com/term/anchor/676586) by Gregor Cresnar for Amphibious * [Anchor](https://thenounproject.com/term/anchor/676586) by Gregor Cresnar for Amphibious
* [survival knife](https://thenounproject.com/search/?q=survival&i=2663392) by b faris for Survivalism
## Others ## Others