diff --git a/README.md b/README.md index 3c3c41475bab..d914f860165e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Currently, the following games are supported: * Hollow Knight * The Witness * Sonic Adventure 2: Battle -* Starcraft 2: Wings of Liberty +* Starcraft 2 * Donkey Kong Country 3 * Dark Souls 3 * Super Mario World diff --git a/Starcraft2Client.py b/Starcraft2Client.py index 87b50d35063e..fb219a690460 100644 --- a/Starcraft2Client.py +++ b/Starcraft2Client.py @@ -3,7 +3,7 @@ import ModuleUpdate ModuleUpdate.update() -from worlds.sc2wol.Client import launch +from worlds.sc2.Client import launch import Utils if __name__ == "__main__": diff --git a/WebHostLib/static/assets/sc2wolTracker.js b/WebHostLib/static/assets/sc2Tracker.js similarity index 85% rename from WebHostLib/static/assets/sc2wolTracker.js rename to WebHostLib/static/assets/sc2Tracker.js index a698214b8dd6..30d4acd60b7e 100644 --- a/WebHostLib/static/assets/sc2wolTracker.js +++ b/WebHostLib/static/assets/sc2Tracker.js @@ -25,16 +25,16 @@ window.addEventListener('load', () => { // Collapsible advancement sections const categories = document.getElementsByClassName("location-category"); - for (let i = 0; i < categories.length; i++) { - let hide_id = categories[i].id.split('-')[0]; - if (hide_id == 'Total') { + for (let category of categories) { + let hide_id = category.id.split('_')[0]; + if (hide_id === 'Total') { continue; } - categories[i].addEventListener('click', function() { + category.addEventListener('click', function() { // Toggle the advancement list document.getElementById(hide_id).classList.toggle("hide"); // Change text of the header - const tab_header = document.getElementById(hide_id+'-header').children[0]; + const tab_header = document.getElementById(hide_id+'_header').children[0]; const orig_text = tab_header.innerHTML; let new_text; if (orig_text.includes("▼")) { diff --git a/WebHostLib/static/static/icons/sc2/SC2_Lab_BioSteel_L1.png b/WebHostLib/static/static/icons/sc2/SC2_Lab_BioSteel_L1.png deleted file mode 100644 index 8fb366b93ff0..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/SC2_Lab_BioSteel_L1.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/SC2_Lab_BioSteel_L2.png b/WebHostLib/static/static/icons/sc2/SC2_Lab_BioSteel_L2.png deleted file mode 100644 index 336dc5f77af2..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/SC2_Lab_BioSteel_L2.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/advanceballistics.png b/WebHostLib/static/static/icons/sc2/advanceballistics.png deleted file mode 100644 index 1bf7df9fb74c..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/advanceballistics.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/autoturretblackops.png b/WebHostLib/static/static/icons/sc2/autoturretblackops.png deleted file mode 100644 index 552707831a00..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/autoturretblackops.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/biomechanicaldrone.png b/WebHostLib/static/static/icons/sc2/biomechanicaldrone.png deleted file mode 100644 index e7ebf4031619..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/biomechanicaldrone.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/burstcapacitors.png b/WebHostLib/static/static/icons/sc2/burstcapacitors.png deleted file mode 100644 index 3af9b20a1698..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/burstcapacitors.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/crossspectrumdampeners.png b/WebHostLib/static/static/icons/sc2/crossspectrumdampeners.png deleted file mode 100644 index d1c0c6c9a010..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/crossspectrumdampeners.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/cyclone.png b/WebHostLib/static/static/icons/sc2/cyclone.png deleted file mode 100644 index d2016116ea3b..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/cyclone.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/cyclonerangeupgrade.png b/WebHostLib/static/static/icons/sc2/cyclonerangeupgrade.png deleted file mode 100644 index 351be570d11b..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/cyclonerangeupgrade.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/drillingclaws.png b/WebHostLib/static/static/icons/sc2/drillingclaws.png deleted file mode 100644 index 2b067a6e44d4..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/drillingclaws.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/emergencythrusters.png b/WebHostLib/static/static/icons/sc2/emergencythrusters.png deleted file mode 100644 index 159fba37c903..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/emergencythrusters.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/hellionbattlemode.png b/WebHostLib/static/static/icons/sc2/hellionbattlemode.png deleted file mode 100644 index 56bfd98c924c..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/hellionbattlemode.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/high-explosive-spidermine.png b/WebHostLib/static/static/icons/sc2/high-explosive-spidermine.png deleted file mode 100644 index 40a5991ebb80..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/high-explosive-spidermine.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/hyperflightrotors.png b/WebHostLib/static/static/icons/sc2/hyperflightrotors.png deleted file mode 100644 index 375325845876..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/hyperflightrotors.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/hyperfluxor.png b/WebHostLib/static/static/icons/sc2/hyperfluxor.png deleted file mode 100644 index cdd95bb515be..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/hyperfluxor.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/impalerrounds.png b/WebHostLib/static/static/icons/sc2/impalerrounds.png deleted file mode 100644 index b00e0c475827..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/impalerrounds.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/improvedburstlaser.png b/WebHostLib/static/static/icons/sc2/improvedburstlaser.png deleted file mode 100644 index 8a48e38e874d..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/improvedburstlaser.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/improvedsiegemode.png b/WebHostLib/static/static/icons/sc2/improvedsiegemode.png deleted file mode 100644 index f19dad952bb5..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/improvedsiegemode.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/interferencematrix.png b/WebHostLib/static/static/icons/sc2/interferencematrix.png deleted file mode 100644 index ced928aa57a9..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/interferencematrix.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/internalizedtechmodule.png b/WebHostLib/static/static/icons/sc2/internalizedtechmodule.png deleted file mode 100644 index e97f3db0d29a..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/internalizedtechmodule.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/jotunboosters.png b/WebHostLib/static/static/icons/sc2/jotunboosters.png deleted file mode 100644 index 25720306e5c2..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/jotunboosters.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/jumpjets.png b/WebHostLib/static/static/icons/sc2/jumpjets.png deleted file mode 100644 index dfdfef4052ca..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/jumpjets.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/lasertargetingsystem.png b/WebHostLib/static/static/icons/sc2/lasertargetingsystem.png deleted file mode 100644 index c57899b270ff..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/lasertargetingsystem.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/liberator.png b/WebHostLib/static/static/icons/sc2/liberator.png deleted file mode 100644 index 31507be5fe68..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/liberator.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/lockdown.png b/WebHostLib/static/static/icons/sc2/lockdown.png deleted file mode 100644 index a2e7f5dc3e3f..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/lockdown.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/magfieldaccelerator.png b/WebHostLib/static/static/icons/sc2/magfieldaccelerator.png deleted file mode 100644 index 0272b4b73892..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/magfieldaccelerator.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/magrailmunitions.png b/WebHostLib/static/static/icons/sc2/magrailmunitions.png deleted file mode 100644 index ec303498ccdb..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/magrailmunitions.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/medivacemergencythrusters.png b/WebHostLib/static/static/icons/sc2/medivacemergencythrusters.png deleted file mode 100644 index 1c7ce9d6ab1a..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/medivacemergencythrusters.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/neosteelfortifiedarmor.png b/WebHostLib/static/static/icons/sc2/neosteelfortifiedarmor.png deleted file mode 100644 index 04d68d35dc46..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/neosteelfortifiedarmor.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/opticalflare.png b/WebHostLib/static/static/icons/sc2/opticalflare.png deleted file mode 100644 index f888fd518b99..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/opticalflare.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/optimizedlogistics.png b/WebHostLib/static/static/icons/sc2/optimizedlogistics.png deleted file mode 100644 index dcf5fd72da86..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/optimizedlogistics.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/reapercombatdrugs.png b/WebHostLib/static/static/icons/sc2/reapercombatdrugs.png deleted file mode 100644 index b9f2f055c265..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/reapercombatdrugs.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/restoration.png b/WebHostLib/static/static/icons/sc2/restoration.png deleted file mode 100644 index f5c94e1aeefd..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/restoration.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/ripwavemissiles.png b/WebHostLib/static/static/icons/sc2/ripwavemissiles.png deleted file mode 100644 index f68e82039765..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/ripwavemissiles.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/shreddermissile.png b/WebHostLib/static/static/icons/sc2/shreddermissile.png deleted file mode 100644 index 40899095fe3a..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/shreddermissile.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/siegetank-spidermines.png b/WebHostLib/static/static/icons/sc2/siegetank-spidermines.png deleted file mode 100644 index 1b9f8cf06097..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/siegetank-spidermines.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/siegetankrange.png b/WebHostLib/static/static/icons/sc2/siegetankrange.png deleted file mode 100644 index 5aef00a656c9..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/siegetankrange.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/specialordance.png b/WebHostLib/static/static/icons/sc2/specialordance.png deleted file mode 100644 index 4f7410d7ca9e..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/specialordance.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/spidermine.png b/WebHostLib/static/static/icons/sc2/spidermine.png deleted file mode 100644 index bb39cf0bf8ce..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/spidermine.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/staticempblast.png b/WebHostLib/static/static/icons/sc2/staticempblast.png deleted file mode 100644 index 38f361510775..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/staticempblast.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/superstimpack.png b/WebHostLib/static/static/icons/sc2/superstimpack.png deleted file mode 100644 index 0fba8ce5749a..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/superstimpack.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/targetingoptics.png b/WebHostLib/static/static/icons/sc2/targetingoptics.png deleted file mode 100644 index 057a40f08e30..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/targetingoptics.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/terran-cloak-color.png b/WebHostLib/static/static/icons/sc2/terran-cloak-color.png deleted file mode 100644 index 44d1bb9541fb..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/terran-cloak-color.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/terran-emp-color.png b/WebHostLib/static/static/icons/sc2/terran-emp-color.png deleted file mode 100644 index 972b828c75e2..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/terran-emp-color.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/terrandefendermodestructureattack.png b/WebHostLib/static/static/icons/sc2/terrandefendermodestructureattack.png deleted file mode 100644 index 9d5982655183..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/terrandefendermodestructureattack.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/thorsiegemode.png b/WebHostLib/static/static/icons/sc2/thorsiegemode.png deleted file mode 100644 index a298fb57de5a..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/thorsiegemode.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/transformationservos.png b/WebHostLib/static/static/icons/sc2/transformationservos.png deleted file mode 100644 index f7f0524ac15c..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/transformationservos.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/valkyrie.png b/WebHostLib/static/static/icons/sc2/valkyrie.png deleted file mode 100644 index 9cbf339b10db..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/valkyrie.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/warpjump.png b/WebHostLib/static/static/icons/sc2/warpjump.png deleted file mode 100644 index ff0a7b1af4aa..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/warpjump.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/widowmine-attackrange.png b/WebHostLib/static/static/icons/sc2/widowmine-attackrange.png deleted file mode 100644 index 8f5e09c6a593..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/widowmine-attackrange.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/widowmine-deathblossom.png b/WebHostLib/static/static/icons/sc2/widowmine-deathblossom.png deleted file mode 100644 index 7097db05e6c0..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/widowmine-deathblossom.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/widowmine.png b/WebHostLib/static/static/icons/sc2/widowmine.png deleted file mode 100644 index 802c49a83d88..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/widowmine.png and /dev/null differ diff --git a/WebHostLib/static/static/icons/sc2/widowminehidden.png b/WebHostLib/static/static/icons/sc2/widowminehidden.png deleted file mode 100644 index e568742e8a50..000000000000 Binary files a/WebHostLib/static/static/icons/sc2/widowminehidden.png and /dev/null differ diff --git a/WebHostLib/static/styles/sc2Tracker.css b/WebHostLib/static/styles/sc2Tracker.css new file mode 100644 index 000000000000..29a719a110c8 --- /dev/null +++ b/WebHostLib/static/styles/sc2Tracker.css @@ -0,0 +1,160 @@ +#player-tracker-wrapper{ + margin: 0; +} + +#tracker-table td { + vertical-align: top; +} + +.inventory-table-area{ + border: 2px solid #000000; + border-radius: 4px; + padding: 3px 10px 3px 10px; +} + +.inventory-table-area:has(.inventory-table-terran) { + width: 690px; + background-color: #525494; +} + +.inventory-table-area:has(.inventory-table-zerg) { + width: 360px; + background-color: #9d60d2; +} + +.inventory-table-area:has(.inventory-table-protoss) { + width: 400px; + background-color: #d2b260; +} + +#tracker-table .inventory-table td{ + width: 40px; + height: 40px; + text-align: center; + vertical-align: middle; +} + +.inventory-table td.title{ + padding-top: 10px; + height: 20px; + font-family: "JuraBook", monospace; + font-size: 16px; + font-weight: bold; +} + +.inventory-table img{ + height: 100%; + max-width: 40px; + max-height: 40px; + border: 1px solid #000000; + filter: grayscale(100%) contrast(75%) brightness(20%); + background-color: black; +} + +.inventory-table img.acquired{ + filter: none; + background-color: black; +} + +.inventory-table .tint-terran img.acquired { + filter: sepia(100%) saturate(300%) brightness(130%) hue-rotate(120deg) +} + +.inventory-table .tint-protoss img.acquired { + filter: sepia(100%) saturate(1000%) brightness(110%) hue-rotate(180deg) +} + +.inventory-table .tint-level-1 img.acquired { + filter: sepia(100%) saturate(1000%) brightness(110%) hue-rotate(60deg) +} + +.inventory-table .tint-level-2 img.acquired { + filter: sepia(100%) saturate(1000%) brightness(110%) hue-rotate(60deg) hue-rotate(120deg) +} + +.inventory-table .tint-level-3 img.acquired { + filter: sepia(100%) saturate(1000%) brightness(110%) hue-rotate(60deg) hue-rotate(240deg) +} + +.inventory-table div.counted-item { + position: relative; +} + +.inventory-table div.item-count { + width: 160px; + text-align: left; + color: black; + font-family: "JuraBook", monospace; + font-weight: bold; +} + +#location-table{ + border: 2px solid #000000; + border-radius: 4px; + background-color: #87b678; + padding: 10px 3px 3px; + font-family: "JuraBook", monospace; + font-size: 16px; + font-weight: bold; + cursor: default; +} + +#location-table table{ + width: 100%; +} + +#location-table th{ + vertical-align: middle; + text-align: left; + padding-right: 10px; +} + +#location-table td{ + padding-top: 2px; + padding-bottom: 2px; + line-height: 20px; +} + +#location-table td.counter { + text-align: right; + font-size: 14px; +} + +#location-table td.toggle-arrow { + text-align: right; +} + +#location-table tr#Total-header { + font-weight: bold; +} + +#location-table img{ + height: 100%; + max-width: 30px; + max-height: 30px; +} + +#location-table tbody.locations { + font-size: 16px; +} + +#location-table td.location-name { + padding-left: 16px; +} + +#location-table td:has(.location-column) { + vertical-align: top; +} + +#location-table .location-column { + width: 100%; + height: 100%; +} + +#location-table .location-column .spacer { + min-height: 24px; +} + +.hide { + display: none; +} diff --git a/WebHostLib/static/styles/sc2wolTracker.css b/WebHostLib/static/styles/sc2wolTracker.css deleted file mode 100644 index a7d8bd28c4f8..000000000000 --- a/WebHostLib/static/styles/sc2wolTracker.css +++ /dev/null @@ -1,112 +0,0 @@ -#player-tracker-wrapper{ - margin: 0; -} - -#inventory-table{ - border-top: 2px solid #000000; - border-left: 2px solid #000000; - border-right: 2px solid #000000; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - padding: 3px 3px 10px; - width: 710px; - background-color: #525494; -} - -#inventory-table td{ - width: 40px; - height: 40px; - text-align: center; - vertical-align: middle; -} - -#inventory-table td.title{ - padding-top: 10px; - height: 20px; - font-family: "JuraBook", monospace; - font-size: 16px; - font-weight: bold; -} - -#inventory-table img{ - height: 100%; - max-width: 40px; - max-height: 40px; - border: 1px solid #000000; - filter: grayscale(100%) contrast(75%) brightness(20%); - background-color: black; -} - -#inventory-table img.acquired{ - filter: none; - background-color: black; -} - -#inventory-table div.counted-item { - position: relative; -} - -#inventory-table div.item-count { - text-align: left; - color: black; - font-family: "JuraBook", monospace; - font-weight: bold; -} - -#location-table{ - width: 710px; - border-left: 2px solid #000000; - border-right: 2px solid #000000; - border-bottom: 2px solid #000000; - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - background-color: #525494; - padding: 10px 3px 3px; - font-family: "JuraBook", monospace; - font-size: 16px; - font-weight: bold; - cursor: default; -} - -#location-table th{ - vertical-align: middle; - text-align: left; - padding-right: 10px; -} - -#location-table td{ - padding-top: 2px; - padding-bottom: 2px; - line-height: 20px; -} - -#location-table td.counter { - text-align: right; - font-size: 14px; -} - -#location-table td.toggle-arrow { - text-align: right; -} - -#location-table tr#Total-header { - font-weight: bold; -} - -#location-table img{ - height: 100%; - max-width: 30px; - max-height: 30px; -} - -#location-table tbody.locations { - font-size: 16px; -} - -#location-table td.location-name { - padding-left: 16px; -} - -.hide { - display: none; -} diff --git a/WebHostLib/templates/tracker__Starcraft2.html b/WebHostLib/templates/tracker__Starcraft2.html new file mode 100644 index 000000000000..b4252df2504d --- /dev/null +++ b/WebHostLib/templates/tracker__Starcraft2.html @@ -0,0 +1,1090 @@ + +{% macro sc2_icon(name) -%} + +{% endmacro -%} +{% macro sc2_progressive_icon(name, url, level) -%} + +{% endmacro -%} +{% macro sc2_progressive_icon_with_custom_name(item_name, url, title) -%} + +{% endmacro -%} +{%+ macro sc2_tint_level(level) %} + tint-level-{{ level }} +{%+ endmacro %} +{% macro sc2_render_area(area) %} + + {{ area }} {{'▼' if area != 'Total'}} + {{ checks_done[area] }} / {{ checks_in_area[area] }} + + + {% for location in location_info[area] %} + + {{ location }} + {{ '✔' if location_info[area][location] else '' }} + + {% endfor %} + +{% endmacro -%} +{% macro sc2_loop_areas(column_index, column_count) %} + {% for area in checks_in_area if checks_in_area[area] > 0 and area != 'Total' %} + {% if loop.index0 < (loop.length / column_count) * (column_index + 1) + and loop.index0 >= (loop.length / column_count) * (column_index) %} + {{ sc2_render_area(area) }} + {% endif %} + {% endfor %} +{% endmacro -%} + + + {{ player_name }}'s Tracker + + + + + + + {# TODO: Replace this with a proper wrapper for each tracker when developing TrackerAPI. #} +
+ Switch To Generic Tracker +
+ +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+

{{ player_name }}'s Starcraft 2 Tracker

+ Starting Resources +
+{{ minerals_count }}
+{{ vespene_count }}
+{{ supply_count }}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Terran +
+ Weapon & Armor Upgrades +
{{ sc2_progressive_icon('Progressive Terran Infantry Weapon', terran_infantry_weapon_url, terran_infantry_weapon_level) }}{{ sc2_progressive_icon('Progressive Terran Infantry Armor', terran_infantry_armor_url, terran_infantry_armor_level) }}{{ sc2_progressive_icon('Progressive Terran Vehicle Weapon', terran_vehicle_weapon_url, terran_vehicle_weapon_level) }}{{ sc2_progressive_icon('Progressive Terran Vehicle Armor', terran_vehicle_armor_url, terran_vehicle_armor_level) }}{{ sc2_progressive_icon('Progressive Terran Ship Weapon', terran_ship_weapon_url, terran_ship_weapon_level) }}{{ sc2_progressive_icon('Progressive Terran Ship Armor', terran_ship_armor_url, terran_ship_armor_level) }}{{ sc2_icon('Ultra-Capacitors') }}{{ sc2_icon('Vanadium Plating') }}
+ Base +
{{ sc2_icon('Bunker') }}{{ sc2_icon('Projectile Accelerator (Bunker)') }}{{ sc2_icon('Neosteel Bunker (Bunker)') }}{{ sc2_icon('Shrike Turret (Bunker)') }}{{ sc2_icon('Fortified Bunker (Bunker)') }}{{ sc2_icon('Missile Turret') }}{{ sc2_icon('Titanium Housing (Missile Turret)') }}{{ sc2_icon('Hellstorm Batteries (Missile Turret)') }}{{ sc2_icon('Tech Reactor') }}{{ sc2_icon('Orbital Depots') }}
{{ sc2_icon('Command Center Reactor') }}{{ sc2_progressive_icon_with_custom_name('Progressive Orbital Command', orbital_command_url, orbital_command_name) }}{{ sc2_icon('Planetary Fortress') }}{{ sc2_progressive_icon_with_custom_name('Progressive Augmented Thrusters (Planetary Fortress)', augmented_thrusters_planetary_fortress_url, augmented_thrusters_planetary_fortress_name) }}{{ sc2_icon('Advanced Targeting (Planetary Fortress)') }}{{ sc2_icon('Advanced Construction (SCV)') }}{{ sc2_icon('Dual-Fusion Welders (SCV)') }}{{ sc2_icon('Micro-Filtering') }}{{ sc2_icon('Automated Refinery') }}
{{ sc2_icon('Sensor Tower') }}{{ sc2_icon('Perdition Turret') }}{{ sc2_icon('Hive Mind Emulator') }}{{ sc2_icon('Psi Disrupter') }}
+ Infantry + + Vehicles +
{{ sc2_icon('Marine') }}{{ sc2_progressive_icon_with_custom_name('Progressive Stimpack (Marine)', stimpack_marine_url, stimpack_marine_name) }}{{ sc2_icon('Combat Shield (Marine)') }}{{ sc2_icon('Laser Targeting System (Marine)') }}{{ sc2_icon('Magrail Munitions (Marine)') }}{{ sc2_icon('Optimized Logistics (Marine)') }}{{ sc2_icon('Hellion') }}{{ sc2_icon('Twin-Linked Flamethrower (Hellion)') }}{{ sc2_icon('Thermite Filaments (Hellion)') }}{{ sc2_icon('Hellbat Aspect (Hellion)') }}{{ sc2_icon('Smart Servos (Hellion)') }}{{ sc2_icon('Optimized Logistics (Hellion)') }}{{ sc2_icon('Jump Jets (Hellion)') }}
{{ sc2_icon('Medic') }}{{ sc2_icon('Advanced Medic Facilities (Medic)') }}{{ sc2_icon('Stabilizer Medpacks (Medic)') }}{{ sc2_icon('Restoration (Medic)') }}{{ sc2_icon('Optical Flare (Medic)') }}{{ sc2_icon('Resource Efficiency (Medic)') }}{{ sc2_icon('Adaptive Medpacks (Medic)') }}{{ sc2_progressive_icon_with_custom_name('Progressive Stimpack (Hellion)', stimpack_hellion_url, stimpack_hellion_name) }}{{ sc2_icon('Infernal Plating (Hellion)') }}
{{ sc2_icon('Nano Projector (Medic)') }}{{ sc2_icon('Vulture') }}{{ sc2_progressive_icon_with_custom_name('Progressive Replenishable Magazine (Vulture)', replenishable_magazine_vulture_url, replenishable_magazine_vulture_name) }}{{ sc2_icon('Ion Thrusters (Vulture)') }}{{ sc2_icon('Auto Launchers (Vulture)') }}{{ sc2_icon('Auto-Repair (Vulture)') }}
{{ sc2_icon('Firebat') }}{{ sc2_icon('Incinerator Gauntlets (Firebat)') }}{{ sc2_icon('Juggernaut Plating (Firebat)') }}{{ sc2_progressive_icon_with_custom_name('Progressive Stimpack (Firebat)', stimpack_firebat_url, stimpack_firebat_name) }}{{ sc2_icon('Resource Efficiency (Firebat)') }}{{ sc2_icon('Infernal Pre-Igniter (Firebat)') }}{{ sc2_icon('Kinetic Foam (Firebat)') }}{{ sc2_icon('Cerberus Mine (Spider Mine)') }}{{ sc2_icon('High Explosive Munition (Spider Mine)') }}
{{ sc2_icon('Nano Projectors (Firebat)') }}{{ sc2_icon('Goliath') }}{{ sc2_icon('Multi-Lock Weapons System (Goliath)') }}{{ sc2_icon('Ares-Class Targeting System (Goliath)') }}{{ sc2_icon('Jump Jets (Goliath)') }}{{ sc2_icon('Shaped Hull (Goliath)') }}{{ sc2_icon('Optimized Logistics (Goliath)') }}{{ sc2_icon('Resource Efficiency (Goliath)') }}
{{ sc2_icon('Marauder') }}{{ sc2_icon('Concussive Shells (Marauder)') }}{{ sc2_icon('Kinetic Foam (Marauder)') }}{{ sc2_progressive_icon_with_custom_name('Progressive Stimpack (Marauder)', stimpack_marauder_url, stimpack_marauder_name) }}{{ sc2_icon('Laser Targeting System (Marauder)') }}{{ sc2_icon('Magrail Munitions (Marauder)') }}{{ sc2_icon('Internal Tech Module (Marauder)') }}{{ sc2_icon('Internal Tech Module (Goliath)') }}
{{ sc2_icon('Juggernaut Plating (Marauder)') }}{{ sc2_icon('Diamondback') }}{{ sc2_progressive_icon_with_custom_name('Progressive Tri-Lithium Power Cell (Diamondback)', trilithium_power_cell_diamondback_url, trilithium_power_cell_diamondback_name) }}{{ sc2_icon('Shaped Hull (Diamondback)') }}{{ sc2_icon('Hyperfluxor (Diamondback)') }}{{ sc2_icon('Burst Capacitors (Diamondback)') }}{{ sc2_icon('Ion Thrusters (Diamondback)') }}{{ sc2_icon('Resource Efficiency (Diamondback)') }}
{{ sc2_icon('Reaper') }}{{ sc2_icon('U-238 Rounds (Reaper)') }}{{ sc2_icon('G-4 Clusterbomb (Reaper)') }}{{ sc2_progressive_icon_with_custom_name('Progressive Stimpack (Reaper)', stimpack_reaper_url, stimpack_reaper_name) }}{{ sc2_icon('Laser Targeting System (Reaper)') }}{{ sc2_icon('Advanced Cloaking Field (Reaper)') }}{{ sc2_icon('Spider Mines (Reaper)') }}{{ sc2_icon('Siege Tank') }}{{ sc2_icon('Maelstrom Rounds (Siege Tank)') }}{{ sc2_icon('Shaped Blast (Siege Tank)') }}{{ sc2_icon('Jump Jets (Siege Tank)') }}{{ sc2_icon('Spider Mines (Siege Tank)') }}{{ sc2_icon('Smart Servos (Siege Tank)') }}{{ sc2_icon('Graduating Range (Siege Tank)') }}
{{ sc2_icon('Combat Drugs (Reaper)') }}{{ sc2_icon('Jet Pack Overdrive (Reaper)') }}{{ sc2_icon('Laser Targeting System (Siege Tank)') }}{{ sc2_icon('Advanced Siege Tech (Siege Tank)') }}{{ sc2_icon('Internal Tech Module (Siege Tank)') }}{{ sc2_icon('Shaped Hull (Siege Tank)') }}{{ sc2_icon('Resource Efficiency (Siege Tank)') }}
{{ sc2_icon('Ghost') }}{{ sc2_icon('Ocular Implants (Ghost)') }}{{ sc2_icon('Crius Suit (Ghost)') }}{{ sc2_icon('EMP Rounds (Ghost)') }}{{ sc2_icon('Lockdown (Ghost)') }}{{ sc2_icon('Resource Efficiency (Ghost)') }}{{ sc2_icon('Thor') }}{{ sc2_icon('330mm Barrage Cannon (Thor)') }}{{ sc2_progressive_icon_with_custom_name('Progressive Immortality Protocol (Thor)', immortality_protocol_thor_url, immortality_protocol_thor_name) }}{{ sc2_progressive_icon_with_custom_name('Progressive High Impact Payload (Thor)', high_impact_payload_thor_url, high_impact_payload_thor_name) }}{{ sc2_icon('Button With a Skull on It (Thor)') }}{{ sc2_icon('Laser Targeting System (Thor)') }}{{ sc2_icon('Large Scale Field Construction (Thor)') }}
{{ sc2_icon('Spectre') }}{{ sc2_icon('Psionic Lash (Spectre)') }}{{ sc2_icon('Nyx-Class Cloaking Module (Spectre)') }}{{ sc2_icon('Impaler Rounds (Spectre)') }}{{ sc2_icon('Resource Efficiency (Spectre)') }}{{ sc2_icon('Predator') }}{{ sc2_icon('Resource Efficiency (Predator)') }}{{ sc2_icon('Cloak (Predator)') }}{{ sc2_icon('Charge (Predator)') }}{{ sc2_icon('Predator\'s Fury (Predator)') }}
{{ sc2_icon('HERC') }}{{ sc2_icon('Juggernaut Plating (HERC)') }}{{ sc2_icon('Kinetic Foam (HERC)') }}{{ sc2_icon('Widow Mine') }}{{ sc2_icon('Drilling Claws (Widow Mine)') }}{{ sc2_icon('Concealment (Widow Mine)') }}{{ sc2_icon('Black Market Launchers (Widow Mine)') }}{{ sc2_icon('Executioner Missiles (Widow Mine)') }}
{{ sc2_icon('Cyclone') }}{{ sc2_icon('Mag-Field Accelerators (Cyclone)') }}{{ sc2_icon('Mag-Field Launchers (Cyclone)') }}{{ sc2_icon('Targeting Optics (Cyclone)') }}{{ sc2_icon('Rapid Fire Launchers (Cyclone)') }}{{ sc2_icon('Resource Efficiency (Cyclone)') }}{{ sc2_icon('Internal Tech Module (Cyclone)') }}
{{ sc2_icon('Warhound') }}{{ sc2_icon('Resource Efficiency (Warhound)') }}{{ sc2_icon('Reinforced Plating (Warhound)') }}
+ Starships +
{{ sc2_icon('Medivac') }}{{ sc2_icon('Rapid Deployment Tube (Medivac)') }}{{ sc2_icon('Advanced Healing AI (Medivac)') }}{{ sc2_icon('Expanded Hull (Medivac)') }}{{ sc2_icon('Afterburners (Medivac)') }}{{ sc2_icon('Scatter Veil (Medivac)') }}{{ sc2_icon('Advanced Cloaking Field (Medivac)') }}{{ sc2_icon('Raven') }}{{ sc2_icon('Bio Mechanical Repair Drone (Raven)') }}{{ sc2_icon('Spider Mines (Raven)') }}{{ sc2_icon('Railgun Turret (Raven)') }}{{ sc2_icon('Hunter-Seeker Weapon (Raven)') }}{{ sc2_icon('Interference Matrix (Raven)') }}{{ sc2_icon('Anti-Armor Missile (Raven)') }}
{{ sc2_icon('Wraith') }}{{ sc2_progressive_icon_with_custom_name('Progressive Tomahawk Power Cells (Wraith)', tomahawk_power_cells_wraith_url, tomahawk_power_cells_wraith_name) }}{{ sc2_icon('Displacement Field (Wraith)') }}{{ sc2_icon('Advanced Laser Technology (Wraith)') }}{{ sc2_icon('Trigger Override (Wraith)') }}{{ sc2_icon('Internal Tech Module (Wraith)') }}{{ sc2_icon('Resource Efficiency (Wraith)') }}{{ sc2_icon('Internal Tech Module (Raven)') }}{{ sc2_icon('Resource Efficiency (Raven)') }}{{ sc2_icon('Durable Materials (Raven)') }}
{{ sc2_icon('Viking') }}{{ sc2_icon('Ripwave Missiles (Viking)') }}{{ sc2_icon('Phobos-Class Weapons System (Viking)') }}{{ sc2_icon('Smart Servos (Viking)') }}{{ sc2_icon('Anti-Mechanical Munition (Viking)') }}{{ sc2_icon('Shredder Rounds (Viking)') }}{{ sc2_icon('W.I.L.D. Missiles (Viking)') }}{{ sc2_icon('Science Vessel') }}{{ sc2_icon('EMP Shockwave (Science Vessel)') }}{{ sc2_icon('Defensive Matrix (Science Vessel)') }}{{ sc2_icon('Improved Nano-Repair (Science Vessel)') }}{{ sc2_icon('Advanced AI Systems (Science Vessel)') }}
{{ sc2_icon('Banshee') }}{{ sc2_progressive_icon_with_custom_name('Progressive Cross-Spectrum Dampeners (Banshee)', crossspectrum_dampeners_banshee_url, crossspectrum_dampeners_banshee_name) }}{{ sc2_icon('Shockwave Missile Battery (Banshee)') }}{{ sc2_icon('Hyperflight Rotors (Banshee)') }}{{ sc2_icon('Laser Targeting System (Banshee)') }}{{ sc2_icon('Internal Tech Module (Banshee)') }}{{ sc2_icon('Shaped Hull (Banshee)') }}{{ sc2_icon('Hercules') }}{{ sc2_icon('Internal Fusion Module (Hercules)') }}{{ sc2_icon('Tactical Jump (Hercules)') }}
{{ sc2_icon('Advanced Targeting Optics (Banshee)') }}{{ sc2_icon('Distortion Blasters (Banshee)') }}{{ sc2_icon('Rocket Barrage (Banshee)') }}{{ sc2_icon('Liberator') }}{{ sc2_icon('Advanced Ballistics (Liberator)') }}{{ sc2_icon('Raid Artillery (Liberator)') }}{{ sc2_icon('Cloak (Liberator)') }}{{ sc2_icon('Laser Targeting System (Liberator)') }}{{ sc2_icon('Optimized Logistics (Liberator)') }}{{ sc2_icon('Smart Servos (Liberator)') }}
{{ sc2_icon('Battlecruiser') }}{{ sc2_progressive_icon('Progressive Missile Pods (Battlecruiser)', missile_pods_battlecruiser_url, missile_pods_battlecruiser_level) }}{{ sc2_progressive_icon_with_custom_name('Progressive Defensive Matrix (Battlecruiser)', defensive_matrix_battlecruiser_url, defensive_matrix_battlecruiser_name) }}{{ sc2_icon('Tactical Jump (Battlecruiser)') }}{{ sc2_icon('Cloak (Battlecruiser)') }}{{ sc2_icon('ATX Laser Battery (Battlecruiser)') }}{{ sc2_icon('Optimized Logistics (Battlecruiser)') }}{{ sc2_icon('Resource Efficiency (Liberator)') }}
{{ sc2_icon('Internal Tech Module (Battlecruiser)') }}{{ sc2_icon('Behemoth Plating (Battlecruiser)') }}{{ sc2_icon('Covert Ops Engines (Battlecruiser)') }}{{ sc2_icon('Valkyrie') }}{{ sc2_icon('Enhanced Cluster Launchers (Valkyrie)') }}{{ sc2_icon('Shaped Hull (Valkyrie)') }}{{ sc2_icon('Flechette Missiles (Valkyrie)') }}{{ sc2_icon('Afterburners (Valkyrie)') }}{{ sc2_icon('Launching Vector Compensator (Valkyrie)') }}{{ sc2_icon('Resource Efficiency (Valkyrie)') }}
+ Mercenaries +
{{ sc2_icon('War Pigs') }}{{ sc2_icon('Devil Dogs') }}{{ sc2_icon('Hammer Securities') }}{{ sc2_icon('Spartan Company') }}{{ sc2_icon('Siege Breakers') }}{{ sc2_icon('Hel\'s Angels') }}{{ sc2_icon('Dusk Wings') }}{{ sc2_icon('Jackson\'s Revenge') }}{{ sc2_icon('Skibi\'s Angels') }}{{ sc2_icon('Death Heads') }}{{ sc2_icon('Winged Nightmares') }}{{ sc2_icon('Midnight Riders') }}{{ sc2_icon('Brynhilds') }}{{ sc2_icon('Jotun') }}
+ General Upgrades +
{{ sc2_progressive_icon('Progressive Fire-Suppression System', firesuppression_system_url, firesuppression_system_level) }}{{ sc2_icon('Orbital Strike') }}{{ sc2_icon('Cellular Reactor') }}{{ sc2_progressive_icon('Progressive Regenerative Bio-Steel', regenerative_biosteel_url, regenerative_biosteel_level) }}{{ sc2_icon('Structure Armor') }}{{ sc2_icon('Hi-Sec Auto Tracking') }}{{ sc2_icon('Advanced Optics') }}{{ sc2_icon('Rogue Forces') }}
+ Nova Equipment +
{{ sc2_icon('C20A Canister Rifle (Nova Weapon)') }}{{ sc2_icon('Hellfire Shotgun (Nova Weapon)') }}{{ sc2_icon('Plasma Rifle (Nova Weapon)') }}{{ sc2_icon('Monomolecular Blade (Nova Weapon)') }}{{ sc2_icon('Blazefire Gunblade (Nova Weapon)') }}{{ sc2_icon('Stim Infusion (Nova Gadget)') }}{{ sc2_icon('Pulse Grenades (Nova Gadget)') }}{{ sc2_icon('Flashbang Grenades (Nova Gadget)') }}{{ sc2_icon('Ionic Force Field (Nova Gadget)') }}{{ sc2_icon('Holo Decoy (Nova Gadget)') }}
{{ sc2_progressive_icon_with_custom_name('Progressive Stealth Suit Module (Nova Suit Module)', stealth_suit_module_nova_suit_module_url, stealth_suit_module_nova_suit_module_name) }}{{ sc2_icon('Energy Suit Module (Nova Suit Module)') }}{{ sc2_icon('Armored Suit Module (Nova Suit Module)') }}{{ sc2_icon('Jump Suit Module (Nova Suit Module)') }}{{ sc2_icon('Ghost Visor (Nova Equipment)') }}{{ sc2_icon('Rangefinder Oculus (Nova Equipment)') }}{{ sc2_icon('Domination (Nova Ability)') }}{{ sc2_icon('Blink (Nova Ability)') }}{{ sc2_icon('Tac Nuke Strike (Nova Ability)') }}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Zerg +
+ Weapon & Armor Upgrades +
{{ sc2_progressive_icon('Progressive Zerg Melee Attack', zerg_melee_attack_url, zerg_melee_attack_level) }}{{ sc2_progressive_icon('Progressive Zerg Missile Attack', zerg_missile_attack_url, zerg_missile_attack_level) }}{{ sc2_progressive_icon('Progressive Zerg Ground Carapace', zerg_ground_carapace_url, zerg_ground_carapace_level) }}{{ sc2_progressive_icon('Progressive Zerg Flyer Attack', zerg_flyer_attack_url, zerg_flyer_attack_level) }}{{ sc2_progressive_icon('Progressive Zerg Flyer Carapace', zerg_flyer_carapace_url, zerg_flyer_carapace_level) }}
+ Base +
{{ sc2_icon('Automated Extractors (Kerrigan Tier 3)') }}{{ sc2_icon('Vespene Efficiency (Kerrigan Tier 5)') }}{{ sc2_icon('Twin Drones (Kerrigan Tier 5)') }}{{ sc2_icon('Improved Overlords (Kerrigan Tier 3)') }}{{ sc2_icon('Ventral Sacs (Overlord)') }}
{{ sc2_icon('Malignant Creep (Kerrigan Tier 5)') }}{{ sc2_icon('Spine Crawler') }}{{ sc2_icon('Spore Crawler') }}
+ Units +
{{ sc2_icon('Zergling') }}{{ sc2_icon('Raptor Strain (Zergling)') }}{{ sc2_icon('Swarmling Strain (Zergling)') }}{{ sc2_icon('Hardened Carapace (Zergling)') }}{{ sc2_icon('Adrenal Overload (Zergling)') }}{{ sc2_icon('Metabolic Boost (Zergling)') }}{{ sc2_icon('Shredding Claws (Zergling)') }}{{ sc2_icon('Zergling Reconstitution (Kerrigan Tier 3)') }}
{{ sc2_icon('Baneling Aspect (Zergling)') }}{{ sc2_icon('Splitter Strain (Baneling)') }}{{ sc2_icon('Hunter Strain (Baneling)') }}{{ sc2_icon('Corrosive Acid (Baneling)') }}{{ sc2_icon('Rupture (Baneling)') }}{{ sc2_icon('Regenerative Acid (Baneling)') }}{{ sc2_icon('Centrifugal Hooks (Baneling)') }}
{{ sc2_icon('Tunneling Jaws (Baneling)') }}{{ sc2_icon('Rapid Metamorph (Baneling)') }}
{{ sc2_icon('Swarm Queen') }}{{ sc2_icon('Spawn Larvae (Swarm Queen)') }}{{ sc2_icon('Deep Tunnel (Swarm Queen)') }}{{ sc2_icon('Organic Carapace (Swarm Queen)') }}{{ sc2_icon('Bio-Mechanical Transfusion (Swarm Queen)') }}{{ sc2_icon('Resource Efficiency (Swarm Queen)') }}{{ sc2_icon('Incubator Chamber (Swarm Queen)') }}
{{ sc2_icon('Roach') }}{{ sc2_icon('Vile Strain (Roach)') }}{{ sc2_icon('Corpser Strain (Roach)') }}{{ sc2_icon('Hydriodic Bile (Roach)') }}{{ sc2_icon('Adaptive Plating (Roach)') }}{{ sc2_icon('Tunneling Claws (Roach)') }}{{ sc2_icon('Glial Reconstitution (Roach)') }}{{ sc2_icon('Organic Carapace (Roach)') }}
{{ sc2_icon('Ravager Aspect (Roach)') }}{{ sc2_icon('Potent Bile (Ravager)') }}{{ sc2_icon('Bloated Bile Ducts (Ravager)') }}{{ sc2_icon('Deep Tunnel (Ravager)') }}
{{ sc2_icon('Hydralisk') }}{{ sc2_icon('Frenzy (Hydralisk)') }}{{ sc2_icon('Ancillary Carapace (Hydralisk)') }}{{ sc2_icon('Grooved Spines (Hydralisk)') }}{{ sc2_icon('Muscular Augments (Hydralisk)') }}{{ sc2_icon('Resource Efficiency (Hydralisk)') }}
{{ sc2_icon('Impaler Aspect (Hydralisk)') }}{{ sc2_icon('Adaptive Talons (Impaler)') }}{{ sc2_icon('Secretion Glands (Impaler)') }}{{ sc2_icon('Hardened Tentacle Spines (Impaler)') }}
{{ sc2_icon('Lurker Aspect (Hydralisk)') }}{{ sc2_icon('Seismic Spines (Lurker)') }}{{ sc2_icon('Adapted Spines (Lurker)') }}
{{ sc2_icon('Aberration') }}
{{ sc2_icon('Swarm Host') }}{{ sc2_icon('Carrion Strain (Swarm Host)') }}{{ sc2_icon('Creeper Strain (Swarm Host)') }}{{ sc2_icon('Burrow (Swarm Host)') }}{{ sc2_icon('Rapid Incubation (Swarm Host)') }}{{ sc2_icon('Pressurized Glands (Swarm Host)') }}{{ sc2_icon('Locust Metabolic Boost (Swarm Host)') }}{{ sc2_icon('Enduring Locusts (Swarm Host)') }}
{{ sc2_icon('Organic Carapace (Swarm Host)') }}{{ sc2_icon('Resource Efficiency (Swarm Host)') }}
{{ sc2_icon('Infestor') }}{{ sc2_icon('Infested Terran (Infestor)') }}{{ sc2_icon('Microbial Shroud (Infestor)') }}
{{ sc2_icon('Defiler') }}
{{ sc2_icon('Ultralisk') }}{{ sc2_icon('Noxious Strain (Ultralisk)') }}{{ sc2_icon('Torrasque Strain (Ultralisk)') }}{{ sc2_icon('Burrow Charge (Ultralisk)') }}{{ sc2_icon('Tissue Assimilation (Ultralisk)') }}{{ sc2_icon('Monarch Blades (Ultralisk)') }}{{ sc2_icon('Anabolic Synthesis (Ultralisk)') }}{{ sc2_icon('Chitinous Plating (Ultralisk)') }}
{{ sc2_icon('Organic Carapace (Ultralisk)') }}{{ sc2_icon('Resource Efficiency (Ultralisk)') }}
{{ sc2_icon('Mutalisk') }}{{ sc2_icon('Rapid Regeneration (Mutalisk)') }}{{ sc2_icon('Sundering Glaive (Mutalisk)') }}{{ sc2_icon('Vicious Glaive (Mutalisk)') }}{{ sc2_icon('Severing Glaive (Mutalisk)') }}{{ sc2_icon('Aerodynamic Glaive Shape (Mutalisk)') }}
{{ sc2_icon('Corruptor') }}{{ sc2_icon('Corruption (Corruptor)') }}{{ sc2_icon('Caustic Spray (Corruptor)') }}
{{ sc2_icon('Brood Lord Aspect (Mutalisk/Corruptor)') }}{{ sc2_icon('Porous Cartilage (Brood Lord)') }}{{ sc2_icon('Evolved Carapace (Brood Lord)') }}{{ sc2_icon('Splitter Mitosis (Brood Lord)') }}{{ sc2_icon('Resource Efficiency (Brood Lord)') }}
{{ sc2_icon('Viper Aspect (Mutalisk/Corruptor)') }}{{ sc2_icon('Parasitic Bomb (Viper)') }}{{ sc2_icon('Paralytic Barbs (Viper)') }}{{ sc2_icon('Virulent Microbes (Viper)') }}
{{ sc2_icon('Guardian Aspect (Mutalisk/Corruptor)') }}{{ sc2_icon('Prolonged Dispersion (Guardian)') }}{{ sc2_icon('Primal Adaptation (Guardian)') }}{{ sc2_icon('Soronan Acid (Guardian)') }}
{{ sc2_icon('Devourer Aspect (Mutalisk/Corruptor)') }}{{ sc2_icon('Corrosive Spray (Devourer)') }}{{ sc2_icon('Gaping Maw (Devourer)') }}{{ sc2_icon('Improved Osmosis (Devourer)') }}{{ sc2_icon('Prescient Spores (Devourer)') }}
{{ sc2_icon('Brood Queen') }}{{ sc2_icon('Fungal Growth (Brood Queen)') }}{{ sc2_icon('Ensnare (Brood Queen)') }}{{ sc2_icon('Enhanced Mitochondria (Brood Queen)') }}
{{ sc2_icon('Scourge') }}{{ sc2_icon('Virulent Spores (Scourge)') }}{{ sc2_icon('Resource Efficiency (Scourge)') }}{{ sc2_icon('Swarm Scourge (Scourge)') }}
+ Mercenaries +
{{ sc2_icon('Infested Medics') }}{{ sc2_icon('Infested Siege Tanks') }}{{ sc2_icon('Infested Banshees') }}
+ Kerrigan +
Level: {{ kerrigan_level }}
{{ sc2_icon('Primal Form (Kerrigan)') }}
{{ sc2_icon('Kinetic Blast (Kerrigan Tier 1)') }}{{ sc2_icon('Heroic Fortitude (Kerrigan Tier 1)') }}{{ sc2_icon('Leaping Strike (Kerrigan Tier 1)') }}{{ sc2_icon('Crushing Grip (Kerrigan Tier 2)') }}{{ sc2_icon('Chain Reaction (Kerrigan Tier 2)') }}{{ sc2_icon('Psionic Shift (Kerrigan Tier 2)') }}
{{ sc2_icon('Wild Mutation (Kerrigan Tier 4)') }}{{ sc2_icon('Spawn Banelings (Kerrigan Tier 4)') }}{{ sc2_icon('Mend (Kerrigan Tier 4)') }}{{ sc2_icon('Infest Broodlings (Kerrigan Tier 6)') }}{{ sc2_icon('Fury (Kerrigan Tier 6)') }}{{ sc2_icon('Ability Efficiency (Kerrigan Tier 6)') }}
{{ sc2_icon('Apocalypse (Kerrigan Tier 7)') }}{{ sc2_icon('Spawn Leviathan (Kerrigan Tier 7)') }}{{ sc2_icon('Drop-Pods (Kerrigan Tier 7)') }}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Protoss +
+ Weapon & Armor Upgrades +
{{ sc2_progressive_icon('Progressive Protoss Ground Weapon', protoss_ground_weapon_url, protoss_ground_weapon_level) }}{{ sc2_progressive_icon('Progressive Protoss Ground Armor', protoss_ground_armor_url, protoss_ground_armor_level) }}{{ sc2_progressive_icon('Progressive Protoss Air Weapon', protoss_air_weapon_url, protoss_air_weapon_level) }}{{ sc2_progressive_icon('Progressive Protoss Air Armor', protoss_air_armor_url, protoss_air_armor_level) }}{{ sc2_progressive_icon('Progressive Protoss Shields', protoss_shields_url, protoss_shields_level) }}{{ sc2_icon('Quatro') }}
+ Base +
{{ sc2_icon('Photon Cannon') }}{{ sc2_icon('Khaydarin Monolith') }}{{ sc2_icon('Shield Battery') }}{{ sc2_icon('Enhanced Targeting') }}{{ sc2_icon('Optimized Ordnance') }}{{ sc2_icon('Khalai Ingenuity') }}{{ sc2_icon('Orbital Assimilators') }}{{ sc2_icon('Amplified Assimilators') }}
{{ sc2_icon('Warp Harmonization') }}{{ sc2_icon('Superior Warp Gates') }}{{ sc2_icon('Nexus Overcharge') }}
+ Gateway +
{{ sc2_icon('Zealot') }}{{ sc2_icon('Centurion') }}{{ sc2_icon('Sentinel') }}{{ sc2_icon('Leg Enhancements (Zealot/Sentinel/Centurion)') }}{{ sc2_icon('Shield Capacity (Zealot/Sentinel/Centurion)') }}
{{ sc2_icon('Supplicant') }}{{ sc2_icon('Blood Shield (Supplicant)') }}{{ sc2_icon('Soul Augmentation (Supplicant)') }}{{ sc2_icon('Shield Regeneration (Supplicant)') }}
{{ sc2_icon('Sentry') }}{{ sc2_icon('Force Field (Sentry)') }}{{ sc2_icon('Hallucination (Sentry)') }}
{{ sc2_icon('Energizer') }}{{ sc2_icon('Reclamation (Energizer)') }}{{ sc2_icon('Forged Chassis (Energizer)') }}{{ sc2_icon('Cloaking Module (Sentry/Energizer/Havoc)') }}{{ sc2_icon('Rapid Recharging (Sentry/Energizer/Havoc/Shield Battery)') }}
{{ sc2_icon('Havoc') }}{{ sc2_icon('Detect Weakness (Havoc)') }}{{ sc2_icon('Bloodshard Resonance (Havoc)') }}
{{ sc2_icon('Stalker') }}{{ sc2_icon('Instigator') }}{{ sc2_icon('Slayer') }}{{ sc2_icon('Disintegrating Particles (Stalker/Instigator/Slayer)') }}{{ sc2_icon('Particle Reflection (Stalker/Instigator/Slayer)') }}
{{ sc2_icon('Dragoon') }}{{ sc2_icon('High Impact Phase Disruptor (Dragoon)') }}{{ sc2_icon('Trillic Compression System (Dragoon)') }}{{ sc2_icon('Singularity Charge (Dragoon)') }}{{ sc2_icon('Enhanced Strider Servos (Dragoon)') }}
{{ sc2_icon('Adept') }}{{ sc2_icon('Shockwave (Adept)') }}{{ sc2_icon('Resonating Glaives (Adept)') }}{{ sc2_icon('Phase Bulwark (Adept)') }}
{{ sc2_icon('High Templar') }}{{ sc2_icon('Signifier') }}{{ sc2_icon('Unshackled Psionic Storm (High Templar/Signifier)') }}{{ sc2_icon('Hallucination (High Templar/Signifier)') }}{{ sc2_icon('Khaydarin Amulet (High Templar/Signifier)') }}{{ sc2_icon('High Archon (Archon)') }}
{{ sc2_icon('Ascendant') }}{{ sc2_icon('Power Overwhelming (Ascendant)') }}{{ sc2_icon('Chaotic Attunement (Ascendant)') }}{{ sc2_icon('Blood Amulet (Ascendant)') }}
{{ sc2_icon('Dark Archon') }}{{ sc2_icon('Feedback (Dark Archon)') }}{{ sc2_icon('Maelstrom (Dark Archon)') }}{{ sc2_icon('Argus Talisman (Dark Archon)') }}
{{ sc2_icon('Dark Templar') }}{{ sc2_icon('Dark Archon Meld (Dark Templar)') }}
{{ sc2_icon('Avenger') }}{{ sc2_icon('Blood Hunter') }}{{ sc2_icon('Shroud of Adun (Dark Templar/Avenger/Blood Hunter)') }}{{ sc2_icon('Shadow Guard Training (Dark Templar/Avenger/Blood Hunter)') }}{{ sc2_icon('Blink (Dark Templar/Avenger/Blood Hunter)') }}{{ sc2_icon('Resource Efficiency (Dark Templar/Avenger/Blood Hunter)') }}
+ Robotics Facility +
{{ sc2_icon('Warp Prism') }}{{ sc2_icon('Gravitic Drive (Warp Prism)') }}{{ sc2_icon('Phase Blaster (Warp Prism)') }}{{ sc2_icon('War Configuration (Warp Prism)') }}
{{ sc2_icon('Immortal') }}{{ sc2_icon('Annihilator') }}{{ sc2_icon('Singularity Charge (Immortal/Annihilator)') }}{{ sc2_icon('Advanced Targeting Mechanics (Immortal/Annihilator)') }}
{{ sc2_icon('Vanguard') }}{{ sc2_icon('Agony Launchers (Vanguard)') }}{{ sc2_icon('Matter Dispersion (Vanguard)') }}
{{ sc2_icon('Colossus') }}{{ sc2_icon('Pacification Protocol (Colossus)') }}
{{ sc2_icon('Wrathwalker') }}{{ sc2_icon('Rapid Power Cycling (Wrathwalker)') }}{{ sc2_icon('Eye of Wrath (Wrathwalker)') }}
{{ sc2_icon('Observer') }}{{ sc2_icon('Gravitic Boosters (Observer)') }}{{ sc2_icon('Sensor Array (Observer)') }}
{{ sc2_icon('Reaver') }}{{ sc2_icon('Scarab Damage (Reaver)') }}{{ sc2_icon('Solarite Payload (Reaver)') }}{{ sc2_icon('Reaver Capacity (Reaver)') }}{{ sc2_icon('Resource Efficiency (Reaver)') }}
{{ sc2_icon('Disruptor') }}
+ Stargate +
{{ sc2_icon('Phoenix') }}{{ sc2_icon('Mirage') }}{{ sc2_icon('Ionic Wavelength Flux (Phoenix/Mirage)') }}{{ sc2_icon('Anion Pulse-Crystals (Phoenix/Mirage)') }}
{{ sc2_icon('Corsair') }}{{ sc2_icon('Stealth Drive (Corsair)') }}{{ sc2_icon('Argus Jewel (Corsair)') }}{{ sc2_icon('Sustaining Disruption (Corsair)') }}{{ sc2_icon('Neutron Shields (Corsair)') }}
{{ sc2_icon('Destroyer') }}{{ sc2_icon('Reforged Bloodshard Core (Destroyer)') }}
{{ sc2_icon('Void Ray') }}{{ sc2_icon('Flux Vanes (Void Ray/Destroyer)') }}
{{ sc2_icon('Carrier') }}{{ sc2_icon('Graviton Catapult (Carrier)') }}{{ sc2_icon('Hull of Past Glories (Carrier)') }}
{{ sc2_icon('Scout') }}{{ sc2_icon('Combat Sensor Array (Scout)') }}{{ sc2_icon('Apial Sensors (Scout)') }}{{ sc2_icon('Gravitic Thrusters (Scout)') }}{{ sc2_icon('Advanced Photon Blasters (Scout)') }}
{{ sc2_icon('Tempest') }}{{ sc2_icon('Tectonic Destabilizers (Tempest)') }}{{ sc2_icon('Quantic Reactor (Tempest)') }}{{ sc2_icon('Gravity Sling (Tempest)') }}
{{ sc2_icon('Mothership') }}
{{ sc2_icon('Arbiter') }}{{ sc2_icon('Chronostatic Reinforcement (Arbiter)') }}{{ sc2_icon('Khaydarin Core (Arbiter)') }}{{ sc2_icon('Spacetime Anchor (Arbiter)') }}{{ sc2_icon('Resource Efficiency (Arbiter)') }}{{ sc2_icon('Enhanced Cloak Field (Arbiter)') }}
{{ sc2_icon('Oracle') }}{{ sc2_icon('Stealth Drive (Oracle)') }}{{ sc2_icon('Stasis Calibration (Oracle)') }}{{ sc2_icon('Temporal Acceleration Beam (Oracle)') }}
+ General Upgrades +
{{ sc2_icon('Matrix Overload') }}{{ sc2_icon('Guardian Shell') }}
+ Spear of Adun +
{{ sc2_icon('Chrono Surge (Spear of Adun Calldown)') }}{{ sc2_progressive_icon_with_custom_name('Progressive Proxy Pylon (Spear of Adun Calldown)', proxy_pylon_spear_of_adun_calldown_url, proxy_pylon_spear_of_adun_calldown_name) }}{{ sc2_icon('Pylon Overcharge (Spear of Adun Calldown)') }}{{ sc2_icon('Mass Recall (Spear of Adun Calldown)') }}{{ sc2_icon('Shield Overcharge (Spear of Adun Calldown)') }}{{ sc2_icon('Deploy Fenix (Spear of Adun Calldown)') }}{{ sc2_icon('Reconstruction Beam (Spear of Adun Auto-Cast)') }}
{{ sc2_icon('Orbital Strike (Spear of Adun Calldown)') }}{{ sc2_icon('Temporal Field (Spear of Adun Calldown)') }}{{ sc2_icon('Solar Lance (Spear of Adun Calldown)') }}{{ sc2_icon('Purifier Beam (Spear of Adun Calldown)') }}{{ sc2_icon('Time Stop (Spear of Adun Calldown)') }}{{ sc2_icon('Solar Bombardment (Spear of Adun Calldown)') }}{{ sc2_icon('Overwatch (Spear of Adun Auto-Cast)') }}
+
+ + + + + + +
+ + {{ sc2_loop_areas(0, 3) }} +
+
+ + {{ sc2_loop_areas(1, 3) }} +
+
+ + {{ sc2_loop_areas(2, 3) }} + + {{ sc2_render_area('Total') }} +
 
+
+
+
+ + diff --git a/WebHostLib/templates/tracker__Starcraft2WingsOfLiberty.html b/WebHostLib/templates/tracker__Starcraft2WingsOfLiberty.html deleted file mode 100644 index c27f690dfd36..000000000000 --- a/WebHostLib/templates/tracker__Starcraft2WingsOfLiberty.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - {{ player_name }}'s Tracker - - - - - - - {# TODO: Replace this with a proper wrapper for each tracker when developing TrackerAPI. #} -
- Switch To Generic Tracker -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Starting Resources -
+{{ minerals_count }}
+{{ vespene_count }}
- Weapon & Armor Upgrades -
- Base -
- Infantry - - Vehicles -
- Starships -
- Mercenaries -
- General Upgrades -
- Protoss Units -
- - {% for area in checks_in_area %} - {% if checks_in_area[area] > 0 %} - - - - - - {% for location in location_info[area] %} - - - - - {% endfor %} - - {% endif %} - {% endfor %} -
{{ area }} {{'▼' if area != 'Total'}}{{ checks_done[area] }} / {{ checks_in_area[area] }}
{{ location }}{{ '✔' if location_info[area][location] else '' }}
-
- - diff --git a/WebHostLib/tracker.py b/WebHostLib/tracker.py index e8b1ae5b3171..c2fdab0ed074 100644 --- a/WebHostLib/tracker.py +++ b/WebHostLib/tracker.py @@ -1553,212 +1553,298 @@ def render_ChecksFinder_tracker(tracker_data: TrackerData, team: int, player: in _player_trackers["ChecksFinder"] = render_ChecksFinder_tracker -if "Starcraft 2 Wings of Liberty" in network_data_package["games"]: - def render_Starcraft2WingsOfLiberty_tracker(tracker_data: TrackerData, team: int, player: int) -> str: +if "Starcraft 2" in network_data_package["games"]: + def render_Starcraft2_tracker(tracker_data: TrackerData, team: int, player: int) -> str: SC2WOL_LOC_ID_OFFSET = 1000 + SC2HOTS_LOC_ID_OFFSET = 20000000 # Avoid clashes with The Legend of Zelda + SC2LOTV_LOC_ID_OFFSET = SC2HOTS_LOC_ID_OFFSET + 2000 + SC2NCO_LOC_ID_OFFSET = SC2LOTV_LOC_ID_OFFSET + 2500 + SC2WOL_ITEM_ID_OFFSET = 1000 + SC2HOTS_ITEM_ID_OFFSET = SC2WOL_ITEM_ID_OFFSET + 1000 + SC2LOTV_ITEM_ID_OFFSET = SC2HOTS_ITEM_ID_OFFSET + 1000 + + slot_data = tracker_data.get_slot_data(team, player) + minerals_per_item = slot_data.get("minerals_per_item", 15) + vespene_per_item = slot_data.get("vespene_per_item", 15) + starting_supply_per_item = slot_data.get("starting_supply_per_item", 2) + + github_icon_base_url = "https://matthewmarinets.github.io/ap_sc2_icons/icons/" + organics_icon_base_url = "https://0rganics.org/archipelago/sc2wol/" icons = { "Starting Minerals": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/icons/icon-mineral-protoss.png", "Starting Vespene": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/icons/icon-gas-terran.png", - "Starting Supply": "https://static.wikia.nocookie.net/starcraft/images/d/d3/TerranSupply_SC2_Icon1.gif", - - "Infantry Weapons Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryweaponslevel1.png", - "Infantry Weapons Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryweaponslevel2.png", - "Infantry Weapons Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryweaponslevel3.png", - "Infantry Armor Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryarmorlevel1.png", - "Infantry Armor Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryarmorlevel2.png", - "Infantry Armor Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryarmorlevel3.png", - "Vehicle Weapons Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleweaponslevel1.png", - "Vehicle Weapons Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleweaponslevel2.png", - "Vehicle Weapons Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleweaponslevel3.png", - "Vehicle Armor Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleplatinglevel1.png", - "Vehicle Armor Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleplatinglevel2.png", - "Vehicle Armor Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleplatinglevel3.png", - "Ship Weapons Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipweaponslevel1.png", - "Ship Weapons Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipweaponslevel2.png", - "Ship Weapons Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipweaponslevel3.png", - "Ship Armor Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipplatinglevel1.png", - "Ship Armor Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipplatinglevel2.png", - "Ship Armor Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipplatinglevel3.png", + "Starting Supply": github_icon_base_url + "blizzard/icon-supply-terran_nobg.png", + + "Terran Infantry Weapons Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryweaponslevel1.png", + "Terran Infantry Weapons Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryweaponslevel2.png", + "Terran Infantry Weapons Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryweaponslevel3.png", + "Terran Infantry Armor Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryarmorlevel1.png", + "Terran Infantry Armor Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryarmorlevel2.png", + "Terran Infantry Armor Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryarmorlevel3.png", + "Terran Vehicle Weapons Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleweaponslevel1.png", + "Terran Vehicle Weapons Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleweaponslevel2.png", + "Terran Vehicle Weapons Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleweaponslevel3.png", + "Terran Vehicle Armor Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleplatinglevel1.png", + "Terran Vehicle Armor Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleplatinglevel2.png", + "Terran Vehicle Armor Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleplatinglevel3.png", + "Terran Ship Weapons Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipweaponslevel1.png", + "Terran Ship Weapons Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipweaponslevel2.png", + "Terran Ship Weapons Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipweaponslevel3.png", + "Terran Ship Armor Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipplatinglevel1.png", + "Terran Ship Armor Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipplatinglevel2.png", + "Terran Ship Armor Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipplatinglevel3.png", "Bunker": "https://static.wikia.nocookie.net/starcraft/images/c/c5/Bunker_SC2_Icon1.jpg", "Missile Turret": "https://static.wikia.nocookie.net/starcraft/images/5/5f/MissileTurret_SC2_Icon1.jpg", "Sensor Tower": "https://static.wikia.nocookie.net/starcraft/images/d/d2/SensorTower_SC2_Icon1.jpg", - "Projectile Accelerator (Bunker)": "https://0rganics.org/archipelago/sc2wol/ProjectileAccelerator.png", - "Neosteel Bunker (Bunker)": "https://0rganics.org/archipelago/sc2wol/NeosteelBunker.png", - "Titanium Housing (Missile Turret)": "https://0rganics.org/archipelago/sc2wol/TitaniumHousing.png", - "Hellstorm Batteries (Missile Turret)": "https://0rganics.org/archipelago/sc2wol/HellstormBatteries.png", - "Advanced Construction (SCV)": "https://0rganics.org/archipelago/sc2wol/AdvancedConstruction.png", - "Dual-Fusion Welders (SCV)": "https://0rganics.org/archipelago/sc2wol/Dual-FusionWelders.png", - "Fire-Suppression System (Building)": "https://0rganics.org/archipelago/sc2wol/Fire-SuppressionSystem.png", - "Orbital Command (Building)": "https://0rganics.org/archipelago/sc2wol/OrbitalCommandCampaign.png", + "Projectile Accelerator (Bunker)": github_icon_base_url + "blizzard/btn-upgrade-zerg-stukov-bunkerresearchbundle_05.png", + "Neosteel Bunker (Bunker)": organics_icon_base_url + "NeosteelBunker.png", + "Titanium Housing (Missile Turret)": organics_icon_base_url + "TitaniumHousing.png", + "Hellstorm Batteries (Missile Turret)": github_icon_base_url + "blizzard/btn-ability-stetmann-corruptormissilebarrage.png", + "Advanced Construction (SCV)": github_icon_base_url + "blizzard/btn-ability-mengsk-trooper-advancedconstruction.png", + "Dual-Fusion Welders (SCV)": github_icon_base_url + "blizzard/btn-upgrade-swann-scvdoublerepair.png", + "Fire-Suppression System Level 1": organics_icon_base_url + "Fire-SuppressionSystem.png", + "Fire-Suppression System Level 2": github_icon_base_url + "blizzard/btn-upgrade-swann-firesuppressionsystem.png", + + "Orbital Command": organics_icon_base_url + "OrbitalCommandCampaign.png", + "Planetary Command Module": github_icon_base_url + "original/btn-orbital-fortress.png", + "Lift Off (Planetary Fortress)": github_icon_base_url + "blizzard/btn-ability-terran-liftoff.png", + "Armament Stabilizers (Planetary Fortress)": github_icon_base_url + "blizzard/btn-ability-mengsk-siegetank-flyingtankarmament.png", + "Advanced Targeting (Planetary Fortress)": github_icon_base_url + "blizzard/btn-ability-terran-detectionconedebuff.png", "Marine": "https://static.wikia.nocookie.net/starcraft/images/4/47/Marine_SC2_Icon1.jpg", - "Medic": "https://static.wikia.nocookie.net/starcraft/images/7/74/Medic_SC2_Rend1.jpg", - "Firebat": "https://static.wikia.nocookie.net/starcraft/images/3/3c/Firebat_SC2_Rend1.jpg", + "Medic": github_icon_base_url + "blizzard/btn-unit-terran-medic.png", + "Firebat": github_icon_base_url + "blizzard/btn-unit-terran-firebat.png", "Marauder": "https://static.wikia.nocookie.net/starcraft/images/b/ba/Marauder_SC2_Icon1.jpg", "Reaper": "https://static.wikia.nocookie.net/starcraft/images/7/7d/Reaper_SC2_Icon1.jpg", - - "Stimpack (Marine)": "https://0rganics.org/archipelago/sc2wol/StimpacksCampaign.png", - "Super Stimpack (Marine)": "/static/static/icons/sc2/superstimpack.png", - "Combat Shield (Marine)": "https://0rganics.org/archipelago/sc2wol/CombatShieldCampaign.png", - "Laser Targeting System (Marine)": "/static/static/icons/sc2/lasertargetingsystem.png", - "Magrail Munitions (Marine)": "/static/static/icons/sc2/magrailmunitions.png", - "Optimized Logistics (Marine)": "/static/static/icons/sc2/optimizedlogistics.png", - "Advanced Medic Facilities (Medic)": "https://0rganics.org/archipelago/sc2wol/AdvancedMedicFacilities.png", - "Stabilizer Medpacks (Medic)": "https://0rganics.org/archipelago/sc2wol/StabilizerMedpacks.png", - "Restoration (Medic)": "/static/static/icons/sc2/restoration.png", - "Optical Flare (Medic)": "/static/static/icons/sc2/opticalflare.png", - "Optimized Logistics (Medic)": "/static/static/icons/sc2/optimizedlogistics.png", - "Incinerator Gauntlets (Firebat)": "https://0rganics.org/archipelago/sc2wol/IncineratorGauntlets.png", - "Juggernaut Plating (Firebat)": "https://0rganics.org/archipelago/sc2wol/JuggernautPlating.png", - "Stimpack (Firebat)": "https://0rganics.org/archipelago/sc2wol/StimpacksCampaign.png", - "Super Stimpack (Firebat)": "/static/static/icons/sc2/superstimpack.png", - "Optimized Logistics (Firebat)": "/static/static/icons/sc2/optimizedlogistics.png", - "Concussive Shells (Marauder)": "https://0rganics.org/archipelago/sc2wol/ConcussiveShellsCampaign.png", - "Kinetic Foam (Marauder)": "https://0rganics.org/archipelago/sc2wol/KineticFoam.png", - "Stimpack (Marauder)": "https://0rganics.org/archipelago/sc2wol/StimpacksCampaign.png", - "Super Stimpack (Marauder)": "/static/static/icons/sc2/superstimpack.png", - "Laser Targeting System (Marauder)": "/static/static/icons/sc2/lasertargetingsystem.png", - "Magrail Munitions (Marauder)": "/static/static/icons/sc2/magrailmunitions.png", - "Internal Tech Module (Marauder)": "/static/static/icons/sc2/internalizedtechmodule.png", - "U-238 Rounds (Reaper)": "https://0rganics.org/archipelago/sc2wol/U-238Rounds.png", - "G-4 Clusterbomb (Reaper)": "https://0rganics.org/archipelago/sc2wol/G-4Clusterbomb.png", - "Stimpack (Reaper)": "https://0rganics.org/archipelago/sc2wol/StimpacksCampaign.png", - "Super Stimpack (Reaper)": "/static/static/icons/sc2/superstimpack.png", - "Laser Targeting System (Reaper)": "/static/static/icons/sc2/lasertargetingsystem.png", - "Advanced Cloaking Field (Reaper)": "/static/static/icons/sc2/terran-cloak-color.png", - "Spider Mines (Reaper)": "/static/static/icons/sc2/spidermine.png", - "Combat Drugs (Reaper)": "/static/static/icons/sc2/reapercombatdrugs.png", + "Ghost": "https://static.wikia.nocookie.net/starcraft/images/6/6e/Ghost_SC2_Icon1.jpg", + "Spectre": github_icon_base_url + "original/btn-unit-terran-spectre.png", + "HERC": github_icon_base_url + "blizzard/btn-unit-terran-herc.png", + + "Stimpack (Marine)": github_icon_base_url + "blizzard/btn-ability-terran-stimpack-color.png", + "Super Stimpack (Marine)": github_icon_base_url + "blizzard/btn-upgrade-terran-superstimppack.png", + "Combat Shield (Marine)": github_icon_base_url + "blizzard/btn-techupgrade-terran-combatshield-color.png", + "Laser Targeting System (Marine)": github_icon_base_url + "blizzard/btn-upgrade-terran-lazertargetingsystem.png", + "Magrail Munitions (Marine)": github_icon_base_url + "blizzard/btn-upgrade-terran-magrailmunitions.png", + "Optimized Logistics (Marine)": github_icon_base_url + "blizzard/btn-upgrade-terran-optimizedlogistics.png", + "Advanced Medic Facilities (Medic)": organics_icon_base_url + "AdvancedMedicFacilities.png", + "Stabilizer Medpacks (Medic)": github_icon_base_url + "blizzard/btn-upgrade-raynor-stabilizermedpacks.png", + "Restoration (Medic)": github_icon_base_url + "original/btn-ability-terran-restoration@scbw.png", + "Optical Flare (Medic)": github_icon_base_url + "blizzard/btn-upgrade-protoss-fenix-dragoonsolariteflare.png", + "Resource Efficiency (Medic)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Adaptive Medpacks (Medic)": github_icon_base_url + "blizzard/btn-ability-terran-heal-color.png", + "Nano Projector (Medic)": github_icon_base_url + "blizzard/talent-raynor-level03-firebatmedicrange.png", + "Incinerator Gauntlets (Firebat)": github_icon_base_url + "blizzard/btn-upgrade-raynor-incineratorgauntlets.png", + "Juggernaut Plating (Firebat)": github_icon_base_url + "blizzard/btn-upgrade-raynor-juggernautplating.png", + "Stimpack (Firebat)": github_icon_base_url + "blizzard/btn-ability-terran-stimpack-color.png", + "Super Stimpack (Firebat)": github_icon_base_url + "blizzard/btn-upgrade-terran-superstimppack.png", + "Resource Efficiency (Firebat)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Infernal Pre-Igniter (Firebat)": github_icon_base_url + "blizzard/btn-upgrade-terran-infernalpreigniter.png", + "Kinetic Foam (Firebat)": organics_icon_base_url + "KineticFoam.png", + "Nano Projectors (Firebat)": github_icon_base_url + "blizzard/talent-raynor-level03-firebatmedicrange.png", + "Concussive Shells (Marauder)": github_icon_base_url + "blizzard/btn-ability-terran-punishergrenade-color.png", + "Kinetic Foam (Marauder)": organics_icon_base_url + "KineticFoam.png", + "Stimpack (Marauder)": github_icon_base_url + "blizzard/btn-ability-terran-stimpack-color.png", + "Super Stimpack (Marauder)": github_icon_base_url + "blizzard/btn-upgrade-terran-superstimppack.png", + "Laser Targeting System (Marauder)": github_icon_base_url + "blizzard/btn-upgrade-terran-lazertargetingsystem.png", + "Magrail Munitions (Marauder)": github_icon_base_url + "blizzard/btn-upgrade-terran-magrailmunitions.png", + "Internal Tech Module (Marauder)": github_icon_base_url + "blizzard/btn-upgrade-terran-internalizedtechmodule.png", + "Juggernaut Plating (Marauder)": organics_icon_base_url + "JuggernautPlating.png", + "U-238 Rounds (Reaper)": organics_icon_base_url + "U-238Rounds.png", + "G-4 Clusterbomb (Reaper)": github_icon_base_url + "blizzard/btn-upgrade-terran-kd8chargeex3.png", + "Stimpack (Reaper)": github_icon_base_url + "blizzard/btn-ability-terran-stimpack-color.png", + "Super Stimpack (Reaper)": github_icon_base_url + "blizzard/btn-upgrade-terran-superstimppack.png", + "Laser Targeting System (Reaper)": github_icon_base_url + "blizzard/btn-upgrade-terran-lazertargetingsystem.png", + "Advanced Cloaking Field (Reaper)": github_icon_base_url + "original/btn-permacloak-reaper.png", + "Spider Mines (Reaper)": github_icon_base_url + "original/btn-ability-terran-spidermine.png", + "Combat Drugs (Reaper)": github_icon_base_url + "blizzard/btn-upgrade-terran-reapercombatdrugs.png", + "Jet Pack Overdrive (Reaper)": github_icon_base_url + "blizzard/btn-ability-hornerhan-reaper-flightmode.png", + "Ocular Implants (Ghost)": organics_icon_base_url + "OcularImplants.png", + "Crius Suit (Ghost)": github_icon_base_url + "original/btn-permacloak-ghost.png", + "EMP Rounds (Ghost)": github_icon_base_url + "blizzard/btn-ability-terran-emp-color.png", + "Lockdown (Ghost)": github_icon_base_url + "original/btn-abilty-terran-lockdown@scbw.png", + "Resource Efficiency (Ghost)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Psionic Lash (Spectre)": organics_icon_base_url + "PsionicLash.png", + "Nyx-Class Cloaking Module (Spectre)": github_icon_base_url + "original/btn-permacloak-spectre.png", + "Impaler Rounds (Spectre)": github_icon_base_url + "blizzard/btn-techupgrade-terran-impalerrounds.png", + "Resource Efficiency (Spectre)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Juggernaut Plating (HERC)": organics_icon_base_url + "JuggernautPlating.png", + "Kinetic Foam (HERC)": organics_icon_base_url + "KineticFoam.png", "Hellion": "https://static.wikia.nocookie.net/starcraft/images/5/56/Hellion_SC2_Icon1.jpg", - "Vulture": "https://static.wikia.nocookie.net/starcraft/images/d/da/Vulture_WoL.jpg", - "Goliath": "https://static.wikia.nocookie.net/starcraft/images/e/eb/Goliath_WoL.jpg", - "Diamondback": "https://static.wikia.nocookie.net/starcraft/images/a/a6/Diamondback_WoL.jpg", + "Vulture": github_icon_base_url + "blizzard/btn-unit-terran-vulture.png", + "Goliath": github_icon_base_url + "blizzard/btn-unit-terran-goliath.png", + "Diamondback": github_icon_base_url + "blizzard/btn-unit-terran-cobra.png", "Siege Tank": "https://static.wikia.nocookie.net/starcraft/images/5/57/SiegeTank_SC2_Icon1.jpg", - - "Twin-Linked Flamethrower (Hellion)": "https://0rganics.org/archipelago/sc2wol/Twin-LinkedFlamethrower.png", - "Thermite Filaments (Hellion)": "https://0rganics.org/archipelago/sc2wol/ThermiteFilaments.png", - "Hellbat Aspect (Hellion)": "/static/static/icons/sc2/hellionbattlemode.png", - "Smart Servos (Hellion)": "/static/static/icons/sc2/transformationservos.png", - "Optimized Logistics (Hellion)": "/static/static/icons/sc2/optimizedlogistics.png", - "Jump Jets (Hellion)": "/static/static/icons/sc2/jumpjets.png", - "Stimpack (Hellion)": "https://0rganics.org/archipelago/sc2wol/StimpacksCampaign.png", - "Super Stimpack (Hellion)": "/static/static/icons/sc2/superstimpack.png", - "Cerberus Mine (Spider Mine)": "https://0rganics.org/archipelago/sc2wol/CerberusMine.png", - "High Explosive Munition (Spider Mine)": "/static/static/icons/sc2/high-explosive-spidermine.png", - "Replenishable Magazine (Vulture)": "https://0rganics.org/archipelago/sc2wol/ReplenishableMagazine.png", - "Ion Thrusters (Vulture)": "/static/static/icons/sc2/emergencythrusters.png", - "Auto Launchers (Vulture)": "/static/static/icons/sc2/jotunboosters.png", - "Multi-Lock Weapons System (Goliath)": "https://0rganics.org/archipelago/sc2wol/Multi-LockWeaponsSystem.png", - "Ares-Class Targeting System (Goliath)": "https://0rganics.org/archipelago/sc2wol/Ares-ClassTargetingSystem.png", - "Jump Jets (Goliath)": "/static/static/icons/sc2/jumpjets.png", - "Optimized Logistics (Goliath)": "/static/static/icons/sc2/optimizedlogistics.png", - "Tri-Lithium Power Cell (Diamondback)": "https://0rganics.org/archipelago/sc2wol/Tri-LithiumPowerCell.png", - "Shaped Hull (Diamondback)": "https://0rganics.org/archipelago/sc2wol/ShapedHull.png", - "Hyperfluxor (Diamondback)": "/static/static/icons/sc2/hyperfluxor.png", - "Burst Capacitors (Diamondback)": "/static/static/icons/sc2/burstcapacitors.png", - "Optimized Logistics (Diamondback)": "/static/static/icons/sc2/optimizedlogistics.png", - "Maelstrom Rounds (Siege Tank)": "https://0rganics.org/archipelago/sc2wol/MaelstromRounds.png", - "Shaped Blast (Siege Tank)": "https://0rganics.org/archipelago/sc2wol/ShapedBlast.png", - "Jump Jets (Siege Tank)": "/static/static/icons/sc2/jumpjets.png", - "Spider Mines (Siege Tank)": "/static/static/icons/sc2/siegetank-spidermines.png", - "Smart Servos (Siege Tank)": "/static/static/icons/sc2/transformationservos.png", - "Graduating Range (Siege Tank)": "/static/static/icons/sc2/siegetankrange.png", - "Laser Targeting System (Siege Tank)": "/static/static/icons/sc2/lasertargetingsystem.png", - "Advanced Siege Tech (Siege Tank)": "/static/static/icons/sc2/improvedsiegemode.png", - "Internal Tech Module (Siege Tank)": "/static/static/icons/sc2/internalizedtechmodule.png", + "Thor": "https://static.wikia.nocookie.net/starcraft/images/e/ef/Thor_SC2_Icon1.jpg", + "Predator": github_icon_base_url + "original/btn-unit-terran-predator.png", + "Widow Mine": github_icon_base_url + "blizzard/btn-unit-terran-widowmine.png", + "Cyclone": github_icon_base_url + "blizzard/btn-unit-terran-cyclone.png", + "Warhound": github_icon_base_url + "blizzard/btn-unit-terran-warhound.png", + + "Twin-Linked Flamethrower (Hellion)": github_icon_base_url + "blizzard/btn-upgrade-mengsk-trooper-flamethrower.png", + "Thermite Filaments (Hellion)": github_icon_base_url + "blizzard/btn-upgrade-terran-infernalpreigniter.png", + "Hellbat Aspect (Hellion)": github_icon_base_url + "blizzard/btn-unit-terran-hellionbattlemode.png", + "Smart Servos (Hellion)": github_icon_base_url + "blizzard/btn-upgrade-terran-transformationservos.png", + "Optimized Logistics (Hellion)": github_icon_base_url + "blizzard/btn-upgrade-terran-optimizedlogistics.png", + "Jump Jets (Hellion)": github_icon_base_url + "blizzard/btn-upgrade-terran-jumpjets.png", + "Stimpack (Hellion)": github_icon_base_url + "blizzard/btn-ability-terran-stimpack-color.png", + "Super Stimpack (Hellion)": github_icon_base_url + "blizzard/btn-upgrade-terran-superstimppack.png", + "Infernal Plating (Hellion)": github_icon_base_url + "blizzard/btn-upgrade-swann-hellarmor.png", + "Cerberus Mine (Spider Mine)": github_icon_base_url + "blizzard/btn-upgrade-raynor-cerberusmines.png", + "High Explosive Munition (Spider Mine)": github_icon_base_url + "original/btn-ability-terran-spidermine.png", + "Replenishable Magazine (Vulture)": github_icon_base_url + "blizzard/btn-upgrade-raynor-replenishablemagazine.png", + "Replenishable Magazine (Free) (Vulture)": github_icon_base_url + "blizzard/btn-upgrade-raynor-replenishablemagazine.png", + "Ion Thrusters (Vulture)": github_icon_base_url + "blizzard/btn-ability-terran-emergencythrusters.png", + "Auto Launchers (Vulture)": github_icon_base_url + "blizzard/btn-upgrade-terran-jotunboosters.png", + "Auto-Repair (Vulture)": github_icon_base_url + "blizzard/ui_tipicon_campaign_space01-repair.png", + "Multi-Lock Weapons System (Goliath)": github_icon_base_url + "blizzard/btn-upgrade-swann-multilockweaponsystem.png", + "Ares-Class Targeting System (Goliath)": github_icon_base_url + "blizzard/btn-upgrade-swann-aresclasstargetingsystem.png", + "Jump Jets (Goliath)": github_icon_base_url + "blizzard/btn-upgrade-terran-jumpjets.png", + "Optimized Logistics (Goliath)": github_icon_base_url + "blizzard/btn-upgrade-terran-optimizedlogistics.png", + "Shaped Hull (Goliath)": organics_icon_base_url + "ShapedHull.png", + "Resource Efficiency (Goliath)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Internal Tech Module (Goliath)": github_icon_base_url + "blizzard/btn-upgrade-terran-internalizedtechmodule.png", + "Tri-Lithium Power Cell (Diamondback)": github_icon_base_url + "original/btn-upgrade-terran-trilithium-power-cell.png", + "Tungsten Spikes (Diamondback)": github_icon_base_url + "original/btn-upgrade-terran-tungsten-spikes.png", + "Shaped Hull (Diamondback)": organics_icon_base_url + "ShapedHull.png", + "Hyperfluxor (Diamondback)": github_icon_base_url + "blizzard/btn-upgrade-mengsk-engineeringbay-orbitaldrop.png", + "Burst Capacitors (Diamondback)": github_icon_base_url + "blizzard/btn-ability-terran-electricfield.png", + "Ion Thrusters (Diamondback)": github_icon_base_url + "blizzard/btn-ability-terran-emergencythrusters.png", + "Resource Efficiency (Diamondback)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Maelstrom Rounds (Siege Tank)": github_icon_base_url + "blizzard/btn-upgrade-raynor-maelstromrounds.png", + "Shaped Blast (Siege Tank)": organics_icon_base_url + "ShapedBlast.png", + "Jump Jets (Siege Tank)": github_icon_base_url + "blizzard/btn-upgrade-terran-jumpjets.png", + "Spider Mines (Siege Tank)": github_icon_base_url + "blizzard/btn-upgrade-siegetank-spidermines.png", + "Smart Servos (Siege Tank)": github_icon_base_url + "blizzard/btn-upgrade-terran-transformationservos.png", + "Graduating Range (Siege Tank)": github_icon_base_url + "blizzard/btn-upgrade-terran-nova-siegetankrange.png", + "Laser Targeting System (Siege Tank)": github_icon_base_url + "blizzard/btn-upgrade-terran-lazertargetingsystem.png", + "Advanced Siege Tech (Siege Tank)": github_icon_base_url + "blizzard/btn-upgrade-raynor-improvedsiegemode.png", + "Internal Tech Module (Siege Tank)": github_icon_base_url + "blizzard/btn-upgrade-terran-internalizedtechmodule.png", + "Shaped Hull (Siege Tank)": organics_icon_base_url + "ShapedHull.png", + "Resource Efficiency (Siege Tank)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "330mm Barrage Cannon (Thor)": github_icon_base_url + "original/btn-ability-thor-330mm.png", + "Immortality Protocol (Thor)": github_icon_base_url + "blizzard/btn-techupgrade-terran-immortalityprotocol.png", + "Immortality Protocol (Free) (Thor)": github_icon_base_url + "blizzard/btn-techupgrade-terran-immortalityprotocol.png", + "High Impact Payload (Thor)": github_icon_base_url + "blizzard/btn-unit-terran-thorsiegemode.png", + "Smart Servos (Thor)": github_icon_base_url + "blizzard/btn-upgrade-terran-transformationservos.png", + "Button With a Skull on It (Thor)": github_icon_base_url + "blizzard/btn-ability-terran-nuclearstrike-color.png", + "Laser Targeting System (Thor)": github_icon_base_url + "blizzard/btn-upgrade-terran-lazertargetingsystem.png", + "Large Scale Field Construction (Thor)": github_icon_base_url + "blizzard/talent-swann-level12-immortalityprotocol.png", + "Resource Efficiency (Predator)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Cloak (Predator)": github_icon_base_url + "blizzard/btn-ability-terran-cloak-color.png", + "Charge (Predator)": github_icon_base_url + "blizzard/btn-ability-protoss-charge-color.png", + "Predator's Fury (Predator)": github_icon_base_url + "blizzard/btn-ability-protoss-shadowfury.png", + "Drilling Claws (Widow Mine)": github_icon_base_url + "blizzard/btn-upgrade-terran-researchdrillingclaws.png", + "Concealment (Widow Mine)": github_icon_base_url + "blizzard/btn-ability-terran-widowminehidden.png", + "Black Market Launchers (Widow Mine)": github_icon_base_url + "blizzard/btn-ability-hornerhan-widowmine-attackrange.png", + "Executioner Missiles (Widow Mine)": github_icon_base_url + "blizzard/btn-ability-hornerhan-widowmine-deathblossom.png", + "Mag-Field Accelerators (Cyclone)": github_icon_base_url + "blizzard/btn-upgrade-terran-magfieldaccelerator.png", + "Mag-Field Launchers (Cyclone)": github_icon_base_url + "blizzard/btn-upgrade-terran-cyclonerangeupgrade.png", + "Targeting Optics (Cyclone)": github_icon_base_url + "blizzard/btn-upgrade-swann-targetingoptics.png", + "Rapid Fire Launchers (Cyclone)": github_icon_base_url + "blizzard/btn-upgrade-raynor-ripwavemissiles.png", + "Resource Efficiency (Cyclone)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Internal Tech Module (Cyclone)": github_icon_base_url + "blizzard/btn-upgrade-terran-internalizedtechmodule.png", + "Resource Efficiency (Warhound)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Reinforced Plating (Warhound)": github_icon_base_url + "original/btn-research-zerg-fortifiedbunker.png", "Medivac": "https://static.wikia.nocookie.net/starcraft/images/d/db/Medivac_SC2_Icon1.jpg", - "Wraith": "https://static.wikia.nocookie.net/starcraft/images/7/75/Wraith_WoL.jpg", + "Wraith": github_icon_base_url + "blizzard/btn-unit-terran-wraith.png", "Viking": "https://static.wikia.nocookie.net/starcraft/images/2/2a/Viking_SC2_Icon1.jpg", "Banshee": "https://static.wikia.nocookie.net/starcraft/images/3/32/Banshee_SC2_Icon1.jpg", "Battlecruiser": "https://static.wikia.nocookie.net/starcraft/images/f/f5/Battlecruiser_SC2_Icon1.jpg", - - "Rapid Deployment Tube (Medivac)": "https://0rganics.org/archipelago/sc2wol/RapidDeploymentTube.png", - "Advanced Healing AI (Medivac)": "https://0rganics.org/archipelago/sc2wol/AdvancedHealingAI.png", - "Expanded Hull (Medivac)": "/static/static/icons/sc2/neosteelfortifiedarmor.png", - "Afterburners (Medivac)": "/static/static/icons/sc2/medivacemergencythrusters.png", - "Tomahawk Power Cells (Wraith)": "https://0rganics.org/archipelago/sc2wol/TomahawkPowerCells.png", - "Displacement Field (Wraith)": "https://0rganics.org/archipelago/sc2wol/DisplacementField.png", - "Advanced Laser Technology (Wraith)": "/static/static/icons/sc2/improvedburstlaser.png", - "Ripwave Missiles (Viking)": "https://0rganics.org/archipelago/sc2wol/RipwaveMissiles.png", - "Phobos-Class Weapons System (Viking)": "https://0rganics.org/archipelago/sc2wol/Phobos-ClassWeaponsSystem.png", - "Smart Servos (Viking)": "/static/static/icons/sc2/transformationservos.png", - "Magrail Munitions (Viking)": "/static/static/icons/sc2/magrailmunitions.png", - "Cross-Spectrum Dampeners (Banshee)": "/static/static/icons/sc2/crossspectrumdampeners.png", - "Advanced Cross-Spectrum Dampeners (Banshee)": "https://0rganics.org/archipelago/sc2wol/Cross-SpectrumDampeners.png", - "Shockwave Missile Battery (Banshee)": "https://0rganics.org/archipelago/sc2wol/ShockwaveMissileBattery.png", - "Hyperflight Rotors (Banshee)": "/static/static/icons/sc2/hyperflightrotors.png", - "Laser Targeting System (Banshee)": "/static/static/icons/sc2/lasertargetingsystem.png", - "Internal Tech Module (Banshee)": "/static/static/icons/sc2/internalizedtechmodule.png", - "Missile Pods (Battlecruiser)": "https://0rganics.org/archipelago/sc2wol/MissilePods.png", - "Defensive Matrix (Battlecruiser)": "https://0rganics.org/archipelago/sc2wol/DefensiveMatrix.png", - "Tactical Jump (Battlecruiser)": "/static/static/icons/sc2/warpjump.png", - "Cloak (Battlecruiser)": "/static/static/icons/sc2/terran-cloak-color.png", - "ATX Laser Battery (Battlecruiser)": "/static/static/icons/sc2/specialordance.png", - "Optimized Logistics (Battlecruiser)": "/static/static/icons/sc2/optimizedlogistics.png", - "Internal Tech Module (Battlecruiser)": "/static/static/icons/sc2/internalizedtechmodule.png", - - "Ghost": "https://static.wikia.nocookie.net/starcraft/images/6/6e/Ghost_SC2_Icon1.jpg", - "Spectre": "https://static.wikia.nocookie.net/starcraft/images/0/0d/Spectre_WoL.jpg", - "Thor": "https://static.wikia.nocookie.net/starcraft/images/e/ef/Thor_SC2_Icon1.jpg", - - "Widow Mine": "/static/static/icons/sc2/widowmine.png", - "Cyclone": "/static/static/icons/sc2/cyclone.png", - "Liberator": "/static/static/icons/sc2/liberator.png", - "Valkyrie": "/static/static/icons/sc2/valkyrie.png", - - "Ocular Implants (Ghost)": "https://0rganics.org/archipelago/sc2wol/OcularImplants.png", - "Crius Suit (Ghost)": "https://0rganics.org/archipelago/sc2wol/CriusSuit.png", - "EMP Rounds (Ghost)": "/static/static/icons/sc2/terran-emp-color.png", - "Lockdown (Ghost)": "/static/static/icons/sc2/lockdown.png", - "Psionic Lash (Spectre)": "https://0rganics.org/archipelago/sc2wol/PsionicLash.png", - "Nyx-Class Cloaking Module (Spectre)": "https://0rganics.org/archipelago/sc2wol/Nyx-ClassCloakingModule.png", - "Impaler Rounds (Spectre)": "/static/static/icons/sc2/impalerrounds.png", - "330mm Barrage Cannon (Thor)": "https://0rganics.org/archipelago/sc2wol/330mmBarrageCannon.png", - "Immortality Protocol (Thor)": "https://0rganics.org/archipelago/sc2wol/ImmortalityProtocol.png", - "High Impact Payload (Thor)": "/static/static/icons/sc2/thorsiegemode.png", - "Smart Servos (Thor)": "/static/static/icons/sc2/transformationservos.png", - - "Optimized Logistics (Predator)": "/static/static/icons/sc2/optimizedlogistics.png", - "Drilling Claws (Widow Mine)": "/static/static/icons/sc2/drillingclaws.png", - "Concealment (Widow Mine)": "/static/static/icons/sc2/widowminehidden.png", - "Black Market Launchers (Widow Mine)": "/static/static/icons/sc2/widowmine-attackrange.png", - "Executioner Missiles (Widow Mine)": "/static/static/icons/sc2/widowmine-deathblossom.png", - "Mag-Field Accelerators (Cyclone)": "/static/static/icons/sc2/magfieldaccelerator.png", - "Mag-Field Launchers (Cyclone)": "/static/static/icons/sc2/cyclonerangeupgrade.png", - "Targeting Optics (Cyclone)": "/static/static/icons/sc2/targetingoptics.png", - "Rapid Fire Launchers (Cyclone)": "/static/static/icons/sc2/ripwavemissiles.png", - "Bio Mechanical Repair Drone (Raven)": "/static/static/icons/sc2/biomechanicaldrone.png", - "Spider Mines (Raven)": "/static/static/icons/sc2/siegetank-spidermines.png", - "Railgun Turret (Raven)": "/static/static/icons/sc2/autoturretblackops.png", - "Hunter-Seeker Weapon (Raven)": "/static/static/icons/sc2/specialordance.png", - "Interference Matrix (Raven)": "/static/static/icons/sc2/interferencematrix.png", - "Anti-Armor Missile (Raven)": "/static/static/icons/sc2/shreddermissile.png", - "Internal Tech Module (Raven)": "/static/static/icons/sc2/internalizedtechmodule.png", - "EMP Shockwave (Science Vessel)": "/static/static/icons/sc2/staticempblast.png", - "Defensive Matrix (Science Vessel)": "https://0rganics.org/archipelago/sc2wol/DefensiveMatrix.png", - "Advanced Ballistics (Liberator)": "/static/static/icons/sc2/advanceballistics.png", - "Raid Artillery (Liberator)": "/static/static/icons/sc2/terrandefendermodestructureattack.png", - "Cloak (Liberator)": "/static/static/icons/sc2/terran-cloak-color.png", - "Laser Targeting System (Liberator)": "/static/static/icons/sc2/lasertargetingsystem.png", - "Optimized Logistics (Liberator)": "/static/static/icons/sc2/optimizedlogistics.png", - "Enhanced Cluster Launchers (Valkyrie)": "https://0rganics.org/archipelago/sc2wol/HellstormBatteries.png", - "Shaped Hull (Valkyrie)": "https://0rganics.org/archipelago/sc2wol/ShapedHull.png", - "Burst Lasers (Valkyrie)": "/static/static/icons/sc2/improvedburstlaser.png", - "Afterburners (Valkyrie)": "/static/static/icons/sc2/medivacemergencythrusters.png", + "Raven": "https://static.wikia.nocookie.net/starcraft/images/1/19/SC2_Lab_Raven_Icon.png", + "Science Vessel": "https://static.wikia.nocookie.net/starcraft/images/c/c3/SC2_Lab_SciVes_Icon.png", + "Hercules": "https://static.wikia.nocookie.net/starcraft/images/4/40/SC2_Lab_Hercules_Icon.png", + "Liberator": github_icon_base_url + "blizzard/btn-unit-terran-liberator.png", + "Valkyrie": github_icon_base_url + "original/btn-unit-terran-valkyrie@scbw.png", + + "Rapid Deployment Tube (Medivac)": organics_icon_base_url + "RapidDeploymentTube.png", + "Advanced Healing AI (Medivac)": github_icon_base_url + "blizzard/btn-ability-mengsk-medivac-doublehealbeam.png", + "Expanded Hull (Medivac)": github_icon_base_url + "blizzard/btn-upgrade-mengsk-engineeringbay-neosteelfortifiedarmor.png", + "Afterburners (Medivac)": github_icon_base_url + "blizzard/btn-upgrade-terran-medivacemergencythrusters.png", + "Scatter Veil (Medivac)": github_icon_base_url + "blizzard/btn-upgrade-swann-defensivematrix.png", + "Advanced Cloaking Field (Medivac)": github_icon_base_url + "original/btn-permacloak-medivac.png", + "Tomahawk Power Cells (Wraith)": organics_icon_base_url + "TomahawkPowerCells.png", + "Unregistered Cloaking Module (Wraith)": github_icon_base_url + "original/btn-permacloak-wraith.png", + "Trigger Override (Wraith)": github_icon_base_url + "blizzard/btn-ability-hornerhan-wraith-attackspeed.png", + "Internal Tech Module (Wraith)": github_icon_base_url + "blizzard/btn-upgrade-terran-internalizedtechmodule.png", + "Resource Efficiency (Wraith)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Displacement Field (Wraith)": github_icon_base_url + "blizzard/btn-upgrade-swann-displacementfield.png", + "Advanced Laser Technology (Wraith)": github_icon_base_url + "blizzard/btn-upgrade-swann-improvedburstlaser.png", + "Ripwave Missiles (Viking)": github_icon_base_url + "blizzard/btn-upgrade-raynor-ripwavemissiles.png", + "Phobos-Class Weapons System (Viking)": github_icon_base_url + "blizzard/btn-upgrade-raynor-phobosclassweaponssystem.png", + "Smart Servos (Viking)": github_icon_base_url + "blizzard/btn-upgrade-terran-transformationservos.png", + "Anti-Mechanical Munition (Viking)": github_icon_base_url + "blizzard/btn-ability-terran-ignorearmor.png", + "Shredder Rounds (Viking)": github_icon_base_url + "blizzard/btn-ability-hornerhan-viking-piercingattacks.png", + "W.I.L.D. Missiles (Viking)": github_icon_base_url + "blizzard/btn-ability-hornerhan-viking-missileupgrade.png", + "Cross-Spectrum Dampeners (Banshee)": github_icon_base_url + "original/btn-banshee-cross-spectrum-dampeners.png", + "Advanced Cross-Spectrum Dampeners (Banshee)": github_icon_base_url + "original/btn-permacloak-banshee.png", + "Shockwave Missile Battery (Banshee)": github_icon_base_url + "blizzard/btn-upgrade-raynor-shockwavemissilebattery.png", + "Hyperflight Rotors (Banshee)": github_icon_base_url + "blizzard/btn-upgrade-terran-hyperflightrotors.png", + "Laser Targeting System (Banshee)": github_icon_base_url + "blizzard/btn-upgrade-terran-lazertargetingsystem.png", + "Internal Tech Module (Banshee)": github_icon_base_url + "blizzard/btn-upgrade-terran-internalizedtechmodule.png", + "Shaped Hull (Banshee)": organics_icon_base_url + "ShapedHull.png", + "Advanced Targeting Optics (Banshee)": github_icon_base_url + "blizzard/btn-ability-terran-detectionconedebuff.png", + "Distortion Blasters (Banshee)": github_icon_base_url + "blizzard/btn-techupgrade-terran-cloakdistortionfield.png", + "Rocket Barrage (Banshee)": github_icon_base_url + "blizzard/btn-upgrade-terran-nova-bansheemissilestrik.png", + "Missile Pods (Battlecruiser) Level 1": organics_icon_base_url + "MissilePods.png", + "Missile Pods (Battlecruiser) Level 2": github_icon_base_url + "blizzard/btn-upgrade-terran-nova-bansheemissilestrik.png", + "Defensive Matrix (Battlecruiser)": github_icon_base_url + "blizzard/btn-upgrade-swann-defensivematrix.png", + "Advanced Defensive Matrix (Battlecruiser)": github_icon_base_url + "blizzard/btn-upgrade-swann-defensivematrix.png", + "Tactical Jump (Battlecruiser)": github_icon_base_url + "blizzard/btn-ability-terran-warpjump.png", + "Cloak (Battlecruiser)": github_icon_base_url + "blizzard/btn-ability-terran-cloak-color.png", + "ATX Laser Battery (Battlecruiser)": github_icon_base_url + "blizzard/btn-upgrade-terran-nova-specialordance.png", + "Optimized Logistics (Battlecruiser)": github_icon_base_url + "blizzard/btn-upgrade-terran-optimizedlogistics.png", + "Internal Tech Module (Battlecruiser)": github_icon_base_url + "blizzard/btn-upgrade-terran-internalizedtechmodule.png", + "Behemoth Plating (Battlecruiser)": github_icon_base_url + "original/btn-research-zerg-fortifiedbunker.png", + "Covert Ops Engines (Battlecruiser)": github_icon_base_url + "blizzard/btn-ability-terran-emergencythrusters.png", + "Bio Mechanical Repair Drone (Raven)": github_icon_base_url + "blizzard/btn-unit-biomechanicaldrone.png", + "Spider Mines (Raven)": github_icon_base_url + "blizzard/btn-upgrade-siegetank-spidermines.png", + "Railgun Turret (Raven)": github_icon_base_url + "blizzard/btn-unit-terran-autoturretblackops.png", + "Hunter-Seeker Weapon (Raven)": github_icon_base_url + "blizzard/btn-upgrade-terran-nova-specialordance.png", + "Interference Matrix (Raven)": github_icon_base_url + "blizzard/btn-upgrade-terran-interferencematrix.png", + "Anti-Armor Missile (Raven)": github_icon_base_url + "blizzard/btn-ability-terran-shreddermissile-color.png", + "Internal Tech Module (Raven)": github_icon_base_url + "blizzard/btn-upgrade-terran-internalizedtechmodule.png", + "Resource Efficiency (Raven)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Durable Materials (Raven)": github_icon_base_url + "blizzard/btn-upgrade-terran-durablematerials.png", + "EMP Shockwave (Science Vessel)": github_icon_base_url + "blizzard/btn-ability-mengsk-ghost-staticempblast.png", + "Defensive Matrix (Science Vessel)": github_icon_base_url + "blizzard/btn-upgrade-swann-defensivematrix.png", + "Improved Nano-Repair (Science Vessel)": github_icon_base_url + "blizzard/btn-upgrade-swann-improvednanorepair.png", + "Advanced AI Systems (Science Vessel)": github_icon_base_url + "blizzard/btn-ability-mengsk-medivac-doublehealbeam.png", + "Internal Fusion Module (Hercules)": github_icon_base_url + "blizzard/btn-upgrade-terran-internalizedtechmodule.png", + "Tactical Jump (Hercules)": github_icon_base_url + "blizzard/btn-ability-terran-hercules-tacticaljump.png", + "Advanced Ballistics (Liberator)": github_icon_base_url + "blizzard/btn-upgrade-terran-advanceballistics.png", + "Raid Artillery (Liberator)": github_icon_base_url + "blizzard/btn-upgrade-terran-nova-terrandefendermodestructureattack.png", + "Cloak (Liberator)": github_icon_base_url + "blizzard/btn-ability-terran-cloak-color.png", + "Laser Targeting System (Liberator)": github_icon_base_url + "blizzard/btn-upgrade-terran-lazertargetingsystem.png", + "Optimized Logistics (Liberator)": github_icon_base_url + "blizzard/btn-upgrade-terran-optimizedlogistics.png", + "Smart Servos (Liberator)": github_icon_base_url + "blizzard/btn-upgrade-terran-transformationservos.png", + "Resource Efficiency (Liberator)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Enhanced Cluster Launchers (Valkyrie)": github_icon_base_url + "blizzard/btn-ability-stetmann-corruptormissilebarrage.png", + "Shaped Hull (Valkyrie)": organics_icon_base_url + "ShapedHull.png", + "Flechette Missiles (Valkyrie)": github_icon_base_url + "blizzard/btn-ability-hornerhan-viking-missileupgrade.png", + "Afterburners (Valkyrie)": github_icon_base_url + "blizzard/btn-upgrade-terran-medivacemergencythrusters.png", + "Launching Vector Compensator (Valkyrie)": github_icon_base_url + "blizzard/btn-ability-terran-emergencythrusters.png", + "Resource Efficiency (Valkyrie)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", "War Pigs": "https://static.wikia.nocookie.net/starcraft/images/e/ed/WarPigs_SC2_Icon1.jpg", "Devil Dogs": "https://static.wikia.nocookie.net/starcraft/images/3/33/DevilDogs_SC2_Icon1.jpg", "Hammer Securities": "https://static.wikia.nocookie.net/starcraft/images/3/3b/HammerSecurity_SC2_Icon1.jpg", "Spartan Company": "https://static.wikia.nocookie.net/starcraft/images/b/be/SpartanCompany_SC2_Icon1.jpg", "Siege Breakers": "https://static.wikia.nocookie.net/starcraft/images/3/31/SiegeBreakers_SC2_Icon1.jpg", - "Hel's Angel": "https://static.wikia.nocookie.net/starcraft/images/6/63/HelsAngels_SC2_Icon1.jpg", + "Hel's Angels": "https://static.wikia.nocookie.net/starcraft/images/6/63/HelsAngels_SC2_Icon1.jpg", "Dusk Wings": "https://static.wikia.nocookie.net/starcraft/images/5/52/DuskWings_SC2_Icon1.jpg", "Jackson's Revenge": "https://static.wikia.nocookie.net/starcraft/images/9/95/JacksonsRevenge_SC2_Icon1.jpg", + "Skibi's Angels": github_icon_base_url + "blizzard/btn-unit-terran-medicelite.png", + "Death Heads": github_icon_base_url + "blizzard/btn-unit-terran-deathhead.png", + "Winged Nightmares": github_icon_base_url + "blizzard/btn-unit-collection-wraith-junker.png", + "Midnight Riders": github_icon_base_url + "blizzard/btn-unit-terran-liberatorblackops.png", + "Brynhilds": github_icon_base_url + "blizzard/btn-unit-collection-vikingfighter-covertops.png", + "Jotun": github_icon_base_url + "blizzard/btn-unit-terran-thormengsk.png", "Ultra-Capacitors": "https://static.wikia.nocookie.net/starcraft/images/2/23/SC2_Lab_Ultra_Capacitors_Icon.png", "Vanadium Plating": "https://static.wikia.nocookie.net/starcraft/images/6/67/SC2_Lab_VanPlating_Icon.png", @@ -1766,8 +1852,6 @@ def render_Starcraft2WingsOfLiberty_tracker(tracker_data: TrackerData, team: int "Micro-Filtering": "https://static.wikia.nocookie.net/starcraft/images/2/20/SC2_Lab_MicroFilter_Icon.png", "Automated Refinery": "https://static.wikia.nocookie.net/starcraft/images/7/71/SC2_Lab_Auto_Refinery_Icon.png", "Command Center Reactor": "https://static.wikia.nocookie.net/starcraft/images/e/ef/SC2_Lab_CC_Reactor_Icon.png", - "Raven": "https://static.wikia.nocookie.net/starcraft/images/1/19/SC2_Lab_Raven_Icon.png", - "Science Vessel": "https://static.wikia.nocookie.net/starcraft/images/c/c3/SC2_Lab_SciVes_Icon.png", "Tech Reactor": "https://static.wikia.nocookie.net/starcraft/images/c/c5/SC2_Lab_Tech_Reactor_Icon.png", "Orbital Strike": "https://static.wikia.nocookie.net/starcraft/images/d/df/SC2_Lab_Orb_Strike_Icon.png", @@ -1775,23 +1859,372 @@ def render_Starcraft2WingsOfLiberty_tracker(tracker_data: TrackerData, team: int "Fortified Bunker (Bunker)": "https://static.wikia.nocookie.net/starcraft/images/4/4f/SC2_Lab_FortBunker_Icon.png", "Planetary Fortress": "https://static.wikia.nocookie.net/starcraft/images/0/0b/SC2_Lab_PlanetFortress_Icon.png", "Perdition Turret": "https://static.wikia.nocookie.net/starcraft/images/a/af/SC2_Lab_PerdTurret_Icon.png", - "Predator": "https://static.wikia.nocookie.net/starcraft/images/8/83/SC2_Lab_Predator_Icon.png", - "Hercules": "https://static.wikia.nocookie.net/starcraft/images/4/40/SC2_Lab_Hercules_Icon.png", "Cellular Reactor": "https://static.wikia.nocookie.net/starcraft/images/d/d8/SC2_Lab_CellReactor_Icon.png", - "Regenerative Bio-Steel Level 1": "/static/static/icons/sc2/SC2_Lab_BioSteel_L1.png", - "Regenerative Bio-Steel Level 2": "/static/static/icons/sc2/SC2_Lab_BioSteel_L2.png", + "Regenerative Bio-Steel Level 1": github_icon_base_url + "original/btn-regenerativebiosteel-green.png", + "Regenerative Bio-Steel Level 2": github_icon_base_url + "original/btn-regenerativebiosteel-blue.png", + "Regenerative Bio-Steel Level 3": github_icon_base_url + "blizzard/btn-research-zerg-regenerativebio-steel.png", "Hive Mind Emulator": "https://static.wikia.nocookie.net/starcraft/images/b/bc/SC2_Lab_Hive_Emulator_Icon.png", "Psi Disrupter": "https://static.wikia.nocookie.net/starcraft/images/c/cf/SC2_Lab_Psi_Disruptor_Icon.png", - "Zealot": "https://static.wikia.nocookie.net/starcraft/images/6/6e/Icon_Protoss_Zealot.jpg", + "Structure Armor": github_icon_base_url + "blizzard/btn-upgrade-terran-buildingarmor.png", + "Hi-Sec Auto Tracking": github_icon_base_url + "blizzard/btn-upgrade-terran-hisecautotracking.png", + "Advanced Optics": github_icon_base_url + "blizzard/btn-upgrade-swann-vehiclerangeincrease.png", + "Rogue Forces": github_icon_base_url + "blizzard/btn-unit-terran-tosh.png", + + "Ghost Visor (Nova Equipment)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-ghostvisor.png", + "Rangefinder Oculus (Nova Equipment)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-rangefinderoculus.png", + "Domination (Nova Ability)": github_icon_base_url + "blizzard/btn-ability-nova-domination.png", + "Blink (Nova Ability)": github_icon_base_url + "blizzard/btn-upgrade-nova-blink.png", + "Stealth Suit Module (Nova Suit Module)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-stealthsuit.png", + "Cloak (Nova Suit Module)": github_icon_base_url + "blizzard/btn-ability-terran-cloak-color.png", + "Permanently Cloaked (Nova Suit Module)": github_icon_base_url + "blizzard/btn-upgrade-nova-tacticalstealthsuit.png", + "Energy Suit Module (Nova Suit Module)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-apolloinfantrysuit.png", + "Armored Suit Module (Nova Suit Module)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-blinksuit.png", + "Jump Suit Module (Nova Suit Module)": github_icon_base_url + "blizzard/btn-upgrade-nova-jetpack.png", + "C20A Canister Rifle (Nova Weapon)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-canisterrifle.png", + "Hellfire Shotgun (Nova Weapon)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-shotgun.png", + "Plasma Rifle (Nova Weapon)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-plasmagun.png", + "Monomolecular Blade (Nova Weapon)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-monomolecularblade.png", + "Blazefire Gunblade (Nova Weapon)": github_icon_base_url + "blizzard/btn-upgrade-nova-equipment-gunblade_sword.png", + "Stim Infusion (Nova Gadget)": github_icon_base_url + "blizzard/btn-upgrade-terran-superstimppack.png", + "Pulse Grenades (Nova Gadget)": github_icon_base_url + "blizzard/btn-upgrade-nova-btn-upgrade-nova-pulsegrenade.png", + "Flashbang Grenades (Nova Gadget)": github_icon_base_url + "blizzard/btn-upgrade-nova-btn-upgrade-nova-flashgrenade.png", + "Ionic Force Field (Nova Gadget)": github_icon_base_url + "blizzard/btn-upgrade-terran-nova-personaldefensivematrix.png", + "Holo Decoy (Nova Gadget)": github_icon_base_url + "blizzard/btn-upgrade-nova-holographicdecoy.png", + "Tac Nuke Strike (Nova Ability)": github_icon_base_url + "blizzard/btn-ability-terran-nuclearstrike-color.png", + + "Zerg Melee Attack Level 1": github_icon_base_url + "blizzard/btn-upgrade-zerg-meleeattacks-level1.png", + "Zerg Melee Attack Level 2": github_icon_base_url + "blizzard/btn-upgrade-zerg-meleeattacks-level2.png", + "Zerg Melee Attack Level 3": github_icon_base_url + "blizzard/btn-upgrade-zerg-meleeattacks-level3.png", + "Zerg Missile Attack Level 1": github_icon_base_url + "blizzard/btn-upgrade-zerg-missileattacks-level1.png", + "Zerg Missile Attack Level 2": github_icon_base_url + "blizzard/btn-upgrade-zerg-missileattacks-level2.png", + "Zerg Missile Attack Level 3": github_icon_base_url + "blizzard/btn-upgrade-zerg-missileattacks-level3.png", + "Zerg Ground Carapace Level 1": github_icon_base_url + "blizzard/btn-upgrade-zerg-groundcarapace-level1.png", + "Zerg Ground Carapace Level 2": github_icon_base_url + "blizzard/btn-upgrade-zerg-groundcarapace-level2.png", + "Zerg Ground Carapace Level 3": github_icon_base_url + "blizzard/btn-upgrade-zerg-groundcarapace-level3.png", + "Zerg Flyer Attack Level 1": github_icon_base_url + "blizzard/btn-upgrade-zerg-airattacks-level1.png", + "Zerg Flyer Attack Level 2": github_icon_base_url + "blizzard/btn-upgrade-zerg-airattacks-level2.png", + "Zerg Flyer Attack Level 3": github_icon_base_url + "blizzard/btn-upgrade-zerg-airattacks-level3.png", + "Zerg Flyer Carapace Level 1": github_icon_base_url + "blizzard/btn-upgrade-zerg-flyercarapace-level1.png", + "Zerg Flyer Carapace Level 2": github_icon_base_url + "blizzard/btn-upgrade-zerg-flyercarapace-level2.png", + "Zerg Flyer Carapace Level 3": github_icon_base_url + "blizzard/btn-upgrade-zerg-flyercarapace-level3.png", + + "Automated Extractors (Kerrigan Tier 3)": github_icon_base_url + "blizzard/btn-ability-kerrigan-automatedextractors.png", + "Vespene Efficiency (Kerrigan Tier 5)": github_icon_base_url + "blizzard/btn-ability-kerrigan-vespeneefficiency.png", + "Twin Drones (Kerrigan Tier 5)": github_icon_base_url + "blizzard/btn-ability-kerrigan-twindrones.png", + "Improved Overlords (Kerrigan Tier 3)": github_icon_base_url + "blizzard/btn-ability-kerrigan-improvedoverlords.png", + "Ventral Sacs (Overlord)": github_icon_base_url + "blizzard/btn-upgrade-zerg-ventralsacs.png", + "Malignant Creep (Kerrigan Tier 5)": github_icon_base_url + "blizzard/btn-ability-kerrigan-malignantcreep.png", + + "Spine Crawler": github_icon_base_url + "blizzard/btn-building-zerg-spinecrawler.png", + "Spore Crawler": github_icon_base_url + "blizzard/btn-building-zerg-sporecrawler.png", + + "Zergling": github_icon_base_url + "blizzard/btn-unit-zerg-zergling.png", + "Swarm Queen": github_icon_base_url + "blizzard/btn-unit-zerg-broodqueen.png", + "Roach": github_icon_base_url + "blizzard/btn-unit-zerg-roach.png", + "Hydralisk": github_icon_base_url + "blizzard/btn-unit-zerg-hydralisk.png", + "Aberration": github_icon_base_url + "blizzard/btn-unit-zerg-aberration.png", + "Mutalisk": github_icon_base_url + "blizzard/btn-unit-zerg-mutalisk.png", + "Corruptor": github_icon_base_url + "blizzard/btn-unit-zerg-corruptor.png", + "Swarm Host": github_icon_base_url + "blizzard/btn-unit-zerg-swarmhost.png", + "Infestor": github_icon_base_url + "blizzard/btn-unit-zerg-infestor.png", + "Defiler": github_icon_base_url + "original/btn-unit-zerg-defiler@scbw.png", + "Ultralisk": github_icon_base_url + "blizzard/btn-unit-zerg-ultralisk.png", + "Brood Queen": github_icon_base_url + "blizzard/btn-unit-zerg-classicqueen.png", + "Scourge": github_icon_base_url + "blizzard/btn-unit-zerg-scourge.png", + + "Baneling Aspect (Zergling)": github_icon_base_url + "blizzard/btn-unit-zerg-baneling.png", + "Ravager Aspect (Roach)": github_icon_base_url + "blizzard/btn-unit-zerg-ravager.png", + "Impaler Aspect (Hydralisk)": github_icon_base_url + "blizzard/btn-unit-zerg-impaler.png", + "Lurker Aspect (Hydralisk)": github_icon_base_url + "blizzard/btn-unit-zerg-lurker.png", + "Brood Lord Aspect (Mutalisk/Corruptor)": github_icon_base_url + "blizzard/btn-unit-zerg-broodlord.png", + "Viper Aspect (Mutalisk/Corruptor)": github_icon_base_url + "blizzard/btn-unit-zerg-viper.png", + "Guardian Aspect (Mutalisk/Corruptor)": github_icon_base_url + "blizzard/btn-unit-zerg-primalguardian.png", + "Devourer Aspect (Mutalisk/Corruptor)": github_icon_base_url + "blizzard/btn-unit-zerg-devourerex3.png", + + "Raptor Strain (Zergling)": github_icon_base_url + "blizzard/btn-unit-zerg-zergling-raptor.png", + "Swarmling Strain (Zergling)": github_icon_base_url + "blizzard/btn-unit-zerg-zergling-swarmling.png", + "Hardened Carapace (Zergling)": github_icon_base_url + "blizzard/btn-upgrade-zerg-hardenedcarapace.png", + "Adrenal Overload (Zergling)": github_icon_base_url + "blizzard/btn-upgrade-zerg-adrenaloverload.png", + "Metabolic Boost (Zergling)": github_icon_base_url + "blizzard/btn-upgrade-zerg-hotsmetabolicboost.png", + "Shredding Claws (Zergling)": github_icon_base_url + "blizzard/btn-upgrade-zergling-armorshredding.png", + "Zergling Reconstitution (Kerrigan Tier 3)": github_icon_base_url + "blizzard/btn-ability-kerrigan-zerglingreconstitution.png", + "Splitter Strain (Baneling)": github_icon_base_url + "blizzard/talent-zagara-level14-unlocksplitterling.png", + "Hunter Strain (Baneling)": github_icon_base_url + "blizzard/btn-ability-zerg-cliffjump-baneling.png", + "Corrosive Acid (Baneling)": github_icon_base_url + "blizzard/btn-upgrade-zerg-corrosiveacid.png", + "Rupture (Baneling)": github_icon_base_url + "blizzard/btn-upgrade-zerg-rupture.png", + "Regenerative Acid (Baneling)": github_icon_base_url + "blizzard/btn-upgrade-zerg-regenerativebile.png", + "Centrifugal Hooks (Baneling)": github_icon_base_url + "blizzard/btn-upgrade-zerg-centrifugalhooks.png", + "Tunneling Jaws (Baneling)": github_icon_base_url + "blizzard/btn-upgrade-zerg-tunnelingjaws.png", + "Rapid Metamorph (Baneling)": github_icon_base_url + "blizzard/btn-upgrade-terran-optimizedlogistics.png", + "Spawn Larvae (Swarm Queen)": github_icon_base_url + "blizzard/btn-unit-zerg-larva.png", + "Deep Tunnel (Swarm Queen)": github_icon_base_url + "blizzard/btn-ability-zerg-deeptunnel.png", + "Organic Carapace (Swarm Queen)": github_icon_base_url + "blizzard/btn-upgrade-zerg-organiccarapace.png", + "Bio-Mechanical Transfusion (Swarm Queen)": github_icon_base_url + "blizzard/btn-upgrade-zerg-abathur-biomechanicaltransfusion.png", + "Resource Efficiency (Swarm Queen)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Incubator Chamber (Swarm Queen)": github_icon_base_url + "blizzard/btn-upgrade-zerg-abathur-incubationchamber.png", + "Vile Strain (Roach)": github_icon_base_url + "blizzard/btn-unit-zerg-roach-vile.png", + "Corpser Strain (Roach)": github_icon_base_url + "blizzard/btn-unit-zerg-roach-corpser.png", + "Hydriodic Bile (Roach)": github_icon_base_url + "blizzard/btn-upgrade-zerg-hydriaticacid.png", + "Adaptive Plating (Roach)": github_icon_base_url + "blizzard/btn-upgrade-zerg-adaptivecarapace.png", + "Tunneling Claws (Roach)": github_icon_base_url + "blizzard/btn-upgrade-zerg-hotstunnelingclaws.png", + "Glial Reconstitution (Roach)": github_icon_base_url + "blizzard/btn-upgrade-zerg-glialreconstitution.png", + "Organic Carapace (Roach)": github_icon_base_url + "blizzard/btn-upgrade-zerg-organiccarapace.png", + "Potent Bile (Ravager)": github_icon_base_url + "blizzard/potentbile_coop.png", + "Bloated Bile Ducts (Ravager)": github_icon_base_url + "blizzard/btn-ability-zerg-abathur-corrosivebilelarge.png", + "Deep Tunnel (Ravager)": github_icon_base_url + "blizzard/btn-ability-zerg-deeptunnel.png", + "Frenzy (Hydralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-frenzy.png", + "Ancillary Carapace (Hydralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-ancillaryarmor.png", + "Grooved Spines (Hydralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-hotsgroovedspines.png", + "Muscular Augments (Hydralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-evolvemuscularaugments.png", + "Resource Efficiency (Hydralisk)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Adaptive Talons (Impaler)": github_icon_base_url + "blizzard/btn-upgrade-zerg-adaptivetalons.png", + "Secretion Glands (Impaler)": github_icon_base_url + "blizzard/btn-ability-zerg-creepspread.png", + "Hardened Tentacle Spines (Impaler)": github_icon_base_url + "blizzard/btn-ability-zerg-dehaka-impaler-tenderize.png", + "Seismic Spines (Lurker)": github_icon_base_url + "blizzard/btn-upgrade-kerrigan-seismicspines.png", + "Adapted Spines (Lurker)": github_icon_base_url + "blizzard/btn-upgrade-zerg-groovedspines.png", + "Vicious Glaive (Mutalisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-viciousglaive.png", + "Rapid Regeneration (Mutalisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-rapidregeneration.png", + "Sundering Glaive (Mutalisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-explosiveglaive.png", + "Severing Glaive (Mutalisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-explosiveglaive.png", + "Aerodynamic Glaive Shape (Mutalisk)": github_icon_base_url + "blizzard/btn-ability-dehaka-airbonusdamage.png", + "Corruption (Corruptor)": github_icon_base_url + "blizzard/btn-ability-zerg-causticspray.png", + "Caustic Spray (Corruptor)": github_icon_base_url + "blizzard/btn-ability-zerg-corruption-color.png", + "Porous Cartilage (Brood Lord)": github_icon_base_url + "blizzard/btn-upgrade-kerrigan-broodlordspeed.png", + "Evolved Carapace (Brood Lord)": github_icon_base_url + "blizzard/btn-upgrade-zerg-chitinousplating.png", + "Splitter Mitosis (Brood Lord)": github_icon_base_url + "blizzard/abilityicon_spawnbroodlings_square.png", + "Resource Efficiency (Brood Lord)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Parasitic Bomb (Viper)": github_icon_base_url + "blizzard/btn-ability-zerg-parasiticbomb.png", + "Paralytic Barbs (Viper)": github_icon_base_url + "blizzard/btn-upgrade-zerg-abathur-abduct.png", + "Virulent Microbes (Viper)": github_icon_base_url + "blizzard/btn-upgrade-zerg-abathur-castrange.png", + "Prolonged Dispersion (Guardian)": github_icon_base_url + "blizzard/btn-upgrade-zerg-abathur-prolongeddispersion.png", + "Primal Adaptation (Guardian)": github_icon_base_url + "blizzard/biomassrecovery_coop.png", + "Soronan Acid (Guardian)": github_icon_base_url + "blizzard/btn-upgrade-zerg-abathur-biomass.png", + "Corrosive Spray (Devourer)": github_icon_base_url + "blizzard/btn-upgrade-zerg-abathur-devourer-corrosivespray.png", + "Gaping Maw (Devourer)": github_icon_base_url + "blizzard/btn-ability-zerg-explode-color.png", + "Improved Osmosis (Devourer)": github_icon_base_url + "blizzard/btn-upgrade-zerg-pneumatizedcarapace.png", + "Prescient Spores (Devourer)": github_icon_base_url + "blizzard/btn-upgrade-zerg-airattacks-level2.png", + "Carrion Strain (Swarm Host)": github_icon_base_url + "blizzard/btn-unit-zerg-swarmhost-carrion.png", + "Creeper Strain (Swarm Host)": github_icon_base_url + "blizzard/btn-unit-zerg-swarmhost-creeper.png", + "Burrow (Swarm Host)": github_icon_base_url + "blizzard/btn-ability-zerg-burrow-color.png", + "Rapid Incubation (Swarm Host)": github_icon_base_url + "blizzard/btn-upgrade-zerg-rapidincubation.png", + "Pressurized Glands (Swarm Host)": github_icon_base_url + "blizzard/btn-upgrade-zerg-pressurizedglands.png", + "Locust Metabolic Boost (Swarm Host)": github_icon_base_url + "blizzard/btn-upgrade-zerg-glialreconstitution.png", + "Enduring Locusts (Swarm Host)": github_icon_base_url + "blizzard/btn-upgrade-zerg-evolveincreasedlocustlifetime.png", + "Organic Carapace (Swarm Host)": github_icon_base_url + "blizzard/btn-upgrade-zerg-organiccarapace.png", + "Resource Efficiency (Swarm Host)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Infested Terran (Infestor)": github_icon_base_url + "blizzard/btn-unit-zerg-infestedmarine.png", + "Microbial Shroud (Infestor)": github_icon_base_url + "blizzard/btn-ability-zerg-darkswarm.png", + "Noxious Strain (Ultralisk)": github_icon_base_url + "blizzard/btn-unit-zerg-ultralisk-noxious.png", + "Torrasque Strain (Ultralisk)": github_icon_base_url + "blizzard/btn-unit-zerg-ultralisk-torrasque.png", + "Burrow Charge (Ultralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-burrowcharge.png", + "Tissue Assimilation (Ultralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-tissueassimilation.png", + "Monarch Blades (Ultralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-monarchblades.png", + "Anabolic Synthesis (Ultralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-anabolicsynthesis.png", + "Chitinous Plating (Ultralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-chitinousplating.png", + "Organic Carapace (Ultralisk)": github_icon_base_url + "blizzard/btn-upgrade-zerg-organiccarapace.png", + "Resource Efficiency (Ultralisk)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Fungal Growth (Brood Queen)": github_icon_base_url + "blizzard/btn-upgrade-zerg-stukov-researchqueenfungalgrowth.png", + "Ensnare (Brood Queen)": github_icon_base_url + "blizzard/btn-ability-zerg-fungalgrowth-color.png", + "Enhanced Mitochondria (Brood Queen)": github_icon_base_url + "blizzard/btn-upgrade-zerg-stukov-queenenergyregen.png", + "Virulent Spores (Scourge)": github_icon_base_url + "blizzard/btn-upgrade-zagara-scourgesplashdamage.png", + "Resource Efficiency (Scourge)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Swarm Scourge (Scourge)": github_icon_base_url + "original/btn-upgrade-custom-triple-scourge.png", + + "Infested Medics": github_icon_base_url + "blizzard/btn-unit-terran-medicelite.png", + "Infested Siege Tanks": github_icon_base_url + "original/btn-unit-terran-siegetankmercenary-tank.png", + "Infested Banshees": github_icon_base_url + "original/btn-unit-terran-bansheemercenary.png", + + "Primal Form (Kerrigan)": github_icon_base_url + "blizzard/btn-unit-zerg-kerriganinfested.png", + "Kinetic Blast (Kerrigan Tier 1)": github_icon_base_url + "blizzard/btn-ability-kerrigan-kineticblast.png", + "Heroic Fortitude (Kerrigan Tier 1)": github_icon_base_url + "blizzard/btn-ability-kerrigan-heroicfortitude.png", + "Leaping Strike (Kerrigan Tier 1)": github_icon_base_url + "blizzard/btn-ability-kerrigan-leapingstrike.png", + "Crushing Grip (Kerrigan Tier 2)": github_icon_base_url + "blizzard/btn-ability-swarm-kerrigan-crushinggrip.png", + "Chain Reaction (Kerrigan Tier 2)": github_icon_base_url + "blizzard/btn-ability-swarm-kerrigan-chainreaction.png", + "Psionic Shift (Kerrigan Tier 2)": github_icon_base_url + "blizzard/btn-ability-kerrigan-psychicshift.png", + "Wild Mutation (Kerrigan Tier 4)": github_icon_base_url + "blizzard/btn-ability-kerrigan-wildmutation.png", + "Spawn Banelings (Kerrigan Tier 4)": github_icon_base_url + "blizzard/abilityicon_spawnbanelings_square.png", + "Mend (Kerrigan Tier 4)": github_icon_base_url + "blizzard/btn-ability-zerg-transfusion-color.png", + "Infest Broodlings (Kerrigan Tier 6)": github_icon_base_url + "blizzard/abilityicon_spawnbroodlings_square.png", + "Fury (Kerrigan Tier 6)": github_icon_base_url + "blizzard/btn-ability-kerrigan-fury.png", + "Ability Efficiency (Kerrigan Tier 6)": github_icon_base_url + "blizzard/btn-ability-kerrigan-abilityefficiency.png", + "Apocalypse (Kerrigan Tier 7)": github_icon_base_url + "blizzard/btn-ability-kerrigan-apocalypse.png", + "Spawn Leviathan (Kerrigan Tier 7)": github_icon_base_url + "blizzard/btn-unit-zerg-leviathan.png", + "Drop-Pods (Kerrigan Tier 7)": github_icon_base_url + "blizzard/btn-ability-kerrigan-droppods.png", + + "Protoss Ground Weapon Level 1": github_icon_base_url + "blizzard/btn-upgrade-protoss-groundweaponslevel1.png", + "Protoss Ground Weapon Level 2": github_icon_base_url + "blizzard/btn-upgrade-protoss-groundweaponslevel2.png", + "Protoss Ground Weapon Level 3": github_icon_base_url + "blizzard/btn-upgrade-protoss-groundweaponslevel3.png", + "Protoss Ground Armor Level 1": github_icon_base_url + "blizzard/btn-upgrade-protoss-groundarmorlevel1.png", + "Protoss Ground Armor Level 2": github_icon_base_url + "blizzard/btn-upgrade-protoss-groundarmorlevel2.png", + "Protoss Ground Armor Level 3": github_icon_base_url + "blizzard/btn-upgrade-protoss-groundarmorlevel3.png", + "Protoss Shields Level 1": github_icon_base_url + "blizzard/btn-upgrade-protoss-shieldslevel1.png", + "Protoss Shields Level 2": github_icon_base_url + "blizzard/btn-upgrade-protoss-shieldslevel2.png", + "Protoss Shields Level 3": github_icon_base_url + "blizzard/btn-upgrade-protoss-shieldslevel3.png", + "Protoss Air Weapon Level 1": github_icon_base_url + "blizzard/btn-upgrade-protoss-airweaponslevel1.png", + "Protoss Air Weapon Level 2": github_icon_base_url + "blizzard/btn-upgrade-protoss-airweaponslevel2.png", + "Protoss Air Weapon Level 3": github_icon_base_url + "blizzard/btn-upgrade-protoss-airweaponslevel3.png", + "Protoss Air Armor Level 1": github_icon_base_url + "blizzard/btn-upgrade-protoss-airarmorlevel1.png", + "Protoss Air Armor Level 2": github_icon_base_url + "blizzard/btn-upgrade-protoss-airarmorlevel2.png", + "Protoss Air Armor Level 3": github_icon_base_url + "blizzard/btn-upgrade-protoss-airarmorlevel3.png", + + "Quatro": github_icon_base_url + "blizzard/btn-progression-protoss-fenix-6-forgeresearch.png", + + "Photon Cannon": github_icon_base_url + "blizzard/btn-building-protoss-photoncannon.png", + "Khaydarin Monolith": github_icon_base_url + "blizzard/btn-unit-protoss-khaydarinmonolith.png", + "Shield Battery": github_icon_base_url + "blizzard/btn-building-protoss-shieldbattery.png", + + "Enhanced Targeting": github_icon_base_url + "blizzard/btn-upgrade-karax-turretrange.png", + "Optimized Ordnance": github_icon_base_url + "blizzard/btn-upgrade-karax-turretattackspeed.png", + "Khalai Ingenuity": github_icon_base_url + "blizzard/btn-upgrade-karax-pylonwarpininstantly.png", + "Orbital Assimilators": github_icon_base_url + "blizzard/btn-ability-spearofadun-orbitalassimilator.png", + "Amplified Assimilators": github_icon_base_url + "original/btn-research-terran-microfiltering.png", + "Warp Harmonization": github_icon_base_url + "blizzard/btn-ability-spearofadun-warpharmonization.png", + "Superior Warp Gates": github_icon_base_url + "blizzard/talent-artanis-level03-warpgatecharges.png", + "Nexus Overcharge": github_icon_base_url + "blizzard/btn-ability-spearofadun-nexusovercharge.png", + + "Zealot": github_icon_base_url + "blizzard/btn-unit-protoss-zealot-aiur.png", + "Centurion": github_icon_base_url + "blizzard/btn-unit-protoss-zealot-nerazim.png", + "Sentinel": github_icon_base_url + "blizzard/btn-unit-protoss-zealot-purifier.png", + "Supplicant": github_icon_base_url + "blizzard/btn-unit-protoss-alarak-taldarim-supplicant.png", + "Sentry": github_icon_base_url + "blizzard/btn-unit-protoss-sentry.png", + "Energizer": github_icon_base_url + "blizzard/btn-unit-protoss-sentry-purifier.png", + "Havoc": github_icon_base_url + "blizzard/btn-unit-protoss-sentry-taldarim.png", "Stalker": "https://static.wikia.nocookie.net/starcraft/images/0/0d/Icon_Protoss_Stalker.jpg", + "Instigator": github_icon_base_url + "blizzard/btn-unit-protoss-stalker-purifier.png", + "Slayer": github_icon_base_url + "blizzard/btn-unit-protoss-alarak-taldarim-stalker.png", + "Dragoon": github_icon_base_url + "blizzard/btn-unit-protoss-dragoon-void.png", + "Adept": github_icon_base_url + "blizzard/btn-unit-protoss-adept-purifier.png", "High Templar": "https://static.wikia.nocookie.net/starcraft/images/a/a0/Icon_Protoss_High_Templar.jpg", + "Signifier": github_icon_base_url + "original/btn-unit-protoss-hightemplar-nerazim.png", + "Ascendant": github_icon_base_url + "blizzard/btn-unit-protoss-hightemplar-taldarim.png", + "Dark Archon": github_icon_base_url + "blizzard/talent-vorazun-level05-unlockdarkarchon.png", "Dark Templar": "https://static.wikia.nocookie.net/starcraft/images/9/90/Icon_Protoss_Dark_Templar.jpg", + "Avenger": github_icon_base_url + "blizzard/btn-unit-protoss-darktemplar-aiur.png", + "Blood Hunter": github_icon_base_url + "blizzard/btn-unit-protoss-darktemplar-taldarim.png", + + "Leg Enhancements (Zealot/Sentinel/Centurion)": github_icon_base_url + "blizzard/btn-ability-protoss-charge-color.png", + "Shield Capacity (Zealot/Sentinel/Centurion)": github_icon_base_url + "blizzard/btn-upgrade-protoss-shieldslevel1.png", + "Blood Shield (Supplicant)": github_icon_base_url + "blizzard/btn-upgrade-protoss-alarak-supplicantarmor.png", + "Soul Augmentation (Supplicant)": github_icon_base_url + "blizzard/btn-upgrade-protoss-alarak-supplicantextrashields.png", + "Shield Regeneration (Supplicant)": github_icon_base_url + "blizzard/btn-ability-protoss-voidarmor.png", + "Force Field (Sentry)": github_icon_base_url + "blizzard/btn-ability-protoss-forcefield-color.png", + "Hallucination (Sentry)": github_icon_base_url + "blizzard/btn-ability-protoss-hallucination-color.png", + "Reclamation (Energizer)": github_icon_base_url + "blizzard/btn-ability-protoss-reclamation.png", + "Forged Chassis (Energizer)": github_icon_base_url + "blizzard/btn-upgrade-protoss-groundarmorlevel0.png", + "Detect Weakness (Havoc)": github_icon_base_url + "blizzard/btn-upgrade-protoss-alarak-havoctargetlockbuffed.png", + "Bloodshard Resonance (Havoc)": github_icon_base_url + "blizzard/btn-upgrade-protoss-alarak-rangeincrease.png", + "Cloaking Module (Sentry/Energizer/Havoc)": github_icon_base_url + "blizzard/btn-upgrade-protoss-alarak-permanentcloak.png", + "Rapid Recharging (Sentry/Energizer/Havoc/Shield Battery)": github_icon_base_url + "blizzard/btn-upgrade-karax-energyregen200.png", + "Disintegrating Particles (Stalker/Instigator/Slayer)": github_icon_base_url + "blizzard/btn-ability-protoss-phasedisruptor.png", + "Particle Reflection (Stalker/Instigator/Slayer)": github_icon_base_url + "blizzard/btn-upgrade-protoss-fenix-adeptchampionbounceattack.png", + "High Impact Phase Disruptor (Dragoon)": github_icon_base_url + "blizzard/btn-ability-protoss-phasedisruptor.png", + "Trillic Compression System (Dragoon)": github_icon_base_url + "blizzard/btn-ability-protoss-dragoonchassis.png", + "Singularity Charge (Dragoon)": github_icon_base_url + "blizzard/btn-upgrade-artanis-singularitycharge.png", + "Enhanced Strider Servos (Dragoon)": github_icon_base_url + "blizzard/btn-upgrade-terran-transformationservos.png", + "Shockwave (Adept)": github_icon_base_url + "blizzard/btn-upgrade-protoss-fenix-adept-recochetglaiveupgraded.png", + "Resonating Glaives (Adept)": github_icon_base_url + "blizzard/btn-upgrade-protoss-resonatingglaives.png", + "Phase Bulwark (Adept)": github_icon_base_url + "blizzard/btn-upgrade-protoss-adeptshieldupgrade.png", + "Unshackled Psionic Storm (High Templar/Signifier)": github_icon_base_url + "blizzard/btn-ability-protoss-psistorm.png", + "Hallucination (High Templar/Signifier)": github_icon_base_url + "blizzard/btn-ability-protoss-hallucination-color.png", + "Khaydarin Amulet (High Templar/Signifier)": github_icon_base_url + "blizzard/btn-upgrade-protoss-khaydarinamulet.png", + "High Archon (Archon)": github_icon_base_url + "blizzard/btn-upgrade-artanis-healingpsionicstorm.png", + "Power Overwhelming (Ascendant)": github_icon_base_url + "blizzard/btn-upgrade-protoss-alarak-ascendantspermanentlybetter.png", + "Chaotic Attunement (Ascendant)": github_icon_base_url + "blizzard/btn-upgrade-protoss-alarak-ascendant'spsiorbtravelsfurther.png", + "Blood Amulet (Ascendant)": github_icon_base_url + "blizzard/btn-upgrade-protoss-wrathwalker-chargetimeimproved.png", + "Feedback (Dark Archon)": github_icon_base_url + "blizzard/btn-ability-protoss-feedback-color.png", + "Maelstrom (Dark Archon)": github_icon_base_url + "blizzard/btn-ability-protoss-voidstasis.png", + "Argus Talisman (Dark Archon)": github_icon_base_url + "original/btn-upgrade-protoss-argustalisman@scbw.png", + "Dark Archon Meld (Dark Templar)": github_icon_base_url + "blizzard/talent-vorazun-level05-unlockdarkarchon.png", + "Shroud of Adun (Dark Templar/Avenger/Blood Hunter)": github_icon_base_url + "blizzard/talent-vorazun-level01-shadowstalk.png", + "Shadow Guard Training (Dark Templar/Avenger/Blood Hunter)": github_icon_base_url + "blizzard/btn-ability-terran-heal-color.png", + "Blink (Dark Templar/Avenger/Blood Hunter)": github_icon_base_url + "blizzard/btn-ability-protoss-shadowdash.png", + "Resource Efficiency (Dark Templar/Avenger/Blood Hunter)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + + "Warp Prism": github_icon_base_url + "blizzard/btn-unit-protoss-warpprism.png", "Immortal": "https://static.wikia.nocookie.net/starcraft/images/c/c1/Icon_Protoss_Immortal.jpg", - "Colossus": "https://static.wikia.nocookie.net/starcraft/images/4/40/Icon_Protoss_Colossus.jpg", + "Annihilator": github_icon_base_url + "blizzard/btn-unit-protoss-immortal-nerazim.png", + "Vanguard": github_icon_base_url + "blizzard/btn-unit-protoss-immortal-taldarim.png", + "Colossus": github_icon_base_url + "blizzard/btn-unit-protoss-colossus-purifier.png", + "Wrathwalker": github_icon_base_url + "blizzard/btn-unit-protoss-colossus-taldarim.png", + "Observer": github_icon_base_url + "blizzard/btn-unit-protoss-observer.png", + "Reaver": github_icon_base_url + "blizzard/btn-unit-protoss-reaver.png", + "Disruptor": github_icon_base_url + "blizzard/btn-unit-protoss-disruptor.png", + + "Gravitic Drive (Warp Prism)": github_icon_base_url + "blizzard/btn-upgrade-protoss-graviticdrive.png", + "Phase Blaster (Warp Prism)": github_icon_base_url + "blizzard/btn-upgrade-protoss-airweaponslevel0.png", + "War Configuration (Warp Prism)": github_icon_base_url + "blizzard/btn-upgrade-protoss-alarak-graviticdrive.png", + "Singularity Charge (Immortal/Annihilator)": github_icon_base_url + "blizzard/btn-upgrade-artanis-singularitycharge.png", + "Advanced Targeting Mechanics (Immortal/Annihilator)": github_icon_base_url + "blizzard/btn-ability-terran-detectionconedebuff.png", + "Agony Launchers (Vanguard)": github_icon_base_url + "blizzard/btn-upgrade-protoss-vanguard-aoeradiusincreased.png", + "Matter Dispersion (Vanguard)": github_icon_base_url + "blizzard/btn-ability-terran-detectionconedebuff.png", + "Pacification Protocol (Colossus)": github_icon_base_url + "blizzard/btn-ability-protoss-chargedblast.png", + "Rapid Power Cycling (Wrathwalker)": github_icon_base_url + "blizzard/btn-upgrade-protoss-wrathwalker-chargetimeimproved.png", + "Eye of Wrath (Wrathwalker)": github_icon_base_url + "blizzard/btn-upgrade-protoss-extendedthermallance.png", + "Gravitic Boosters (Observer)": github_icon_base_url + "blizzard/btn-upgrade-protoss-graviticbooster.png", + "Sensor Array (Observer)": github_icon_base_url + "blizzard/btn-ability-zeratul-observer-sensorarray.png", + "Scarab Damage (Reaver)": github_icon_base_url + "blizzard/btn-ability-protoss-scarabshot.png", + "Solarite Payload (Reaver)": github_icon_base_url + "blizzard/btn-upgrade-artanis-scarabsplashradius.png", + "Reaver Capacity (Reaver)": github_icon_base_url + "original/btn-upgrade-protoss-increasedscarabcapacity@scbw.png", + "Resource Efficiency (Reaver)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Phoenix": "https://static.wikia.nocookie.net/starcraft/images/b/b1/Icon_Protoss_Phoenix.jpg", - "Void Ray": "https://static.wikia.nocookie.net/starcraft/images/1/1d/VoidRay_SC2_Rend1.jpg", + "Mirage": github_icon_base_url + "blizzard/btn-unit-protoss-phoenix-purifier.png", + "Corsair": github_icon_base_url + "blizzard/btn-unit-protoss-corsair.png", + "Destroyer": github_icon_base_url + "blizzard/btn-unit-protoss-voidray-taldarim.png", + "Void Ray": github_icon_base_url + "blizzard/btn-unit-protoss-voidray-nerazim.png", "Carrier": "https://static.wikia.nocookie.net/starcraft/images/2/2c/Icon_Protoss_Carrier.jpg", + "Scout": github_icon_base_url + "original/btn-unit-protoss-scout.png", + "Tempest": github_icon_base_url + "blizzard/btn-unit-protoss-tempest-purifier.png", + "Mothership": github_icon_base_url + "blizzard/btn-unit-protoss-mothership-taldarim.png", + "Arbiter": github_icon_base_url + "blizzard/btn-unit-protoss-arbiter.png", + "Oracle": github_icon_base_url + "blizzard/btn-unit-protoss-oracle.png", + + "Ionic Wavelength Flux (Phoenix/Mirage)": github_icon_base_url + "blizzard/btn-upgrade-protoss-airweaponslevel0.png", + "Anion Pulse-Crystals (Phoenix/Mirage)": github_icon_base_url + "blizzard/btn-upgrade-protoss-phoenixrange.png", + "Stealth Drive (Corsair)": github_icon_base_url + "blizzard/btn-upgrade-vorazun-corsairpermanentlycloaked.png", + "Argus Jewel (Corsair)": github_icon_base_url + "blizzard/btn-ability-protoss-stasistrap.png", + "Sustaining Disruption (Corsair)": github_icon_base_url + "blizzard/btn-ability-protoss-disruptionweb.png", + "Neutron Shields (Corsair)": github_icon_base_url + "blizzard/btn-upgrade-protoss-shieldslevel1.png", + "Reforged Bloodshard Core (Destroyer)": github_icon_base_url + "blizzard/btn-amonshardsarmor.png", + "Flux Vanes (Void Ray/Destroyer)": github_icon_base_url + "blizzard/btn-upgrade-protoss-fluxvanes.png", + "Graviton Catapult (Carrier)": github_icon_base_url + "blizzard/btn-upgrade-protoss-gravitoncatapult.png", + "Hull of Past Glories (Carrier)": github_icon_base_url + "blizzard/btn-progression-protoss-fenix-14-colossusandcarrierchampionsresearch.png", + "Combat Sensor Array (Scout)": github_icon_base_url + "blizzard/btn-upgrade-protoss-fenix-scoutchampionrange.png", + "Apial Sensors (Scout)": github_icon_base_url + "blizzard/btn-upgrade-tychus-detection.png", + "Gravitic Thrusters (Scout)": github_icon_base_url + "blizzard/btn-upgrade-protoss-graviticbooster.png", + "Advanced Photon Blasters (Scout)": github_icon_base_url + "blizzard/btn-upgrade-protoss-airweaponslevel3.png", + "Tectonic Destabilizers (Tempest)": github_icon_base_url + "blizzard/btn-ability-protoss-disruptionblast.png", + "Quantic Reactor (Tempest)": github_icon_base_url + "blizzard/btn-upgrade-protoss-researchgravitysling.png", + "Gravity Sling (Tempest)": github_icon_base_url + "blizzard/btn-upgrade-protoss-tectonicdisruptors.png", + "Chronostatic Reinforcement (Arbiter)": github_icon_base_url + "blizzard/btn-upgrade-protoss-airarmorlevel2.png", + "Khaydarin Core (Arbiter)": github_icon_base_url + "blizzard/btn-upgrade-protoss-adeptshieldupgrade.png", + "Spacetime Anchor (Arbiter)": github_icon_base_url + "blizzard/btn-ability-protoss-stasisfield.png", + "Resource Efficiency (Arbiter)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png", + "Enhanced Cloak Field (Arbiter)": github_icon_base_url + "blizzard/btn-ability-stetmann-stetzonegenerator-speed.png", + "Stealth Drive (Oracle)": github_icon_base_url + "blizzard/btn-upgrade-vorazun-oraclepermanentlycloaked.png", + "Stasis Calibration (Oracle)": github_icon_base_url + "blizzard/btn-ability-protoss-oracle-stasiscalibration.png", + "Temporal Acceleration Beam (Oracle)": github_icon_base_url + "blizzard/btn-ability-protoss-oraclepulsarcannonon.png", + + "Matrix Overload": github_icon_base_url + "blizzard/btn-ability-spearofadun-matrixoverload.png", + "Guardian Shell": github_icon_base_url + "blizzard/btn-ability-spearofadun-guardianshell.png", + + "Chrono Surge (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-chronosurge.png", + "Proxy Pylon (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-deploypylon.png", + "Warp In Reinforcements (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-warpinreinforcements.png", + "Pylon Overcharge (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-protoss-purify.png", + "Orbital Strike (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-orbitalstrike.png", + "Temporal Field (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-temporalfield.png", + "Solar Lance (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-solarlance.png", + "Mass Recall (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-massrecall.png", + "Shield Overcharge (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-shieldovercharge.png", + "Deploy Fenix (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-unit-protoss-fenix.png", + "Purifier Beam (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-purifierbeam.png", + "Time Stop (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-timestop.png", + "Solar Bombardment (Spear of Adun Calldown)": github_icon_base_url + "blizzard/btn-ability-spearofadun-solarbombardment.png", + + "Reconstruction Beam (Spear of Adun Auto-Cast)": github_icon_base_url + "blizzard/btn-ability-spearofadun-reconstructionbeam.png", + "Overwatch (Spear of Adun Auto-Cast)": github_icon_base_url + "blizzard/btn-ability-zeratul-chargedcrystal-psionicwinds.png", "Nothing": "", } @@ -1824,97 +2257,310 @@ def render_Starcraft2WingsOfLiberty_tracker(tracker_data: TrackerData, team: int "Gates of Hell": range(SC2WOL_LOC_ID_OFFSET + 2600, SC2WOL_LOC_ID_OFFSET + 2700), "Belly of the Beast": range(SC2WOL_LOC_ID_OFFSET + 2700, SC2WOL_LOC_ID_OFFSET + 2800), "Shatter the Sky": range(SC2WOL_LOC_ID_OFFSET + 2800, SC2WOL_LOC_ID_OFFSET + 2900), + "All-In": range(SC2WOL_LOC_ID_OFFSET + 2900, SC2WOL_LOC_ID_OFFSET + 3000), + + "Lab Rat": range(SC2HOTS_LOC_ID_OFFSET + 100, SC2HOTS_LOC_ID_OFFSET + 200), + "Back in the Saddle": range(SC2HOTS_LOC_ID_OFFSET + 200, SC2HOTS_LOC_ID_OFFSET + 300), + "Rendezvous": range(SC2HOTS_LOC_ID_OFFSET + 300, SC2HOTS_LOC_ID_OFFSET + 400), + "Harvest of Screams": range(SC2HOTS_LOC_ID_OFFSET + 400, SC2HOTS_LOC_ID_OFFSET + 500), + "Shoot the Messenger": range(SC2HOTS_LOC_ID_OFFSET + 500, SC2HOTS_LOC_ID_OFFSET + 600), + "Enemy Within": range(SC2HOTS_LOC_ID_OFFSET + 600, SC2HOTS_LOC_ID_OFFSET + 700), + "Domination": range(SC2HOTS_LOC_ID_OFFSET + 700, SC2HOTS_LOC_ID_OFFSET + 800), + "Fire in the Sky": range(SC2HOTS_LOC_ID_OFFSET + 800, SC2HOTS_LOC_ID_OFFSET + 900), + "Old Soldiers": range(SC2HOTS_LOC_ID_OFFSET + 900, SC2HOTS_LOC_ID_OFFSET + 1000), + "Waking the Ancient": range(SC2HOTS_LOC_ID_OFFSET + 1000, SC2HOTS_LOC_ID_OFFSET + 1100), + "The Crucible": range(SC2HOTS_LOC_ID_OFFSET + 1100, SC2HOTS_LOC_ID_OFFSET + 1200), + "Supreme": range(SC2HOTS_LOC_ID_OFFSET + 1200, SC2HOTS_LOC_ID_OFFSET + 1300), + "Infested": range(SC2HOTS_LOC_ID_OFFSET + 1300, SC2HOTS_LOC_ID_OFFSET + 1400), + "Hand of Darkness": range(SC2HOTS_LOC_ID_OFFSET + 1400, SC2HOTS_LOC_ID_OFFSET + 1500), + "Phantoms of the Void": range(SC2HOTS_LOC_ID_OFFSET + 1500, SC2HOTS_LOC_ID_OFFSET + 1600), + "With Friends Like These": range(SC2HOTS_LOC_ID_OFFSET + 1600, SC2HOTS_LOC_ID_OFFSET + 1700), + "Conviction": range(SC2HOTS_LOC_ID_OFFSET + 1700, SC2HOTS_LOC_ID_OFFSET + 1800), + "Planetfall": range(SC2HOTS_LOC_ID_OFFSET + 1800, SC2HOTS_LOC_ID_OFFSET + 1900), + "Death From Above": range(SC2HOTS_LOC_ID_OFFSET + 1900, SC2HOTS_LOC_ID_OFFSET + 2000), + "The Reckoning": range(SC2HOTS_LOC_ID_OFFSET + 2000, SC2HOTS_LOC_ID_OFFSET + 2100), + + "Dark Whispers": range(SC2LOTV_LOC_ID_OFFSET + 100, SC2LOTV_LOC_ID_OFFSET + 200), + "Ghosts in the Fog": range(SC2LOTV_LOC_ID_OFFSET + 200, SC2LOTV_LOC_ID_OFFSET + 300), + "Evil Awoken": range(SC2LOTV_LOC_ID_OFFSET + 300, SC2LOTV_LOC_ID_OFFSET + 400), + + "For Aiur!": range(SC2LOTV_LOC_ID_OFFSET + 400, SC2LOTV_LOC_ID_OFFSET + 500), + "The Growing Shadow": range(SC2LOTV_LOC_ID_OFFSET + 500, SC2LOTV_LOC_ID_OFFSET + 600), + "The Spear of Adun": range(SC2LOTV_LOC_ID_OFFSET + 600, SC2LOTV_LOC_ID_OFFSET + 700), + "Sky Shield": range(SC2LOTV_LOC_ID_OFFSET + 700, SC2LOTV_LOC_ID_OFFSET + 800), + "Brothers in Arms": range(SC2LOTV_LOC_ID_OFFSET + 800, SC2LOTV_LOC_ID_OFFSET + 900), + "Amon's Reach": range(SC2LOTV_LOC_ID_OFFSET + 900, SC2LOTV_LOC_ID_OFFSET + 1000), + "Last Stand": range(SC2LOTV_LOC_ID_OFFSET + 1000, SC2LOTV_LOC_ID_OFFSET + 1100), + "Forbidden Weapon": range(SC2LOTV_LOC_ID_OFFSET + 1100, SC2LOTV_LOC_ID_OFFSET + 1200), + "Temple of Unification": range(SC2LOTV_LOC_ID_OFFSET + 1200, SC2LOTV_LOC_ID_OFFSET + 1300), + "The Infinite Cycle": range(SC2LOTV_LOC_ID_OFFSET + 1300, SC2LOTV_LOC_ID_OFFSET + 1400), + "Harbinger of Oblivion": range(SC2LOTV_LOC_ID_OFFSET + 1400, SC2LOTV_LOC_ID_OFFSET + 1500), + "Unsealing the Past": range(SC2LOTV_LOC_ID_OFFSET + 1500, SC2LOTV_LOC_ID_OFFSET + 1600), + "Purification": range(SC2LOTV_LOC_ID_OFFSET + 1600, SC2LOTV_LOC_ID_OFFSET + 1700), + "Steps of the Rite": range(SC2LOTV_LOC_ID_OFFSET + 1700, SC2LOTV_LOC_ID_OFFSET + 1800), + "Rak'Shir": range(SC2LOTV_LOC_ID_OFFSET + 1800, SC2LOTV_LOC_ID_OFFSET + 1900), + "Templar's Charge": range(SC2LOTV_LOC_ID_OFFSET + 1900, SC2LOTV_LOC_ID_OFFSET + 2000), + "Templar's Return": range(SC2LOTV_LOC_ID_OFFSET + 2000, SC2LOTV_LOC_ID_OFFSET + 2100), + "The Host": range(SC2LOTV_LOC_ID_OFFSET + 2100, SC2LOTV_LOC_ID_OFFSET + 2200), + "Salvation": range(SC2LOTV_LOC_ID_OFFSET + 2200, SC2LOTV_LOC_ID_OFFSET + 2300), + + "Into the Void": range(SC2LOTV_LOC_ID_OFFSET + 2300, SC2LOTV_LOC_ID_OFFSET + 2400), + "The Essence of Eternity": range(SC2LOTV_LOC_ID_OFFSET + 2400, SC2LOTV_LOC_ID_OFFSET + 2500), + "Amon's Fall": range(SC2LOTV_LOC_ID_OFFSET + 2500, SC2LOTV_LOC_ID_OFFSET + 2600), + + "The Escape": range(SC2NCO_LOC_ID_OFFSET + 100, SC2NCO_LOC_ID_OFFSET + 200), + "Sudden Strike": range(SC2NCO_LOC_ID_OFFSET + 200, SC2NCO_LOC_ID_OFFSET + 300), + "Enemy Intelligence": range(SC2NCO_LOC_ID_OFFSET + 300, SC2NCO_LOC_ID_OFFSET + 400), + "Trouble In Paradise": range(SC2NCO_LOC_ID_OFFSET + 400, SC2NCO_LOC_ID_OFFSET + 500), + "Night Terrors": range(SC2NCO_LOC_ID_OFFSET + 500, SC2NCO_LOC_ID_OFFSET + 600), + "Flashpoint": range(SC2NCO_LOC_ID_OFFSET + 600, SC2NCO_LOC_ID_OFFSET + 700), + "In the Enemy's Shadow": range(SC2NCO_LOC_ID_OFFSET + 700, SC2NCO_LOC_ID_OFFSET + 800), + "Dark Skies": range(SC2NCO_LOC_ID_OFFSET + 800, SC2NCO_LOC_ID_OFFSET + 900), + "End Game": range(SC2NCO_LOC_ID_OFFSET + 900, SC2NCO_LOC_ID_OFFSET + 1000), } display_data = {} # Grouped Items grouped_item_ids = { - "Progressive Weapon Upgrade": 107 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Armor Upgrade": 108 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Infantry Upgrade": 109 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Vehicle Upgrade": 110 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Ship Upgrade": 111 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Weapon/Armor Upgrade": 112 + SC2WOL_ITEM_ID_OFFSET + "Progressive Terran Weapon Upgrade": 107 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Armor Upgrade": 108 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Infantry Upgrade": 109 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Vehicle Upgrade": 110 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Ship Upgrade": 111 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Weapon/Armor Upgrade": 112 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Zerg Weapon Upgrade": 105 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Armor Upgrade": 106 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Ground Upgrade": 107 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Flyer Upgrade": 108 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Weapon/Armor Upgrade": 109 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Protoss Weapon Upgrade": 105 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Protoss Armor Upgrade": 106 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Protoss Ground Upgrade": 107 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Protoss Air Upgrade": 108 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Protoss Weapon/Armor Upgrade": 109 + SC2WOL_ITEM_ID_OFFSET, } grouped_item_replacements = { - "Progressive Weapon Upgrade": ["Progressive Infantry Weapon", "Progressive Vehicle Weapon", - "Progressive Ship Weapon"], - "Progressive Armor Upgrade": ["Progressive Infantry Armor", "Progressive Vehicle Armor", - "Progressive Ship Armor"], - "Progressive Infantry Upgrade": ["Progressive Infantry Weapon", "Progressive Infantry Armor"], - "Progressive Vehicle Upgrade": ["Progressive Vehicle Weapon", "Progressive Vehicle Armor"], - "Progressive Ship Upgrade": ["Progressive Ship Weapon", "Progressive Ship Armor"] + "Progressive Terran Weapon Upgrade": ["Progressive Terran Infantry Weapon", + "Progressive Terran Vehicle Weapon", + "Progressive Terran Ship Weapon"], + "Progressive Terran Armor Upgrade": ["Progressive Terran Infantry Armor", + "Progressive Terran Vehicle Armor", + "Progressive Terran Ship Armor"], + "Progressive Terran Infantry Upgrade": ["Progressive Terran Infantry Weapon", + "Progressive Terran Infantry Armor"], + "Progressive Terran Vehicle Upgrade": ["Progressive Terran Vehicle Weapon", + "Progressive Terran Vehicle Armor"], + "Progressive Terran Ship Upgrade": ["Progressive Terran Ship Weapon", "Progressive Terran Ship Armor"], + "Progressive Zerg Weapon Upgrade": ["Progressive Zerg Melee Attack", "Progressive Zerg Missile Attack", + "Progressive Zerg Flyer Attack"], + "Progressive Zerg Armor Upgrade": ["Progressive Zerg Ground Carapace", + "Progressive Zerg Flyer Carapace"], + "Progressive Zerg Ground Upgrade": ["Progressive Zerg Melee Attack", "Progressive Zerg Missile Attack", + "Progressive Zerg Ground Carapace"], + "Progressive Zerg Flyer Upgrade": ["Progressive Zerg Flyer Attack", "Progressive Zerg Flyer Carapace"], + "Progressive Protoss Weapon Upgrade": ["Progressive Protoss Ground Weapon", + "Progressive Protoss Air Weapon"], + "Progressive Protoss Armor Upgrade": ["Progressive Protoss Ground Armor", "Progressive Protoss Shields", + "Progressive Protoss Air Armor"], + "Progressive Protoss Ground Upgrade": ["Progressive Protoss Ground Weapon", + "Progressive Protoss Ground Armor", + "Progressive Protoss Shields"], + "Progressive Protoss Air Upgrade": ["Progressive Protoss Air Weapon", "Progressive Protoss Air Armor", + "Progressive Protoss Shields"] } - grouped_item_replacements["Progressive Weapon/Armor Upgrade"] = grouped_item_replacements[ - "Progressive Weapon Upgrade"] + \ - grouped_item_replacements[ - "Progressive Armor Upgrade"] + grouped_item_replacements["Progressive Terran Weapon/Armor Upgrade"] = \ + grouped_item_replacements["Progressive Terran Weapon Upgrade"] \ + + grouped_item_replacements["Progressive Terran Armor Upgrade"] + grouped_item_replacements["Progressive Zerg Weapon/Armor Upgrade"] = \ + grouped_item_replacements["Progressive Zerg Weapon Upgrade"] \ + + grouped_item_replacements["Progressive Zerg Armor Upgrade"] + grouped_item_replacements["Progressive Protoss Weapon/Armor Upgrade"] = \ + grouped_item_replacements["Progressive Protoss Weapon Upgrade"] \ + + grouped_item_replacements["Progressive Protoss Armor Upgrade"] replacement_item_ids = { - "Progressive Infantry Weapon": 100 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Infantry Armor": 102 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Vehicle Weapon": 103 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Vehicle Armor": 104 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Ship Weapon": 105 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Ship Armor": 106 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Infantry Weapon": 100 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Infantry Armor": 102 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Vehicle Weapon": 103 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Vehicle Armor": 104 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Ship Weapon": 105 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Ship Armor": 106 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Zerg Melee Attack": 100 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Missile Attack": 101 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Ground Carapace": 102 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Flyer Attack": 103 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Flyer Carapace": 104 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Protoss Ground Weapon": 100 + SC2LOTV_ITEM_ID_OFFSET, + "Progressive Protoss Ground Armor": 101 + SC2LOTV_ITEM_ID_OFFSET, + "Progressive Protoss Shields": 102 + SC2LOTV_ITEM_ID_OFFSET, + "Progressive Protoss Air Weapon": 103 + SC2LOTV_ITEM_ID_OFFSET, + "Progressive Protoss Air Armor": 104 + SC2LOTV_ITEM_ID_OFFSET, } - inventory = tracker_data.get_player_inventory_counts(team, player) + inventory: collections.Counter = tracker_data.get_player_inventory_counts(team, player) for grouped_item_name, grouped_item_id in grouped_item_ids.items(): count: int = inventory[grouped_item_id] if count > 0: for replacement_item in grouped_item_replacements[grouped_item_name]: replacement_id: int = replacement_item_ids[replacement_item] - inventory[replacement_id] = count + if replacement_id not in inventory or count > inventory[replacement_id]: + # If two groups provide the same individual item, maximum is used + # (this behavior is used for Protoss Shields) + inventory[replacement_id] = count # Determine display for progressive items progressive_items = { - "Progressive Infantry Weapon": 100 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Infantry Armor": 102 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Vehicle Weapon": 103 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Vehicle Armor": 104 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Ship Weapon": 105 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Ship Armor": 106 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Stimpack (Marine)": 208 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Stimpack (Firebat)": 226 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Stimpack (Marauder)": 228 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Stimpack (Reaper)": 250 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Stimpack (Hellion)": 259 + SC2WOL_ITEM_ID_OFFSET, - "Progressive High Impact Payload (Thor)": 361 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Cross-Spectrum Dampeners (Banshee)": 316 + SC2WOL_ITEM_ID_OFFSET, - "Progressive Regenerative Bio-Steel": 617 + SC2WOL_ITEM_ID_OFFSET + "Progressive Terran Infantry Weapon": 100 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Infantry Armor": 102 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Vehicle Weapon": 103 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Vehicle Armor": 104 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Ship Weapon": 105 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Terran Ship Armor": 106 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Fire-Suppression System": 206 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Orbital Command": 207 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Stimpack (Marine)": 208 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Stimpack (Firebat)": 226 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Stimpack (Marauder)": 228 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Stimpack (Reaper)": 250 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Stimpack (Hellion)": 259 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Replenishable Magazine (Vulture)": 303 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Tri-Lithium Power Cell (Diamondback)": 306 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Tomahawk Power Cells (Wraith)": 312 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Cross-Spectrum Dampeners (Banshee)": 316 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Missile Pods (Battlecruiser)": 318 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Defensive Matrix (Battlecruiser)": 319 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Immortality Protocol (Thor)": 325 + SC2WOL_ITEM_ID_OFFSET, + "Progressive High Impact Payload (Thor)": 361 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Augmented Thrusters (Planetary Fortress)": 388 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Regenerative Bio-Steel": 617 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Stealth Suit Module (Nova Suit Module)": 904 + SC2WOL_ITEM_ID_OFFSET, + "Progressive Zerg Melee Attack": 100 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Missile Attack": 101 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Ground Carapace": 102 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Flyer Attack": 103 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Zerg Flyer Carapace": 104 + SC2HOTS_ITEM_ID_OFFSET, + "Progressive Protoss Ground Weapon": 100 + SC2LOTV_ITEM_ID_OFFSET, + "Progressive Protoss Ground Armor": 101 + SC2LOTV_ITEM_ID_OFFSET, + "Progressive Protoss Shields": 102 + SC2LOTV_ITEM_ID_OFFSET, + "Progressive Protoss Air Weapon": 103 + SC2LOTV_ITEM_ID_OFFSET, + "Progressive Protoss Air Armor": 104 + SC2LOTV_ITEM_ID_OFFSET, + "Progressive Proxy Pylon (Spear of Adun Calldown)": 701 + SC2LOTV_ITEM_ID_OFFSET, } + # Format: L0, L1, L2, L3 progressive_names = { - "Progressive Infantry Weapon": ["Infantry Weapons Level 1", "Infantry Weapons Level 1", - "Infantry Weapons Level 2", "Infantry Weapons Level 3"], - "Progressive Infantry Armor": ["Infantry Armor Level 1", "Infantry Armor Level 1", - "Infantry Armor Level 2", "Infantry Armor Level 3"], - "Progressive Vehicle Weapon": ["Vehicle Weapons Level 1", "Vehicle Weapons Level 1", - "Vehicle Weapons Level 2", "Vehicle Weapons Level 3"], - "Progressive Vehicle Armor": ["Vehicle Armor Level 1", "Vehicle Armor Level 1", - "Vehicle Armor Level 2", "Vehicle Armor Level 3"], - "Progressive Ship Weapon": ["Ship Weapons Level 1", "Ship Weapons Level 1", - "Ship Weapons Level 2", "Ship Weapons Level 3"], - "Progressive Ship Armor": ["Ship Armor Level 1", "Ship Armor Level 1", - "Ship Armor Level 2", "Ship Armor Level 3"], - "Progressive Stimpack (Marine)": ["Stimpack (Marine)", "Stimpack (Marine)", - "Super Stimpack (Marine)"], - "Progressive Stimpack (Firebat)": ["Stimpack (Firebat)", "Stimpack (Firebat)", - "Super Stimpack (Firebat)"], - "Progressive Stimpack (Marauder)": ["Stimpack (Marauder)", "Stimpack (Marauder)", - "Super Stimpack (Marauder)"], - "Progressive Stimpack (Reaper)": ["Stimpack (Reaper)", "Stimpack (Reaper)", - "Super Stimpack (Reaper)"], - "Progressive Stimpack (Hellion)": ["Stimpack (Hellion)", "Stimpack (Hellion)", - "Super Stimpack (Hellion)"], - "Progressive High Impact Payload (Thor)": ["High Impact Payload (Thor)", - "High Impact Payload (Thor)", "Smart Servos (Thor)"], - "Progressive Cross-Spectrum Dampeners (Banshee)": ["Cross-Spectrum Dampeners (Banshee)", - "Cross-Spectrum Dampeners (Banshee)", - "Advanced Cross-Spectrum Dampeners (Banshee)"], - "Progressive Regenerative Bio-Steel": ["Regenerative Bio-Steel Level 1", - "Regenerative Bio-Steel Level 1", - "Regenerative Bio-Steel Level 2"] + "Progressive Terran Infantry Weapon": ["Terran Infantry Weapons Level 1", + "Terran Infantry Weapons Level 1", + "Terran Infantry Weapons Level 2", + "Terran Infantry Weapons Level 3"], + "Progressive Terran Infantry Armor": ["Terran Infantry Armor Level 1", + "Terran Infantry Armor Level 1", + "Terran Infantry Armor Level 2", + "Terran Infantry Armor Level 3"], + "Progressive Terran Vehicle Weapon": ["Terran Vehicle Weapons Level 1", + "Terran Vehicle Weapons Level 1", + "Terran Vehicle Weapons Level 2", + "Terran Vehicle Weapons Level 3"], + "Progressive Terran Vehicle Armor": ["Terran Vehicle Armor Level 1", + "Terran Vehicle Armor Level 1", + "Terran Vehicle Armor Level 2", + "Terran Vehicle Armor Level 3"], + "Progressive Terran Ship Weapon": ["Terran Ship Weapons Level 1", + "Terran Ship Weapons Level 1", + "Terran Ship Weapons Level 2", + "Terran Ship Weapons Level 3"], + "Progressive Terran Ship Armor": ["Terran Ship Armor Level 1", + "Terran Ship Armor Level 1", + "Terran Ship Armor Level 2", + "Terran Ship Armor Level 3"], + "Progressive Fire-Suppression System": ["Fire-Suppression System Level 1", + "Fire-Suppression System Level 1", + "Fire-Suppression System Level 2"], + "Progressive Orbital Command": ["Orbital Command", "Orbital Command", + "Planetary Command Module"], + "Progressive Stimpack (Marine)": ["Stimpack (Marine)", "Stimpack (Marine)", + "Super Stimpack (Marine)"], + "Progressive Stimpack (Firebat)": ["Stimpack (Firebat)", "Stimpack (Firebat)", + "Super Stimpack (Firebat)"], + "Progressive Stimpack (Marauder)": ["Stimpack (Marauder)", "Stimpack (Marauder)", + "Super Stimpack (Marauder)"], + "Progressive Stimpack (Reaper)": ["Stimpack (Reaper)", "Stimpack (Reaper)", + "Super Stimpack (Reaper)"], + "Progressive Stimpack (Hellion)": ["Stimpack (Hellion)", "Stimpack (Hellion)", + "Super Stimpack (Hellion)"], + "Progressive Replenishable Magazine (Vulture)": ["Replenishable Magazine (Vulture)", + "Replenishable Magazine (Vulture)", + "Replenishable Magazine (Free) (Vulture)"], + "Progressive Tri-Lithium Power Cell (Diamondback)": ["Tri-Lithium Power Cell (Diamondback)", + "Tri-Lithium Power Cell (Diamondback)", + "Tungsten Spikes (Diamondback)"], + "Progressive Tomahawk Power Cells (Wraith)": ["Tomahawk Power Cells (Wraith)", + "Tomahawk Power Cells (Wraith)", + "Unregistered Cloaking Module (Wraith)"], + "Progressive Cross-Spectrum Dampeners (Banshee)": ["Cross-Spectrum Dampeners (Banshee)", + "Cross-Spectrum Dampeners (Banshee)", + "Advanced Cross-Spectrum Dampeners (Banshee)"], + "Progressive Missile Pods (Battlecruiser)": ["Missile Pods (Battlecruiser) Level 1", + "Missile Pods (Battlecruiser) Level 1", + "Missile Pods (Battlecruiser) Level 2"], + "Progressive Defensive Matrix (Battlecruiser)": ["Defensive Matrix (Battlecruiser)", + "Defensive Matrix (Battlecruiser)", + "Advanced Defensive Matrix (Battlecruiser)"], + "Progressive Immortality Protocol (Thor)": ["Immortality Protocol (Thor)", + "Immortality Protocol (Thor)", + "Immortality Protocol (Free) (Thor)"], + "Progressive High Impact Payload (Thor)": ["High Impact Payload (Thor)", + "High Impact Payload (Thor)", "Smart Servos (Thor)"], + "Progressive Augmented Thrusters (Planetary Fortress)": ["Lift Off (Planetary Fortress)", + "Lift Off (Planetary Fortress)", + "Armament Stabilizers (Planetary Fortress)"], + "Progressive Regenerative Bio-Steel": ["Regenerative Bio-Steel Level 1", + "Regenerative Bio-Steel Level 1", + "Regenerative Bio-Steel Level 2", + "Regenerative Bio-Steel Level 3"], + "Progressive Stealth Suit Module (Nova Suit Module)": ["Stealth Suit Module (Nova Suit Module)", + "Cloak (Nova Suit Module)", + "Permanently Cloaked (Nova Suit Module)"], + "Progressive Zerg Melee Attack": ["Zerg Melee Attack Level 1", + "Zerg Melee Attack Level 1", + "Zerg Melee Attack Level 2", + "Zerg Melee Attack Level 3"], + "Progressive Zerg Missile Attack": ["Zerg Missile Attack Level 1", + "Zerg Missile Attack Level 1", + "Zerg Missile Attack Level 2", + "Zerg Missile Attack Level 3"], + "Progressive Zerg Ground Carapace": ["Zerg Ground Carapace Level 1", + "Zerg Ground Carapace Level 1", + "Zerg Ground Carapace Level 2", + "Zerg Ground Carapace Level 3"], + "Progressive Zerg Flyer Attack": ["Zerg Flyer Attack Level 1", + "Zerg Flyer Attack Level 1", + "Zerg Flyer Attack Level 2", + "Zerg Flyer Attack Level 3"], + "Progressive Zerg Flyer Carapace": ["Zerg Flyer Carapace Level 1", + "Zerg Flyer Carapace Level 1", + "Zerg Flyer Carapace Level 2", + "Zerg Flyer Carapace Level 3"], + "Progressive Protoss Ground Weapon": ["Protoss Ground Weapon Level 1", + "Protoss Ground Weapon Level 1", + "Protoss Ground Weapon Level 2", + "Protoss Ground Weapon Level 3"], + "Progressive Protoss Ground Armor": ["Protoss Ground Armor Level 1", + "Protoss Ground Armor Level 1", + "Protoss Ground Armor Level 2", + "Protoss Ground Armor Level 3"], + "Progressive Protoss Shields": ["Protoss Shields Level 1", "Protoss Shields Level 1", + "Protoss Shields Level 2", "Protoss Shields Level 3"], + "Progressive Protoss Air Weapon": ["Protoss Air Weapon Level 1", + "Protoss Air Weapon Level 1", + "Protoss Air Weapon Level 2", + "Protoss Air Weapon Level 3"], + "Progressive Protoss Air Armor": ["Protoss Air Armor Level 1", + "Protoss Air Armor Level 1", + "Protoss Air Armor Level 2", + "Protoss Air Armor Level 3"], + "Progressive Proxy Pylon (Spear of Adun Calldown)": ["Proxy Pylon (Spear of Adun Calldown)", + "Proxy Pylon (Spear of Adun Calldown)", + "Warp In Reinforcements (Spear of Adun Calldown)"] } for item_name, item_id in progressive_items.items(): level = min(inventory[item_id], len(progressive_names[item_name]) - 1) @@ -1925,24 +2571,62 @@ def render_Starcraft2WingsOfLiberty_tracker(tracker_data: TrackerData, team: int .replace("(", "") .replace(")", "")) display_data[base_name + "_level"] = level - display_data[base_name + "_url"] = icons[display_name] + display_data[base_name + "_url"] = icons[display_name] if display_name in icons else "FIXME" display_data[base_name + "_name"] = display_name # Multi-items multi_items = { - "+15 Starting Minerals": 800 + SC2WOL_ITEM_ID_OFFSET, - "+15 Starting Vespene": 801 + SC2WOL_ITEM_ID_OFFSET, - "+2 Starting Supply": 802 + SC2WOL_ITEM_ID_OFFSET + "Additional Starting Minerals": 800 + SC2WOL_ITEM_ID_OFFSET, + "Additional Starting Vespene": 801 + SC2WOL_ITEM_ID_OFFSET, + "Additional Starting Supply": 802 + SC2WOL_ITEM_ID_OFFSET } for item_name, item_id in multi_items.items(): base_name = item_name.split()[-1].lower() count = inventory[item_id] if base_name == "supply": - count = count * 2 - display_data[base_name + "_count"] = count - else: - count = count * 15 - display_data[base_name + "_count"] = count + count = count * starting_supply_per_item + elif base_name == "minerals": + count = count * minerals_per_item + elif base_name == "vespene": + count = count * vespene_per_item + display_data[base_name + "_count"] = count + # Kerrigan level + level_items = { + "1 Kerrigan Level": 509 + SC2HOTS_ITEM_ID_OFFSET, + "2 Kerrigan Levels": 508 + SC2HOTS_ITEM_ID_OFFSET, + "3 Kerrigan Levels": 507 + SC2HOTS_ITEM_ID_OFFSET, + "4 Kerrigan Levels": 506 + SC2HOTS_ITEM_ID_OFFSET, + "5 Kerrigan Levels": 505 + SC2HOTS_ITEM_ID_OFFSET, + "6 Kerrigan Levels": 504 + SC2HOTS_ITEM_ID_OFFSET, + "7 Kerrigan Levels": 503 + SC2HOTS_ITEM_ID_OFFSET, + "8 Kerrigan Levels": 502 + SC2HOTS_ITEM_ID_OFFSET, + "9 Kerrigan Levels": 501 + SC2HOTS_ITEM_ID_OFFSET, + "10 Kerrigan Levels": 500 + SC2HOTS_ITEM_ID_OFFSET, + "14 Kerrigan Levels": 510 + SC2HOTS_ITEM_ID_OFFSET, + "35 Kerrigan Levels": 511 + SC2HOTS_ITEM_ID_OFFSET, + "70 Kerrigan Levels": 512 + SC2HOTS_ITEM_ID_OFFSET, + } + level_amounts = { + "1 Kerrigan Level": 1, + "2 Kerrigan Levels": 2, + "3 Kerrigan Levels": 3, + "4 Kerrigan Levels": 4, + "5 Kerrigan Levels": 5, + "6 Kerrigan Levels": 6, + "7 Kerrigan Levels": 7, + "8 Kerrigan Levels": 8, + "9 Kerrigan Levels": 9, + "10 Kerrigan Levels": 10, + "14 Kerrigan Levels": 14, + "35 Kerrigan Levels": 35, + "70 Kerrigan Levels": 70, + } + kerrigan_level = 0 + for item_name, item_id in level_items.items(): + count = inventory[item_id] + amount = level_amounts[item_name] + kerrigan_level += count * amount + display_data["kerrigan_level"] = kerrigan_level # Victory condition game_state = tracker_data.get_player_client_status(team, player) @@ -1951,7 +2635,7 @@ def render_Starcraft2WingsOfLiberty_tracker(tracker_data: TrackerData, team: int # Turn location IDs into mission objective counts locations = tracker_data.get_player_locations(team, player) checked_locations = tracker_data.get_player_checked_locations(team, player) - lookup_name = lambda id: tracker_data.location_id_to_name["Starcraft 2 Wings of Liberty"][id] + lookup_name = lambda id: tracker_data.location_id_to_name["Starcraft 2"][id] location_info = {mission_name: {lookup_name(id): (id in checked_locations) for id in mission_locations if id in set(locations)} for mission_name, mission_locations in sc2wol_location_ids.items()} @@ -1963,9 +2647,9 @@ def render_Starcraft2WingsOfLiberty_tracker(tracker_data: TrackerData, team: int mission_name, mission_locations in sc2wol_location_ids.items()} checks_in_area['Total'] = sum(checks_in_area.values()) - lookup_any_item_id_to_name = tracker_data.item_id_to_name["Starcraft 2 Wings of Liberty"] + lookup_any_item_id_to_name = tracker_data.item_id_to_name["Starcraft 2"] return render_template( - "tracker__Starcraft2WingsOfLiberty.html", + "tracker__Starcraft2.html", inventory=inventory, icons=icons, acquired_items={lookup_any_item_id_to_name[id] for id, count in inventory.items() if count > 0}, @@ -1979,4 +2663,4 @@ def render_Starcraft2WingsOfLiberty_tracker(tracker_data: TrackerData, team: int **display_data, ) - _player_trackers["Starcraft 2 Wings of Liberty"] = render_Starcraft2WingsOfLiberty_tracker + _player_trackers["Starcraft 2"] = render_Starcraft2_tracker diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS index d6730b7308ae..dea869fb5536 100644 --- a/docs/CODEOWNERS +++ b/docs/CODEOWNERS @@ -134,8 +134,8 @@ # Sonic Adventure 2 Battle /worlds/sa2b/ @PoryGone @RaspberrySpace -# Starcraft 2 Wings of Liberty -/worlds/sc2wol/ @Ziktofel +# Starcraft 2 +/worlds/sc2/ @Ziktofel # Super Metroid /worlds/sm/ @lordlou diff --git a/setup.py b/setup.py index 68cab1d5e25a..ffb7e02fabb3 100644 --- a/setup.py +++ b/setup.py @@ -84,7 +84,6 @@ # LogicMixin is broken before 3.10 import revamp if sys.version_info < (3,10): non_apworlds.add("Hollow Knight") - non_apworlds.add("Starcraft 2 Wings of Liberty") def download_SNI(): print("Updating SNI") diff --git a/test/general/test_items.py b/test/general/test_items.py index 82b6030379d6..25623d4d8357 100644 --- a/test/general/test_items.py +++ b/test/general/test_items.py @@ -23,8 +23,8 @@ def test_item_name_group_has_valid_item(self): {"Pendants", "Crystals"}, "Ocarina of Time": {"medallions", "stones", "rewards", "logic_bottles"}, - "Starcraft 2 Wings of Liberty": - {"Missions"}, + "Starcraft 2": + {"Missions", "WoL Missions"}, } for game_name, world_type in AutoWorldRegister.world_types.items(): with self.subTest(game_name, game_name=game_name): diff --git a/worlds/_sc2common/bot/bot_ai.py b/worlds/_sc2common/bot/bot_ai.py index 79c11a5ad4a3..b08f8af29ac0 100644 --- a/worlds/_sc2common/bot/bot_ai.py +++ b/worlds/_sc2common/bot/bot_ai.py @@ -12,6 +12,8 @@ from .unit import Unit from .units import Units +from worlds._sc2common.bot import logger + if TYPE_CHECKING: from .game_info import Ramp @@ -310,6 +312,7 @@ async def chat_send(self, message: str, team_only: bool = False): :param message: :param team_only:""" assert isinstance(message, str), f"{message} is not a string" + logger.debug("Sending message: " + message) await self.client.chat_send(message, team_only) def in_map_bounds(self, pos: Union[Point2, tuple, list]) -> bool: diff --git a/worlds/sc2/Client.py b/worlds/sc2/Client.py new file mode 100644 index 000000000000..fe6efb9c3035 --- /dev/null +++ b/worlds/sc2/Client.py @@ -0,0 +1,1631 @@ +from __future__ import annotations + +import asyncio +import copy +import ctypes +import enum +import inspect +import logging +import multiprocessing +import os.path +import re +import sys +import tempfile +import typing +import queue +import zipfile +import io +import random +import concurrent.futures +from pathlib import Path + +# CommonClient import first to trigger ModuleUpdater +from CommonClient import CommonContext, server_loop, ClientCommandProcessor, gui_enabled, get_base_parser +from Utils import init_logging, is_windows, async_start +from worlds.sc2 import ItemNames +from worlds.sc2.ItemGroups import item_name_groups, unlisted_item_name_groups +from worlds.sc2 import Options +from worlds.sc2.Options import ( + MissionOrder, KerriganPrimalStatus, kerrigan_unit_available, KerriganPresence, + GameSpeed, GenericUpgradeItems, GenericUpgradeResearch, ColorChoice, GenericUpgradeMissions, + LocationInclusion, ExtraLocations, MasteryLocations, ChallengeLocations, VanillaLocations, + DisableForcedCamera, SkipCutscenes, GrantStoryTech, GrantStoryLevels, TakeOverAIAllies, RequiredTactics, + SpearOfAdunPresence, SpearOfAdunPresentInNoBuild, SpearOfAdunAutonomouslyCastAbilityPresence, + SpearOfAdunAutonomouslyCastPresentInNoBuild +) + + +if __name__ == "__main__": + init_logging("SC2Client", exception_logger="Client") + +logger = logging.getLogger("Client") +sc2_logger = logging.getLogger("Starcraft2") + +import nest_asyncio +from worlds._sc2common import bot +from worlds._sc2common.bot.data import Race +from worlds._sc2common.bot.main import run_game +from worlds._sc2common.bot.player import Bot +from worlds.sc2.Items import lookup_id_to_name, get_full_item_list, ItemData, type_flaggroups, upgrade_numbers, upgrade_numbers_all +from worlds.sc2.Locations import SC2WOL_LOC_ID_OFFSET, LocationType, SC2HOTS_LOC_ID_OFFSET +from worlds.sc2.MissionTables import lookup_id_to_mission, SC2Campaign, lookup_name_to_mission, \ + lookup_id_to_campaign, MissionConnection, SC2Mission, campaign_mission_table, SC2Race, get_no_build_missions +from worlds.sc2.Regions import MissionInfo + +import colorama +from Options import Option +from NetUtils import ClientStatus, NetworkItem, JSONtoTextParser, JSONMessagePart, add_json_item, add_json_location, add_json_text, JSONTypes +from MultiServer import mark_raw + +pool = concurrent.futures.ThreadPoolExecutor(1) +loop = asyncio.get_event_loop_policy().new_event_loop() +nest_asyncio.apply(loop) +MAX_BONUS: int = 28 +VICTORY_MODULO: int = 100 + +# GitHub repo where the Map/mod data is hosted for /download_data command +DATA_REPO_OWNER = "Ziktofel" +DATA_REPO_NAME = "Archipelago-SC2-data" +DATA_API_VERSION = "API3" + +# Bot controller +CONTROLLER_HEALTH: int = 38281 +CONTROLLER2_HEALTH: int = 38282 + +# Games +STARCRAFT2 = "Starcraft 2" +STARCRAFT2_WOL = "Starcraft 2 Wings of Liberty" + + +# Data version file path. +# This file is used to tell if the downloaded data are outdated +# Associated with /download_data command +def get_metadata_file() -> str: + return os.environ["SC2PATH"] + os.sep + "ArchipelagoSC2Metadata.txt" + + +class ConfigurableOptionType(enum.Enum): + INTEGER = enum.auto() + ENUM = enum.auto() + +class ConfigurableOptionInfo(typing.NamedTuple): + name: str + variable_name: str + option_class: typing.Type[Option] + option_type: ConfigurableOptionType = ConfigurableOptionType.ENUM + can_break_logic: bool = False + + +class ColouredMessage: + def __init__(self, text: str = '') -> None: + self.parts: typing.List[dict] = [] + if text: + self(text) + def __call__(self, text: str) -> 'ColouredMessage': + add_json_text(self.parts, text) + return self + def coloured(self, text: str, colour: str) -> 'ColouredMessage': + add_json_text(self.parts, text, type="color", color=colour) + return self + def location(self, location_id: int, player_id: int = 0) -> 'ColouredMessage': + add_json_location(self.parts, location_id, player_id) + return self + def item(self, item_id: int, player_id: int = 0, flags: int = 0) -> 'ColouredMessage': + add_json_item(self.parts, item_id, player_id, flags) + return self + def player(self, player_id: int) -> 'ColouredMessage': + add_json_text(self.parts, str(player_id), type=JSONTypes.player_id) + return self + def send(self, ctx: SC2Context) -> None: + ctx.on_print_json({"data": self.parts, "cmd": "PrintJSON"}) + + +class StarcraftClientProcessor(ClientCommandProcessor): + ctx: SC2Context + echo_commands = True + + def formatted_print(self, text: str) -> None: + """Prints with kivy formatting to the GUI, and also prints to command-line and to all logs""" + # Note(mm): Bold/underline can help readability, but unfortunately the CommonClient does not filter bold tags from command-line output. + # Regardless, using `on_print_json` to get formatted text in the GUI and output in the command-line and in the logs, + # without having to branch code from CommonClient + self.ctx.on_print_json({"data": [{"text": text}]}) + + def _cmd_difficulty(self, difficulty: str = "") -> bool: + """Overrides the current difficulty set for the world. Takes the argument casual, normal, hard, or brutal""" + options = difficulty.split() + num_options = len(options) + + if num_options > 0: + difficulty_choice = options[0].lower() + if difficulty_choice == "casual": + self.ctx.difficulty_override = 0 + elif difficulty_choice == "normal": + self.ctx.difficulty_override = 1 + elif difficulty_choice == "hard": + self.ctx.difficulty_override = 2 + elif difficulty_choice == "brutal": + self.ctx.difficulty_override = 3 + else: + self.output("Unable to parse difficulty '" + options[0] + "'") + return False + + self.output("Difficulty set to " + options[0]) + return True + + else: + if self.ctx.difficulty == -1: + self.output("Please connect to a seed before checking difficulty.") + else: + current_difficulty = self.ctx.difficulty + if self.ctx.difficulty_override >= 0: + current_difficulty = self.ctx.difficulty_override + self.output("Current difficulty: " + ["Casual", "Normal", "Hard", "Brutal"][current_difficulty]) + self.output("To change the difficulty, add the name of the difficulty after the command.") + return False + + + def _cmd_game_speed(self, game_speed: str = "") -> bool: + """Overrides the current game speed for the world. + Takes the arguments default, slower, slow, normal, fast, faster""" + options = game_speed.split() + num_options = len(options) + + if num_options > 0: + speed_choice = options[0].lower() + if speed_choice == "default": + self.ctx.game_speed_override = 0 + elif speed_choice == "slower": + self.ctx.game_speed_override = 1 + elif speed_choice == "slow": + self.ctx.game_speed_override = 2 + elif speed_choice == "normal": + self.ctx.game_speed_override = 3 + elif speed_choice == "fast": + self.ctx.game_speed_override = 4 + elif speed_choice == "faster": + self.ctx.game_speed_override = 5 + else: + self.output("Unable to parse game speed '" + options[0] + "'") + return False + + self.output("Game speed set to " + options[0]) + return True + + else: + if self.ctx.game_speed == -1: + self.output("Please connect to a seed before checking game speed.") + else: + current_speed = self.ctx.game_speed + if self.ctx.game_speed_override >= 0: + current_speed = self.ctx.game_speed_override + self.output("Current game speed: " + + ["Default", "Slower", "Slow", "Normal", "Fast", "Faster"][current_speed]) + self.output("To change the game speed, add the name of the speed after the command," + " or Default to select based on difficulty.") + return False + + @mark_raw + def _cmd_received(self, filter_search: str = "") -> bool: + """List received items. + Pass in a parameter to filter the search by partial item name or exact item group.""" + # Groups must be matched case-sensitively, so we properly capitalize the search term + # eg. "Spear of Adun" over "Spear Of Adun" or "spear of adun" + # This fails a lot of item name matches, but those should be found by partial name match + formatted_filter_search = " ".join([(part.lower() if len(part) <= 3 else part.lower().capitalize()) for part in filter_search.split()]) + + def item_matches_filter(item_name: str) -> bool: + # The filter can be an exact group name or a partial item name + # Partial item name can be matched case-insensitively + if filter_search.lower() in item_name.lower(): + return True + # The search term should already be formatted as a group name + if formatted_filter_search in item_name_groups and item_name in item_name_groups[formatted_filter_search]: + return True + return False + + items = get_full_item_list() + categorized_items: typing.Dict[SC2Race, typing.List[int]] = {} + parent_to_child: typing.Dict[int, typing.List[int]] = {} + items_received: typing.Dict[int, typing.List[NetworkItem]] = {} + filter_match_count = 0 + for item in self.ctx.items_received: + items_received.setdefault(item.item, []).append(item) + items_received_set = set(items_received) + for item_data in items.values(): + if item_data.parent_item: + parent_to_child.setdefault(items[item_data.parent_item].code, []).append(item_data.code) + else: + categorized_items.setdefault(item_data.race, []).append(item_data.code) + for faction in SC2Race: + has_printed_faction_title = False + def print_faction_title(): + if not has_printed_faction_title: + self.formatted_print(f" [u]{faction.name}[/u] ") + + for item_id in categorized_items[faction]: + item_name = self.ctx.item_names[item_id] + received_child_items = items_received_set.intersection(parent_to_child.get(item_id, [])) + matching_children = [child for child in received_child_items + if item_matches_filter(self.ctx.item_names[child])] + received_items_of_this_type = items_received.get(item_id, []) + item_is_match = item_matches_filter(item_name) + if item_is_match or len(matching_children) > 0: + # Print found item if it or its children match the filter + if item_is_match: + filter_match_count += len(received_items_of_this_type) + for item in received_items_of_this_type: + print_faction_title() + has_printed_faction_title = True + (ColouredMessage('* ').item(item.item, flags=item.flags) + (" from ").location(item.location, self.ctx.slot) + (" by ").player(item.player) + ).send(self.ctx) + + if received_child_items: + # We have this item's children + if len(matching_children) == 0: + # ...but none of them match the filter + continue + + if not received_items_of_this_type: + # We didn't receive the item itself + print_faction_title() + has_printed_faction_title = True + ColouredMessage("- ").coloured(item_name, "black")(" - not obtained").send(self.ctx) + + for child_item in matching_children: + received_items_of_this_type = items_received.get(child_item, []) + for item in received_items_of_this_type: + filter_match_count += len(received_items_of_this_type) + (ColouredMessage(' * ').item(item.item, flags=item.flags) + (" from ").location(item.location, self.ctx.slot) + (" by ").player(item.player) + ).send(self.ctx) + + non_matching_children = len(received_child_items) - len(matching_children) + if non_matching_children > 0: + self.formatted_print(f" + {non_matching_children} child items that don't match the filter") + if filter_search == "": + self.formatted_print(f"[b]Obtained: {len(self.ctx.items_received)} items[/b]") + else: + self.formatted_print(f"[b]Filter \"{filter_search}\" found {filter_match_count} out of {len(self.ctx.items_received)} obtained items[/b]") + return True + + def _cmd_option(self, option_name: str = "", option_value: str = "") -> None: + """Sets a Starcraft game option that can be changed after generation. Use "/option list" to see all options.""" + + LOGIC_WARNING = f" *Note changing this may result in logically unbeatable games*\n" + + options = ( + ConfigurableOptionInfo('kerrigan_presence', 'kerrigan_presence', Options.KerriganPresence, can_break_logic=True), + ConfigurableOptionInfo('soa_presence', 'spear_of_adun_presence', Options.SpearOfAdunPresence, can_break_logic=True), + ConfigurableOptionInfo('soa_in_nobuilds', 'spear_of_adun_present_in_no_build', Options.SpearOfAdunPresentInNoBuild, can_break_logic=True), + ConfigurableOptionInfo('control_ally', 'take_over_ai_allies', Options.TakeOverAIAllies, can_break_logic=True), + ConfigurableOptionInfo('minerals_per_item', 'minerals_per_item', Options.MineralsPerItem, ConfigurableOptionType.INTEGER), + ConfigurableOptionInfo('gas_per_item', 'vespene_per_item', Options.VespenePerItem, ConfigurableOptionType.INTEGER), + ConfigurableOptionInfo('supply_per_item', 'starting_supply_per_item', Options.StartingSupplyPerItem, ConfigurableOptionType.INTEGER), + ConfigurableOptionInfo('no_forced_camera', 'disable_forced_camera', Options.DisableForcedCamera), + ConfigurableOptionInfo('skip_cutscenes', 'skip_cutscenes', Options.SkipCutscenes), + ) + + WARNING_COLOUR = "salmon" + CMD_COLOUR = "slateblue" + boolean_option_map = { + 'y': 'true', 'yes': 'true', 'n': 'false', 'no': 'false', + } + + help_message = ColouredMessage(inspect.cleandoc(""" + Options + -------------------- + """))('\n') + for option in options: + option_help_text = inspect.cleandoc(option.option_class.__doc__ or "No description provided.").split('\n', 1)[0] + help_message.coloured(option.name, CMD_COLOUR)(": " + " | ".join(option.option_class.options) + + f" -- {option_help_text}\n") + if option.can_break_logic: + help_message.coloured(LOGIC_WARNING, WARNING_COLOUR) + help_message("--------------------\nEnter an option without arguments to see its current value.\n") + + if not option_name or option_name == 'list' or option_name == 'help': + help_message.send(self.ctx) + return + for option in options: + if option_name == option.name: + option_value = boolean_option_map.get(option_value, option_value) + if not option_value: + pass + elif option.option_type == ConfigurableOptionType.ENUM and option_value in option.option_class.options: + self.ctx.__dict__[option.variable_name] = option.option_class.options[option_value] + elif option.option_type == ConfigurableOptionType.INTEGER: + try: + self.ctx.__dict__[option.variable_name] = int(option_value, base=0) + except: + self.output(f"{option_value} is not a valid integer") + else: + self.output(f"Unknown option value '{option_value}'") + ColouredMessage(f"{option.name} is '{option.option_class.get_option_name(self.ctx.__dict__[option.variable_name])}'").send(self.ctx) + break + else: + self.output(f"Unknown option '{option_name}'") + help_message.send(self.ctx) + + def _cmd_color(self, faction: str = "", color: str = "") -> None: + """Changes the player color for a given faction.""" + player_colors = [ + "White", "Red", "Blue", "Teal", + "Purple", "Yellow", "Orange", "Green", + "LightPink", "Violet", "LightGrey", "DarkGreen", + "Brown", "LightGreen", "DarkGrey", "Pink", + "Rainbow", "Random", "Default" + ] + var_names = { + 'raynor': 'player_color_raynor', + 'kerrigan': 'player_color_zerg', + 'primal': 'player_color_zerg_primal', + 'protoss': 'player_color_protoss', + 'nova': 'player_color_nova', + } + faction = faction.lower() + if not faction: + for faction_name, key in var_names.items(): + self.output(f"Current player color for {faction_name}: {player_colors[self.ctx.__dict__[key]]}") + self.output("To change your color, add the faction name and color after the command.") + self.output("Available factions: " + ', '.join(var_names)) + self.output("Available colors: " + ', '.join(player_colors)) + return + elif faction not in var_names: + self.output(f"Unknown faction '{faction}'.") + self.output("Available factions: " + ', '.join(var_names)) + return + match_colors = [player_color.lower() for player_color in player_colors] + if not color: + self.output(f"Current player color for {faction}: {player_colors[self.ctx.__dict__[var_names[faction]]]}") + self.output("To change this faction's colors, add the name of the color after the command.") + self.output("Available colors: " + ', '.join(player_colors)) + else: + if color.lower() not in match_colors: + self.output(color + " is not a valid color. Available colors: " + ', '.join(player_colors)) + return + if color.lower() == "random": + color = random.choice(player_colors[:16]) + self.ctx.__dict__[var_names[faction]] = match_colors.index(color.lower()) + self.ctx.pending_color_update = True + self.output(f"Color for {faction} set to " + player_colors[self.ctx.__dict__[var_names[faction]]]) + + def _cmd_disable_mission_check(self) -> bool: + """Disables the check to see if a mission is available to play. Meant for co-op runs where one player can play + the next mission in a chain the other player is doing.""" + self.ctx.missions_unlocked = True + sc2_logger.info("Mission check has been disabled") + return True + + def _cmd_play(self, mission_id: str = "") -> bool: + """Start a Starcraft 2 mission""" + + options = mission_id.split() + num_options = len(options) + + if num_options > 0: + mission_number = int(options[0]) + + self.ctx.play_mission(mission_number) + + else: + sc2_logger.info( + "Mission ID needs to be specified. Use /unfinished or /available to view ids for available missions.") + return False + + return True + + def _cmd_available(self) -> bool: + """Get what missions are currently available to play""" + + request_available_missions(self.ctx) + return True + + def _cmd_unfinished(self) -> bool: + """Get what missions are currently available to play and have not had all locations checked""" + + request_unfinished_missions(self.ctx) + return True + + @mark_raw + def _cmd_set_path(self, path: str = '') -> bool: + """Manually set the SC2 install directory (if the automatic detection fails).""" + if path: + os.environ["SC2PATH"] = path + is_mod_installed_correctly() + return True + else: + sc2_logger.warning("When using set_path, you must type the path to your SC2 install directory.") + return False + + def _cmd_download_data(self) -> bool: + """Download the most recent release of the necessary files for playing SC2 with + Archipelago. Will overwrite existing files.""" + pool.submit(self._download_data) + return True + + @staticmethod + def _download_data() -> bool: + if "SC2PATH" not in os.environ: + check_game_install_path() + + if os.path.exists(get_metadata_file()): + with open(get_metadata_file(), "r") as f: + metadata = f.read() + else: + metadata = None + + tempzip, metadata = download_latest_release_zip( + DATA_REPO_OWNER, DATA_REPO_NAME, DATA_API_VERSION, metadata=metadata, force_download=True) + + if tempzip: + try: + zipfile.ZipFile(tempzip).extractall(path=os.environ["SC2PATH"]) + sc2_logger.info(f"Download complete. Package installed.") + if metadata is not None: + with open(get_metadata_file(), "w") as f: + f.write(metadata) + finally: + os.remove(tempzip) + else: + sc2_logger.warning("Download aborted/failed. Read the log for more information.") + return False + return True + + +class SC2JSONtoTextParser(JSONtoTextParser): + def __init__(self, ctx) -> None: + self.handlers = { + "ItemSend": self._handle_color, + "ItemCheat": self._handle_color, + "Hint": self._handle_color, + } + super().__init__(ctx) + + def _handle_color(self, node: JSONMessagePart) -> str: + codes = node["color"].split(";") + buffer = "".join(self.color_code(code) for code in codes if code in self.color_codes) + return buffer + self._handle_text(node) + '' + + def color_code(self, code: str) -> str: + return '' + + +class SC2Context(CommonContext): + command_processor = StarcraftClientProcessor + game = STARCRAFT2 + items_handling = 0b111 + + def __init__(self, *args, **kwargs) -> None: + super(SC2Context, self).__init__(*args, **kwargs) + self.raw_text_parser = SC2JSONtoTextParser(self) + + self.difficulty = -1 + self.game_speed = -1 + self.disable_forced_camera = 0 + self.skip_cutscenes = 0 + self.all_in_choice = 0 + self.mission_order = 0 + self.player_color_raynor = ColorChoice.option_blue + self.player_color_zerg = ColorChoice.option_orange + self.player_color_zerg_primal = ColorChoice.option_purple + self.player_color_protoss = ColorChoice.option_blue + self.player_color_nova = ColorChoice.option_dark_grey + self.pending_color_update = False + self.kerrigan_presence = 0 + self.kerrigan_primal_status = 0 + self.levels_per_check = 0 + self.checks_per_level = 1 + self.mission_req_table: typing.Dict[SC2Campaign, typing.Dict[str, MissionInfo]] = {} + self.final_mission: int = 29 + self.announcements: queue.Queue = queue.Queue() + self.sc2_run_task: typing.Optional[asyncio.Task] = None + self.missions_unlocked: bool = False # allow launching missions ignoring requirements + self.generic_upgrade_missions = 0 + self.generic_upgrade_research = 0 + self.generic_upgrade_items = 0 + self.location_inclusions: typing.Dict[LocationType, int] = {} + self.plando_locations: typing.List[str] = [] + self.current_tooltip = None + self.last_loc_list = None + self.difficulty_override = -1 + self.game_speed_override = -1 + self.mission_id_to_location_ids: typing.Dict[int, typing.List[int]] = {} + self.last_bot: typing.Optional[ArchipelagoBot] = None + self.slot_data_version = 2 + self.grant_story_tech = 0 + self.required_tactics = RequiredTactics.option_standard + self.take_over_ai_allies = TakeOverAIAllies.option_false + self.spear_of_adun_presence = SpearOfAdunPresence.option_not_present + self.spear_of_adun_present_in_no_build = SpearOfAdunPresentInNoBuild.option_false + self.spear_of_adun_autonomously_cast_ability_presence = SpearOfAdunAutonomouslyCastAbilityPresence.option_not_present + self.spear_of_adun_autonomously_cast_present_in_no_build = SpearOfAdunAutonomouslyCastPresentInNoBuild.option_false + self.minerals_per_item = 15 + self.vespene_per_item = 15 + self.starting_supply_per_item = 2 + self.nova_covert_ops_only = False + self.kerrigan_levels_per_mission_completed = 0 + + async def server_auth(self, password_requested: bool = False) -> None: + self.game = STARCRAFT2 + if password_requested and not self.password: + await super(SC2Context, self).server_auth(password_requested) + await self.get_username() + await self.send_connect() + if self.ui: + self.ui.first_check = True + + def is_legacy_game(self): + return self.game == STARCRAFT2_WOL + + def event_invalid_game(self): + if self.is_legacy_game(): + self.game = STARCRAFT2 + super().event_invalid_game() + else: + self.game = STARCRAFT2_WOL + async_start(self.send_connect()) + + def on_package(self, cmd: str, args: dict) -> None: + if cmd == "Connected": + self.difficulty = args["slot_data"]["game_difficulty"] + self.game_speed = args["slot_data"].get("game_speed", GameSpeed.option_default) + self.disable_forced_camera = args["slot_data"].get("disable_forced_camera", DisableForcedCamera.default) + self.skip_cutscenes = args["slot_data"].get("skip_cutscenes", SkipCutscenes.default) + self.all_in_choice = args["slot_data"]["all_in_map"] + self.slot_data_version = args["slot_data"].get("version", 2) + slot_req_table: dict = args["slot_data"]["mission_req"] + + first_item = list(slot_req_table.keys())[0] + # Maintaining backwards compatibility with older slot data + if first_item in [str(campaign.id) for campaign in SC2Campaign]: + # Multi-campaign + self.mission_req_table = {} + for campaign_id in slot_req_table: + campaign = lookup_id_to_campaign[int(campaign_id)] + self.mission_req_table[campaign] = { + mission: self.parse_mission_info(mission_info) + for mission, mission_info in slot_req_table[campaign_id].items() + } + else: + # Old format + self.mission_req_table = {SC2Campaign.GLOBAL: { + mission: self.parse_mission_info(mission_info) + for mission, mission_info in slot_req_table.items() + } + } + + self.mission_order = args["slot_data"].get("mission_order", MissionOrder.option_vanilla) + self.final_mission = args["slot_data"].get("final_mission", SC2Mission.ALL_IN.id) + self.player_color_raynor = args["slot_data"].get("player_color_terran_raynor", ColorChoice.option_blue) + self.player_color_zerg = args["slot_data"].get("player_color_zerg", ColorChoice.option_orange) + self.player_color_zerg_primal = args["slot_data"].get("player_color_zerg_primal", ColorChoice.option_purple) + self.player_color_protoss = args["slot_data"].get("player_color_protoss", ColorChoice.option_blue) + self.player_color_nova = args["slot_data"].get("player_color_nova", ColorChoice.option_dark_grey) + self.generic_upgrade_missions = args["slot_data"].get("generic_upgrade_missions", GenericUpgradeMissions.default) + self.generic_upgrade_items = args["slot_data"].get("generic_upgrade_items", GenericUpgradeItems.option_individual_items) + self.generic_upgrade_research = args["slot_data"].get("generic_upgrade_research", GenericUpgradeResearch.option_vanilla) + self.kerrigan_presence = args["slot_data"].get("kerrigan_presence", KerriganPresence.option_vanilla) + self.kerrigan_primal_status = args["slot_data"].get("kerrigan_primal_status", KerriganPrimalStatus.option_vanilla) + self.kerrigan_levels_per_mission_completed = args["slot_data"].get("kerrigan_levels_per_mission_completed", 0) + self.kerrigan_levels_per_mission_completed_cap = args["slot_data"].get("kerrigan_levels_per_mission_completed_cap", -1) + self.kerrigan_total_level_cap = args["slot_data"].get("kerrigan_total_level_cap", -1) + self.grant_story_tech = args["slot_data"].get("grant_story_tech", GrantStoryTech.option_false) + self.grant_story_levels = args["slot_data"].get("grant_story_levels", GrantStoryLevels.option_additive) + self.required_tactics = args["slot_data"].get("required_tactics", RequiredTactics.option_standard) + self.take_over_ai_allies = args["slot_data"].get("take_over_ai_allies", TakeOverAIAllies.option_false) + self.spear_of_adun_presence = args["slot_data"].get("spear_of_adun_presence", SpearOfAdunPresence.option_not_present) + self.spear_of_adun_present_in_no_build = args["slot_data"].get("spear_of_adun_present_in_no_build", SpearOfAdunPresentInNoBuild.option_false) + self.spear_of_adun_autonomously_cast_ability_presence = args["slot_data"].get("spear_of_adun_autonomously_cast_ability_presence", SpearOfAdunAutonomouslyCastAbilityPresence.option_not_present) + self.spear_of_adun_autonomously_cast_present_in_no_build = args["slot_data"].get("spear_of_adun_autonomously_cast_present_in_no_build", SpearOfAdunAutonomouslyCastPresentInNoBuild.option_false) + self.minerals_per_item = args["slot_data"].get("minerals_per_item", 15) + self.vespene_per_item = args["slot_data"].get("vespene_per_item", 15) + self.starting_supply_per_item = args["slot_data"].get("starting_supply_per_item", 2) + self.nova_covert_ops_only = args["slot_data"].get("nova_covert_ops_only", False) + + if self.required_tactics == RequiredTactics.option_no_logic: + # Locking Grant Story Tech/Levels if no logic + self.grant_story_tech = GrantStoryTech.option_true + self.grant_story_levels = GrantStoryLevels.option_minimum + + self.location_inclusions = { + LocationType.VICTORY: LocationInclusion.option_enabled, # Victory checks are always enabled + LocationType.VANILLA: args["slot_data"].get("vanilla_locations", VanillaLocations.default), + LocationType.EXTRA: args["slot_data"].get("extra_locations", ExtraLocations.default), + LocationType.CHALLENGE: args["slot_data"].get("challenge_locations", ChallengeLocations.default), + LocationType.MASTERY: args["slot_data"].get("mastery_locations", MasteryLocations.default), + } + self.plando_locations = args["slot_data"].get("plando_locations", []) + + self.build_location_to_mission_mapping() + + # Looks for the required maps and mods for SC2. Runs check_game_install_path. + maps_present = is_mod_installed_correctly() + if os.path.exists(get_metadata_file()): + with open(get_metadata_file(), "r") as f: + current_ver = f.read() + sc2_logger.debug(f"Current version: {current_ver}") + if is_mod_update_available(DATA_REPO_OWNER, DATA_REPO_NAME, DATA_API_VERSION, current_ver): + sc2_logger.info("NOTICE: Update for required files found. Run /download_data to install.") + elif maps_present: + sc2_logger.warning("NOTICE: Your map files may be outdated (version number not found). " + "Run /download_data to update them.") + + @staticmethod + def parse_mission_info(mission_info: dict[str, typing.Any]) -> MissionInfo: + if mission_info.get("id") is not None: + mission_info["mission"] = lookup_id_to_mission[mission_info["id"]] + elif isinstance(mission_info["mission"], int): + mission_info["mission"] = lookup_id_to_mission[mission_info["mission"]] + + return MissionInfo( + **{field: value for field, value in mission_info.items() if field in MissionInfo._fields} + ) + + def find_campaign(self, mission_name: str) -> SC2Campaign: + data = self.mission_req_table + for campaign in data.keys(): + if mission_name in data[campaign].keys(): + return campaign + sc2_logger.info(f"Attempted to find campaign of unknown mission '{mission_name}'; defaulting to GLOBAL") + return SC2Campaign.GLOBAL + + + + def on_print_json(self, args: dict) -> None: + # goes to this world + if "receiving" in args and self.slot_concerns_self(args["receiving"]): + relevant = True + # found in this world + elif "item" in args and self.slot_concerns_self(args["item"].player): + relevant = True + # not related + else: + relevant = False + + if relevant: + self.announcements.put(self.raw_text_parser(copy.deepcopy(args["data"]))) + + super(SC2Context, self).on_print_json(args) + + def run_gui(self) -> None: + from .ClientGui import start_gui + start_gui(self) + + + async def shutdown(self) -> None: + await super(SC2Context, self).shutdown() + if self.last_bot: + self.last_bot.want_close = True + if self.sc2_run_task: + self.sc2_run_task.cancel() + + def play_mission(self, mission_id: int) -> bool: + if self.missions_unlocked or is_mission_available(self, mission_id): + if self.sc2_run_task: + if not self.sc2_run_task.done(): + sc2_logger.warning("Starcraft 2 Client is still running!") + self.sc2_run_task.cancel() # doesn't actually close the game, just stops the python task + if self.slot is None: + sc2_logger.warning("Launching Mission without Archipelago authentication, " + "checks will not be registered to server.") + self.sc2_run_task = asyncio.create_task(starcraft_launch(self, mission_id), + name="Starcraft 2 Launch") + return True + else: + sc2_logger.info( + f"{lookup_id_to_mission[mission_id].mission_name} is not currently unlocked. " + f"Use /unfinished or /available to see what is available.") + return False + + def build_location_to_mission_mapping(self) -> None: + mission_id_to_location_ids: typing.Dict[int, typing.Set[int]] = { + mission_info.mission.id: set() for campaign_mission in self.mission_req_table.values() for mission_info in campaign_mission.values() + } + + for loc in self.server_locations: + offset = SC2WOL_LOC_ID_OFFSET if loc < SC2HOTS_LOC_ID_OFFSET \ + else (SC2HOTS_LOC_ID_OFFSET - SC2Mission.ALL_IN.id * VICTORY_MODULO) + mission_id, objective = divmod(loc - offset, VICTORY_MODULO) + mission_id_to_location_ids[mission_id].add(objective) + self.mission_id_to_location_ids = {mission_id: sorted(objectives) for mission_id, objectives in + mission_id_to_location_ids.items()} + + def locations_for_mission(self, mission_name: str): + mission = lookup_name_to_mission[mission_name] + mission_id: int = mission.id + objectives = self.mission_id_to_location_ids[mission_id] + for objective in objectives: + yield get_location_offset(mission_id) + mission_id * VICTORY_MODULO + objective + + +class CompatItemHolder(typing.NamedTuple): + name: str + quantity: int = 1 + + +async def main(): + multiprocessing.freeze_support() + parser = get_base_parser() + parser.add_argument('--name', default=None, help="Slot Name to connect as.") + args = parser.parse_args() + + ctx = SC2Context(args.connect, args.password) + ctx.auth = args.name + if ctx.server_task is None: + ctx.server_task = asyncio.create_task(server_loop(ctx), name="ServerLoop") + + if gui_enabled: + ctx.run_gui() + ctx.run_cli() + + await ctx.exit_event.wait() + + await ctx.shutdown() + +# These items must be given to the player if the game is generated on version 2 +API2_TO_API3_COMPAT_ITEMS: typing.Set[CompatItemHolder] = { + CompatItemHolder(ItemNames.PHOTON_CANNON), + CompatItemHolder(ItemNames.OBSERVER), + CompatItemHolder(ItemNames.WARP_HARMONIZATION), + CompatItemHolder(ItemNames.PROGRESSIVE_PROTOSS_GROUND_WEAPON, 3), + CompatItemHolder(ItemNames.PROGRESSIVE_PROTOSS_GROUND_ARMOR, 3), + CompatItemHolder(ItemNames.PROGRESSIVE_PROTOSS_SHIELDS, 3), + CompatItemHolder(ItemNames.PROGRESSIVE_PROTOSS_AIR_WEAPON, 3), + CompatItemHolder(ItemNames.PROGRESSIVE_PROTOSS_AIR_ARMOR, 3), + CompatItemHolder(ItemNames.PROGRESSIVE_PROTOSS_WEAPON_ARMOR_UPGRADE, 3) +} + + +def compat_item_to_network_items(compat_item: CompatItemHolder) -> typing.List[NetworkItem]: + item_id = get_full_item_list()[compat_item.name].code + network_item = NetworkItem(item_id, 0, 0, 0) + return compat_item.quantity * [network_item] + + +def calculate_items(ctx: SC2Context) -> typing.Dict[SC2Race, typing.List[int]]: + items = ctx.items_received.copy() + # Items unlocked in API2 by default (Prophecy default items) + if ctx.slot_data_version < 3: + for compat_item in API2_TO_API3_COMPAT_ITEMS: + items.extend(compat_item_to_network_items(compat_item)) + + network_item: NetworkItem + accumulators: typing.Dict[SC2Race, typing.List[int]] = {race: [0 for _ in type_flaggroups[race]] for race in SC2Race} + + # Protoss Shield grouped item specific logic + shields_from_ground_upgrade: int = 0 + shields_from_air_upgrade: int = 0 + + item_list = get_full_item_list() + for network_item in items: + name: str = lookup_id_to_name[network_item.item] + item_data: ItemData = item_list[name] + + # exists exactly once + if item_data.quantity == 1: + accumulators[item_data.race][type_flaggroups[item_data.race][item_data.type]] |= 1 << item_data.number + + # exists multiple times + elif item_data.type in ["Upgrade", "Progressive Upgrade","Progressive Upgrade 2"]: + flaggroup = type_flaggroups[item_data.race][item_data.type] + + # Generic upgrades apply only to Weapon / Armor upgrades + if item_data.type != "Upgrade" or ctx.generic_upgrade_items == 0: + accumulators[item_data.race][flaggroup] += 1 << item_data.number + else: + if name == ItemNames.PROGRESSIVE_PROTOSS_GROUND_UPGRADE: + shields_from_ground_upgrade += 1 + if name == ItemNames.PROGRESSIVE_PROTOSS_AIR_UPGRADE: + shields_from_air_upgrade += 1 + for bundled_number in upgrade_numbers[item_data.number]: + accumulators[item_data.race][flaggroup] += 1 << bundled_number + + # Regen bio-steel nerf with API3 - undo for older games + if ctx.slot_data_version < 3 and name == ItemNames.PROGRESSIVE_REGENERATIVE_BIO_STEEL: + current_level = (accumulators[item_data.race][flaggroup] >> item_data.number) % 4 + if current_level == 2: + # Switch from level 2 to level 3 for compatibility + accumulators[item_data.race][flaggroup] += 1 << item_data.number + # sum + else: + if name == ItemNames.STARTING_MINERALS: + accumulators[item_data.race][type_flaggroups[item_data.race][item_data.type]] += ctx.minerals_per_item + elif name == ItemNames.STARTING_VESPENE: + accumulators[item_data.race][type_flaggroups[item_data.race][item_data.type]] += ctx.vespene_per_item + elif name == ItemNames.STARTING_SUPPLY: + accumulators[item_data.race][type_flaggroups[item_data.race][item_data.type]] += ctx.starting_supply_per_item + else: + accumulators[item_data.race][type_flaggroups[item_data.race][item_data.type]] += item_data.number + + # Fix Shields from generic upgrades by unit class (Maximum of ground/air upgrades) + if shields_from_ground_upgrade > 0 or shields_from_air_upgrade > 0: + shield_upgrade_level = max(shields_from_ground_upgrade, shields_from_air_upgrade) + shield_upgrade_item = item_list[ItemNames.PROGRESSIVE_PROTOSS_SHIELDS] + for _ in range(0, shield_upgrade_level): + accumulators[shield_upgrade_item.race][type_flaggroups[shield_upgrade_item.race][shield_upgrade_item.type]] += 1 << shield_upgrade_item.number + + # Kerrigan levels per check + accumulators[SC2Race.ZERG][type_flaggroups[SC2Race.ZERG]["Level"]] += (len(ctx.checked_locations) // ctx.checks_per_level) * ctx.levels_per_check + + # Upgrades from completed missions + if ctx.generic_upgrade_missions > 0: + total_missions = sum(len(ctx.mission_req_table[campaign]) for campaign in ctx.mission_req_table) + for race in SC2Race: + if "Upgrade" not in type_flaggroups[race]: + continue + upgrade_flaggroup = type_flaggroups[race]["Upgrade"] + num_missions = ctx.generic_upgrade_missions * total_missions + amounts = [ + num_missions // 100, + 2 * num_missions // 100, + 3 * num_missions // 100 + ] + upgrade_count = 0 + completed = len([id for id in ctx.mission_id_to_location_ids if get_location_offset(id) + VICTORY_MODULO * id in ctx.checked_locations]) + for amount in amounts: + if completed >= amount: + upgrade_count += 1 + # Equivalent to "Progressive Weapon/Armor Upgrade" item + for bundled_number in upgrade_numbers[upgrade_numbers_all[race]]: + accumulators[race][upgrade_flaggroup] += upgrade_count << bundled_number + + return accumulators + + +def calc_difficulty(difficulty: int): + if difficulty == 0: + return 'C' + elif difficulty == 1: + return 'N' + elif difficulty == 2: + return 'H' + elif difficulty == 3: + return 'B' + + return 'X' + + +def get_kerrigan_level(ctx: SC2Context, items: typing.Dict[SC2Race, typing.List[int]], missions_beaten: int) -> int: + item_value = items[SC2Race.ZERG][type_flaggroups[SC2Race.ZERG]["Level"]] + mission_value = missions_beaten * ctx.kerrigan_levels_per_mission_completed + if ctx.kerrigan_levels_per_mission_completed_cap != -1: + mission_value = min(mission_value, ctx.kerrigan_levels_per_mission_completed_cap) + total_value = item_value + mission_value + if ctx.kerrigan_total_level_cap != -1: + total_value = min(total_value, ctx.kerrigan_total_level_cap) + return total_value + + +def calculate_kerrigan_options(ctx: SC2Context) -> int: + options = 0 + + # Bits 0, 1 + # Kerrigan unit available + if ctx.kerrigan_presence in kerrigan_unit_available: + options |= 1 << 0 + + # Bit 2 + # Kerrigan primal status by map + if ctx.kerrigan_primal_status == KerriganPrimalStatus.option_vanilla: + options |= 1 << 2 + + return options + + +def caclulate_soa_options(ctx: SC2Context) -> int: + options = 0 + + # Bits 0, 1 + # SoA Calldowns available + soa_presence_value = 0 + if ctx.spear_of_adun_presence == SpearOfAdunPresence.option_not_present: + soa_presence_value = 0 + elif ctx.spear_of_adun_presence == SpearOfAdunPresence.option_lotv_protoss: + soa_presence_value = 1 + elif ctx.spear_of_adun_presence == SpearOfAdunPresence.option_protoss: + soa_presence_value = 2 + elif ctx.spear_of_adun_presence == SpearOfAdunPresence.option_everywhere: + soa_presence_value = 3 + options |= soa_presence_value << 0 + + # Bit 2 + # SoA Calldowns for no-builds + if ctx.spear_of_adun_present_in_no_build == SpearOfAdunPresentInNoBuild.option_true: + options |= 1 << 2 + + # Bits 3,4 + # Autocasts + soa_autocasts_presence_value = 0 + if ctx.spear_of_adun_autonomously_cast_ability_presence == SpearOfAdunAutonomouslyCastAbilityPresence.option_not_present: + soa_autocasts_presence_value = 0 + elif ctx.spear_of_adun_autonomously_cast_ability_presence == SpearOfAdunAutonomouslyCastAbilityPresence.option_lotv_protoss: + soa_autocasts_presence_value = 1 + elif ctx.spear_of_adun_autonomously_cast_ability_presence == SpearOfAdunAutonomouslyCastAbilityPresence.option_protoss: + soa_autocasts_presence_value = 2 + elif ctx.spear_of_adun_autonomously_cast_ability_presence == SpearOfAdunAutonomouslyCastAbilityPresence.option_everywhere: + soa_autocasts_presence_value = 3 + options |= soa_autocasts_presence_value << 3 + + # Bit 5 + # Autocasts in no-builds + if ctx.spear_of_adun_autonomously_cast_present_in_no_build == SpearOfAdunAutonomouslyCastPresentInNoBuild.option_true: + options |= 1 << 5 + + return options + +def kerrigan_primal(ctx: SC2Context, items: typing.Dict[SC2Race, typing.List[int]]) -> bool: + if ctx.kerrigan_primal_status == KerriganPrimalStatus.option_always_zerg: + return True + elif ctx.kerrigan_primal_status == KerriganPrimalStatus.option_always_human: + return False + elif ctx.kerrigan_primal_status == KerriganPrimalStatus.option_level_35: + return items[SC2Race.ZERG][type_flaggroups[SC2Race.ZERG]["Level"]] >= 35 + elif ctx.kerrigan_primal_status == KerriganPrimalStatus.option_half_completion: + total_missions = len(ctx.mission_id_to_location_ids) + completed = len([(mission_id * VICTORY_MODULO + get_location_offset(mission_id)) in ctx.checked_locations + for mission_id in ctx.mission_id_to_location_ids]) + return completed >= (total_missions / 2) + elif ctx.kerrigan_primal_status == KerriganPrimalStatus.option_item: + codes = [item.item for item in ctx.items_received] + return get_full_item_list()[ItemNames.KERRIGAN_PRIMAL_FORM].code in codes + return False + +async def starcraft_launch(ctx: SC2Context, mission_id: int): + sc2_logger.info(f"Launching {lookup_id_to_mission[mission_id].mission_name}. If game does not launch check log file for errors.") + + with DllDirectory(None): + run_game(bot.maps.get(lookup_id_to_mission[mission_id].map_file), [Bot(Race.Terran, ArchipelagoBot(ctx, mission_id), + name="Archipelago", fullscreen=True)], realtime=True) + + +class ArchipelagoBot(bot.bot_ai.BotAI): + __slots__ = [ + 'game_running', + 'mission_completed', + 'boni', + 'setup_done', + 'ctx', + 'mission_id', + 'want_close', + 'can_read_game', + 'last_received_update', + ] + + def __init__(self, ctx: SC2Context, mission_id: int): + self.game_running = False + self.mission_completed = False + self.want_close = False + self.can_read_game = False + self.last_received_update: int = 0 + self.setup_done = False + self.ctx = ctx + self.ctx.last_bot = self + self.mission_id = mission_id + self.boni = [False for _ in range(MAX_BONUS)] + + super(ArchipelagoBot, self).__init__() + + async def on_step(self, iteration: int): + if self.want_close: + self.want_close = False + await self._client.leave() + return + game_state = 0 + if not self.setup_done: + self.setup_done = True + start_items = calculate_items(self.ctx) + missions_beaten = self.missions_beaten_count() + kerrigan_level = get_kerrigan_level(self.ctx, start_items, missions_beaten) + kerrigan_options = calculate_kerrigan_options(self.ctx) + soa_options = caclulate_soa_options(self.ctx) + if self.ctx.difficulty_override >= 0: + difficulty = calc_difficulty(self.ctx.difficulty_override) + else: + difficulty = calc_difficulty(self.ctx.difficulty) + if self.ctx.game_speed_override >= 0: + game_speed = self.ctx.game_speed_override + else: + game_speed = self.ctx.game_speed + await self.chat_send("?SetOptions {} {} {} {} {} {} {} {} {} {} {} {} {}".format( + difficulty, + self.ctx.generic_upgrade_research, + self.ctx.all_in_choice, + game_speed, + self.ctx.disable_forced_camera, + self.ctx.skip_cutscenes, + kerrigan_options, + self.ctx.grant_story_tech, + self.ctx.take_over_ai_allies, + soa_options, + self.ctx.mission_order, + 1 if self.ctx.nova_covert_ops_only else 0, + self.ctx.grant_story_levels + )) + await self.chat_send("?GiveResources {} {} {}".format( + start_items[SC2Race.ANY][0], + start_items[SC2Race.ANY][1], + start_items[SC2Race.ANY][2] + )) + await self.updateTerranTech(start_items) + await self.updateZergTech(start_items, kerrigan_level) + await self.updateProtossTech(start_items) + await self.updateColors() + await self.chat_send("?LoadFinished") + self.last_received_update = len(self.ctx.items_received) + + else: + if self.ctx.pending_color_update: + await self.updateColors() + + if not self.ctx.announcements.empty(): + message = self.ctx.announcements.get(timeout=1) + await self.chat_send("?SendMessage " + message) + self.ctx.announcements.task_done() + + # Archipelago reads the health + controller1_state = 0 + controller2_state = 0 + for unit in self.all_own_units(): + if unit.health_max == CONTROLLER_HEALTH: + controller1_state = int(CONTROLLER_HEALTH - unit.health) + self.can_read_game = True + elif unit.health_max == CONTROLLER2_HEALTH: + controller2_state = int(CONTROLLER2_HEALTH - unit.health) + self.can_read_game = True + game_state = controller1_state + (controller2_state << 15) + + if iteration == 160 and not game_state & 1: + await self.chat_send("?SendMessage Warning: Archipelago unable to connect or has lost connection to " + + "Starcraft 2 (This is likely a map issue)") + + if self.last_received_update < len(self.ctx.items_received): + current_items = calculate_items(self.ctx) + missions_beaten = self.missions_beaten_count() + kerrigan_level = get_kerrigan_level(self.ctx, current_items, missions_beaten) + await self.updateTerranTech(current_items) + await self.updateZergTech(current_items, kerrigan_level) + await self.updateProtossTech(current_items) + self.last_received_update = len(self.ctx.items_received) + + if game_state & 1: + if not self.game_running: + print("Archipelago Connected") + self.game_running = True + + if self.can_read_game: + if game_state & (1 << 1) and not self.mission_completed: + if self.mission_id != self.ctx.final_mission: + print("Mission Completed") + await self.ctx.send_msgs( + [{"cmd": 'LocationChecks', + "locations": [get_location_offset(self.mission_id) + VICTORY_MODULO * self.mission_id]}]) + self.mission_completed = True + else: + print("Game Complete") + await self.ctx.send_msgs([{"cmd": 'StatusUpdate', "status": ClientStatus.CLIENT_GOAL}]) + self.mission_completed = True + + for x, completed in enumerate(self.boni): + if not completed and game_state & (1 << (x + 2)): + await self.ctx.send_msgs( + [{"cmd": 'LocationChecks', + "locations": [get_location_offset(self.mission_id) + VICTORY_MODULO * self.mission_id + x + 1]}]) + self.boni[x] = True + else: + await self.chat_send("?SendMessage LostConnection - Lost connection to game.") + + def missions_beaten_count(self): + return len([location for location in self.ctx.checked_locations if location % VICTORY_MODULO == 0]) + + async def updateColors(self): + await self.chat_send("?SetColor rr " + str(self.ctx.player_color_raynor)) + await self.chat_send("?SetColor ks " + str(self.ctx.player_color_zerg)) + await self.chat_send("?SetColor pz " + str(self.ctx.player_color_zerg_primal)) + await self.chat_send("?SetColor da " + str(self.ctx.player_color_protoss)) + await self.chat_send("?SetColor nova " + str(self.ctx.player_color_nova)) + self.ctx.pending_color_update = False + + async def updateTerranTech(self, current_items): + terran_items = current_items[SC2Race.TERRAN] + await self.chat_send("?GiveTerranTech {} {} {} {} {} {} {} {} {} {} {} {} {} {}".format( + terran_items[0], terran_items[1], terran_items[2], terran_items[3], terran_items[4], + terran_items[5], terran_items[6], terran_items[7], terran_items[8], terran_items[9], terran_items[10], + terran_items[11], terran_items[12], terran_items[13])) + + async def updateZergTech(self, current_items, kerrigan_level): + zerg_items = current_items[SC2Race.ZERG] + kerrigan_primal_by_items = kerrigan_primal(self.ctx, current_items) + kerrigan_primal_bot_value = 1 if kerrigan_primal_by_items else 0 + await self.chat_send("?GiveZergTech {} {} {} {} {} {} {} {} {} {} {} {}".format( + kerrigan_level, kerrigan_primal_bot_value, zerg_items[0], zerg_items[1], zerg_items[2], + zerg_items[3], zerg_items[4], zerg_items[5], zerg_items[6], zerg_items[9], zerg_items[10], zerg_items[11] + )) + + async def updateProtossTech(self, current_items): + protoss_items = current_items[SC2Race.PROTOSS] + await self.chat_send("?GiveProtossTech {} {} {} {} {} {} {} {} {} {}".format( + protoss_items[0], protoss_items[1], protoss_items[2], protoss_items[3], protoss_items[4], + protoss_items[5], protoss_items[6], protoss_items[7], protoss_items[8], protoss_items[9] + )) + + +def request_unfinished_missions(ctx: SC2Context) -> None: + if ctx.mission_req_table: + message = "Unfinished Missions: " + unlocks = initialize_blank_mission_dict(ctx.mission_req_table) + unfinished_locations: typing.Dict[SC2Mission, typing.List[str]] = {} + + _, unfinished_missions = calc_unfinished_missions(ctx, unlocks=unlocks) + + for mission in unfinished_missions: + objectives = set(ctx.locations_for_mission(mission)) + if objectives: + remaining_objectives = objectives.difference(ctx.checked_locations) + unfinished_locations[mission] = [ctx.location_names[location_id] for location_id in remaining_objectives] + else: + unfinished_locations[mission] = [] + + # Removing All-In from location pool + final_mission = lookup_id_to_mission[ctx.final_mission] + if final_mission in unfinished_missions.keys(): + message = f"Final Mission Available: {final_mission}[{ctx.final_mission}]\n" + message + if unfinished_missions[final_mission] == -1: + unfinished_missions.pop(final_mission) + + message += ", ".join(f"{mark_up_mission_name(ctx, mission, unlocks)}[{ctx.mission_req_table[ctx.find_campaign(mission)][mission].mission.id}] " + + mark_up_objectives( + f"[{len(unfinished_missions[mission])}/" + f"{sum(1 for _ in ctx.locations_for_mission(mission))}]", + ctx, unfinished_locations, mission) + for mission in unfinished_missions) + + if ctx.ui: + ctx.ui.log_panels['All'].on_message_markup(message) + ctx.ui.log_panels['Starcraft2'].on_message_markup(message) + else: + sc2_logger.info(message) + else: + sc2_logger.warning("No mission table found, you are likely not connected to a server.") + + +def calc_unfinished_missions(ctx: SC2Context, unlocks: typing.Optional[typing.Dict] = None): + unfinished_missions: typing.List[str] = [] + locations_completed: typing.List[typing.Union[typing.Set[int], typing.Literal[-1]]] = [] + + if not unlocks: + unlocks = initialize_blank_mission_dict(ctx.mission_req_table) + + available_missions = calc_available_missions(ctx, unlocks) + + for name in available_missions: + objectives = set(ctx.locations_for_mission(name)) + if objectives: + objectives_completed = ctx.checked_locations & objectives + if len(objectives_completed) < len(objectives): + unfinished_missions.append(name) + locations_completed.append(objectives_completed) + + else: # infer that this is the final mission as it has no objectives + unfinished_missions.append(name) + locations_completed.append(-1) + + return available_missions, dict(zip(unfinished_missions, locations_completed)) + + +def is_mission_available(ctx: SC2Context, mission_id_to_check: int) -> bool: + unfinished_missions = calc_available_missions(ctx) + + return any(mission_id_to_check == ctx.mission_req_table[ctx.find_campaign(mission)][mission].mission.id for mission in unfinished_missions) + + +def mark_up_mission_name(ctx: SC2Context, mission_name: str, unlock_table: typing.Dict) -> str: + """Checks if the mission is required for game completion and adds '*' to the name to mark that.""" + + campaign = ctx.find_campaign(mission_name) + mission_info = ctx.mission_req_table[campaign][mission_name] + if mission_info.completion_critical: + if ctx.ui: + message = "[color=AF99EF]" + mission_name + "[/color]" + else: + message = "*" + mission_name + "*" + else: + message = mission_name + + if ctx.ui: + campaign_missions = list(ctx.mission_req_table[campaign].keys()) + unlocks: typing.List[str] + index = campaign_missions.index(mission_name) + if index in unlock_table[campaign]: + unlocks = unlock_table[campaign][index] + else: + unlocks = [] + + if len(unlocks) > 0: + pre_message = f"[ref={mission_info.mission.id}|Unlocks: " + pre_message += ", ".join(f"{unlock}({ctx.mission_req_table[ctx.find_campaign(unlock)][unlock].mission.id})" for unlock in unlocks) + pre_message += f"]" + message = pre_message + message + "[/ref]" + + return message + + +def mark_up_objectives(message, ctx, unfinished_locations, mission): + formatted_message = message + + if ctx.ui: + locations = unfinished_locations[mission] + campaign = ctx.find_campaign(mission) + + pre_message = f"[ref={list(ctx.mission_req_table[campaign]).index(mission) + 30}|" + pre_message += "
".join(location for location in locations) + pre_message += f"]" + formatted_message = pre_message + message + "[/ref]" + + return formatted_message + + +def request_available_missions(ctx: SC2Context): + if ctx.mission_req_table: + message = "Available Missions: " + + # Initialize mission unlock table + unlocks = initialize_blank_mission_dict(ctx.mission_req_table) + + missions = calc_available_missions(ctx, unlocks) + message += \ + ", ".join(f"{mark_up_mission_name(ctx, mission, unlocks)}" + f"[{ctx.mission_req_table[ctx.find_campaign(mission)][mission].mission.id}]" + for mission in missions) + + if ctx.ui: + ctx.ui.log_panels['All'].on_message_markup(message) + ctx.ui.log_panels['Starcraft2'].on_message_markup(message) + else: + sc2_logger.info(message) + else: + sc2_logger.warning("No mission table found, you are likely not connected to a server.") + + +def calc_available_missions(ctx: SC2Context, unlocks: typing.Optional[dict] = None) -> typing.List[str]: + available_missions: typing.List[str] = [] + missions_complete = 0 + + # Get number of missions completed + for loc in ctx.checked_locations: + if loc % VICTORY_MODULO == 0: + missions_complete += 1 + + for campaign in ctx.mission_req_table: + # Go through the required missions for each mission and fill up unlock table used later for hover-over tooltips + for mission_name in ctx.mission_req_table[campaign]: + if unlocks: + for unlock in ctx.mission_req_table[campaign][mission_name].required_world: + parsed_unlock = parse_unlock(unlock) + # TODO prophecy-only wants to connect to WoL here + index = parsed_unlock.connect_to - 1 + unlock_mission = list(ctx.mission_req_table[parsed_unlock.campaign])[index] + unlock_campaign = ctx.find_campaign(unlock_mission) + if unlock_campaign in unlocks: + if index not in unlocks[unlock_campaign]: + unlocks[unlock_campaign][index] = list() + unlocks[unlock_campaign][index].append(mission_name) + + if mission_reqs_completed(ctx, mission_name, missions_complete): + available_missions.append(mission_name) + + return available_missions + + +def parse_unlock(unlock: typing.Union[typing.Dict[typing.Literal["connect_to", "campaign"], int], MissionConnection, int]) -> MissionConnection: + if isinstance(unlock, int): + # Legacy + return MissionConnection(unlock) + elif isinstance(unlock, MissionConnection): + return unlock + else: + # Multi-campaign + return MissionConnection(unlock["connect_to"], lookup_id_to_campaign[unlock["campaign"]]) + + +def mission_reqs_completed(ctx: SC2Context, mission_name: str, missions_complete: int) -> bool: + """Returns a bool signifying if the mission has all requirements complete and can be done + + Arguments: + ctx -- instance of SC2Context + locations_to_check -- the mission string name to check + missions_complete -- an int of how many missions have been completed + mission_path -- a list of missions that have already been checked + """ + campaign = ctx.find_campaign(mission_name) + + if len(ctx.mission_req_table[campaign][mission_name].required_world) >= 1: + # A check for when the requirements are being or'd + or_success = False + + # Loop through required missions + for req_mission in ctx.mission_req_table[campaign][mission_name].required_world: + req_success = True + parsed_req_mission = parse_unlock(req_mission) + + # Check if required mission has been completed + mission_id = ctx.mission_req_table[parsed_req_mission.campaign][ + list(ctx.mission_req_table[parsed_req_mission.campaign])[parsed_req_mission.connect_to - 1]].mission.id + if not (mission_id * VICTORY_MODULO + get_location_offset(mission_id)) in ctx.checked_locations: + if not ctx.mission_req_table[campaign][mission_name].or_requirements: + return False + else: + req_success = False + + # Grid-specific logic (to avoid long path checks and infinite recursion) + if ctx.mission_order in (MissionOrder.option_grid, MissionOrder.option_mini_grid, MissionOrder.option_medium_grid): + if req_success: + return True + else: + if parsed_req_mission == ctx.mission_req_table[campaign][mission_name].required_world[-1]: + return False + else: + continue + + # Recursively check required mission to see if it's requirements are met, in case !collect has been done + # Skipping recursive check on Grid settings to speed up checks and avoid infinite recursion + if not mission_reqs_completed(ctx, list(ctx.mission_req_table[parsed_req_mission.campaign])[parsed_req_mission.connect_to - 1], missions_complete): + if not ctx.mission_req_table[campaign][mission_name].or_requirements: + return False + else: + req_success = False + + # If requirement check succeeded mark or as satisfied + if ctx.mission_req_table[campaign][mission_name].or_requirements and req_success: + or_success = True + + if ctx.mission_req_table[campaign][mission_name].or_requirements: + # Return false if or requirements not met + if not or_success: + return False + + # Check number of missions + if missions_complete >= ctx.mission_req_table[campaign][mission_name].number: + return True + else: + return False + else: + return True + + +def initialize_blank_mission_dict(location_table: typing.Dict[SC2Campaign, typing.Dict[str, MissionInfo]]): + unlocks: typing.Dict[SC2Campaign, typing.Dict] = {} + + for mission in list(location_table): + unlocks[mission] = {} + + return unlocks + + +def check_game_install_path() -> bool: + # First thing: go to the default location for ExecuteInfo. + # An exception for Windows is included because it's very difficult to find ~\Documents if the user moved it. + if is_windows: + # The next five lines of utterly inscrutable code are brought to you by copy-paste from Stack Overflow. + # https://stackoverflow.com/questions/6227590/finding-the-users-my-documents-path/30924555# + import ctypes.wintypes + CSIDL_PERSONAL = 5 # My Documents + SHGFP_TYPE_CURRENT = 0 # Get current, not default value + + buf = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH) + ctypes.windll.shell32.SHGetFolderPathW(None, CSIDL_PERSONAL, None, SHGFP_TYPE_CURRENT, buf) + documentspath: str = buf.value + einfo = str(documentspath / Path("StarCraft II\\ExecuteInfo.txt")) + else: + einfo = str(bot.paths.get_home() / Path(bot.paths.USERPATH[bot.paths.PF])) + + # Check if the file exists. + if os.path.isfile(einfo): + + # Open the file and read it, picking out the latest executable's path. + with open(einfo) as f: + content = f.read() + if content: + search_result = re.search(r" = (.*)Versions", content) + if not search_result: + sc2_logger.warning(f"Found {einfo}, but it was empty. Run SC2 through the Blizzard launcher, " + "then try again.") + return False + base = search_result.group(1) + + if os.path.exists(base): + executable = bot.paths.latest_executeble(Path(base).expanduser() / "Versions") + + # Finally, check the path for an actual executable. + # If we find one, great. Set up the SC2PATH. + if os.path.isfile(executable): + sc2_logger.info(f"Found an SC2 install at {base}!") + sc2_logger.debug(f"Latest executable at {executable}.") + os.environ["SC2PATH"] = base + sc2_logger.debug(f"SC2PATH set to {base}.") + return True + else: + sc2_logger.warning(f"We may have found an SC2 install at {base}, but couldn't find {executable}.") + else: + sc2_logger.warning(f"{einfo} pointed to {base}, but we could not find an SC2 install there.") + else: + sc2_logger.warning(f"Couldn't find {einfo}. Run SC2 through the Blizzard launcher, then try again. " + f"If that fails, please run /set_path with your SC2 install directory.") + return False + + +def is_mod_installed_correctly() -> bool: + """Searches for all required files.""" + if "SC2PATH" not in os.environ: + check_game_install_path() + sc2_path: str = os.environ["SC2PATH"] + mapdir = sc2_path / Path('Maps/ArchipelagoCampaign') + mods = ["ArchipelagoCore", "ArchipelagoPlayer", "ArchipelagoPlayerSuper", "ArchipelagoPatches", + "ArchipelagoTriggers", "ArchipelagoPlayerWoL", "ArchipelagoPlayerHotS", + "ArchipelagoPlayerLotV", "ArchipelagoPlayerLotVPrologue", "ArchipelagoPlayerNCO"] + modfiles = [sc2_path / Path("Mods/" + mod + ".SC2Mod") for mod in mods] + wol_required_maps: typing.List[str] = ["WoL" + os.sep + mission.map_file + ".SC2Map" for mission in SC2Mission + if mission.campaign in (SC2Campaign.WOL, SC2Campaign.PROPHECY)] + hots_required_maps: typing.List[str] = ["HotS" + os.sep + mission.map_file + ".SC2Map" for mission in campaign_mission_table[SC2Campaign.HOTS]] + lotv_required_maps: typing.List[str] = ["LotV" + os.sep + mission.map_file + ".SC2Map" for mission in SC2Mission + if mission.campaign in (SC2Campaign.LOTV, SC2Campaign.PROLOGUE, SC2Campaign.EPILOGUE)] + nco_required_maps: typing.List[str] = ["NCO" + os.sep + mission.map_file + ".SC2Map" for mission in campaign_mission_table[SC2Campaign.NCO]] + required_maps = wol_required_maps + hots_required_maps + lotv_required_maps + nco_required_maps + needs_files = False + + # Check for maps. + missing_maps: typing.List[str] = [] + for mapfile in required_maps: + if not os.path.isfile(mapdir / mapfile): + missing_maps.append(mapfile) + if len(missing_maps) >= 19: + sc2_logger.warning(f"All map files missing from {mapdir}.") + needs_files = True + elif len(missing_maps) > 0: + for map in missing_maps: + sc2_logger.debug(f"Missing {map} from {mapdir}.") + sc2_logger.warning(f"Missing {len(missing_maps)} map files.") + needs_files = True + else: # Must be no maps missing + sc2_logger.info(f"All maps found in {mapdir}.") + + # Check for mods. + for modfile in modfiles: + if os.path.isfile(modfile) or os.path.isdir(modfile): + sc2_logger.info(f"Archipelago mod found at {modfile}.") + else: + sc2_logger.warning(f"Archipelago mod could not be found at {modfile}.") + needs_files = True + + # Final verdict. + if needs_files: + sc2_logger.warning(f"Required files are missing. Run /download_data to acquire them.") + return False + else: + sc2_logger.debug(f"All map/mod files are properly installed.") + return True + + +class DllDirectory: + # Credit to Black Sliver for this code. + # More info: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setdlldirectoryw + _old: typing.Optional[str] = None + _new: typing.Optional[str] = None + + def __init__(self, new: typing.Optional[str]): + self._new = new + + def __enter__(self): + old = self.get() + if self.set(self._new): + self._old = old + + def __exit__(self, *args): + if self._old is not None: + self.set(self._old) + + @staticmethod + def get() -> typing.Optional[str]: + if sys.platform == "win32": + n = ctypes.windll.kernel32.GetDllDirectoryW(0, None) + buf = ctypes.create_unicode_buffer(n) + ctypes.windll.kernel32.GetDllDirectoryW(n, buf) + return buf.value + # NOTE: other OS may support os.environ["LD_LIBRARY_PATH"], but this fix is windows-specific + return None + + @staticmethod + def set(s: typing.Optional[str]) -> bool: + if sys.platform == "win32": + return ctypes.windll.kernel32.SetDllDirectoryW(s) != 0 + # NOTE: other OS may support os.environ["LD_LIBRARY_PATH"], but this fix is windows-specific + return False + + +def download_latest_release_zip( + owner: str, + repo: str, + api_version: str, + metadata: typing.Optional[str] = None, + force_download=False +) -> typing.Tuple[str, typing.Optional[str]]: + """Downloads the latest release of a GitHub repo to the current directory as a .zip file.""" + import requests + + headers = {"Accept": 'application/vnd.github.v3+json'} + url = f"https://api.github.com/repos/{owner}/{repo}/releases/tags/{api_version}" + + r1 = requests.get(url, headers=headers) + if r1.status_code == 200: + latest_metadata = r1.json() + cleanup_downloaded_metadata(latest_metadata) + latest_metadata = str(latest_metadata) + # sc2_logger.info(f"Latest version: {latest_metadata}.") + else: + sc2_logger.warning(f"Status code: {r1.status_code}") + sc2_logger.warning(f"Failed to reach GitHub. Could not find download link.") + sc2_logger.warning(f"text: {r1.text}") + return "", metadata + + if (force_download is False) and (metadata == latest_metadata): + sc2_logger.info("Latest version already installed.") + return "", metadata + + sc2_logger.info(f"Attempting to download latest version of API version {api_version} of {repo}.") + download_url = r1.json()["assets"][0]["browser_download_url"] + + r2 = requests.get(download_url, headers=headers) + if r2.status_code == 200 and zipfile.is_zipfile(io.BytesIO(r2.content)): + tempdir = tempfile.gettempdir() + file = tempdir + os.sep + f"{repo}.zip" + with open(file, "wb") as fh: + fh.write(r2.content) + sc2_logger.info(f"Successfully downloaded {repo}.zip.") + return file, latest_metadata + else: + sc2_logger.warning(f"Status code: {r2.status_code}") + sc2_logger.warning("Download failed.") + sc2_logger.warning(f"text: {r2.text}") + return "", metadata + + +def cleanup_downloaded_metadata(medatada_json: dict) -> None: + for asset in medatada_json['assets']: + del asset['download_count'] + + +def is_mod_update_available(owner: str, repo: str, api_version: str, metadata: str) -> bool: + import requests + + headers = {"Accept": 'application/vnd.github.v3+json'} + url = f"https://api.github.com/repos/{owner}/{repo}/releases/tags/{api_version}" + + r1 = requests.get(url, headers=headers) + if r1.status_code == 200: + latest_metadata = r1.json() + cleanup_downloaded_metadata(latest_metadata) + latest_metadata = str(latest_metadata) + if metadata != latest_metadata: + return True + else: + return False + + else: + sc2_logger.warning(f"Failed to reach GitHub while checking for updates.") + sc2_logger.warning(f"Status code: {r1.status_code}") + sc2_logger.warning(f"text: {r1.text}") + return False + + +def get_location_offset(mission_id): + return SC2WOL_LOC_ID_OFFSET if mission_id <= SC2Mission.ALL_IN.id \ + else (SC2HOTS_LOC_ID_OFFSET - SC2Mission.ALL_IN.id * VICTORY_MODULO) + + +def launch(): + colorama.init() + asyncio.run(main()) + colorama.deinit() diff --git a/worlds/sc2/ClientGui.py b/worlds/sc2/ClientGui.py new file mode 100644 index 000000000000..167583fd1ecb --- /dev/null +++ b/worlds/sc2/ClientGui.py @@ -0,0 +1,304 @@ +from typing import * +import asyncio + +from kvui import GameManager, HoverBehavior, ServerToolTip +from kivy.app import App +from kivy.clock import Clock +from kivy.uix.tabbedpanel import TabbedPanelItem +from kivy.uix.gridlayout import GridLayout +from kivy.lang import Builder +from kivy.uix.label import Label +from kivy.uix.button import Button +from kivy.uix.floatlayout import FloatLayout +from kivy.uix.scrollview import ScrollView +from kivy.properties import StringProperty + +from worlds.sc2.Client import SC2Context, calc_unfinished_missions, parse_unlock +from worlds.sc2.MissionTables import lookup_id_to_mission, lookup_name_to_mission, campaign_race_exceptions, \ + SC2Mission, SC2Race, SC2Campaign +from worlds.sc2.Locations import LocationType, lookup_location_id_to_type +from worlds.sc2.Options import LocationInclusion +from worlds.sc2 import SC2World, get_first_mission + + +class HoverableButton(HoverBehavior, Button): + pass + + +class MissionButton(HoverableButton): + tooltip_text = StringProperty("Test") + + def __init__(self, *args, **kwargs): + super(HoverableButton, self).__init__(*args, **kwargs) + self.layout = FloatLayout() + self.popuplabel = ServerToolTip(text=self.text, markup=True) + self.popuplabel.padding = [5, 2, 5, 2] + self.layout.add_widget(self.popuplabel) + + def on_enter(self): + self.popuplabel.text = self.tooltip_text + + if self.ctx.current_tooltip: + App.get_running_app().root.remove_widget(self.ctx.current_tooltip) + + if self.tooltip_text == "": + self.ctx.current_tooltip = None + else: + App.get_running_app().root.add_widget(self.layout) + self.ctx.current_tooltip = self.layout + + def on_leave(self): + self.ctx.ui.clear_tooltip() + + @property + def ctx(self) -> SC2Context: + return App.get_running_app().ctx + +class CampaignScroll(ScrollView): + pass + +class MultiCampaignLayout(GridLayout): + pass + +class CampaignLayout(GridLayout): + pass + +class MissionLayout(GridLayout): + pass + +class MissionCategory(GridLayout): + pass + +class SC2Manager(GameManager): + logging_pairs = [ + ("Client", "Archipelago"), + ("Starcraft2", "Starcraft2"), + ] + base_title = "Archipelago Starcraft 2 Client" + + campaign_panel: Optional[CampaignLayout] = None + last_checked_locations: Set[int] = set() + mission_id_to_button: Dict[int, MissionButton] = {} + launching: Union[bool, int] = False # if int -> mission ID + refresh_from_launching = True + first_check = True + first_mission = "" + ctx: SC2Context + + def __init__(self, ctx) -> None: + super().__init__(ctx) + + def clear_tooltip(self) -> None: + if self.ctx.current_tooltip: + App.get_running_app().root.remove_widget(self.ctx.current_tooltip) + + self.ctx.current_tooltip = None + + def build(self): + container = super().build() + + panel = TabbedPanelItem(text="Starcraft 2 Launcher") + panel.content = CampaignScroll() + self.campaign_panel = MultiCampaignLayout() + panel.content.add_widget(self.campaign_panel) + + self.tabs.add_widget(panel) + + Clock.schedule_interval(self.build_mission_table, 0.5) + + return container + + def build_mission_table(self, dt) -> None: + if (not self.launching and (not self.last_checked_locations == self.ctx.checked_locations or + not self.refresh_from_launching)) or self.first_check: + assert self.campaign_panel is not None + self.refresh_from_launching = True + + self.campaign_panel.clear_widgets() + if self.ctx.mission_req_table: + self.last_checked_locations = self.ctx.checked_locations.copy() + self.first_check = False + self.first_mission = get_first_mission(self.ctx.mission_req_table) + + self.mission_id_to_button = {} + + available_missions, unfinished_missions = calc_unfinished_missions(self.ctx) + + multi_campaign_layout_height = 0 + + for campaign, missions in sorted(self.ctx.mission_req_table.items(), key=lambda item: item[0].id): + categories: Dict[str, List[str]] = {} + + # separate missions into categories + for mission_index in missions: + mission_info = self.ctx.mission_req_table[campaign][mission_index] + if mission_info.category not in categories: + categories[mission_info.category] = [] + + categories[mission_info.category].append(mission_index) + + max_mission_count = max(len(categories[category]) for category in categories) + if max_mission_count == 1: + campaign_layout_height = 115 + else: + campaign_layout_height = (max_mission_count + 2) * 50 + multi_campaign_layout_height += campaign_layout_height + campaign_layout = CampaignLayout(size_hint_y=None, height=campaign_layout_height) + if campaign != SC2Campaign.GLOBAL: + campaign_layout.add_widget( + Label(text=campaign.campaign_name, size_hint_y=None, height=25, outline_width=1) + ) + mission_layout = MissionLayout() + + for category in categories: + category_name_height = 0 + category_spacing = 3 + if category.startswith('_'): + category_display_name = '' + else: + category_display_name = category + category_name_height += 25 + category_spacing = 10 + category_panel = MissionCategory(padding=[category_spacing,6,category_spacing,6]) + category_panel.add_widget( + Label(text=category_display_name, size_hint_y=None, height=category_name_height, outline_width=1)) + + for mission in categories[category]: + text: str = mission + tooltip: str = "" + mission_obj: SC2Mission = lookup_name_to_mission[mission] + mission_id: int = mission_obj.id + mission_data = self.ctx.mission_req_table[campaign][mission] + remaining_locations, plando_locations, remaining_count = self.sort_unfinished_locations(mission) + # Map has uncollected locations + if mission in unfinished_missions: + if self.any_valuable_locations(remaining_locations): + text = f"[color=6495ED]{text}[/color]" + else: + text = f"[color=A0BEF4]{text}[/color]" + elif mission in available_missions: + text = f"[color=FFFFFF]{text}[/color]" + # Map requirements not met + else: + text = f"[color=a9a9a9]{text}[/color]" + tooltip = f"Requires: " + if mission_data.required_world: + tooltip += ", ".join(list(self.ctx.mission_req_table[parse_unlock(req_mission).campaign])[parse_unlock(req_mission).connect_to - 1] for + req_mission in + mission_data.required_world) + + if mission_data.number: + tooltip += " and " + if mission_data.number: + tooltip += f"{self.ctx.mission_req_table[campaign][mission].number} missions completed" + + if mission_id == self.ctx.final_mission: + if mission in available_missions: + text = f"[color=FFBC95]{mission}[/color]" + else: + text = f"[color=D0C0BE]{mission}[/color]" + if tooltip: + tooltip += "\n" + tooltip += "Final Mission" + + if remaining_count > 0: + if tooltip: + tooltip += "\n\n" + tooltip += f"-- Uncollected locations --" + for loctype in LocationType: + if len(remaining_locations[loctype]) > 0: + if loctype == LocationType.VICTORY: + tooltip += f"\n- {remaining_locations[loctype][0]}" + else: + tooltip += f"\n{self.get_location_type_title(loctype)}:\n- " + tooltip += "\n- ".join(remaining_locations[loctype]) + if len(plando_locations) > 0: + tooltip += f"\nPlando:\n- " + tooltip += "\n- ".join(plando_locations) + + MISSION_BUTTON_HEIGHT = 50 + for pad in range(mission_data.ui_vertical_padding): + column_spacer = Label(text='', size_hint_y=None, height=MISSION_BUTTON_HEIGHT) + category_panel.add_widget(column_spacer) + mission_button = MissionButton(text=text, size_hint_y=None, height=MISSION_BUTTON_HEIGHT) + mission_race = mission_obj.race + if mission_race == SC2Race.ANY: + mission_race = mission_obj.campaign.race + race = campaign_race_exceptions.get(mission_obj, mission_race) + racial_colors = { + SC2Race.TERRAN: (0.24, 0.84, 0.68), + SC2Race.ZERG: (1, 0.65, 0.37), + SC2Race.PROTOSS: (0.55, 0.7, 1) + } + if race in racial_colors: + mission_button.background_color = racial_colors[race] + mission_button.tooltip_text = tooltip + mission_button.bind(on_press=self.mission_callback) + self.mission_id_to_button[mission_id] = mission_button + category_panel.add_widget(mission_button) + + category_panel.add_widget(Label(text="")) + mission_layout.add_widget(category_panel) + campaign_layout.add_widget(mission_layout) + self.campaign_panel.add_widget(campaign_layout) + self.campaign_panel.height = multi_campaign_layout_height + + elif self.launching: + assert self.campaign_panel is not None + self.refresh_from_launching = False + + self.campaign_panel.clear_widgets() + self.campaign_panel.add_widget(Label(text="Launching Mission: " + + lookup_id_to_mission[self.launching].mission_name)) + if self.ctx.ui: + self.ctx.ui.clear_tooltip() + + def mission_callback(self, button: MissionButton) -> None: + if not self.launching: + mission_id: int = next(k for k, v in self.mission_id_to_button.items() if v == button) + if self.ctx.play_mission(mission_id): + self.launching = mission_id + Clock.schedule_once(self.finish_launching, 10) + + def finish_launching(self, dt): + self.launching = False + + def sort_unfinished_locations(self, mission_name: str) -> Tuple[Dict[LocationType, List[str]], List[str], int]: + locations: Dict[LocationType, List[str]] = {loctype: [] for loctype in LocationType} + count = 0 + for loc in self.ctx.locations_for_mission(mission_name): + if loc in self.ctx.missing_locations: + count += 1 + locations[lookup_location_id_to_type[loc]].append(self.ctx.location_names[loc]) + + plando_locations = [] + for plando_loc in self.ctx.plando_locations: + for loctype in LocationType: + if plando_loc in locations[loctype]: + locations[loctype].remove(plando_loc) + plando_locations.append(plando_loc) + + return locations, plando_locations, count + + def any_valuable_locations(self, locations: Dict[LocationType, List[str]]) -> bool: + for loctype in LocationType: + if len(locations[loctype]) > 0 and self.ctx.location_inclusions[loctype] == LocationInclusion.option_enabled: + return True + return False + + def get_location_type_title(self, location_type: LocationType) -> str: + title = location_type.name.title().replace("_", " ") + if self.ctx.location_inclusions[location_type] == LocationInclusion.option_disabled: + title += " (Nothing)" + elif self.ctx.location_inclusions[location_type] == LocationInclusion.option_resources: + title += " (Resources)" + else: + title += "" + return title + +def start_gui(context: SC2Context): + context.ui = SC2Manager(context) + context.ui_task = asyncio.create_task(context.ui.async_run(), name="UI") + import pkgutil + data = pkgutil.get_data(SC2World.__module__, "Starcraft2.kv").decode() + Builder.load_string(data) diff --git a/worlds/sc2/ItemGroups.py b/worlds/sc2/ItemGroups.py new file mode 100644 index 000000000000..a77fb920f64d --- /dev/null +++ b/worlds/sc2/ItemGroups.py @@ -0,0 +1,100 @@ +import typing +from . import Items, ItemNames +from .MissionTables import campaign_mission_table, SC2Campaign, SC2Mission + +""" +Item name groups, given to Archipelago and used in YAMLs and /received filtering. +For non-developers the following will be useful: +* Items with a bracket get groups named after the unbracketed part + * eg. "Advanced Healing AI (Medivac)" is accessible as "Advanced Healing AI" + * The exception to this are item names that would be ambiguous (eg. "Resource Efficiency") +* Item flaggroups get unique groups as well as combined groups for numbered flaggroups + * eg. "Unit" contains all units, "Armory" contains "Armory 1" through "Armory 6" + * The best place to look these up is at the bottom of Items.py +* Items that have a parent are grouped together + * eg. "Zergling Items" contains all items that have "Zergling" as a parent + * These groups do NOT contain the parent item + * This currently does not include items with multiple potential parents, like some LotV unit upgrades +* All items are grouped by their race ("Terran", "Protoss", "Zerg", "Any") +* Hand-crafted item groups can be found at the bottom of this file +""" + +item_name_groups: typing.Dict[str, typing.List[str]] = {} + +# Groups for use in world logic +item_name_groups["Missions"] = ["Beat " + mission.mission_name for mission in SC2Mission] +item_name_groups["WoL Missions"] = ["Beat " + mission.mission_name for mission in campaign_mission_table[SC2Campaign.WOL]] + \ + ["Beat " + mission.mission_name for mission in campaign_mission_table[SC2Campaign.PROPHECY]] + +# These item name groups should not show up in documentation +unlisted_item_name_groups = { + "Missions", "WoL Missions" +} + +# Some item names only differ in bracketed parts +# These items are ambiguous for short-hand name groups +bracketless_duplicates: typing.Set[str] +# This is a list of names in ItemNames with bracketed parts removed, for internal use +_shortened_names = [(name[:name.find(' (')] if '(' in name else name) + for name in [ItemNames.__dict__[name] for name in ItemNames.__dir__() if not name.startswith('_')]] +# Remove the first instance of every short-name from the full item list +bracketless_duplicates = set(_shortened_names) +for name in bracketless_duplicates: + _shortened_names.remove(name) +# The remaining short-names are the duplicates +bracketless_duplicates = set(_shortened_names) +del _shortened_names + +# All items get sorted into their data type +for item, data in Items.get_full_item_list().items(): + # Items get assigned to their flaggroup's type + item_name_groups.setdefault(data.type, []).append(item) + # Numbered flaggroups get sorted into an unnumbered group + # Currently supports numbers of one or two digits + if data.type[-2:].strip().isnumeric: + type_group = data.type[:-2].strip() + item_name_groups.setdefault(type_group, []).append(item) + # Flaggroups with numbers are unlisted + unlisted_item_name_groups.add(data.type) + # Items with a bracket get a short-hand name group for ease of use in YAMLs + if '(' in item: + short_name = item[:item.find(' (')] + # Ambiguous short-names are dropped + if short_name not in bracketless_duplicates: + item_name_groups[short_name] = [item] + # Short-name groups are unlisted + unlisted_item_name_groups.add(short_name) + # Items with a parent get assigned to their parent's group + if data.parent_item: + # The parent groups need a special name, otherwise they are ambiguous with the parent + parent_group = f"{data.parent_item} Items" + item_name_groups.setdefault(parent_group, []).append(item) + # Parent groups are unlisted + unlisted_item_name_groups.add(parent_group) + # All items get assigned to their race's group + race_group = data.race.name.capitalize() + item_name_groups.setdefault(race_group, []).append(item) + + +# Hand-made groups +item_name_groups["Aiur"] = [ + ItemNames.ZEALOT, ItemNames.DRAGOON, ItemNames.SENTRY, ItemNames.AVENGER, ItemNames.HIGH_TEMPLAR, + ItemNames.IMMORTAL, ItemNames.REAVER, + ItemNames.PHOENIX, ItemNames.SCOUT, ItemNames.ARBITER, ItemNames.CARRIER, +] +item_name_groups["Nerazim"] = [ + ItemNames.CENTURION, ItemNames.STALKER, ItemNames.DARK_TEMPLAR, ItemNames.SIGNIFIER, ItemNames.DARK_ARCHON, + ItemNames.ANNIHILATOR, + ItemNames.CORSAIR, ItemNames.ORACLE, ItemNames.VOID_RAY, +] +item_name_groups["Tal'Darim"] = [ + ItemNames.SUPPLICANT, ItemNames.SLAYER, ItemNames.HAVOC, ItemNames.BLOOD_HUNTER, ItemNames.ASCENDANT, + ItemNames.VANGUARD, ItemNames.WRATHWALKER, + ItemNames.DESTROYER, ItemNames.MOTHERSHIP, + ItemNames.WARP_PRISM_PHASE_BLASTER, +] +item_name_groups["Purifier"] = [ + ItemNames.SENTINEL, ItemNames.ADEPT, ItemNames.INSTIGATOR, ItemNames.ENERGIZER, + ItemNames.COLOSSUS, ItemNames.DISRUPTOR, + ItemNames.MIRAGE, ItemNames.TEMPEST, +] \ No newline at end of file diff --git a/worlds/sc2/ItemNames.py b/worlds/sc2/ItemNames.py new file mode 100644 index 000000000000..10c713910311 --- /dev/null +++ b/worlds/sc2/ItemNames.py @@ -0,0 +1,661 @@ +""" +A complete collection of Starcraft 2 item names as strings. +Users of this data may make some assumptions about the structure of a name: +* The upgrade for a unit will end with the unit's name in parentheses +* Weapon / armor upgrades may be grouped by a common prefix specified within this file +""" + +# Terran Units +MARINE = "Marine" +MEDIC = "Medic" +FIREBAT = "Firebat" +MARAUDER = "Marauder" +REAPER = "Reaper" +HELLION = "Hellion" +VULTURE = "Vulture" +GOLIATH = "Goliath" +DIAMONDBACK = "Diamondback" +SIEGE_TANK = "Siege Tank" +MEDIVAC = "Medivac" +WRAITH = "Wraith" +VIKING = "Viking" +BANSHEE = "Banshee" +BATTLECRUISER = "Battlecruiser" +GHOST = "Ghost" +SPECTRE = "Spectre" +THOR = "Thor" +RAVEN = "Raven" +SCIENCE_VESSEL = "Science Vessel" +PREDATOR = "Predator" +HERCULES = "Hercules" +# Extended units +LIBERATOR = "Liberator" +VALKYRIE = "Valkyrie" +WIDOW_MINE = "Widow Mine" +CYCLONE = "Cyclone" +HERC = "HERC" +WARHOUND = "Warhound" + +# Terran Buildings +BUNKER = "Bunker" +MISSILE_TURRET = "Missile Turret" +SENSOR_TOWER = "Sensor Tower" +PLANETARY_FORTRESS = "Planetary Fortress" +PERDITION_TURRET = "Perdition Turret" +HIVE_MIND_EMULATOR = "Hive Mind Emulator" +PSI_DISRUPTER = "Psi Disrupter" + +# Terran Weapon / Armor Upgrades +TERRAN_UPGRADE_PREFIX = "Progressive Terran" +TERRAN_INFANTRY_UPGRADE_PREFIX = f"{TERRAN_UPGRADE_PREFIX} Infantry" +TERRAN_VEHICLE_UPGRADE_PREFIX = f"{TERRAN_UPGRADE_PREFIX} Vehicle" +TERRAN_SHIP_UPGRADE_PREFIX = f"{TERRAN_UPGRADE_PREFIX} Ship" + +PROGRESSIVE_TERRAN_INFANTRY_WEAPON = f"{TERRAN_INFANTRY_UPGRADE_PREFIX} Weapon" +PROGRESSIVE_TERRAN_INFANTRY_ARMOR = f"{TERRAN_INFANTRY_UPGRADE_PREFIX} Armor" +PROGRESSIVE_TERRAN_VEHICLE_WEAPON = f"{TERRAN_VEHICLE_UPGRADE_PREFIX} Weapon" +PROGRESSIVE_TERRAN_VEHICLE_ARMOR = f"{TERRAN_VEHICLE_UPGRADE_PREFIX} Armor" +PROGRESSIVE_TERRAN_SHIP_WEAPON = f"{TERRAN_SHIP_UPGRADE_PREFIX} Weapon" +PROGRESSIVE_TERRAN_SHIP_ARMOR = f"{TERRAN_SHIP_UPGRADE_PREFIX} Armor" +PROGRESSIVE_TERRAN_WEAPON_UPGRADE = f"{TERRAN_UPGRADE_PREFIX} Weapon Upgrade" +PROGRESSIVE_TERRAN_ARMOR_UPGRADE = f"{TERRAN_UPGRADE_PREFIX} Armor Upgrade" +PROGRESSIVE_TERRAN_INFANTRY_UPGRADE = f"{TERRAN_INFANTRY_UPGRADE_PREFIX} Upgrade" +PROGRESSIVE_TERRAN_VEHICLE_UPGRADE = f"{TERRAN_VEHICLE_UPGRADE_PREFIX} Upgrade" +PROGRESSIVE_TERRAN_SHIP_UPGRADE = f"{TERRAN_SHIP_UPGRADE_PREFIX} Upgrade" +PROGRESSIVE_TERRAN_WEAPON_ARMOR_UPGRADE = f"{TERRAN_UPGRADE_PREFIX} Weapon/Armor Upgrade" + +# Mercenaries +WAR_PIGS = "War Pigs" +DEVIL_DOGS = "Devil Dogs" +HAMMER_SECURITIES = "Hammer Securities" +SPARTAN_COMPANY = "Spartan Company" +SIEGE_BREAKERS = "Siege Breakers" +HELS_ANGELS = "Hel's Angels" +DUSK_WINGS = "Dusk Wings" +JACKSONS_REVENGE = "Jackson's Revenge" +SKIBIS_ANGELS = "Skibi's Angels" +DEATH_HEADS = "Death Heads" +WINGED_NIGHTMARES = "Winged Nightmares" +MIDNIGHT_RIDERS = "Midnight Riders" +BRYNHILDS = "Brynhilds" +JOTUN = "Jotun" + +# Lab / Global +ULTRA_CAPACITORS = "Ultra-Capacitors" +VANADIUM_PLATING = "Vanadium Plating" +ORBITAL_DEPOTS = "Orbital Depots" +MICRO_FILTERING = "Micro-Filtering" +AUTOMATED_REFINERY = "Automated Refinery" +COMMAND_CENTER_REACTOR = "Command Center Reactor" +TECH_REACTOR = "Tech Reactor" +ORBITAL_STRIKE = "Orbital Strike" +CELLULAR_REACTOR = "Cellular Reactor" +PROGRESSIVE_REGENERATIVE_BIO_STEEL = "Progressive Regenerative Bio-Steel" +PROGRESSIVE_FIRE_SUPPRESSION_SYSTEM = "Progressive Fire-Suppression System" +PROGRESSIVE_ORBITAL_COMMAND = "Progressive Orbital Command" +STRUCTURE_ARMOR = "Structure Armor" +HI_SEC_AUTO_TRACKING = "Hi-Sec Auto Tracking" +ADVANCED_OPTICS = "Advanced Optics" +ROGUE_FORCES = "Rogue Forces" + +# Terran Unit Upgrades +BANSHEE_HYPERFLIGHT_ROTORS = "Hyperflight Rotors (Banshee)" +BANSHEE_INTERNAL_TECH_MODULE = "Internal Tech Module (Banshee)" +BANSHEE_LASER_TARGETING_SYSTEM = "Laser Targeting System (Banshee)" +BANSHEE_PROGRESSIVE_CROSS_SPECTRUM_DAMPENERS = "Progressive Cross-Spectrum Dampeners (Banshee)" +BANSHEE_SHOCKWAVE_MISSILE_BATTERY = "Shockwave Missile Battery (Banshee)" +BANSHEE_SHAPED_HULL = "Shaped Hull (Banshee)" +BANSHEE_ADVANCED_TARGETING_OPTICS = "Advanced Targeting Optics (Banshee)" +BANSHEE_DISTORTION_BLASTERS = "Distortion Blasters (Banshee)" +BANSHEE_ROCKET_BARRAGE = "Rocket Barrage (Banshee)" +BATTLECRUISER_ATX_LASER_BATTERY = "ATX Laser Battery (Battlecruiser)" +BATTLECRUISER_CLOAK = "Cloak (Battlecruiser)" +BATTLECRUISER_PROGRESSIVE_DEFENSIVE_MATRIX = "Progressive Defensive Matrix (Battlecruiser)" +BATTLECRUISER_INTERNAL_TECH_MODULE = "Internal Tech Module (Battlecruiser)" +BATTLECRUISER_PROGRESSIVE_MISSILE_PODS = "Progressive Missile Pods (Battlecruiser)" +BATTLECRUISER_OPTIMIZED_LOGISTICS = "Optimized Logistics (Battlecruiser)" +BATTLECRUISER_TACTICAL_JUMP = "Tactical Jump (Battlecruiser)" +BATTLECRUISER_BEHEMOTH_PLATING = "Behemoth Plating (Battlecruiser)" +BATTLECRUISER_COVERT_OPS_ENGINES = "Covert Ops Engines (Battlecruiser)" +BUNKER_NEOSTEEL_BUNKER = "Neosteel Bunker (Bunker)" +BUNKER_PROJECTILE_ACCELERATOR = "Projectile Accelerator (Bunker)" +BUNKER_SHRIKE_TURRET = "Shrike Turret (Bunker)" +BUNKER_FORTIFIED_BUNKER = "Fortified Bunker (Bunker)" +CYCLONE_MAG_FIELD_ACCELERATORS = "Mag-Field Accelerators (Cyclone)" +CYCLONE_MAG_FIELD_LAUNCHERS = "Mag-Field Launchers (Cyclone)" +CYCLONE_RAPID_FIRE_LAUNCHERS = "Rapid Fire Launchers (Cyclone)" +CYCLONE_TARGETING_OPTICS = "Targeting Optics (Cyclone)" +CYCLONE_RESOURCE_EFFICIENCY = "Resource Efficiency (Cyclone)" +CYCLONE_INTERNAL_TECH_MODULE = "Internal Tech Module (Cyclone)" +DIAMONDBACK_BURST_CAPACITORS = "Burst Capacitors (Diamondback)" +DIAMONDBACK_HYPERFLUXOR = "Hyperfluxor (Diamondback)" +DIAMONDBACK_RESOURCE_EFFICIENCY = "Resource Efficiency (Diamondback)" +DIAMONDBACK_SHAPED_HULL = "Shaped Hull (Diamondback)" +DIAMONDBACK_PROGRESSIVE_TRI_LITHIUM_POWER_CELL = "Progressive Tri-Lithium Power Cell (Diamondback)" +DIAMONDBACK_ION_THRUSTERS = "Ion Thrusters (Diamondback)" +FIREBAT_INCINERATOR_GAUNTLETS = "Incinerator Gauntlets (Firebat)" +FIREBAT_JUGGERNAUT_PLATING = "Juggernaut Plating (Firebat)" +FIREBAT_RESOURCE_EFFICIENCY = "Resource Efficiency (Firebat)" +FIREBAT_PROGRESSIVE_STIMPACK = "Progressive Stimpack (Firebat)" +FIREBAT_INFERNAL_PRE_IGNITER = "Infernal Pre-Igniter (Firebat)" +FIREBAT_KINETIC_FOAM = "Kinetic Foam (Firebat)" +FIREBAT_NANO_PROJECTORS = "Nano Projectors (Firebat)" +GHOST_CRIUS_SUIT = "Crius Suit (Ghost)" +GHOST_EMP_ROUNDS = "EMP Rounds (Ghost)" +GHOST_LOCKDOWN = "Lockdown (Ghost)" +GHOST_OCULAR_IMPLANTS = "Ocular Implants (Ghost)" +GHOST_RESOURCE_EFFICIENCY = "Resource Efficiency (Ghost)" +GOLIATH_ARES_CLASS_TARGETING_SYSTEM = "Ares-Class Targeting System (Goliath)" +GOLIATH_JUMP_JETS = "Jump Jets (Goliath)" +GOLIATH_MULTI_LOCK_WEAPONS_SYSTEM = "Multi-Lock Weapons System (Goliath)" +GOLIATH_OPTIMIZED_LOGISTICS = "Optimized Logistics (Goliath)" +GOLIATH_SHAPED_HULL = "Shaped Hull (Goliath)" +GOLIATH_RESOURCE_EFFICIENCY = "Resource Efficiency (Goliath)" +GOLIATH_INTERNAL_TECH_MODULE = "Internal Tech Module (Goliath)" +HELLION_HELLBAT_ASPECT = "Hellbat Aspect (Hellion)" +HELLION_JUMP_JETS = "Jump Jets (Hellion)" +HELLION_OPTIMIZED_LOGISTICS = "Optimized Logistics (Hellion)" +HELLION_PROGRESSIVE_STIMPACK = "Progressive Stimpack (Hellion)" +HELLION_SMART_SERVOS = "Smart Servos (Hellion)" +HELLION_THERMITE_FILAMENTS = "Thermite Filaments (Hellion)" +HELLION_TWIN_LINKED_FLAMETHROWER = "Twin-Linked Flamethrower (Hellion)" +HELLION_INFERNAL_PLATING = "Infernal Plating (Hellion)" +HERC_JUGGERNAUT_PLATING = "Juggernaut Plating (HERC)" +HERC_KINETIC_FOAM = "Kinetic Foam (HERC)" +HERC_RESOURCE_EFFICIENCY = "Resource Efficiency (HERC)" +HERCULES_INTERNAL_FUSION_MODULE = "Internal Fusion Module (Hercules)" +HERCULES_TACTICAL_JUMP = "Tactical Jump (Hercules)" +LIBERATOR_ADVANCED_BALLISTICS = "Advanced Ballistics (Liberator)" +LIBERATOR_CLOAK = "Cloak (Liberator)" +LIBERATOR_LASER_TARGETING_SYSTEM = "Laser Targeting System (Liberator)" +LIBERATOR_OPTIMIZED_LOGISTICS = "Optimized Logistics (Liberator)" +LIBERATOR_RAID_ARTILLERY = "Raid Artillery (Liberator)" +LIBERATOR_SMART_SERVOS = "Smart Servos (Liberator)" +LIBERATOR_RESOURCE_EFFICIENCY = "Resource Efficiency (Liberator)" +MARAUDER_CONCUSSIVE_SHELLS = "Concussive Shells (Marauder)" +MARAUDER_INTERNAL_TECH_MODULE = "Internal Tech Module (Marauder)" +MARAUDER_KINETIC_FOAM = "Kinetic Foam (Marauder)" +MARAUDER_LASER_TARGETING_SYSTEM = "Laser Targeting System (Marauder)" +MARAUDER_MAGRAIL_MUNITIONS = "Magrail Munitions (Marauder)" +MARAUDER_PROGRESSIVE_STIMPACK = "Progressive Stimpack (Marauder)" +MARAUDER_JUGGERNAUT_PLATING = "Juggernaut Plating (Marauder)" +MARINE_COMBAT_SHIELD = "Combat Shield (Marine)" +MARINE_LASER_TARGETING_SYSTEM = "Laser Targeting System (Marine)" +MARINE_MAGRAIL_MUNITIONS = "Magrail Munitions (Marine)" +MARINE_OPTIMIZED_LOGISTICS = "Optimized Logistics (Marine)" +MARINE_PROGRESSIVE_STIMPACK = "Progressive Stimpack (Marine)" +MEDIC_ADVANCED_MEDIC_FACILITIES = "Advanced Medic Facilities (Medic)" +MEDIC_OPTICAL_FLARE = "Optical Flare (Medic)" +MEDIC_RESOURCE_EFFICIENCY = "Resource Efficiency (Medic)" +MEDIC_RESTORATION = "Restoration (Medic)" +MEDIC_STABILIZER_MEDPACKS = "Stabilizer Medpacks (Medic)" +MEDIC_ADAPTIVE_MEDPACKS = "Adaptive Medpacks (Medic)" +MEDIC_NANO_PROJECTOR = "Nano Projector (Medic)" +MEDIVAC_ADVANCED_HEALING_AI = "Advanced Healing AI (Medivac)" +MEDIVAC_AFTERBURNERS = "Afterburners (Medivac)" +MEDIVAC_EXPANDED_HULL = "Expanded Hull (Medivac)" +MEDIVAC_RAPID_DEPLOYMENT_TUBE = "Rapid Deployment Tube (Medivac)" +MEDIVAC_SCATTER_VEIL = "Scatter Veil (Medivac)" +MEDIVAC_ADVANCED_CLOAKING_FIELD = "Advanced Cloaking Field (Medivac)" +MISSILE_TURRET_HELLSTORM_BATTERIES = "Hellstorm Batteries (Missile Turret)" +MISSILE_TURRET_TITANIUM_HOUSING = "Titanium Housing (Missile Turret)" +PLANETARY_FORTRESS_PROGRESSIVE_AUGMENTED_THRUSTERS = "Progressive Augmented Thrusters (Planetary Fortress)" +PLANETARY_FORTRESS_ADVANCED_TARGETING = "Advanced Targeting (Planetary Fortress)" +PREDATOR_RESOURCE_EFFICIENCY = "Resource Efficiency (Predator)" +PREDATOR_CLOAK = "Cloak (Predator)" +PREDATOR_CHARGE = "Charge (Predator)" +PREDATOR_PREDATOR_S_FURY = "Predator's Fury (Predator)" +RAVEN_ANTI_ARMOR_MISSILE = "Anti-Armor Missile (Raven)" +RAVEN_BIO_MECHANICAL_REPAIR_DRONE = "Bio Mechanical Repair Drone (Raven)" +RAVEN_HUNTER_SEEKER_WEAPON = "Hunter-Seeker Weapon (Raven)" +RAVEN_INTERFERENCE_MATRIX = "Interference Matrix (Raven)" +RAVEN_INTERNAL_TECH_MODULE = "Internal Tech Module (Raven)" +RAVEN_RAILGUN_TURRET = "Railgun Turret (Raven)" +RAVEN_SPIDER_MINES = "Spider Mines (Raven)" +RAVEN_RESOURCE_EFFICIENCY = "Resource Efficiency (Raven)" +RAVEN_DURABLE_MATERIALS = "Durable Materials (Raven)" +REAPER_ADVANCED_CLOAKING_FIELD = "Advanced Cloaking Field (Reaper)" +REAPER_COMBAT_DRUGS = "Combat Drugs (Reaper)" +REAPER_G4_CLUSTERBOMB = "G-4 Clusterbomb (Reaper)" +REAPER_LASER_TARGETING_SYSTEM = "Laser Targeting System (Reaper)" +REAPER_PROGRESSIVE_STIMPACK = "Progressive Stimpack (Reaper)" +REAPER_SPIDER_MINES = "Spider Mines (Reaper)" +REAPER_U238_ROUNDS = "U-238 Rounds (Reaper)" +REAPER_JET_PACK_OVERDRIVE = "Jet Pack Overdrive (Reaper)" +SCIENCE_VESSEL_DEFENSIVE_MATRIX = "Defensive Matrix (Science Vessel)" +SCIENCE_VESSEL_EMP_SHOCKWAVE = "EMP Shockwave (Science Vessel)" +SCIENCE_VESSEL_IMPROVED_NANO_REPAIR = "Improved Nano-Repair (Science Vessel)" +SCIENCE_VESSEL_ADVANCED_AI_SYSTEMS = "Advanced AI Systems (Science Vessel)" +SCV_ADVANCED_CONSTRUCTION = "Advanced Construction (SCV)" +SCV_DUAL_FUSION_WELDERS = "Dual-Fusion Welders (SCV)" +SCV_HOSTILE_ENVIRONMENT_ADAPTATION = "Hostile Environment Adaptation (SCV)" +SIEGE_TANK_ADVANCED_SIEGE_TECH = "Advanced Siege Tech (Siege Tank)" +SIEGE_TANK_GRADUATING_RANGE = "Graduating Range (Siege Tank)" +SIEGE_TANK_INTERNAL_TECH_MODULE = "Internal Tech Module (Siege Tank)" +SIEGE_TANK_JUMP_JETS = "Jump Jets (Siege Tank)" +SIEGE_TANK_LASER_TARGETING_SYSTEM = "Laser Targeting System (Siege Tank)" +SIEGE_TANK_MAELSTROM_ROUNDS = "Maelstrom Rounds (Siege Tank)" +SIEGE_TANK_SHAPED_BLAST = "Shaped Blast (Siege Tank)" +SIEGE_TANK_SMART_SERVOS = "Smart Servos (Siege Tank)" +SIEGE_TANK_SPIDER_MINES = "Spider Mines (Siege Tank)" +SIEGE_TANK_SHAPED_HULL = "Shaped Hull (Siege Tank)" +SIEGE_TANK_RESOURCE_EFFICIENCY = "Resource Efficiency (Siege Tank)" +SPECTRE_IMPALER_ROUNDS = "Impaler Rounds (Spectre)" +SPECTRE_NYX_CLASS_CLOAKING_MODULE = "Nyx-Class Cloaking Module (Spectre)" +SPECTRE_PSIONIC_LASH = "Psionic Lash (Spectre)" +SPECTRE_RESOURCE_EFFICIENCY = "Resource Efficiency (Spectre)" +SPIDER_MINE_CERBERUS_MINE = "Cerberus Mine (Spider Mine)" +SPIDER_MINE_HIGH_EXPLOSIVE_MUNITION = "High Explosive Munition (Spider Mine)" +THOR_330MM_BARRAGE_CANNON = "330mm Barrage Cannon (Thor)" +THOR_PROGRESSIVE_IMMORTALITY_PROTOCOL = "Progressive Immortality Protocol (Thor)" +THOR_PROGRESSIVE_HIGH_IMPACT_PAYLOAD = "Progressive High Impact Payload (Thor)" +THOR_BUTTON_WITH_A_SKULL_ON_IT = "Button With a Skull on It (Thor)" +THOR_LASER_TARGETING_SYSTEM = "Laser Targeting System (Thor)" +THOR_LARGE_SCALE_FIELD_CONSTRUCTION = "Large Scale Field Construction (Thor)" +VALKYRIE_AFTERBURNERS = "Afterburners (Valkyrie)" +VALKYRIE_FLECHETTE_MISSILES = "Flechette Missiles (Valkyrie)" +VALKYRIE_ENHANCED_CLUSTER_LAUNCHERS = "Enhanced Cluster Launchers (Valkyrie)" +VALKYRIE_SHAPED_HULL = "Shaped Hull (Valkyrie)" +VALKYRIE_LAUNCHING_VECTOR_COMPENSATOR = "Launching Vector Compensator (Valkyrie)" +VALKYRIE_RESOURCE_EFFICIENCY = "Resource Efficiency (Valkyrie)" +VIKING_ANTI_MECHANICAL_MUNITION = "Anti-Mechanical Munition (Viking)" +VIKING_PHOBOS_CLASS_WEAPONS_SYSTEM = "Phobos-Class Weapons System (Viking)" +VIKING_RIPWAVE_MISSILES = "Ripwave Missiles (Viking)" +VIKING_SMART_SERVOS = "Smart Servos (Viking)" +VIKING_SHREDDER_ROUNDS = "Shredder Rounds (Viking)" +VIKING_WILD_MISSILES = "W.I.L.D. Missiles (Viking)" +VULTURE_AUTO_LAUNCHERS = "Auto Launchers (Vulture)" +VULTURE_ION_THRUSTERS = "Ion Thrusters (Vulture)" +VULTURE_PROGRESSIVE_REPLENISHABLE_MAGAZINE = "Progressive Replenishable Magazine (Vulture)" +VULTURE_AUTO_REPAIR = "Auto-Repair (Vulture)" +WARHOUND_RESOURCE_EFFICIENCY = "Resource Efficiency (Warhound)" +WARHOUND_REINFORCED_PLATING = "Reinforced Plating (Warhound)" +WIDOW_MINE_BLACK_MARKET_LAUNCHERS = "Black Market Launchers (Widow Mine)" +WIDOW_MINE_CONCEALMENT = "Concealment (Widow Mine)" +WIDOW_MINE_DRILLING_CLAWS = "Drilling Claws (Widow Mine)" +WIDOW_MINE_EXECUTIONER_MISSILES = "Executioner Missiles (Widow Mine)" +WRAITH_ADVANCED_LASER_TECHNOLOGY = "Advanced Laser Technology (Wraith)" +WRAITH_DISPLACEMENT_FIELD = "Displacement Field (Wraith)" +WRAITH_PROGRESSIVE_TOMAHAWK_POWER_CELLS = "Progressive Tomahawk Power Cells (Wraith)" +WRAITH_TRIGGER_OVERRIDE = "Trigger Override (Wraith)" +WRAITH_INTERNAL_TECH_MODULE = "Internal Tech Module (Wraith)" +WRAITH_RESOURCE_EFFICIENCY = "Resource Efficiency (Wraith)" + +# Nova +NOVA_GHOST_VISOR = "Ghost Visor (Nova Equipment)" +NOVA_RANGEFINDER_OCULUS = "Rangefinder Oculus (Nova Equipment)" +NOVA_DOMINATION = "Domination (Nova Ability)" +NOVA_BLINK = "Blink (Nova Ability)" +NOVA_PROGRESSIVE_STEALTH_SUIT_MODULE = "Progressive Stealth Suit Module (Nova Suit Module)" +NOVA_ENERGY_SUIT_MODULE = "Energy Suit Module (Nova Suit Module)" +NOVA_ARMORED_SUIT_MODULE = "Armored Suit Module (Nova Suit Module)" +NOVA_JUMP_SUIT_MODULE = "Jump Suit Module (Nova Suit Module)" +NOVA_C20A_CANISTER_RIFLE = "C20A Canister Rifle (Nova Weapon)" +NOVA_HELLFIRE_SHOTGUN = "Hellfire Shotgun (Nova Weapon)" +NOVA_PLASMA_RIFLE = "Plasma Rifle (Nova Weapon)" +NOVA_MONOMOLECULAR_BLADE = "Monomolecular Blade (Nova Weapon)" +NOVA_BLAZEFIRE_GUNBLADE = "Blazefire Gunblade (Nova Weapon)" +NOVA_STIM_INFUSION = "Stim Infusion (Nova Gadget)" +NOVA_PULSE_GRENADES = "Pulse Grenades (Nova Gadget)" +NOVA_FLASHBANG_GRENADES = "Flashbang Grenades (Nova Gadget)" +NOVA_IONIC_FORCE_FIELD = "Ionic Force Field (Nova Gadget)" +NOVA_HOLO_DECOY = "Holo Decoy (Nova Gadget)" +NOVA_NUKE = "Tac Nuke Strike (Nova Ability)" + +# Zerg Units +ZERGLING = "Zergling" +SWARM_QUEEN = "Swarm Queen" +ROACH = "Roach" +HYDRALISK = "Hydralisk" +ABERRATION = "Aberration" +MUTALISK = "Mutalisk" +SWARM_HOST = "Swarm Host" +INFESTOR = "Infestor" +ULTRALISK = "Ultralisk" +CORRUPTOR = "Corruptor" +SCOURGE = "Scourge" +BROOD_QUEEN = "Brood Queen" +DEFILER = "Defiler" + +# Zerg Buildings +SPORE_CRAWLER = "Spore Crawler" +SPINE_CRAWLER = "Spine Crawler" + +# Zerg Weapon / Armor Upgrades +ZERG_UPGRADE_PREFIX = "Progressive Zerg" +ZERG_FLYER_UPGRADE_PREFIX = f"{ZERG_UPGRADE_PREFIX} Flyer" + +PROGRESSIVE_ZERG_MELEE_ATTACK = f"{ZERG_UPGRADE_PREFIX} Melee Attack" +PROGRESSIVE_ZERG_MISSILE_ATTACK = f"{ZERG_UPGRADE_PREFIX} Missile Attack" +PROGRESSIVE_ZERG_GROUND_CARAPACE = f"{ZERG_UPGRADE_PREFIX} Ground Carapace" +PROGRESSIVE_ZERG_FLYER_ATTACK = f"{ZERG_FLYER_UPGRADE_PREFIX} Attack" +PROGRESSIVE_ZERG_FLYER_CARAPACE = f"{ZERG_FLYER_UPGRADE_PREFIX} Carapace" +PROGRESSIVE_ZERG_WEAPON_UPGRADE = f"{ZERG_UPGRADE_PREFIX} Weapon Upgrade" +PROGRESSIVE_ZERG_ARMOR_UPGRADE = f"{ZERG_UPGRADE_PREFIX} Armor Upgrade" +PROGRESSIVE_ZERG_GROUND_UPGRADE = f"{ZERG_UPGRADE_PREFIX} Ground Upgrade" +PROGRESSIVE_ZERG_FLYER_UPGRADE = f"{ZERG_FLYER_UPGRADE_PREFIX} Upgrade" +PROGRESSIVE_ZERG_WEAPON_ARMOR_UPGRADE = f"{ZERG_UPGRADE_PREFIX} Weapon/Armor Upgrade" + +# Zerg Unit Upgrades +ZERGLING_HARDENED_CARAPACE = "Hardened Carapace (Zergling)" +ZERGLING_ADRENAL_OVERLOAD = "Adrenal Overload (Zergling)" +ZERGLING_METABOLIC_BOOST = "Metabolic Boost (Zergling)" +ZERGLING_SHREDDING_CLAWS = "Shredding Claws (Zergling)" +ROACH_HYDRIODIC_BILE = "Hydriodic Bile (Roach)" +ROACH_ADAPTIVE_PLATING = "Adaptive Plating (Roach)" +ROACH_TUNNELING_CLAWS = "Tunneling Claws (Roach)" +ROACH_GLIAL_RECONSTITUTION = "Glial Reconstitution (Roach)" +ROACH_ORGANIC_CARAPACE = "Organic Carapace (Roach)" +HYDRALISK_FRENZY = "Frenzy (Hydralisk)" +HYDRALISK_ANCILLARY_CARAPACE = "Ancillary Carapace (Hydralisk)" +HYDRALISK_GROOVED_SPINES = "Grooved Spines (Hydralisk)" +HYDRALISK_MUSCULAR_AUGMENTS = "Muscular Augments (Hydralisk)" +HYDRALISK_RESOURCE_EFFICIENCY = "Resource Efficiency (Hydralisk)" +BANELING_CORROSIVE_ACID = "Corrosive Acid (Baneling)" +BANELING_RUPTURE = "Rupture (Baneling)" +BANELING_REGENERATIVE_ACID = "Regenerative Acid (Baneling)" +BANELING_CENTRIFUGAL_HOOKS = "Centrifugal Hooks (Baneling)" +BANELING_TUNNELING_JAWS = "Tunneling Jaws (Baneling)" +BANELING_RAPID_METAMORPH = "Rapid Metamorph (Baneling)" +MUTALISK_VICIOUS_GLAIVE = "Vicious Glaive (Mutalisk)" +MUTALISK_RAPID_REGENERATION = "Rapid Regeneration (Mutalisk)" +MUTALISK_SUNDERING_GLAIVE = "Sundering Glaive (Mutalisk)" +MUTALISK_SEVERING_GLAIVE = "Severing Glaive (Mutalisk)" +MUTALISK_AERODYNAMIC_GLAIVE_SHAPE = "Aerodynamic Glaive Shape (Mutalisk)" +SWARM_HOST_BURROW = "Burrow (Swarm Host)" +SWARM_HOST_RAPID_INCUBATION = "Rapid Incubation (Swarm Host)" +SWARM_HOST_PRESSURIZED_GLANDS = "Pressurized Glands (Swarm Host)" +SWARM_HOST_LOCUST_METABOLIC_BOOST = "Locust Metabolic Boost (Swarm Host)" +SWARM_HOST_ENDURING_LOCUSTS = "Enduring Locusts (Swarm Host)" +SWARM_HOST_ORGANIC_CARAPACE = "Organic Carapace (Swarm Host)" +SWARM_HOST_RESOURCE_EFFICIENCY = "Resource Efficiency (Swarm Host)" +ULTRALISK_BURROW_CHARGE = "Burrow Charge (Ultralisk)" +ULTRALISK_TISSUE_ASSIMILATION = "Tissue Assimilation (Ultralisk)" +ULTRALISK_MONARCH_BLADES = "Monarch Blades (Ultralisk)" +ULTRALISK_ANABOLIC_SYNTHESIS = "Anabolic Synthesis (Ultralisk)" +ULTRALISK_CHITINOUS_PLATING = "Chitinous Plating (Ultralisk)" +ULTRALISK_ORGANIC_CARAPACE = "Organic Carapace (Ultralisk)" +ULTRALISK_RESOURCE_EFFICIENCY = "Resource Efficiency (Ultralisk)" +CORRUPTOR_CORRUPTION = "Corruption (Corruptor)" +CORRUPTOR_CAUSTIC_SPRAY = "Caustic Spray (Corruptor)" +SCOURGE_VIRULENT_SPORES = "Virulent Spores (Scourge)" +SCOURGE_RESOURCE_EFFICIENCY = "Resource Efficiency (Scourge)" +SCOURGE_SWARM_SCOURGE = "Swarm Scourge (Scourge)" +DEVOURER_CORROSIVE_SPRAY = "Corrosive Spray (Devourer)" +DEVOURER_GAPING_MAW = "Gaping Maw (Devourer)" +DEVOURER_IMPROVED_OSMOSIS = "Improved Osmosis (Devourer)" +DEVOURER_PRESCIENT_SPORES = "Prescient Spores (Devourer)" +GUARDIAN_PROLONGED_DISPERSION = "Prolonged Dispersion (Guardian)" +GUARDIAN_PRIMAL_ADAPTATION = "Primal Adaptation (Guardian)" +GUARDIAN_SORONAN_ACID = "Soronan Acid (Guardian)" +IMPALER_ADAPTIVE_TALONS = "Adaptive Talons (Impaler)" +IMPALER_SECRETION_GLANDS = "Secretion Glands (Impaler)" +IMPALER_HARDENED_TENTACLE_SPINES = "Hardened Tentacle Spines (Impaler)" +LURKER_SEISMIC_SPINES = "Seismic Spines (Lurker)" +LURKER_ADAPTED_SPINES = "Adapted Spines (Lurker)" +RAVAGER_POTENT_BILE = "Potent Bile (Ravager)" +RAVAGER_BLOATED_BILE_DUCTS = "Bloated Bile Ducts (Ravager)" +RAVAGER_DEEP_TUNNEL = "Deep Tunnel (Ravager)" +VIPER_PARASITIC_BOMB = "Parasitic Bomb (Viper)" +VIPER_PARALYTIC_BARBS = "Paralytic Barbs (Viper)" +VIPER_VIRULENT_MICROBES = "Virulent Microbes (Viper)" +BROOD_LORD_POROUS_CARTILAGE = "Porous Cartilage (Brood Lord)" +BROOD_LORD_EVOLVED_CARAPACE = "Evolved Carapace (Brood Lord)" +BROOD_LORD_SPLITTER_MITOSIS = "Splitter Mitosis (Brood Lord)" +BROOD_LORD_RESOURCE_EFFICIENCY = "Resource Efficiency (Brood Lord)" +INFESTOR_INFESTED_TERRAN = "Infested Terran (Infestor)" +INFESTOR_MICROBIAL_SHROUD = "Microbial Shroud (Infestor)" +SWARM_QUEEN_SPAWN_LARVAE = "Spawn Larvae (Swarm Queen)" +SWARM_QUEEN_DEEP_TUNNEL = "Deep Tunnel (Swarm Queen)" +SWARM_QUEEN_ORGANIC_CARAPACE = "Organic Carapace (Swarm Queen)" +SWARM_QUEEN_BIO_MECHANICAL_TRANSFUSION = "Bio-Mechanical Transfusion (Swarm Queen)" +SWARM_QUEEN_RESOURCE_EFFICIENCY = "Resource Efficiency (Swarm Queen)" +SWARM_QUEEN_INCUBATOR_CHAMBER = "Incubator Chamber (Swarm Queen)" +BROOD_QUEEN_FUNGAL_GROWTH = "Fungal Growth (Brood Queen)" +BROOD_QUEEN_ENSNARE = "Ensnare (Brood Queen)" +BROOD_QUEEN_ENHANCED_MITOCHONDRIA = "Enhanced Mitochondria (Brood Queen)" + +# Zerg Strains +ZERGLING_RAPTOR_STRAIN = "Raptor Strain (Zergling)" +ZERGLING_SWARMLING_STRAIN = "Swarmling Strain (Zergling)" +ROACH_VILE_STRAIN = "Vile Strain (Roach)" +ROACH_CORPSER_STRAIN = "Corpser Strain (Roach)" +BANELING_SPLITTER_STRAIN = "Splitter Strain (Baneling)" +BANELING_HUNTER_STRAIN = "Hunter Strain (Baneling)" +SWARM_HOST_CARRION_STRAIN = "Carrion Strain (Swarm Host)" +SWARM_HOST_CREEPER_STRAIN = "Creeper Strain (Swarm Host)" +ULTRALISK_NOXIOUS_STRAIN = "Noxious Strain (Ultralisk)" +ULTRALISK_TORRASQUE_STRAIN = "Torrasque Strain (Ultralisk)" + +# Morphs +ZERGLING_BANELING_ASPECT = "Baneling Aspect (Zergling)" +HYDRALISK_IMPALER_ASPECT = "Impaler Aspect (Hydralisk)" +HYDRALISK_LURKER_ASPECT = "Lurker Aspect (Hydralisk)" +MUTALISK_CORRUPTOR_BROOD_LORD_ASPECT = "Brood Lord Aspect (Mutalisk/Corruptor)" +MUTALISK_CORRUPTOR_VIPER_ASPECT = "Viper Aspect (Mutalisk/Corruptor)" +MUTALISK_CORRUPTOR_GUARDIAN_ASPECT = "Guardian Aspect (Mutalisk/Corruptor)" +MUTALISK_CORRUPTOR_DEVOURER_ASPECT = "Devourer Aspect (Mutalisk/Corruptor)" +ROACH_RAVAGER_ASPECT = "Ravager Aspect (Roach)" + +# Zerg Mercs +INFESTED_MEDICS = "Infested Medics" +INFESTED_SIEGE_TANKS = "Infested Siege Tanks" +INFESTED_BANSHEES = "Infested Banshees" + +# Kerrigan Upgrades +KERRIGAN_KINETIC_BLAST = "Kinetic Blast (Kerrigan Tier 1)" +KERRIGAN_HEROIC_FORTITUDE = "Heroic Fortitude (Kerrigan Tier 1)" +KERRIGAN_LEAPING_STRIKE = "Leaping Strike (Kerrigan Tier 1)" +KERRIGAN_CRUSHING_GRIP = "Crushing Grip (Kerrigan Tier 2)" +KERRIGAN_CHAIN_REACTION = "Chain Reaction (Kerrigan Tier 2)" +KERRIGAN_PSIONIC_SHIFT = "Psionic Shift (Kerrigan Tier 2)" +KERRIGAN_WILD_MUTATION = "Wild Mutation (Kerrigan Tier 4)" +KERRIGAN_SPAWN_BANELINGS = "Spawn Banelings (Kerrigan Tier 4)" +KERRIGAN_MEND = "Mend (Kerrigan Tier 4)" +KERRIGAN_INFEST_BROODLINGS = "Infest Broodlings (Kerrigan Tier 6)" +KERRIGAN_FURY = "Fury (Kerrigan Tier 6)" +KERRIGAN_ABILITY_EFFICIENCY = "Ability Efficiency (Kerrigan Tier 6)" +KERRIGAN_APOCALYPSE = "Apocalypse (Kerrigan Tier 7)" +KERRIGAN_SPAWN_LEVIATHAN = "Spawn Leviathan (Kerrigan Tier 7)" +KERRIGAN_DROP_PODS = "Drop-Pods (Kerrigan Tier 7)" +KERRIGAN_PRIMAL_FORM = "Primal Form (Kerrigan)" + +# Misc Upgrades +KERRIGAN_ZERGLING_RECONSTITUTION = "Zergling Reconstitution (Kerrigan Tier 3)" +KERRIGAN_IMPROVED_OVERLORDS = "Improved Overlords (Kerrigan Tier 3)" +KERRIGAN_AUTOMATED_EXTRACTORS = "Automated Extractors (Kerrigan Tier 3)" +KERRIGAN_TWIN_DRONES = "Twin Drones (Kerrigan Tier 5)" +KERRIGAN_MALIGNANT_CREEP = "Malignant Creep (Kerrigan Tier 5)" +KERRIGAN_VESPENE_EFFICIENCY = "Vespene Efficiency (Kerrigan Tier 5)" +OVERLORD_VENTRAL_SACS = "Ventral Sacs (Overlord)" + +# Kerrigan Levels +KERRIGAN_LEVELS_1 = "1 Kerrigan Level" +KERRIGAN_LEVELS_2 = "2 Kerrigan Levels" +KERRIGAN_LEVELS_3 = "3 Kerrigan Levels" +KERRIGAN_LEVELS_4 = "4 Kerrigan Levels" +KERRIGAN_LEVELS_5 = "5 Kerrigan Levels" +KERRIGAN_LEVELS_6 = "6 Kerrigan Levels" +KERRIGAN_LEVELS_7 = "7 Kerrigan Levels" +KERRIGAN_LEVELS_8 = "8 Kerrigan Levels" +KERRIGAN_LEVELS_9 = "9 Kerrigan Levels" +KERRIGAN_LEVELS_10 = "10 Kerrigan Levels" +KERRIGAN_LEVELS_14 = "14 Kerrigan Levels" +KERRIGAN_LEVELS_35 = "35 Kerrigan Levels" +KERRIGAN_LEVELS_70 = "70 Kerrigan Levels" + +# Protoss Units +ZEALOT = "Zealot" +STALKER = "Stalker" +HIGH_TEMPLAR = "High Templar" +DARK_TEMPLAR = "Dark Templar" +IMMORTAL = "Immortal" +COLOSSUS = "Colossus" +PHOENIX = "Phoenix" +VOID_RAY = "Void Ray" +CARRIER = "Carrier" +OBSERVER = "Observer" +CENTURION = "Centurion" +SENTINEL = "Sentinel" +SUPPLICANT = "Supplicant" +INSTIGATOR = "Instigator" +SLAYER = "Slayer" +SENTRY = "Sentry" +ENERGIZER = "Energizer" +HAVOC = "Havoc" +SIGNIFIER = "Signifier" +ASCENDANT = "Ascendant" +AVENGER = "Avenger" +BLOOD_HUNTER = "Blood Hunter" +DRAGOON = "Dragoon" +DARK_ARCHON = "Dark Archon" +ADEPT = "Adept" +WARP_PRISM = "Warp Prism" +ANNIHILATOR = "Annihilator" +VANGUARD = "Vanguard" +WRATHWALKER = "Wrathwalker" +REAVER = "Reaver" +DISRUPTOR = "Disruptor" +MIRAGE = "Mirage" +CORSAIR = "Corsair" +DESTROYER = "Destroyer" +SCOUT = "Scout" +TEMPEST = "Tempest" +MOTHERSHIP = "Mothership" +ARBITER = "Arbiter" +ORACLE = "Oracle" + +# Upgrades +PROTOSS_UPGRADE_PREFIX = "Progressive Protoss" +PROTOSS_GROUND_UPGRADE_PREFIX = f"{PROTOSS_UPGRADE_PREFIX} Ground" +PROTOSS_AIR_UPGRADE_PREFIX = f"{PROTOSS_UPGRADE_PREFIX} Air" +PROGRESSIVE_PROTOSS_GROUND_WEAPON = f"{PROTOSS_GROUND_UPGRADE_PREFIX} Weapon" +PROGRESSIVE_PROTOSS_GROUND_ARMOR = f"{PROTOSS_GROUND_UPGRADE_PREFIX} Armor" +PROGRESSIVE_PROTOSS_SHIELDS = f"{PROTOSS_UPGRADE_PREFIX} Shields" +PROGRESSIVE_PROTOSS_AIR_WEAPON = f"{PROTOSS_AIR_UPGRADE_PREFIX} Weapon" +PROGRESSIVE_PROTOSS_AIR_ARMOR = f"{PROTOSS_AIR_UPGRADE_PREFIX} Armor" +PROGRESSIVE_PROTOSS_WEAPON_UPGRADE = f"{PROTOSS_UPGRADE_PREFIX} Weapon Upgrade" +PROGRESSIVE_PROTOSS_ARMOR_UPGRADE = f"{PROTOSS_UPGRADE_PREFIX} Armor Upgrade" +PROGRESSIVE_PROTOSS_GROUND_UPGRADE = f"{PROTOSS_GROUND_UPGRADE_PREFIX} Upgrade" +PROGRESSIVE_PROTOSS_AIR_UPGRADE = f"{PROTOSS_AIR_UPGRADE_PREFIX} Upgrade" +PROGRESSIVE_PROTOSS_WEAPON_ARMOR_UPGRADE = f"{PROTOSS_UPGRADE_PREFIX} Weapon/Armor Upgrade" + +# Buildings +PHOTON_CANNON = "Photon Cannon" +KHAYDARIN_MONOLITH = "Khaydarin Monolith" +SHIELD_BATTERY = "Shield Battery" + +# Unit Upgrades +SUPPLICANT_BLOOD_SHIELD = "Blood Shield (Supplicant)" +SUPPLICANT_SOUL_AUGMENTATION = "Soul Augmentation (Supplicant)" +SUPPLICANT_SHIELD_REGENERATION = "Shield Regeneration (Supplicant)" +ADEPT_SHOCKWAVE = "Shockwave (Adept)" +ADEPT_RESONATING_GLAIVES = "Resonating Glaives (Adept)" +ADEPT_PHASE_BULWARK = "Phase Bulwark (Adept)" +STALKER_INSTIGATOR_SLAYER_DISINTEGRATING_PARTICLES = "Disintegrating Particles (Stalker/Instigator/Slayer)" +STALKER_INSTIGATOR_SLAYER_PARTICLE_REFLECTION = "Particle Reflection (Stalker/Instigator/Slayer)" +DRAGOON_HIGH_IMPACT_PHASE_DISRUPTORS = "High Impact Phase Disruptor (Dragoon)" +DRAGOON_TRILLIC_COMPRESSION_SYSTEM = "Trillic Compression System (Dragoon)" +DRAGOON_SINGULARITY_CHARGE = "Singularity Charge (Dragoon)" +DRAGOON_ENHANCED_STRIDER_SERVOS = "Enhanced Strider Servos (Dragoon)" +SCOUT_COMBAT_SENSOR_ARRAY = "Combat Sensor Array (Scout)" +SCOUT_APIAL_SENSORS = "Apial Sensors (Scout)" +SCOUT_GRAVITIC_THRUSTERS = "Gravitic Thrusters (Scout)" +SCOUT_ADVANCED_PHOTON_BLASTERS = "Advanced Photon Blasters (Scout)" +TEMPEST_TECTONIC_DESTABILIZERS = "Tectonic Destabilizers (Tempest)" +TEMPEST_QUANTIC_REACTOR = "Quantic Reactor (Tempest)" +TEMPEST_GRAVITY_SLING = "Gravity Sling (Tempest)" +PHOENIX_MIRAGE_IONIC_WAVELENGTH_FLUX = "Ionic Wavelength Flux (Phoenix/Mirage)" +PHOENIX_MIRAGE_ANION_PULSE_CRYSTALS = "Anion Pulse-Crystals (Phoenix/Mirage)" +CORSAIR_STEALTH_DRIVE = "Stealth Drive (Corsair)" +CORSAIR_ARGUS_JEWEL = "Argus Jewel (Corsair)" +CORSAIR_SUSTAINING_DISRUPTION = "Sustaining Disruption (Corsair)" +CORSAIR_NEUTRON_SHIELDS = "Neutron Shields (Corsair)" +ORACLE_STEALTH_DRIVE = "Stealth Drive (Oracle)" +ORACLE_STASIS_CALIBRATION = "Stasis Calibration (Oracle)" +ORACLE_TEMPORAL_ACCELERATION_BEAM = "Temporal Acceleration Beam (Oracle)" +ARBITER_CHRONOSTATIC_REINFORCEMENT = "Chronostatic Reinforcement (Arbiter)" +ARBITER_KHAYDARIN_CORE = "Khaydarin Core (Arbiter)" +ARBITER_SPACETIME_ANCHOR = "Spacetime Anchor (Arbiter)" +ARBITER_RESOURCE_EFFICIENCY = "Resource Efficiency (Arbiter)" +ARBITER_ENHANCED_CLOAK_FIELD = "Enhanced Cloak Field (Arbiter)" +CARRIER_GRAVITON_CATAPULT = "Graviton Catapult (Carrier)" +CARRIER_HULL_OF_PAST_GLORIES = "Hull of Past Glories (Carrier)" +VOID_RAY_DESTROYER_FLUX_VANES = "Flux Vanes (Void Ray/Destroyer)" +DESTROYER_REFORGED_BLOODSHARD_CORE = "Reforged Bloodshard Core (Destroyer)" +WARP_PRISM_GRAVITIC_DRIVE = "Gravitic Drive (Warp Prism)" +WARP_PRISM_PHASE_BLASTER = "Phase Blaster (Warp Prism)" +WARP_PRISM_WAR_CONFIGURATION = "War Configuration (Warp Prism)" +OBSERVER_GRAVITIC_BOOSTERS = "Gravitic Boosters (Observer)" +OBSERVER_SENSOR_ARRAY = "Sensor Array (Observer)" +REAVER_SCARAB_DAMAGE = "Scarab Damage (Reaver)" +REAVER_SOLARITE_PAYLOAD = "Solarite Payload (Reaver)" +REAVER_REAVER_CAPACITY = "Reaver Capacity (Reaver)" +REAVER_RESOURCE_EFFICIENCY = "Resource Efficiency (Reaver)" +VANGUARD_AGONY_LAUNCHERS = "Agony Launchers (Vanguard)" +VANGUARD_MATTER_DISPERSION = "Matter Dispersion (Vanguard)" +IMMORTAL_ANNIHILATOR_SINGULARITY_CHARGE = "Singularity Charge (Immortal/Annihilator)" +IMMORTAL_ANNIHILATOR_ADVANCED_TARGETING_MECHANICS = "Advanced Targeting Mechanics (Immortal/Annihilator)" +COLOSSUS_PACIFICATION_PROTOCOL = "Pacification Protocol (Colossus)" +WRATHWALKER_RAPID_POWER_CYCLING = "Rapid Power Cycling (Wrathwalker)" +WRATHWALKER_EYE_OF_WRATH = "Eye of Wrath (Wrathwalker)" +DARK_TEMPLAR_AVENGER_BLOOD_HUNTER_SHROUD_OF_ADUN = "Shroud of Adun (Dark Templar/Avenger/Blood Hunter)" +DARK_TEMPLAR_AVENGER_BLOOD_HUNTER_SHADOW_GUARD_TRAINING = "Shadow Guard Training (Dark Templar/Avenger/Blood Hunter)" +DARK_TEMPLAR_AVENGER_BLOOD_HUNTER_BLINK = "Blink (Dark Templar/Avenger/Blood Hunter)" +DARK_TEMPLAR_AVENGER_BLOOD_HUNTER_RESOURCE_EFFICIENCY = "Resource Efficiency (Dark Templar/Avenger/Blood Hunter)" +DARK_TEMPLAR_DARK_ARCHON_MELD = "Dark Archon Meld (Dark Templar)" +HIGH_TEMPLAR_SIGNIFIER_UNSHACKLED_PSIONIC_STORM = "Unshackled Psionic Storm (High Templar/Signifier)" +HIGH_TEMPLAR_SIGNIFIER_HALLUCINATION = "Hallucination (High Templar/Signifier)" +HIGH_TEMPLAR_SIGNIFIER_KHAYDARIN_AMULET = "Khaydarin Amulet (High Templar/Signifier)" +ARCHON_HIGH_ARCHON = "High Archon (Archon)" +DARK_ARCHON_FEEDBACK = "Feedback (Dark Archon)" +DARK_ARCHON_MAELSTROM = "Maelstrom (Dark Archon)" +DARK_ARCHON_ARGUS_TALISMAN = "Argus Talisman (Dark Archon)" +ASCENDANT_POWER_OVERWHELMING = "Power Overwhelming (Ascendant)" +ASCENDANT_CHAOTIC_ATTUNEMENT = "Chaotic Attunement (Ascendant)" +ASCENDANT_BLOOD_AMULET = "Blood Amulet (Ascendant)" +SENTRY_ENERGIZER_HAVOC_CLOAKING_MODULE = "Cloaking Module (Sentry/Energizer/Havoc)" +SENTRY_ENERGIZER_HAVOC_SHIELD_BATTERY_RAPID_RECHARGING = "Rapid Recharging (Sentry/Energizer/Havoc/Shield Battery)" +SENTRY_FORCE_FIELD = "Force Field (Sentry)" +SENTRY_HALLUCINATION = "Hallucination (Sentry)" +ENERGIZER_RECLAMATION = "Reclamation (Energizer)" +ENERGIZER_FORGED_CHASSIS = "Forged Chassis (Energizer)" +HAVOC_DETECT_WEAKNESS = "Detect Weakness (Havoc)" +HAVOC_BLOODSHARD_RESONANCE = "Bloodshard Resonance (Havoc)" +ZEALOT_SENTINEL_CENTURION_LEG_ENHANCEMENTS = "Leg Enhancements (Zealot/Sentinel/Centurion)" +ZEALOT_SENTINEL_CENTURION_SHIELD_CAPACITY = "Shield Capacity (Zealot/Sentinel/Centurion)" + +# Spear Of Adun +SOA_CHRONO_SURGE = "Chrono Surge (Spear of Adun Calldown)" +SOA_PROGRESSIVE_PROXY_PYLON = "Progressive Proxy Pylon (Spear of Adun Calldown)" +SOA_PYLON_OVERCHARGE = "Pylon Overcharge (Spear of Adun Calldown)" +SOA_ORBITAL_STRIKE = "Orbital Strike (Spear of Adun Calldown)" +SOA_TEMPORAL_FIELD = "Temporal Field (Spear of Adun Calldown)" +SOA_SOLAR_LANCE = "Solar Lance (Spear of Adun Calldown)" +SOA_MASS_RECALL = "Mass Recall (Spear of Adun Calldown)" +SOA_SHIELD_OVERCHARGE = "Shield Overcharge (Spear of Adun Calldown)" +SOA_DEPLOY_FENIX = "Deploy Fenix (Spear of Adun Calldown)" +SOA_PURIFIER_BEAM = "Purifier Beam (Spear of Adun Calldown)" +SOA_TIME_STOP = "Time Stop (Spear of Adun Calldown)" +SOA_SOLAR_BOMBARDMENT = "Solar Bombardment (Spear of Adun Calldown)" + +# Generic upgrades +MATRIX_OVERLOAD = "Matrix Overload" +QUATRO = "Quatro" +NEXUS_OVERCHARGE = "Nexus Overcharge" +ORBITAL_ASSIMILATORS = "Orbital Assimilators" +WARP_HARMONIZATION = "Warp Harmonization" +GUARDIAN_SHELL = "Guardian Shell" +RECONSTRUCTION_BEAM = "Reconstruction Beam (Spear of Adun Auto-Cast)" +OVERWATCH = "Overwatch (Spear of Adun Auto-Cast)" +SUPERIOR_WARP_GATES = "Superior Warp Gates" +ENHANCED_TARGETING = "Enhanced Targeting" +OPTIMIZED_ORDNANCE = "Optimized Ordnance" +KHALAI_INGENUITY = "Khalai Ingenuity" +AMPLIFIED_ASSIMILATORS = "Amplified Assimilators" + +# Filler items +STARTING_MINERALS = "Additional Starting Minerals" +STARTING_VESPENE = "Additional Starting Vespene" +STARTING_SUPPLY = "Additional Starting Supply" +NOTHING = "Nothing" diff --git a/worlds/sc2/Items.py b/worlds/sc2/Items.py new file mode 100644 index 000000000000..85fb34e875af --- /dev/null +++ b/worlds/sc2/Items.py @@ -0,0 +1,2553 @@ +import inspect +from pydoc import describe + +from BaseClasses import Item, ItemClassification, MultiWorld +import typing + +from .Options import get_option_value, RequiredTactics +from .MissionTables import SC2Mission, SC2Race, SC2Campaign, campaign_mission_table +from . import ItemNames +from worlds.AutoWorld import World + + +class ItemData(typing.NamedTuple): + code: int + type: str + number: int # Important for bot commands to send the item into the game + race: SC2Race + classification: ItemClassification = ItemClassification.useful + quantity: int = 1 + parent_item: typing.Optional[str] = None + origin: typing.Set[str] = {"wol"} + description: typing.Optional[str] = None + important_for_filtering: bool = False + + def is_important_for_filtering(self): + return self.important_for_filtering \ + or self.classification == ItemClassification.progression \ + or self.classification == ItemClassification.progression_skip_balancing + + +class StarcraftItem(Item): + game: str = "Starcraft 2" + + +def get_full_item_list(): + return item_table + + +SC2WOL_ITEM_ID_OFFSET = 1000 +SC2HOTS_ITEM_ID_OFFSET = SC2WOL_ITEM_ID_OFFSET + 1000 +SC2LOTV_ITEM_ID_OFFSET = SC2HOTS_ITEM_ID_OFFSET + 1000 + +# Descriptions +WEAPON_ARMOR_UPGRADE_NOTE = inspect.cleandoc(""" + Must be researched during the mission if the mission type isn't set to auto-unlock generic upgrades. +""") +LASER_TARGETING_SYSTEMS_DESCRIPTION = "Increases vision by 2 and weapon range by 1." +STIMPACK_SMALL_COST = 10 +STIMPACK_SMALL_HEAL = 30 +STIMPACK_LARGE_COST = 20 +STIMPACK_LARGE_HEAL = 60 +STIMPACK_TEMPLATE = inspect.cleandoc(""" + Level 1: Stimpack: Increases unit movement and attack speed for 15 seconds. Injures the unit for {} life. + Level 2: Super Stimpack: Instead of injuring the unit, heals the unit for {} life instead. +""") +STIMPACK_SMALL_DESCRIPTION = STIMPACK_TEMPLATE.format(STIMPACK_SMALL_COST, STIMPACK_SMALL_HEAL) +STIMPACK_LARGE_DESCRIPTION = STIMPACK_TEMPLATE.format(STIMPACK_LARGE_COST, STIMPACK_LARGE_HEAL) +SMART_SERVOS_DESCRIPTION = "Increases transformation speed between modes." +INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE = "{} can be trained from a {} without an attached Tech Lab." +RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE = "Reduces {} resource and supply cost." +RESOURCE_EFFICIENCY_NO_SUPPLY_DESCRIPTION_TEMPLATE = "Reduces {} resource cost." +CLOAK_DESCRIPTION_TEMPLATE = "Allows {} to use the Cloak ability." + + +# The items are sorted by their IDs. The IDs shall be kept for compatibility with older games. +item_table = { + # WoL + ItemNames.MARINE: + ItemData(0 + SC2WOL_ITEM_ID_OFFSET, "Unit", 0, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="General-purpose infantry."), + ItemNames.MEDIC: + ItemData(1 + SC2WOL_ITEM_ID_OFFSET, "Unit", 1, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Support trooper. Heals nearby biological units."), + ItemNames.FIREBAT: + ItemData(2 + SC2WOL_ITEM_ID_OFFSET, "Unit", 2, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Specialized anti-infantry attacker."), + ItemNames.MARAUDER: + ItemData(3 + SC2WOL_ITEM_ID_OFFSET, "Unit", 3, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Heavy assault infantry."), + ItemNames.REAPER: + ItemData(4 + SC2WOL_ITEM_ID_OFFSET, "Unit", 4, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Raider. Capable of jumping up and down cliffs. Throws explosive mines."), + ItemNames.HELLION: + ItemData(5 + SC2WOL_ITEM_ID_OFFSET, "Unit", 5, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Fast scout. Has a flame attack that damages all enemy units in its line of fire."), + ItemNames.VULTURE: + ItemData(6 + SC2WOL_ITEM_ID_OFFSET, "Unit", 6, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Fast skirmish unit. Can use the Spider Mine ability."), + ItemNames.GOLIATH: + ItemData(7 + SC2WOL_ITEM_ID_OFFSET, "Unit", 7, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Heavy-fire support unit."), + ItemNames.DIAMONDBACK: + ItemData(8 + SC2WOL_ITEM_ID_OFFSET, "Unit", 8, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Fast, high-damage hovertank. Rail Gun can fire while the Diamondback is moving."), + ItemNames.SIEGE_TANK: + ItemData(9 + SC2WOL_ITEM_ID_OFFSET, "Unit", 9, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Heavy tank. Long-range artillery in Siege Mode."), + ItemNames.MEDIVAC: + ItemData(10 + SC2WOL_ITEM_ID_OFFSET, "Unit", 10, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Air transport. Heals nearby biological units."), + ItemNames.WRAITH: + ItemData(11 + SC2WOL_ITEM_ID_OFFSET, "Unit", 11, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Highly mobile flying unit. Excellent at surgical strikes."), + ItemNames.VIKING: + ItemData(12 + SC2WOL_ITEM_ID_OFFSET, "Unit", 12, SC2Race.TERRAN, + classification=ItemClassification.progression, + description=inspect.cleandoc( + """ + Durable support flyer. Loaded with strong anti-capital air missiles. + Can switch into Assault Mode to attack ground units. + """ + )), + ItemNames.BANSHEE: + ItemData(13 + SC2WOL_ITEM_ID_OFFSET, "Unit", 13, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Tactical-strike aircraft."), + ItemNames.BATTLECRUISER: + ItemData(14 + SC2WOL_ITEM_ID_OFFSET, "Unit", 14, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Powerful warship."), + ItemNames.GHOST: + ItemData(15 + SC2WOL_ITEM_ID_OFFSET, "Unit", 15, SC2Race.TERRAN, + classification=ItemClassification.progression, + description=inspect.cleandoc( + """ + Infiltration unit. Can use Snipe and Cloak abilities. Can also call down Tactical Nukes. + """ + )), + ItemNames.SPECTRE: + ItemData(16 + SC2WOL_ITEM_ID_OFFSET, "Unit", 16, SC2Race.TERRAN, + classification=ItemClassification.progression, + description=inspect.cleandoc( + """ + Infiltration unit. Can use Ultrasonic Pulse, Psionic Lash, and Cloak. + Can also call down Tactical Nukes. + """ + )), + ItemNames.THOR: + ItemData(17 + SC2WOL_ITEM_ID_OFFSET, "Unit", 17, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Heavy assault mech."), + # EE units + ItemNames.LIBERATOR: + ItemData(18 + SC2WOL_ITEM_ID_OFFSET, "Unit", 18, SC2Race.TERRAN, + classification=ItemClassification.progression, origin={"nco", "ext"}, + description=inspect.cleandoc( + """ + Artillery fighter. Loaded with missiles that deal area damage to enemy air targets. + Can switch into Defender Mode to provide siege support. + """ + )), + ItemNames.VALKYRIE: + ItemData(19 + SC2WOL_ITEM_ID_OFFSET, "Unit", 19, SC2Race.TERRAN, + classification=ItemClassification.progression, origin={"bw"}, + description=inspect.cleandoc( + """ + Advanced anti-aircraft fighter. + Able to use cluster missiles that deal area damage to air targets. + """ + )), + ItemNames.WIDOW_MINE: + ItemData(20 + SC2WOL_ITEM_ID_OFFSET, "Unit", 20, SC2Race.TERRAN, + classification=ItemClassification.progression, origin={"ext"}, + description=inspect.cleandoc( + """ + Robotic mine. Launches missiles at nearby enemy units while burrowed. + Attacks deal splash damage in a small area around the target. + Widow Mine is revealed when Sentinel Missile is on cooldown. + """ + )), + ItemNames.CYCLONE: + ItemData(21 + SC2WOL_ITEM_ID_OFFSET, "Unit", 21, SC2Race.TERRAN, + classification=ItemClassification.progression, origin={"ext"}, + description=inspect.cleandoc( + """ + Mobile assault vehicle. Can use Lock On to quickly fire while moving. + """ + )), + ItemNames.HERC: + ItemData(22 + SC2WOL_ITEM_ID_OFFSET, "Unit", 26, SC2Race.TERRAN, + classification=ItemClassification.progression, origin={"ext"}, + description=inspect.cleandoc( + """ + Front-line infantry. Can use Grapple. + """ + )), + ItemNames.WARHOUND: + ItemData(23 + SC2WOL_ITEM_ID_OFFSET, "Unit", 27, SC2Race.TERRAN, + classification=ItemClassification.progression, origin={"ext"}, + description=inspect.cleandoc( + """ + Anti-vehicle mech. Haywire missiles do bonus damage to mechanical units. + """ + )), + + # Some other items are moved to Upgrade group because of the way how the bot message is parsed + ItemNames.PROGRESSIVE_TERRAN_INFANTRY_WEAPON: + ItemData(100 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 0, SC2Race.TERRAN, + quantity=3, + description=inspect.cleandoc( + f""" + Increases damage of Terran infantry units. + {WEAPON_ARMOR_UPGRADE_NOTE} + """ + )), + ItemNames.PROGRESSIVE_TERRAN_INFANTRY_ARMOR: + ItemData(102 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 2, SC2Race.TERRAN, + quantity=3, + description=inspect.cleandoc( + f""" + Increases armor of Terran infantry units. + {WEAPON_ARMOR_UPGRADE_NOTE} + """ + )), + ItemNames.PROGRESSIVE_TERRAN_VEHICLE_WEAPON: + ItemData(103 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 4, SC2Race.TERRAN, + quantity=3, + description=inspect.cleandoc( + f""" + Increases damage of Terran vehicle units. + {WEAPON_ARMOR_UPGRADE_NOTE} + """ + )), + ItemNames.PROGRESSIVE_TERRAN_VEHICLE_ARMOR: + ItemData(104 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 6, SC2Race.TERRAN, + quantity=3, + description=inspect.cleandoc( + f""" + Increases armor of Terran vehicle units. + {WEAPON_ARMOR_UPGRADE_NOTE} + """ + )), + ItemNames.PROGRESSIVE_TERRAN_SHIP_WEAPON: + ItemData(105 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 8, SC2Race.TERRAN, + quantity=3, + description=inspect.cleandoc( + f""" + Increases damage of Terran starship units. + {WEAPON_ARMOR_UPGRADE_NOTE} + """ + )), + ItemNames.PROGRESSIVE_TERRAN_SHIP_ARMOR: + ItemData(106 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 10, SC2Race.TERRAN, + quantity=3, + description=inspect.cleandoc( + f""" + Increases armor of Terran starship units. + {WEAPON_ARMOR_UPGRADE_NOTE} + """ + )), + # Upgrade bundle 'number' values are used as indices to get affected 'number's + ItemNames.PROGRESSIVE_TERRAN_WEAPON_UPGRADE: ItemData(107 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 0, SC2Race.TERRAN, quantity=3), + ItemNames.PROGRESSIVE_TERRAN_ARMOR_UPGRADE: ItemData(108 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 1, SC2Race.TERRAN, quantity=3), + ItemNames.PROGRESSIVE_TERRAN_INFANTRY_UPGRADE: ItemData(109 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 2, SC2Race.TERRAN, quantity=3), + ItemNames.PROGRESSIVE_TERRAN_VEHICLE_UPGRADE: ItemData(110 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 3, SC2Race.TERRAN, quantity=3), + ItemNames.PROGRESSIVE_TERRAN_SHIP_UPGRADE: ItemData(111 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 4, SC2Race.TERRAN, quantity=3), + ItemNames.PROGRESSIVE_TERRAN_WEAPON_ARMOR_UPGRADE: ItemData(112 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 5, SC2Race.TERRAN, quantity=3), + + # Unit and structure upgrades + ItemNames.BUNKER_PROJECTILE_ACCELERATOR: + ItemData(200 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 0, SC2Race.TERRAN, + parent_item=ItemNames.BUNKER, + description="Increases range of all units in the Bunker by 1."), + ItemNames.BUNKER_NEOSTEEL_BUNKER: + ItemData(201 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 1, SC2Race.TERRAN, + parent_item=ItemNames.BUNKER, + description="Increases the number of Bunker slots by 2."), + ItemNames.MISSILE_TURRET_TITANIUM_HOUSING: + ItemData(202 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 2, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MISSILE_TURRET, + description="Increases Missile Turret life by 75."), + ItemNames.MISSILE_TURRET_HELLSTORM_BATTERIES: + ItemData(203 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 3, SC2Race.TERRAN, + parent_item=ItemNames.MISSILE_TURRET, + description="The Missile Turret unleashes an additional flurry of missiles with each attack."), + ItemNames.SCV_ADVANCED_CONSTRUCTION: + ItemData(204 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 4, SC2Race.TERRAN, + description="Multiple SCVs can construct a structure, reducing its construction time."), + ItemNames.SCV_DUAL_FUSION_WELDERS: + ItemData(205 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 5, SC2Race.TERRAN, + description="SCVs repair twice as fast."), + ItemNames.PROGRESSIVE_FIRE_SUPPRESSION_SYSTEM: + ItemData(206 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 24, SC2Race.TERRAN, + quantity=2, + description=inspect.cleandoc( + """ + Level 1: While on low health, Terran structures are repaired to half health instead of burning down. + Level 2: Terran structures are repaired to full health instead of half health + """ + )), + ItemNames.PROGRESSIVE_ORBITAL_COMMAND: + ItemData(207 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 26, SC2Race.TERRAN, + quantity=2, classification=ItemClassification.progression, + description=inspect.cleandoc( + """ + Level 1: Allows Command Centers to use Scanner Sweep and Calldown: MULE abilities. + Level 2: Orbital Command abilities work even in Planetary Fortress mode. + """ + )), + ItemNames.MARINE_PROGRESSIVE_STIMPACK: + ItemData(208 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 0, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.MARINE, quantity=2, + description=STIMPACK_SMALL_DESCRIPTION), + ItemNames.MARINE_COMBAT_SHIELD: + ItemData(209 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 9, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.MARINE, + description="Increases Marine life by 10."), + ItemNames.MEDIC_ADVANCED_MEDIC_FACILITIES: + ItemData(210 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 10, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MEDIC, + description=INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE.format("Medics", "Barracks")), + ItemNames.MEDIC_STABILIZER_MEDPACKS: + ItemData(211 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 11, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.MEDIC, + description="Increases Medic heal speed. Reduces the amount of energy required for each heal."), + ItemNames.FIREBAT_INCINERATOR_GAUNTLETS: + ItemData(212 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 12, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.FIREBAT, + description="Increases Firebat's damage radius by 40%"), + ItemNames.FIREBAT_JUGGERNAUT_PLATING: + ItemData(213 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 13, SC2Race.TERRAN, + parent_item=ItemNames.FIREBAT, + description="Increases Firebat's armor by 2."), + ItemNames.MARAUDER_CONCUSSIVE_SHELLS: + ItemData(214 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 14, SC2Race.TERRAN, + parent_item=ItemNames.MARAUDER, + description="Marauder attack temporarily slows all units in target area."), + ItemNames.MARAUDER_KINETIC_FOAM: + ItemData(215 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 15, SC2Race.TERRAN, + parent_item=ItemNames.MARAUDER, + description="Increases Marauder life by 25."), + ItemNames.REAPER_U238_ROUNDS: + ItemData(216 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 16, SC2Race.TERRAN, + parent_item=ItemNames.REAPER, + description=inspect.cleandoc( + """ + Increases Reaper pistol attack range by 1. + Reaper pistols do additional 3 damage to Light Armor. + """ + )), + ItemNames.REAPER_G4_CLUSTERBOMB: + ItemData(217 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 17, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.REAPER, + description="Timed explosive that does heavy area damage."), + ItemNames.CYCLONE_MAG_FIELD_ACCELERATORS: + ItemData(218 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 18, SC2Race.TERRAN, + parent_item=ItemNames.CYCLONE, origin={"ext"}, + description="Increases Cyclone Lock On damage"), + ItemNames.CYCLONE_MAG_FIELD_LAUNCHERS: + ItemData(219 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 19, SC2Race.TERRAN, + parent_item=ItemNames.CYCLONE, origin={"ext"}, + description="Increases Cyclone attack range by 2."), + ItemNames.MARINE_LASER_TARGETING_SYSTEM: + ItemData(220 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 8, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MARINE, origin={"nco"}, + description=LASER_TARGETING_SYSTEMS_DESCRIPTION), + ItemNames.MARINE_MAGRAIL_MUNITIONS: + ItemData(221 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 20, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.MARINE, origin={"nco"}, + description="Deals 20 damage to target unit. Autocast on attack with a cooldown."), + ItemNames.MARINE_OPTIMIZED_LOGISTICS: + ItemData(222 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 21, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MARINE, origin={"nco"}, + description="Increases Marine training speed."), + ItemNames.MEDIC_RESTORATION: + ItemData(223 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 22, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MEDIC, origin={"bw"}, + description="Removes negative status effects from target allied unit."), + ItemNames.MEDIC_OPTICAL_FLARE: + ItemData(224 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 23, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MEDIC, origin={"bw"}, + description="Reduces vision range of target enemy unit. Disables detection."), + ItemNames.MEDIC_RESOURCE_EFFICIENCY: + ItemData(225 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 24, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MEDIC, origin={"bw"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("Medic")), + ItemNames.FIREBAT_PROGRESSIVE_STIMPACK: + ItemData(226 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 6, SC2Race.TERRAN, + parent_item=ItemNames.FIREBAT, quantity=2, origin={"bw"}, + description=STIMPACK_LARGE_DESCRIPTION), + ItemNames.FIREBAT_RESOURCE_EFFICIENCY: + ItemData(227 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 25, SC2Race.TERRAN, + parent_item=ItemNames.FIREBAT, origin={"bw"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("Firebat")), + ItemNames.MARAUDER_PROGRESSIVE_STIMPACK: + ItemData(228 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 8, SC2Race.TERRAN, + parent_item=ItemNames.MARAUDER, quantity=2, origin={"nco"}, + description=STIMPACK_LARGE_DESCRIPTION), + ItemNames.MARAUDER_LASER_TARGETING_SYSTEM: + ItemData(229 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 26, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MARAUDER, origin={"nco"}, + description=LASER_TARGETING_SYSTEMS_DESCRIPTION), + ItemNames.MARAUDER_MAGRAIL_MUNITIONS: + ItemData(230 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 27, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MARAUDER, origin={"nco"}, + description="Deals 20 damage to target unit. Autocast on attack with a cooldown."), + ItemNames.MARAUDER_INTERNAL_TECH_MODULE: + ItemData(231 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 28, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MARAUDER, origin={"nco"}, + description=INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE.format("Marauders", "Barracks")), + ItemNames.SCV_HOSTILE_ENVIRONMENT_ADAPTATION: + ItemData(232 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 29, SC2Race.TERRAN, + classification=ItemClassification.filler, origin={"bw"}, + description="Increases SCV life by 15 and attack speed slightly."), + ItemNames.MEDIC_ADAPTIVE_MEDPACKS: + ItemData(233 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 0, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.MEDIC, origin={"ext"}, + description="Allows Medics to heal mechanical and air units."), + ItemNames.MEDIC_NANO_PROJECTOR: + ItemData(234 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 1, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MEDIC, origin={"ext"}, + description="Increases Medic heal range by 2."), + ItemNames.FIREBAT_INFERNAL_PRE_IGNITER: + ItemData(235 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 2, SC2Race.TERRAN, + parent_item=ItemNames.FIREBAT, origin={"bw"}, + description="Firebats do an additional 4 damage to Light Armor."), + ItemNames.FIREBAT_KINETIC_FOAM: + ItemData(236 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 3, SC2Race.TERRAN, + parent_item=ItemNames.FIREBAT, origin={"ext"}, + description="Increases Firebat life by 100."), + ItemNames.FIREBAT_NANO_PROJECTORS: + ItemData(237 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 4, SC2Race.TERRAN, + parent_item=ItemNames.FIREBAT, origin={"ext"}, + description="Increases Firebat attack range by 2"), + ItemNames.MARAUDER_JUGGERNAUT_PLATING: + ItemData(238 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 5, SC2Race.TERRAN, + parent_item=ItemNames.MARAUDER, origin={"ext"}, + description="Increases Marauder's armor by 2."), + ItemNames.REAPER_JET_PACK_OVERDRIVE: + ItemData(239 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 6, SC2Race.TERRAN, + parent_item=ItemNames.REAPER, origin={"ext"}, + description=inspect.cleandoc( + """ + Allows the Reaper to fly for 10 seconds. + While flying, the Reaper can attack air units. + """ + )), + ItemNames.HELLION_INFERNAL_PLATING: + ItemData(240 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 7, SC2Race.TERRAN, + parent_item=ItemNames.HELLION, origin={"ext"}, + description="Increases Hellion and Hellbat armor by 2."), + ItemNames.VULTURE_AUTO_REPAIR: + ItemData(241 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 8, SC2Race.TERRAN, + parent_item=ItemNames.VULTURE, origin={"ext"}, + description="Vultures regenerate life."), + ItemNames.GOLIATH_SHAPED_HULL: + ItemData(242 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 9, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.GOLIATH, origin={"nco", "ext"}, + description="Increases Goliath life by 25."), + ItemNames.GOLIATH_RESOURCE_EFFICIENCY: + ItemData(243 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 10, SC2Race.TERRAN, + parent_item=ItemNames.GOLIATH, origin={"nco", "bw"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("Goliath")), + ItemNames.GOLIATH_INTERNAL_TECH_MODULE: + ItemData(244 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 11, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.GOLIATH, origin={"nco", "bw"}, + description=INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE.format("Goliaths", "Factory")), + ItemNames.SIEGE_TANK_SHAPED_HULL: + ItemData(245 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 12, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.SIEGE_TANK, origin={"nco", "ext"}, + description="Increases Siege Tank life by 25."), + ItemNames.SIEGE_TANK_RESOURCE_EFFICIENCY: + ItemData(246 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 13, SC2Race.TERRAN, + parent_item=ItemNames.SIEGE_TANK, origin={"bw"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("Siege Tank")), + ItemNames.PREDATOR_CLOAK: + ItemData(247 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 14, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.PREDATOR, origin={"ext"}, + description=CLOAK_DESCRIPTION_TEMPLATE.format("Predators")), + ItemNames.PREDATOR_CHARGE: + ItemData(248 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 15, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.PREDATOR, origin={"ext"}, + description="Allows Predators to intercept enemy ground units."), + ItemNames.MEDIVAC_SCATTER_VEIL: + ItemData(249 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 16, SC2Race.TERRAN, + parent_item=ItemNames.MEDIVAC, origin={"ext"}, + description="Medivacs get 100 shields."), + ItemNames.REAPER_PROGRESSIVE_STIMPACK: + ItemData(250 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 10, SC2Race.TERRAN, + parent_item=ItemNames.REAPER, quantity=2, origin={"nco"}, + description=STIMPACK_SMALL_DESCRIPTION), + ItemNames.REAPER_LASER_TARGETING_SYSTEM: + ItemData(251 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 17, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.REAPER, origin={"nco"}, + description=LASER_TARGETING_SYSTEMS_DESCRIPTION), + ItemNames.REAPER_ADVANCED_CLOAKING_FIELD: + ItemData(252 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 18, SC2Race.TERRAN, + parent_item=ItemNames.REAPER, origin={"nco"}, + description="Reapers are permanently cloaked."), + ItemNames.REAPER_SPIDER_MINES: + ItemData(253 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 19, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.REAPER, origin={"nco"}, + important_for_filtering=True, + description="Allows Reapers to lay Spider Mines. 3 charges per Reaper."), + ItemNames.REAPER_COMBAT_DRUGS: + ItemData(254 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 20, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.REAPER, origin={"ext"}, + description="Reapers regenerate life while out of combat."), + ItemNames.HELLION_HELLBAT_ASPECT: + ItemData(255 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 21, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.HELLION, origin={"nco"}, + description="Allows Hellions to transform into Hellbats."), + ItemNames.HELLION_SMART_SERVOS: + ItemData(256 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 22, SC2Race.TERRAN, + parent_item=ItemNames.HELLION, origin={"nco"}, + description="Transforms faster between modes. Hellions can attack while moving."), + ItemNames.HELLION_OPTIMIZED_LOGISTICS: + ItemData(257 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 23, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.HELLION, origin={"nco"}, + description="Increases Hellion training speed."), + ItemNames.HELLION_JUMP_JETS: + ItemData(258 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 24, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.HELLION, origin={"nco"}, + description=inspect.cleandoc( + """ + Increases movement speed in Hellion mode. + In Hellbat mode, launches the Hellbat toward enemy ground units and briefly stuns them. + """ + )), + ItemNames.HELLION_PROGRESSIVE_STIMPACK: + ItemData(259 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 12, SC2Race.TERRAN, + parent_item=ItemNames.HELLION, quantity=2, origin={"nco"}, + description=STIMPACK_LARGE_DESCRIPTION), + ItemNames.VULTURE_ION_THRUSTERS: + ItemData(260 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 25, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.VULTURE, origin={"bw"}, + description="Increases Vulture movement speed."), + ItemNames.VULTURE_AUTO_LAUNCHERS: + ItemData(261 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 26, SC2Race.TERRAN, + parent_item=ItemNames.VULTURE, origin={"bw"}, + description="Allows Vultures to attack while moving."), + ItemNames.SPIDER_MINE_HIGH_EXPLOSIVE_MUNITION: + ItemData(262 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 27, SC2Race.TERRAN, + origin={"bw"}, + description="Increases Spider mine damage."), + ItemNames.GOLIATH_JUMP_JETS: + ItemData(263 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 28, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.GOLIATH, origin={"nco"}, + description="Allows Goliaths to jump up and down cliffs."), + ItemNames.GOLIATH_OPTIMIZED_LOGISTICS: + ItemData(264 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 29, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.GOLIATH, origin={"nco"}, + description="Increases Goliath training speed."), + ItemNames.DIAMONDBACK_HYPERFLUXOR: + ItemData(265 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 0, SC2Race.TERRAN, + parent_item=ItemNames.DIAMONDBACK, origin={"ext"}, + description="Increases Diamondback attack speed."), + ItemNames.DIAMONDBACK_BURST_CAPACITORS: + ItemData(266 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 1, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.DIAMONDBACK, origin={"ext"}, + description=inspect.cleandoc( + """ + While not attacking, the Diamondback charges its weapon. + The next attack does 10 additional damage. + """ + )), + ItemNames.DIAMONDBACK_RESOURCE_EFFICIENCY: + ItemData(267 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 2, SC2Race.TERRAN, + parent_item=ItemNames.DIAMONDBACK, origin={"ext"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("Diamondback")), + ItemNames.SIEGE_TANK_JUMP_JETS: + ItemData(268 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 3, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.SIEGE_TANK, origin={"nco"}, + description=inspect.cleandoc( + """ + Repositions Siege Tank to a target location. + Can be used in either mode and to jump up and down cliffs. + """ + )), + ItemNames.SIEGE_TANK_SPIDER_MINES: + ItemData(269 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 4, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.SIEGE_TANK, origin={"nco"}, + important_for_filtering=True, + description=inspect.cleandoc( + """ + Allows Siege Tanks to lay Spider Mines. + Lays 3 Spider Mines at once. 3 charges + """ + )), + ItemNames.SIEGE_TANK_SMART_SERVOS: + ItemData(270 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 5, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.SIEGE_TANK, origin={"nco"}, + description=SMART_SERVOS_DESCRIPTION), + ItemNames.SIEGE_TANK_GRADUATING_RANGE: + ItemData(271 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 6, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.SIEGE_TANK, origin={"ext"}, + description=inspect.cleandoc( + """ + Increases the Siege Tank's attack range by 1 every 3 seconds while in Siege Mode, + up to a maximum of 5 additional range. + """ + )), + ItemNames.SIEGE_TANK_LASER_TARGETING_SYSTEM: + ItemData(272 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 7, SC2Race.TERRAN, + parent_item=ItemNames.SIEGE_TANK, origin={"nco"}, + description=LASER_TARGETING_SYSTEMS_DESCRIPTION), + ItemNames.SIEGE_TANK_ADVANCED_SIEGE_TECH: + ItemData(273 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 8, SC2Race.TERRAN, + parent_item=ItemNames.SIEGE_TANK, origin={"ext"}, + description="Siege Tanks gain +3 armor in Siege Mode."), + ItemNames.SIEGE_TANK_INTERNAL_TECH_MODULE: + ItemData(274 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 9, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.SIEGE_TANK, origin={"nco"}, + description=INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE.format("Siege Tanks", "Factory")), + ItemNames.PREDATOR_RESOURCE_EFFICIENCY: + ItemData(275 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 10, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.PREDATOR, origin={"ext"}, + description="Decreases Predator resource and supply cost."), + ItemNames.MEDIVAC_EXPANDED_HULL: + ItemData(276 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 11, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MEDIVAC, origin={"ext"}, + description="Increases Medivac cargo space by 4."), + ItemNames.MEDIVAC_AFTERBURNERS: + ItemData(277 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 12, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MEDIVAC, origin={"ext"}, + description="Ability. Temporarily increases the Medivac's movement speed by 70%."), + ItemNames.WRAITH_ADVANCED_LASER_TECHNOLOGY: + ItemData(278 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 13, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.WRAITH, origin={"ext"}, + description=inspect.cleandoc( + """ + Burst Lasers do more damage and can hit both ground and air targets. + Replaces Gemini Missiles weapon. + """ + )), + ItemNames.VIKING_SMART_SERVOS: + ItemData(279 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 14, SC2Race.TERRAN, + parent_item=ItemNames.VIKING, origin={"ext"}, + description=SMART_SERVOS_DESCRIPTION), + ItemNames.VIKING_ANTI_MECHANICAL_MUNITION: + ItemData(280 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 15, SC2Race.TERRAN, + parent_item=ItemNames.VIKING, origin={"ext"}, + description="Increases Viking damage to mechanical units while in Assault Mode."), + ItemNames.DIAMONDBACK_ION_THRUSTERS: + ItemData(281 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 21, SC2Race.TERRAN, + parent_item=ItemNames.DIAMONDBACK, origin={"ext"}, + description="Increases Diamondback movement speed."), + ItemNames.WARHOUND_RESOURCE_EFFICIENCY: + ItemData(282 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 13, SC2Race.TERRAN, + parent_item=ItemNames.WARHOUND, origin={"ext"}, + description=RESOURCE_EFFICIENCY_NO_SUPPLY_DESCRIPTION_TEMPLATE.format("Warhound")), + ItemNames.WARHOUND_REINFORCED_PLATING: + ItemData(283 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 14, SC2Race.TERRAN, + parent_item=ItemNames.WARHOUND, origin={"ext"}, + description="Increases Warhound armor by 2."), + ItemNames.HERC_RESOURCE_EFFICIENCY: + ItemData(284 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 15, SC2Race.TERRAN, + parent_item=ItemNames.HERC, origin={"ext"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("HERC")), + ItemNames.HERC_JUGGERNAUT_PLATING: + ItemData(285 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 16, SC2Race.TERRAN, + parent_item=ItemNames.WARHOUND, origin={"ext"}, + description="Increases HERC armor by 2."), + ItemNames.HERC_KINETIC_FOAM: + ItemData(286 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 17, SC2Race.TERRAN, + parent_item=ItemNames.WARHOUND, origin={"ext"}, + description="Increases HERC life by 50."), + + ItemNames.HELLION_TWIN_LINKED_FLAMETHROWER: + ItemData(300 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 16, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.HELLION, + description="Doubles the width of the Hellion's flame attack."), + ItemNames.HELLION_THERMITE_FILAMENTS: + ItemData(301 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 17, SC2Race.TERRAN, + parent_item=ItemNames.HELLION, + description="Hellions do an additional 10 damage to Light Armor."), + ItemNames.SPIDER_MINE_CERBERUS_MINE: + ItemData(302 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 18, SC2Race.TERRAN, + classification=ItemClassification.filler, + description="Increases trigger and blast radius of Spider Mines."), + ItemNames.VULTURE_PROGRESSIVE_REPLENISHABLE_MAGAZINE: + ItemData(303 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 16, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.VULTURE, quantity=2, + description=inspect.cleandoc( + """ + Level 1: Allows Vultures to replace used Spider Mines. Costs 15 minerals. + Level 2: Replacing used Spider Mines no longer costs minerals. + """ + )), + ItemNames.GOLIATH_MULTI_LOCK_WEAPONS_SYSTEM: + ItemData(304 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 19, SC2Race.TERRAN, + parent_item=ItemNames.GOLIATH, + description="Goliaths can attack both ground and air targets simultaneously."), + ItemNames.GOLIATH_ARES_CLASS_TARGETING_SYSTEM: + ItemData(305 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 20, SC2Race.TERRAN, + parent_item=ItemNames.GOLIATH, + description="Increases Goliath ground attack range by 1 and air by 3."), + ItemNames.DIAMONDBACK_PROGRESSIVE_TRI_LITHIUM_POWER_CELL: + ItemData(306 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade 2", 4, SC2Race.TERRAN, + parent_item=ItemNames.DIAMONDBACK, quantity=2, + description=inspect.cleandoc( + """ + Level 1: Tri-Lithium Power Cell: Increases Diamondback attack range by 1. + Level 2: Tungsten Spikes: Increases Diamondback attack range by 3. + """ + )), + ItemNames.DIAMONDBACK_SHAPED_HULL: + ItemData(307 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 22, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.DIAMONDBACK, + description="Increases Diamondback life by 50."), + ItemNames.SIEGE_TANK_MAELSTROM_ROUNDS: + ItemData(308 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 23, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.SIEGE_TANK, + description="Siege Tanks do an additional 40 damage to the primary target in Siege Mode."), + ItemNames.SIEGE_TANK_SHAPED_BLAST: + ItemData(309 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 24, SC2Race.TERRAN, + parent_item=ItemNames.SIEGE_TANK, + description="Reduces splash damage to friendly targets while in Siege Mode by 75%."), + ItemNames.MEDIVAC_RAPID_DEPLOYMENT_TUBE: + ItemData(310 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 25, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MEDIVAC, + description="Medivacs deploy loaded troops almost instantly."), + ItemNames.MEDIVAC_ADVANCED_HEALING_AI: + ItemData(311 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 26, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.MEDIVAC, + description="Medivacs can heal two targets at once."), + ItemNames.WRAITH_PROGRESSIVE_TOMAHAWK_POWER_CELLS: + ItemData(312 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 18, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.WRAITH, quantity=2, + description=inspect.cleandoc( + """ + Level 1: Tomahawk Power Cells: Increases Wraith starting energy by 100. + Level 2: Unregistered Cloaking Module: Wraiths do not require energy to cloak and remain cloaked. + """ + )), + ItemNames.WRAITH_DISPLACEMENT_FIELD: + ItemData(313 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 27, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.WRAITH, + description="Wraiths evade 20% of incoming attacks while cloaked."), + ItemNames.VIKING_RIPWAVE_MISSILES: + ItemData(314 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 28, SC2Race.TERRAN, + parent_item=ItemNames.VIKING, + description="Vikings do area damage while in Fighter Mode"), + ItemNames.VIKING_PHOBOS_CLASS_WEAPONS_SYSTEM: + ItemData(315 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 29, SC2Race.TERRAN, + parent_item=ItemNames.VIKING, + description="Increases Viking attack range by 1 in Assault mode and 2 in Fighter mode."), + ItemNames.BANSHEE_PROGRESSIVE_CROSS_SPECTRUM_DAMPENERS: + ItemData(316 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 2, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.BANSHEE, quantity=2, + description=inspect.cleandoc( + """ + Level 1: Banshees can remain cloaked twice as long. + Level 2: Banshees do not require energy to cloak and remain cloaked. + """ + )), + ItemNames.BANSHEE_SHOCKWAVE_MISSILE_BATTERY: + ItemData(317 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 0, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.BANSHEE, + description="Banshees do area damage in a straight line."), + ItemNames.BATTLECRUISER_PROGRESSIVE_MISSILE_PODS: + ItemData(318 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade 2", 2, SC2Race.TERRAN, + parent_item=ItemNames.BATTLECRUISER, quantity=2, + description="Spell. Missile Pods do damage to air targets in a target area."), + ItemNames.BATTLECRUISER_PROGRESSIVE_DEFENSIVE_MATRIX: + ItemData(319 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 20, SC2Race.TERRAN, + parent_item=ItemNames.BATTLECRUISER, quantity=2, + description=inspect.cleandoc( + """ + Level 1: Spell. For 20 seconds the Battlecruiser gains a shield that can absorb up to 200 damage. + Level 2: Passive. Battlecruiser gets 200 shields. + """ + )), + ItemNames.GHOST_OCULAR_IMPLANTS: + ItemData(320 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 2, SC2Race.TERRAN, + parent_item=ItemNames.GHOST, + description="Increases Ghost sight range by 3 and attack range by 2."), + ItemNames.GHOST_CRIUS_SUIT: + ItemData(321 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 3, SC2Race.TERRAN, + parent_item=ItemNames.GHOST, + description="Cloak no longer requires energy to activate or maintain."), + ItemNames.SPECTRE_PSIONIC_LASH: + ItemData(322 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 4, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.SPECTRE, + description="Spell. Deals 200 damage to a single target."), + ItemNames.SPECTRE_NYX_CLASS_CLOAKING_MODULE: + ItemData(323 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 5, SC2Race.TERRAN, + parent_item=ItemNames.SPECTRE, + description="Cloak no longer requires energy to activate or maintain."), + ItemNames.THOR_330MM_BARRAGE_CANNON: + ItemData(324 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 6, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.THOR, + description=inspect.cleandoc( + """ + Improves 250mm Strike Cannons ability to deal area damage and stun units in a small area. + Can be also freely aimed on ground. + """ + )), + ItemNames.THOR_PROGRESSIVE_IMMORTALITY_PROTOCOL: + ItemData(325 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 22, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.THOR, quantity=2, + description=inspect.cleandoc(""" + Level 1: Allows destroyed Thors to be reconstructed on the field. Costs Vespene Gas. + Level 2: Thors are automatically reconstructed after falling for free. + """ + )), + ItemNames.LIBERATOR_ADVANCED_BALLISTICS: + ItemData(326 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 7, SC2Race.TERRAN, + parent_item=ItemNames.LIBERATOR, origin={"ext"}, + description="Increases Liberator range by 3 in Defender Mode."), + ItemNames.LIBERATOR_RAID_ARTILLERY: + ItemData(327 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 8, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.LIBERATOR, origin={"nco"}, + description="Allows Liberators to attack structures while in Defender Mode."), + ItemNames.WIDOW_MINE_DRILLING_CLAWS: + ItemData(328 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 9, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.WIDOW_MINE, origin={"ext"}, + description="Allows Widow Mines to burrow and unburrow faster."), + ItemNames.WIDOW_MINE_CONCEALMENT: + ItemData(329 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 10, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.WIDOW_MINE, origin={"ext"}, + description="Burrowed Widow Mines are no longer revealed when the Sentinel Missile is on cooldown."), + ItemNames.MEDIVAC_ADVANCED_CLOAKING_FIELD: + ItemData(330 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 11, SC2Race.TERRAN, + parent_item=ItemNames.MEDIVAC, origin={"ext"}, + description="Medivacs are permanently cloaked."), + ItemNames.WRAITH_TRIGGER_OVERRIDE: + ItemData(331 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 12, SC2Race.TERRAN, + parent_item=ItemNames.WRAITH, origin={"ext"}, + description="Wraith attack speed increases by 10% with each attack, up to a maximum of 100%."), + ItemNames.WRAITH_INTERNAL_TECH_MODULE: + ItemData(332 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 13, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.WRAITH, origin={"bw"}, + description=INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE.format("Wraiths", "Starport")), + ItemNames.WRAITH_RESOURCE_EFFICIENCY: + ItemData(333 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 14, SC2Race.TERRAN, + parent_item=ItemNames.WRAITH, origin={"bw"}, + description=RESOURCE_EFFICIENCY_NO_SUPPLY_DESCRIPTION_TEMPLATE.format("Wraith")), + ItemNames.VIKING_SHREDDER_ROUNDS: + ItemData(334 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 15, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.VIKING, origin={"ext"}, + description="Attacks in Assault mode do line splash damage."), + ItemNames.VIKING_WILD_MISSILES: + ItemData(335 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 16, SC2Race.TERRAN, + parent_item=ItemNames.VIKING, origin={"ext"}, + description="Launches 5 rockets at the target unit. Each rocket does 25 (40 vs armored) damage."), + ItemNames.BANSHEE_SHAPED_HULL: + ItemData(336 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 17, SC2Race.TERRAN, + parent_item=ItemNames.BANSHEE, origin={"ext"}, + description="Increases Banshee life by 100."), + ItemNames.BANSHEE_ADVANCED_TARGETING_OPTICS: + ItemData(337 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 18, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.BANSHEE, origin={"ext"}, + description="Increases Banshee attack range by 2 while cloaked."), + ItemNames.BANSHEE_DISTORTION_BLASTERS: + ItemData(338 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 19, SC2Race.TERRAN, + parent_item=ItemNames.BANSHEE, origin={"ext"}, + description="Increases Banshee attack damage by 25% while cloaked."), + ItemNames.BANSHEE_ROCKET_BARRAGE: + ItemData(339 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 20, SC2Race.TERRAN, + parent_item=ItemNames.BANSHEE, origin={"ext"}, + description="Deals 75 damage to enemy ground units in the target area."), + ItemNames.GHOST_RESOURCE_EFFICIENCY: + ItemData(340 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 21, SC2Race.TERRAN, + parent_item=ItemNames.GHOST, origin={"bw"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("Ghost")), + ItemNames.SPECTRE_RESOURCE_EFFICIENCY: + ItemData(341 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 22, SC2Race.TERRAN, + parent_item=ItemNames.SPECTRE, origin={"ext"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("Spectre")), + ItemNames.THOR_BUTTON_WITH_A_SKULL_ON_IT: + ItemData(342 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 23, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.THOR, origin={"ext"}, + description="Allows Thors to launch nukes."), + ItemNames.THOR_LASER_TARGETING_SYSTEM: + ItemData(343 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 24, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.THOR, origin={"ext"}, + description=LASER_TARGETING_SYSTEMS_DESCRIPTION), + ItemNames.THOR_LARGE_SCALE_FIELD_CONSTRUCTION: + ItemData(344 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 25, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.THOR, origin={"ext"}, + description="Allows Thors to be built by SCVs like a structure."), + ItemNames.RAVEN_RESOURCE_EFFICIENCY: + ItemData(345 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 26, SC2Race.TERRAN, + parent_item=ItemNames.RAVEN, origin={"ext"}, + description=RESOURCE_EFFICIENCY_NO_SUPPLY_DESCRIPTION_TEMPLATE.format("Raven")), + ItemNames.RAVEN_DURABLE_MATERIALS: + ItemData(346 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 27, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.RAVEN, origin={"ext"}, + description="Extends timed life duration of Raven's summoned objects."), + ItemNames.SCIENCE_VESSEL_IMPROVED_NANO_REPAIR: + ItemData(347 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 28, SC2Race.TERRAN, + parent_item=ItemNames.SCIENCE_VESSEL, origin={"ext"}, + description="Nano-Repair no longer requires energy to use."), + ItemNames.SCIENCE_VESSEL_ADVANCED_AI_SYSTEMS: + ItemData(348 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 29, SC2Race.TERRAN, + parent_item=ItemNames.SCIENCE_VESSEL, origin={"ext"}, + description="Science Vessel can use Nano-Repair at two targets at once."), + ItemNames.CYCLONE_RESOURCE_EFFICIENCY: + ItemData(349 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 0, SC2Race.TERRAN, + parent_item=ItemNames.CYCLONE, origin={"ext"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("Cyclone")), + ItemNames.BANSHEE_HYPERFLIGHT_ROTORS: + ItemData(350 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 1, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.BANSHEE, origin={"ext"}, + description="Increases Banshee movement speed."), + ItemNames.BANSHEE_LASER_TARGETING_SYSTEM: + ItemData(351 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 2, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.BANSHEE, origin={"nco"}, + description=LASER_TARGETING_SYSTEMS_DESCRIPTION), + ItemNames.BANSHEE_INTERNAL_TECH_MODULE: + ItemData(352 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 3, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.BANSHEE, origin={"nco"}, + description=INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE.format("Banshees", "Starport")), + ItemNames.BATTLECRUISER_TACTICAL_JUMP: + ItemData(353 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 4, SC2Race.TERRAN, + parent_item=ItemNames.BATTLECRUISER, origin={"nco", "ext"}, + description=inspect.cleandoc( + """ + Allows Battlecruisers to warp to a target location anywhere on the map. + """ + )), + ItemNames.BATTLECRUISER_CLOAK: + ItemData(354 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 5, SC2Race.TERRAN, + parent_item=ItemNames.BATTLECRUISER, origin={"nco"}, + description=CLOAK_DESCRIPTION_TEMPLATE.format("Battlecruisers")), + ItemNames.BATTLECRUISER_ATX_LASER_BATTERY: + ItemData(355 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 6, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.BATTLECRUISER, origin={"nco"}, + description=inspect.cleandoc( + """ + Battlecruisers can attack while moving, + do the same damage to both ground and air targets, and fire faster. + """ + )), + ItemNames.BATTLECRUISER_OPTIMIZED_LOGISTICS: + ItemData(356 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 7, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.BATTLECRUISER, origin={"ext"}, + description="Increases Battlecruiser training speed."), + ItemNames.BATTLECRUISER_INTERNAL_TECH_MODULE: + ItemData(357 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 8, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.BATTLECRUISER, origin={"nco"}, + description=INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE.format("Battlecruisers", "Starport")), + ItemNames.GHOST_EMP_ROUNDS: + ItemData(358 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 9, SC2Race.TERRAN, + parent_item=ItemNames.GHOST, origin={"ext"}, + description=inspect.cleandoc( + """ + Spell. Does 100 damage to shields and drains all energy from units in the targeted area. + Cloaked units hit by EMP are revealed for a short time. + """ + )), + ItemNames.GHOST_LOCKDOWN: + ItemData(359 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 10, SC2Race.TERRAN, + parent_item=ItemNames.GHOST, origin={"bw"}, + description="Spell. Stuns a target mechanical unit for a long time."), + ItemNames.SPECTRE_IMPALER_ROUNDS: + ItemData(360 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 11, SC2Race.TERRAN, + parent_item=ItemNames.SPECTRE, origin={"ext"}, + description="Spectres do additional damage to armored targets."), + ItemNames.THOR_PROGRESSIVE_HIGH_IMPACT_PAYLOAD: + ItemData(361 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 14, SC2Race.TERRAN, + parent_item=ItemNames.THOR, quantity=2, origin={"ext"}, + description=inspect.cleandoc( + f""" + Level 1: Allows Thors to transform in order to use an alternative air attack. + Level 2: {SMART_SERVOS_DESCRIPTION} + """ + )), + ItemNames.RAVEN_BIO_MECHANICAL_REPAIR_DRONE: + ItemData(363 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 12, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.RAVEN, origin={"nco"}, + description="Spell. Deploys a drone that can heal biological or mechanical units."), + ItemNames.RAVEN_SPIDER_MINES: + ItemData(364 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 13, SC2Race.TERRAN, + parent_item=ItemNames.RAVEN, origin={"nco"}, important_for_filtering=True, + description="Spell. Deploys 3 Spider Mines to a target location."), + ItemNames.RAVEN_RAILGUN_TURRET: + ItemData(365 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 14, SC2Race.TERRAN, + parent_item=ItemNames.RAVEN, origin={"nco"}, + description=inspect.cleandoc( + """ + Spell. Allows Ravens to deploy an advanced Auto-Turret, + that can attack enemy ground units in a straight line. + """ + )), + ItemNames.RAVEN_HUNTER_SEEKER_WEAPON: + ItemData(366 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 15, SC2Race.TERRAN, + classification=ItemClassification.progression, parent_item=ItemNames.RAVEN, origin={"nco"}, + description="Allows Ravens to attack with a Hunter-Seeker weapon."), + ItemNames.RAVEN_INTERFERENCE_MATRIX: + ItemData(367 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 16, SC2Race.TERRAN, + parent_item=ItemNames.RAVEN, origin={"ext"}, + description=inspect.cleandoc( + """ + Spell. Target enemy Mechanical or Psionic unit can't attack or use abilities for a short duration. + """ + )), + ItemNames.RAVEN_ANTI_ARMOR_MISSILE: + ItemData(368 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 17, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.RAVEN, origin={"ext"}, + description="Spell. Decreases target and nearby enemy units armor by 2."), + ItemNames.RAVEN_INTERNAL_TECH_MODULE: + ItemData(369 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 18, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.RAVEN, origin={"nco"}, + description=INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE.format("Ravens", "Starport")), + ItemNames.SCIENCE_VESSEL_EMP_SHOCKWAVE: + ItemData(370 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 19, SC2Race.TERRAN, + parent_item=ItemNames.SCIENCE_VESSEL, origin={"bw"}, + description="Spell. Depletes all energy and shields of all units in a target area."), + ItemNames.SCIENCE_VESSEL_DEFENSIVE_MATRIX: + ItemData(371 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 20, SC2Race.TERRAN, + parent_item=ItemNames.SCIENCE_VESSEL, origin={"bw"}, + description=inspect.cleandoc( + """ + Spell. Provides a target unit with a defensive barrier that can absorb up to 250 damage + """ + )), + ItemNames.CYCLONE_TARGETING_OPTICS: + ItemData(372 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 21, SC2Race.TERRAN, + parent_item=ItemNames.CYCLONE, origin={"ext"}, + description="Increases Cyclone Lock On casting range and the range while Locked On."), + ItemNames.CYCLONE_RAPID_FIRE_LAUNCHERS: + ItemData(373 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 22, SC2Race.TERRAN, + parent_item=ItemNames.CYCLONE, origin={"ext"}, + description="The first 12 shots of Lock On are fired more quickly."), + ItemNames.LIBERATOR_CLOAK: + ItemData(374 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 23, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.LIBERATOR, origin={"nco"}, + description=CLOAK_DESCRIPTION_TEMPLATE.format("Liberators")), + ItemNames.LIBERATOR_LASER_TARGETING_SYSTEM: + ItemData(375 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 24, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.LIBERATOR, origin={"ext"}, + description=LASER_TARGETING_SYSTEMS_DESCRIPTION), + ItemNames.LIBERATOR_OPTIMIZED_LOGISTICS: + ItemData(376 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 25, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.LIBERATOR, origin={"nco"}, + description="Increases Liberator training speed."), + ItemNames.WIDOW_MINE_BLACK_MARKET_LAUNCHERS: + ItemData(377 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 26, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.WIDOW_MINE, origin={"ext"}, + description="Increases Widow Mine Sentinel Missile range."), + ItemNames.WIDOW_MINE_EXECUTIONER_MISSILES: + ItemData(378 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 27, SC2Race.TERRAN, + parent_item=ItemNames.WIDOW_MINE, origin={"ext"}, + description=inspect.cleandoc( + """ + Reduces Sentinel Missile cooldown. + When killed, Widow Mines will launch several missiles at random enemy targets. + """ + )), + ItemNames.VALKYRIE_ENHANCED_CLUSTER_LAUNCHERS: + ItemData(379 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 28, + SC2Race.TERRAN, parent_item=ItemNames.VALKYRIE, origin={"ext"}, + description="Valkyries fire 2 additional rockets each volley."), + ItemNames.VALKYRIE_SHAPED_HULL: + ItemData(380 + SC2WOL_ITEM_ID_OFFSET, "Armory 5", 29, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.VALKYRIE, origin={"ext"}, + description="Increases Valkyrie life by 50."), + ItemNames.VALKYRIE_FLECHETTE_MISSILES: + ItemData(381 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 0, SC2Race.TERRAN, + parent_item=ItemNames.VALKYRIE, origin={"ext"}, + description="Equips Valkyries with Air-to-Surface missiles to attack ground units."), + ItemNames.VALKYRIE_AFTERBURNERS: + ItemData(382 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 1, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.VALKYRIE, origin={"ext"}, + description="Ability. Temporarily increases the Valkyries's movement speed by 70%."), + ItemNames.CYCLONE_INTERNAL_TECH_MODULE: + ItemData(383 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 2, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.CYCLONE, origin={"ext"}, + description=INTERNAL_TECH_MODULE_DESCRIPTION_TEMPLATE.format("Cyclones", "Factory")), + ItemNames.LIBERATOR_SMART_SERVOS: + ItemData(384 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 3, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.LIBERATOR, origin={"nco"}, + description=SMART_SERVOS_DESCRIPTION), + ItemNames.LIBERATOR_RESOURCE_EFFICIENCY: + ItemData(385 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 4, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.LIBERATOR, origin={"ext"}, + description=RESOURCE_EFFICIENCY_NO_SUPPLY_DESCRIPTION_TEMPLATE.format("Liberator")), + ItemNames.HERCULES_INTERNAL_FUSION_MODULE: + ItemData(386 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 5, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.HERCULES, origin={"ext"}, + description="Hercules can be trained from a Starport without having a Fusion Core."), + ItemNames.HERCULES_TACTICAL_JUMP: + ItemData(387 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 6, SC2Race.TERRAN, + parent_item=ItemNames.HERCULES, origin={"ext"}, + description=inspect.cleandoc( + """ + Allows Hercules to warp to a target location anywhere on the map. + """ + )), + ItemNames.PLANETARY_FORTRESS_PROGRESSIVE_AUGMENTED_THRUSTERS: + ItemData(388 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 28, SC2Race.TERRAN, + parent_item=ItemNames.PLANETARY_FORTRESS, origin={"ext"}, quantity=2, + description=inspect.cleandoc( + """ + Level 1: Lift Off - Planetary Fortress can lift off. + Level 2: Armament Stabilizers - Planetary Fortress can attack while lifted off. + """ + )), + ItemNames.PLANETARY_FORTRESS_ADVANCED_TARGETING: + ItemData(389 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 7, SC2Race.TERRAN, + parent_item=ItemNames.PLANETARY_FORTRESS, origin={"ext"}, + description="Planetary Fortress can attack air units."), + ItemNames.VALKYRIE_LAUNCHING_VECTOR_COMPENSATOR: + ItemData(390 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 8, SC2Race.TERRAN, + classification=ItemClassification.filler, parent_item=ItemNames.VALKYRIE, origin={"ext"}, + description="Allows Valkyries to shoot air while moving."), + ItemNames.VALKYRIE_RESOURCE_EFFICIENCY: + ItemData(391 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 9, SC2Race.TERRAN, + parent_item=ItemNames.VALKYRIE, origin={"ext"}, + description=RESOURCE_EFFICIENCY_DESCRIPTION_TEMPLATE.format("Valkyrie")), + ItemNames.PREDATOR_PREDATOR_S_FURY: + ItemData(392 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 10, SC2Race.TERRAN, + parent_item=ItemNames.PREDATOR, origin={"ext"}, + description="Predators can use an attack that jumps between targets."), + ItemNames.BATTLECRUISER_BEHEMOTH_PLATING: + ItemData(393 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 11, SC2Race.TERRAN, + parent_item=ItemNames.BATTLECRUISER, origin={"ext"}, + description="Increases Battlecruiser armor by 2."), + ItemNames.BATTLECRUISER_COVERT_OPS_ENGINES: + ItemData(394 + SC2WOL_ITEM_ID_OFFSET, "Armory 6", 12, SC2Race.TERRAN, + parent_item=ItemNames.BATTLECRUISER, origin={"nco"}, + description="Increases Battlecruiser movement speed."), + + #Buildings + ItemNames.BUNKER: + ItemData(400 + SC2WOL_ITEM_ID_OFFSET, "Building", 0, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Defensive structure. Able to load infantry units, giving them +1 range to their attacks."), + ItemNames.MISSILE_TURRET: + ItemData(401 + SC2WOL_ITEM_ID_OFFSET, "Building", 1, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Anti-air defensive structure."), + ItemNames.SENSOR_TOWER: + ItemData(402 + SC2WOL_ITEM_ID_OFFSET, "Building", 2, SC2Race.TERRAN, + description="Reveals locations of enemy units at long range."), + + ItemNames.WAR_PIGS: + ItemData(500 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 0, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Mercenary Marines"), + ItemNames.DEVIL_DOGS: + ItemData(501 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 1, SC2Race.TERRAN, + classification=ItemClassification.filler, + description="Mercenary Firebats"), + ItemNames.HAMMER_SECURITIES: + ItemData(502 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 2, SC2Race.TERRAN, + description="Mercenary Marauders"), + ItemNames.SPARTAN_COMPANY: + ItemData(503 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 3, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Mercenary Goliaths"), + ItemNames.SIEGE_BREAKERS: + ItemData(504 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 4, SC2Race.TERRAN, + description="Mercenary Siege Tanks"), + ItemNames.HELS_ANGELS: + ItemData(505 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 5, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Mercenary Vikings"), + ItemNames.DUSK_WINGS: + ItemData(506 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 6, SC2Race.TERRAN, + description="Mercenary Banshees"), + ItemNames.JACKSONS_REVENGE: + ItemData(507 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 7, SC2Race.TERRAN, + description="Mercenary Battlecruiser"), + ItemNames.SKIBIS_ANGELS: + ItemData(508 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 8, SC2Race.TERRAN, + origin={"ext"}, + description="Mercenary Medics"), + ItemNames.DEATH_HEADS: + ItemData(509 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 9, SC2Race.TERRAN, + origin={"ext"}, + description="Mercenary Reapers"), + ItemNames.WINGED_NIGHTMARES: + ItemData(510 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 10, SC2Race.TERRAN, + classification=ItemClassification.progression, origin={"ext"}, + description="Mercenary Wraiths"), + ItemNames.MIDNIGHT_RIDERS: + ItemData(511 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 11, SC2Race.TERRAN, + origin={"ext"}, + description="Mercenary Liberators"), + ItemNames.BRYNHILDS: + ItemData(512 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 12, SC2Race.TERRAN, + classification=ItemClassification.progression, origin={"ext"}, + description="Mercenary Valkyries"), + ItemNames.JOTUN: + ItemData(513 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 13, SC2Race.TERRAN, + origin={"ext"}, + description="Mercenary Thor"), + + ItemNames.ULTRA_CAPACITORS: + ItemData(600 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 0, SC2Race.TERRAN, + description="Increases attack speed of units by 5% per weapon upgrade."), + ItemNames.VANADIUM_PLATING: + ItemData(601 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 1, SC2Race.TERRAN, + description="Increases the life of units by 5% per armor upgrade."), + ItemNames.ORBITAL_DEPOTS: + ItemData(602 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 2, SC2Race.TERRAN, + description="Supply depots are built instantly."), + ItemNames.MICRO_FILTERING: + ItemData(603 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 3, SC2Race.TERRAN, + description="Refineries produce Vespene gas 25% faster."), + ItemNames.AUTOMATED_REFINERY: + ItemData(604 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 4, SC2Race.TERRAN, + description="Eliminates the need for SCVs in vespene gas production."), + ItemNames.COMMAND_CENTER_REACTOR: + ItemData(605 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 5, SC2Race.TERRAN, + description="Command Centers can train two SCVs at once."), + ItemNames.RAVEN: + ItemData(606 + SC2WOL_ITEM_ID_OFFSET, "Unit", 22, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Aerial Caster unit."), + ItemNames.SCIENCE_VESSEL: + ItemData(607 + SC2WOL_ITEM_ID_OFFSET, "Unit", 23, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Aerial Caster unit. Can repair mechanical units."), + ItemNames.TECH_REACTOR: + ItemData(608 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 6, SC2Race.TERRAN, + description="Merges Tech Labs and Reactors into one add on structure to provide both functions."), + ItemNames.ORBITAL_STRIKE: + ItemData(609 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 7, SC2Race.TERRAN, + description="Trained units from Barracks are instantly deployed on rally point."), + ItemNames.BUNKER_SHRIKE_TURRET: + ItemData(610 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 6, SC2Race.TERRAN, + parent_item=ItemNames.BUNKER, + description="Adds an automated turret to Bunkers."), + ItemNames.BUNKER_FORTIFIED_BUNKER: + ItemData(611 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 7, SC2Race.TERRAN, + parent_item=ItemNames.BUNKER, + description="Bunkers have more life."), + ItemNames.PLANETARY_FORTRESS: + ItemData(612 + SC2WOL_ITEM_ID_OFFSET, "Building", 3, SC2Race.TERRAN, + classification=ItemClassification.progression, + description=inspect.cleandoc( + """ + Allows Command Centers to upgrade into a defensive structure with a turret and additional armor. + Planetary Fortresses cannot Lift Off, or cast Orbital Command spells. + """ + )), + ItemNames.PERDITION_TURRET: + ItemData(613 + SC2WOL_ITEM_ID_OFFSET, "Building", 4, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Automated defensive turret. Burrows down while no enemies are nearby."), + ItemNames.PREDATOR: + ItemData(614 + SC2WOL_ITEM_ID_OFFSET, "Unit", 24, SC2Race.TERRAN, + classification=ItemClassification.filler, + description="Anti-infantry specialist that deals area damage with each attack."), + ItemNames.HERCULES: + ItemData(615 + SC2WOL_ITEM_ID_OFFSET, "Unit", 25, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Massive transport ship."), + ItemNames.CELLULAR_REACTOR: + ItemData(616 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 8, SC2Race.TERRAN, + description="All Terran spellcasters get +100 starting and maximum energy."), + ItemNames.PROGRESSIVE_REGENERATIVE_BIO_STEEL: + ItemData(617 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 4, SC2Race.TERRAN, quantity=3, + classification= ItemClassification.progression, + description=inspect.cleandoc( + """ + Allows Terran mechanical units to regenerate health while not in combat. + Each level increases life regeneration speed. + """ + )), + ItemNames.HIVE_MIND_EMULATOR: + ItemData(618 + SC2WOL_ITEM_ID_OFFSET, "Building", 5, SC2Race.TERRAN, + ItemClassification.progression, + description="Defensive structure. Can permanently Mind Control Zerg units."), + ItemNames.PSI_DISRUPTER: + ItemData(619 + SC2WOL_ITEM_ID_OFFSET, "Building", 6, SC2Race.TERRAN, + classification=ItemClassification.progression, + description="Defensive structure. Slows the attack and movement speeds of all nearby Zerg units."), + ItemNames.STRUCTURE_ARMOR: + ItemData(620 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 9, SC2Race.TERRAN, + description="Increases armor of all Terran structures by 2."), + ItemNames.HI_SEC_AUTO_TRACKING: + ItemData(621 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 10, SC2Race.TERRAN, + description="Increases attack range of all Terran structures by 1."), + ItemNames.ADVANCED_OPTICS: + ItemData(622 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 11, SC2Race.TERRAN, + description="Increases attack range of all Terran mechanical units by 1."), + ItemNames.ROGUE_FORCES: + ItemData(623 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 12, SC2Race.TERRAN, + description="Mercenary calldowns are no longer limited by charges."), + + ItemNames.ZEALOT: + ItemData(700 + SC2WOL_ITEM_ID_OFFSET, "Unit", 0, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"wol", "lotv"}, + description="Powerful melee warrior. Can use the charge ability."), + ItemNames.STALKER: + ItemData(701 + SC2WOL_ITEM_ID_OFFSET, "Unit", 1, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"wol", "lotv"}, + description="Ranged attack strider. Can use the Blink ability."), + ItemNames.HIGH_TEMPLAR: + ItemData(702 + SC2WOL_ITEM_ID_OFFSET, "Unit", 2, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"wol", "lotv"}, + description="Potent psionic master. Can use the Feedback and Psionic Storm abilities. Can merge into an Archon."), + ItemNames.DARK_TEMPLAR: + ItemData(703 + SC2WOL_ITEM_ID_OFFSET, "Unit", 3, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"wol", "lotv"}, + description="Deadly warrior-assassin. Permanently cloaked. Can use the Shadow Fury ability."), + ItemNames.IMMORTAL: + ItemData(704 + SC2WOL_ITEM_ID_OFFSET, "Unit", 4, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"wol", "lotv"}, + description="Assault strider. Can use Barrier to absorb damage."), + ItemNames.COLOSSUS: + ItemData(705 + SC2WOL_ITEM_ID_OFFSET, "Unit", 5, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"wol", "lotv"}, + description="Battle strider with a powerful area attack. Can walk up and down cliffs. Attacks set fire to the ground, dealing extra damage to enemies over time."), + ItemNames.PHOENIX: + ItemData(706 + SC2WOL_ITEM_ID_OFFSET, "Unit", 6, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"wol", "lotv"}, + description="Air superiority starfighter. Can use Graviton Beam and Phasing Armor abilities."), + ItemNames.VOID_RAY: + ItemData(707 + SC2WOL_ITEM_ID_OFFSET, "Unit", 7, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"wol", "lotv"}, + description="Surgical strike craft. Has the Prismatic Alignment and Prismatic Range abilities."), + ItemNames.CARRIER: + ItemData(708 + SC2WOL_ITEM_ID_OFFSET, "Unit", 8, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"wol", "lotv"}, + description="Capital ship. Builds and launches Interceptors that attack enemy targets. Repair Drones heal nearby mechanical units."), + + # Filler items to fill remaining spots + ItemNames.STARTING_MINERALS: + ItemData(800 + SC2WOL_ITEM_ID_OFFSET, "Minerals", 15, SC2Race.ANY, quantity=0, + classification=ItemClassification.filler, + description="Increases the starting minerals for all missions."), + ItemNames.STARTING_VESPENE: + ItemData(801 + SC2WOL_ITEM_ID_OFFSET, "Vespene", 15, SC2Race.ANY, quantity=0, + classification=ItemClassification.filler, + description="Increases the starting vespene for all missions."), + ItemNames.STARTING_SUPPLY: + ItemData(802 + SC2WOL_ITEM_ID_OFFSET, "Supply", 2, SC2Race.ANY, quantity=0, + classification=ItemClassification.filler, + description="Increases the starting supply for all missions."), + # This item is used to "remove" location from the game. Never placed unless plando'd + ItemNames.NOTHING: + ItemData(803 + SC2WOL_ITEM_ID_OFFSET, "Nothing Group", 2, SC2Race.ANY, quantity=0, + classification=ItemClassification.trap, + description="Does nothing. Used to remove a location from the game."), + + # Nova gear + ItemNames.NOVA_GHOST_VISOR: + ItemData(900 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 0, SC2Race.TERRAN, origin={"nco"}, + description="Reveals the locations of enemy units in the fog of war around Nova. Can detect cloaked units."), + ItemNames.NOVA_RANGEFINDER_OCULUS: + ItemData(901 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 1, SC2Race.TERRAN, origin={"nco"}, + description="Increaases Nova's vision range and non-melee weapon attack range by 2. Also increases range of melee weapons by 1."), + ItemNames.NOVA_DOMINATION: + ItemData(902 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 2, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Gives Nova the ability to mind-control a target enemy unit."), + ItemNames.NOVA_BLINK: + ItemData(903 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 3, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Gives Nova the ability to teleport a short distance and cloak for 10s."), + ItemNames.NOVA_PROGRESSIVE_STEALTH_SUIT_MODULE: + ItemData(904 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade 2", 0, SC2Race.TERRAN, quantity=2, origin={"nco"}, + classification=ItemClassification.progression, + description=inspect.cleandoc( + """ + Level 1: Gives Nova the ability to cloak. + Level 2: Nova is permanently cloaked. + """ + )), + ItemNames.NOVA_ENERGY_SUIT_MODULE: + ItemData(905 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 4, SC2Race.TERRAN, origin={"nco"}, + description="Increases Nova's maximum energy and energy regeneration rate."), + ItemNames.NOVA_ARMORED_SUIT_MODULE: + ItemData(906 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 5, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Increases Nova's health by 100 and armour by 1. Nova also regenerates life quickly out of combat."), + ItemNames.NOVA_JUMP_SUIT_MODULE: + ItemData(907 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 6, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Increases Nova's movement speed and allows her to jump up and down cliffs."), + ItemNames.NOVA_C20A_CANISTER_RIFLE: + ItemData(908 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 7, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Allows Nova to equip the C20A Canister Rifle, which has a ranged attack and allows Nova to cast Snipe."), + ItemNames.NOVA_HELLFIRE_SHOTGUN: + ItemData(909 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 8, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Allows Nova to equip the Hellfire Shotgun, which has a short-range area attack in a cone and allows Nova to cast Penetrating Blast."), + ItemNames.NOVA_PLASMA_RIFLE: + ItemData(910 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 9, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Allows Nova to equip the Plasma Rifle, which has a rapidfire ranged attack and allows Nova to cast Plasma Shot."), + ItemNames.NOVA_MONOMOLECULAR_BLADE: + ItemData(911 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 10, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Allows Nova to equip the Monomolecular Blade, which has a melee attack and allows Nova to cast Dash Attack."), + ItemNames.NOVA_BLAZEFIRE_GUNBLADE: + ItemData(912 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 11, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Allows Nova to equip the Blazefire Gunblade, which has a melee attack and allows Nova to cast Fury of One."), + ItemNames.NOVA_STIM_INFUSION: + ItemData(913 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 12, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Gives Nova the ability to heal herself and temporarily increase her movement and attack speeds."), + ItemNames.NOVA_PULSE_GRENADES: + ItemData(914 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 13, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Gives Nova the ability to throw a grenade dealing large damage in an area."), + ItemNames.NOVA_FLASHBANG_GRENADES: + ItemData(915 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 14, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Gives Nova the ability to throw a grenade to stun enemies and disable detection in a large area."), + ItemNames.NOVA_IONIC_FORCE_FIELD: + ItemData(916 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 15, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Gives Nova the ability to shield herself temporarily."), + ItemNames.NOVA_HOLO_DECOY: + ItemData(917 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 16, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Gives Nova the ability to summon a decoy unit which enemies will prefer to target and takes reduced damage."), + ItemNames.NOVA_NUKE: + ItemData(918 + SC2WOL_ITEM_ID_OFFSET, "Nova Gear", 17, SC2Race.TERRAN, origin={"nco"}, + classification=ItemClassification.progression, + description="Gives Nova the ability to launch tactical nukes built from the Shadow Ops."), + + # HotS + ItemNames.ZERGLING: + ItemData(0 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 0, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Fast inexpensive melee attacker. Hatches in pairs from a single larva. Can morph into a Baneling."), + ItemNames.SWARM_QUEEN: + ItemData(1 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 1, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Ranged support caster. Can use the Spawn Creep Tumor and Rapid Transfusion abilities."), + ItemNames.ROACH: + ItemData(2 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 2, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Durable short ranged attacker. Regenerates life quickly when burrowed."), + ItemNames.HYDRALISK: + ItemData(3 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 3, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="High-damage generalist ranged attacker."), + ItemNames.ZERGLING_BANELING_ASPECT: + ItemData(4 + SC2HOTS_ITEM_ID_OFFSET, "Morph", 5, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Anti-ground suicide unit. Does damage over a small area on death."), + ItemNames.ABERRATION: + ItemData(5 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 5, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Durable melee attacker that deals heavy damage and can walk over other units."), + ItemNames.MUTALISK: + ItemData(6 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 6, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Fragile flying attacker. Attacks bounce between targets."), + ItemNames.SWARM_HOST: + ItemData(7 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 7, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Siege unit that attacks by rooting in place and continually spawning Locusts."), + ItemNames.INFESTOR: + ItemData(8 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 8, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Support caster that can move while burrowed. Can use the Fungal Growth, Parasitic Domination, and Consumption abilities."), + ItemNames.ULTRALISK: + ItemData(9 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 9, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Massive melee attacker. Has an area-damage cleave attack."), + ItemNames.SPORE_CRAWLER: + ItemData(10 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 10, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Anti-air defensive structure that can detect cloaked units."), + ItemNames.SPINE_CRAWLER: + ItemData(11 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 11, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"hots"}, + description="Anti-ground defensive structure."), + ItemNames.CORRUPTOR: + ItemData(12 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 12, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"ext"}, + description="Anti-air flying attacker specializing in taking down enemy capital ships."), + ItemNames.SCOURGE: + ItemData(13 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 13, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"bw", "ext"}, + description="Flying anti-air suicide unit. Hatches in pairs from a single larva."), + ItemNames.BROOD_QUEEN: + ItemData(14 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 4, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"bw", "ext"}, + description="Flying support caster. Can cast the Ocular Symbiote and Spawn Broodlings abilities."), + ItemNames.DEFILER: + ItemData(15 + SC2HOTS_ITEM_ID_OFFSET, "Unit", 14, SC2Race.ZERG, + classification=ItemClassification.progression, origin={"bw"}, + description="Support caster. Can use the Dark Swarm, Consume, and Plague abilities."), + + ItemNames.PROGRESSIVE_ZERG_MELEE_ATTACK: ItemData(100 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 0, SC2Race.ZERG, quantity=3, origin={"hots"}), + ItemNames.PROGRESSIVE_ZERG_MISSILE_ATTACK: ItemData(101 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 2, SC2Race.ZERG, quantity=3, origin={"hots"}), + ItemNames.PROGRESSIVE_ZERG_GROUND_CARAPACE: ItemData(102 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 4, SC2Race.ZERG, quantity=3, origin={"hots"}), + ItemNames.PROGRESSIVE_ZERG_FLYER_ATTACK: ItemData(103 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 6, SC2Race.ZERG, quantity=3, origin={"hots"}), + ItemNames.PROGRESSIVE_ZERG_FLYER_CARAPACE: ItemData(104 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 8, SC2Race.ZERG, quantity=3, origin={"hots"}), + # Upgrade bundle 'number' values are used as indices to get affected 'number's + ItemNames.PROGRESSIVE_ZERG_WEAPON_UPGRADE: ItemData(105 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 6, SC2Race.ZERG, quantity=3, origin={"hots"}), + ItemNames.PROGRESSIVE_ZERG_ARMOR_UPGRADE: ItemData(106 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 7, SC2Race.ZERG, quantity=3, origin={"hots"}), + ItemNames.PROGRESSIVE_ZERG_GROUND_UPGRADE: ItemData(107 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 8, SC2Race.ZERG, quantity=3, origin={"hots"}), + ItemNames.PROGRESSIVE_ZERG_FLYER_UPGRADE: ItemData(108 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 9, SC2Race.ZERG, quantity=3, origin={"hots"}), + ItemNames.PROGRESSIVE_ZERG_WEAPON_ARMOR_UPGRADE: ItemData(109 + SC2HOTS_ITEM_ID_OFFSET, "Upgrade", 10, SC2Race.ZERG, quantity=3, origin={"hots"}), + + ItemNames.ZERGLING_HARDENED_CARAPACE: + ItemData(200 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 0, SC2Race.ZERG, parent_item=ItemNames.ZERGLING, + origin={"hots"}, description="Increases Zergling health by +10."), + ItemNames.ZERGLING_ADRENAL_OVERLOAD: + ItemData(201 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 1, SC2Race.ZERG, parent_item=ItemNames.ZERGLING, + origin={"hots"}, description="Increases Zergling attack speed."), + ItemNames.ZERGLING_METABOLIC_BOOST: + ItemData(202 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 2, SC2Race.ZERG, parent_item=ItemNames.ZERGLING, + origin={"hots"}, classification=ItemClassification.filler, + description="Increases Zergling movement speed."), + ItemNames.ROACH_HYDRIODIC_BILE: + ItemData(203 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 3, SC2Race.ZERG, parent_item=ItemNames.ROACH, + origin={"hots"}, description="Roaches deal +8 damage to light targets."), + ItemNames.ROACH_ADAPTIVE_PLATING: + ItemData(204 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 4, SC2Race.ZERG, parent_item=ItemNames.ROACH, + origin={"hots"}, description="Roaches gain +3 armour when their life is below 50%."), + ItemNames.ROACH_TUNNELING_CLAWS: + ItemData(205 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 5, SC2Race.ZERG, parent_item=ItemNames.ROACH, + origin={"hots"}, classification=ItemClassification.filler, + description="Allows Roaches to move while burrowed."), + ItemNames.HYDRALISK_FRENZY: + ItemData(206 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 6, SC2Race.ZERG, parent_item=ItemNames.HYDRALISK, + origin={"hots"}, + description="Allows Hydralisks to use the Frenzy ability, which increases their attack speed by 50%."), + ItemNames.HYDRALISK_ANCILLARY_CARAPACE: + ItemData(207 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 7, SC2Race.ZERG, parent_item=ItemNames.HYDRALISK, + origin={"hots"}, classification=ItemClassification.filler, description="Hydralisks gain +20 health."), + ItemNames.HYDRALISK_GROOVED_SPINES: + ItemData(208 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 8, SC2Race.ZERG, parent_item=ItemNames.HYDRALISK, + origin={"hots"}, description="Hydralisks gain +1 range."), + ItemNames.BANELING_CORROSIVE_ACID: + ItemData(209 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 9, SC2Race.ZERG, + parent_item=ItemNames.ZERGLING_BANELING_ASPECT, origin={"hots"}, + description="Increases the damage banelings deal to their primary target. Splash damage remains the same."), + ItemNames.BANELING_RUPTURE: + ItemData(210 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 10, SC2Race.ZERG, + parent_item=ItemNames.ZERGLING_BANELING_ASPECT, origin={"hots"}, + classification=ItemClassification.filler, + description="Increases the splash radius of baneling attacks."), + ItemNames.BANELING_REGENERATIVE_ACID: + ItemData(211 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 11, SC2Race.ZERG, + parent_item=ItemNames.ZERGLING_BANELING_ASPECT, origin={"hots"}, + classification=ItemClassification.filler, + description="Banelings will heal nearby friendly units when they explode."), + ItemNames.MUTALISK_VICIOUS_GLAIVE: + ItemData(212 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 12, SC2Race.ZERG, parent_item=ItemNames.MUTALISK, + origin={"hots"}, description="Mutalisks attacks will bounce an additional 3 times."), + ItemNames.MUTALISK_RAPID_REGENERATION: + ItemData(213 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 13, SC2Race.ZERG, parent_item=ItemNames.MUTALISK, + origin={"hots"}, description="Mutalisks will regenerate quickly when out of combat."), + ItemNames.MUTALISK_SUNDERING_GLAIVE: + ItemData(214 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 14, SC2Race.ZERG, parent_item=ItemNames.MUTALISK, + origin={"hots"}, description="Mutalisks deal increased damage to their primary target."), + ItemNames.SWARM_HOST_BURROW: + ItemData(215 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 15, SC2Race.ZERG, parent_item=ItemNames.SWARM_HOST, + origin={"hots"}, classification=ItemClassification.filler, + description="Allows Swarm Hosts to burrow instead of root to spawn locusts."), + ItemNames.SWARM_HOST_RAPID_INCUBATION: + ItemData(216 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 16, SC2Race.ZERG, parent_item=ItemNames.SWARM_HOST, + origin={"hots"}, description="Swarm Hosts will spawn locusts 20% faster."), + ItemNames.SWARM_HOST_PRESSURIZED_GLANDS: + ItemData(217 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 17, SC2Race.ZERG, parent_item=ItemNames.SWARM_HOST, + origin={"hots"}, classification=ItemClassification.progression, + description="Allows Swarm Host Locusts to attack air targets."), + ItemNames.ULTRALISK_BURROW_CHARGE: + ItemData(218 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 18, SC2Race.ZERG, parent_item=ItemNames.ULTRALISK, + origin={"hots"}, + description="Allows Ultralisks to burrow and charge at enemy units, knocking back and stunning units when it emerges."), + ItemNames.ULTRALISK_TISSUE_ASSIMILATION: + ItemData(219 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 19, SC2Race.ZERG, parent_item=ItemNames.ULTRALISK, + origin={"hots"}, description="Ultralisks recover health when they deal damage."), + ItemNames.ULTRALISK_MONARCH_BLADES: + ItemData(220 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 20, SC2Race.ZERG, parent_item=ItemNames.ULTRALISK, + origin={"hots"}, description="Ultralisks gain increased splash damage."), + ItemNames.CORRUPTOR_CAUSTIC_SPRAY: + ItemData(221 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 21, SC2Race.ZERG, parent_item=ItemNames.CORRUPTOR, + origin={"ext"}, + description="Allows Corruptors to use the Caustic Spray ability, which deals ramping damage to buildings over time."), + ItemNames.CORRUPTOR_CORRUPTION: + ItemData(222 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 22, SC2Race.ZERG, parent_item=ItemNames.CORRUPTOR, + origin={"ext"}, + description="Allows Corruptors to use the Corruption ability, which causes a target enemy unit to take increased damage."), + ItemNames.SCOURGE_VIRULENT_SPORES: + ItemData(223 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 23, SC2Race.ZERG, parent_item=ItemNames.SCOURGE, + origin={"ext"}, description="Scourge will deal splash damage."), + ItemNames.SCOURGE_RESOURCE_EFFICIENCY: + ItemData(224 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 24, SC2Race.ZERG, parent_item=ItemNames.SCOURGE, + origin={"ext"}, classification=ItemClassification.progression, + description="Reduces the cost of Scourge by 50 gas per egg."), + ItemNames.SCOURGE_SWARM_SCOURGE: + ItemData(225 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 25, SC2Race.ZERG, parent_item=ItemNames.SCOURGE, + origin={"ext"}, description="An extra Scourge will be built from each egg at no additional cost."), + ItemNames.ZERGLING_SHREDDING_CLAWS: + ItemData(226 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 26, SC2Race.ZERG, parent_item=ItemNames.ZERGLING, + origin={"ext"}, description="Zergling attacks will temporarily reduce their target's armour to 0."), + ItemNames.ROACH_GLIAL_RECONSTITUTION: + ItemData(227 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 27, SC2Race.ZERG, parent_item=ItemNames.ROACH, + origin={"ext"}, description="Increases Roach movement speed."), + ItemNames.ROACH_ORGANIC_CARAPACE: + ItemData(228 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 28, SC2Race.ZERG, parent_item=ItemNames.ROACH, + origin={"ext"}, description="Increases Roach health by +25."), + ItemNames.HYDRALISK_MUSCULAR_AUGMENTS: + ItemData(229 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 1", 29, SC2Race.ZERG, parent_item=ItemNames.HYDRALISK, + origin={"bw"}, description="Increases Hydralisk movement speed."), + ItemNames.HYDRALISK_RESOURCE_EFFICIENCY: + ItemData(230 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 0, SC2Race.ZERG, parent_item=ItemNames.HYDRALISK, + origin={"bw"}, description="Reduces Hydralisk resource cost by 25/25 and supply cost by 1."), + ItemNames.BANELING_CENTRIFUGAL_HOOKS: + ItemData(231 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 1, SC2Race.ZERG, + parent_item=ItemNames.ZERGLING_BANELING_ASPECT, origin={"ext"}, + description="Increases the movement speed of Banelings."), + ItemNames.BANELING_TUNNELING_JAWS: + ItemData(232 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 2, SC2Race.ZERG, + parent_item=ItemNames.ZERGLING_BANELING_ASPECT, origin={"ext"}, + description="Allows Banelings to move while burrowed."), + ItemNames.BANELING_RAPID_METAMORPH: + ItemData(233 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 3, SC2Race.ZERG, + parent_item=ItemNames.ZERGLING_BANELING_ASPECT, origin={"ext"}, description="Banelings morph faster."), + ItemNames.MUTALISK_SEVERING_GLAIVE: + ItemData(234 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 4, SC2Race.ZERG, parent_item=ItemNames.MUTALISK, + origin={"ext"}, description="Mutalisk bounce attacks will deal full damage."), + ItemNames.MUTALISK_AERODYNAMIC_GLAIVE_SHAPE: + ItemData(235 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 5, SC2Race.ZERG, parent_item=ItemNames.MUTALISK, + origin={"ext"}, description="Increases the attack range of Mutalisks by 2."), + ItemNames.SWARM_HOST_LOCUST_METABOLIC_BOOST: + ItemData(236 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 6, SC2Race.ZERG, parent_item=ItemNames.SWARM_HOST, + origin={"ext"}, classification=ItemClassification.filler, + description="Increases Locust movement speed."), + ItemNames.SWARM_HOST_ENDURING_LOCUSTS: + ItemData(237 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 7, SC2Race.ZERG, parent_item=ItemNames.SWARM_HOST, + origin={"ext"}, description="Increases the duration of Swarm Hosts' Locusts by 10s."), + ItemNames.SWARM_HOST_ORGANIC_CARAPACE: + ItemData(238 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 8, SC2Race.ZERG, parent_item=ItemNames.SWARM_HOST, + origin={"ext"}, description="Increases Swarm Host health by +40."), + ItemNames.SWARM_HOST_RESOURCE_EFFICIENCY: + ItemData(239 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 9, SC2Race.ZERG, parent_item=ItemNames.SWARM_HOST, + origin={"ext"}, description="Reduces Swarm Host resource cost by 100/25."), + ItemNames.ULTRALISK_ANABOLIC_SYNTHESIS: + ItemData(240 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 10, SC2Race.ZERG, parent_item=ItemNames.ULTRALISK, + origin={"bw"}, classification=ItemClassification.filler), + ItemNames.ULTRALISK_CHITINOUS_PLATING: + ItemData(241 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 11, SC2Race.ZERG, parent_item=ItemNames.ULTRALISK, + origin={"bw"}), + ItemNames.ULTRALISK_ORGANIC_CARAPACE: + ItemData(242 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 12, SC2Race.ZERG, parent_item=ItemNames.ULTRALISK, + origin={"ext"}), + ItemNames.ULTRALISK_RESOURCE_EFFICIENCY: + ItemData(243 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 13, SC2Race.ZERG, parent_item=ItemNames.ULTRALISK, + origin={"bw"}), + ItemNames.DEVOURER_CORROSIVE_SPRAY: + ItemData(244 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 14, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_DEVOURER_ASPECT, origin={"ext"}), + ItemNames.DEVOURER_GAPING_MAW: + ItemData(245 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 15, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_DEVOURER_ASPECT, origin={"ext"}), + ItemNames.DEVOURER_IMPROVED_OSMOSIS: + ItemData(246 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 16, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_DEVOURER_ASPECT, origin={"ext"}, + classification=ItemClassification.filler), + ItemNames.DEVOURER_PRESCIENT_SPORES: + ItemData(247 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 17, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_DEVOURER_ASPECT, origin={"ext"}), + ItemNames.GUARDIAN_PROLONGED_DISPERSION: + ItemData(248 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 18, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_GUARDIAN_ASPECT, origin={"ext"}), + ItemNames.GUARDIAN_PRIMAL_ADAPTATION: + ItemData(249 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 19, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_GUARDIAN_ASPECT, origin={"ext"}), + ItemNames.GUARDIAN_SORONAN_ACID: + ItemData(250 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 20, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_GUARDIAN_ASPECT, origin={"ext"}), + ItemNames.IMPALER_ADAPTIVE_TALONS: + ItemData(251 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 21, SC2Race.ZERG, + parent_item=ItemNames.HYDRALISK_IMPALER_ASPECT, origin={"ext"}, + classification=ItemClassification.filler), + ItemNames.IMPALER_SECRETION_GLANDS: + ItemData(252 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 22, SC2Race.ZERG, + parent_item=ItemNames.HYDRALISK_IMPALER_ASPECT, origin={"ext"}), + ItemNames.IMPALER_HARDENED_TENTACLE_SPINES: + ItemData(253 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 23, SC2Race.ZERG, + parent_item=ItemNames.HYDRALISK_IMPALER_ASPECT, origin={"ext"}), + ItemNames.LURKER_SEISMIC_SPINES: + ItemData(254 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 24, SC2Race.ZERG, + parent_item=ItemNames.HYDRALISK_LURKER_ASPECT, origin={"ext"}), + ItemNames.LURKER_ADAPTED_SPINES: + ItemData(255 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 25, SC2Race.ZERG, + parent_item=ItemNames.HYDRALISK_LURKER_ASPECT, origin={"ext"}), + ItemNames.RAVAGER_POTENT_BILE: + ItemData(256 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 26, SC2Race.ZERG, + parent_item=ItemNames.ROACH_RAVAGER_ASPECT, origin={"ext"}), + ItemNames.RAVAGER_BLOATED_BILE_DUCTS: + ItemData(257 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 27, SC2Race.ZERG, + parent_item=ItemNames.ROACH_RAVAGER_ASPECT, origin={"ext"}), + ItemNames.RAVAGER_DEEP_TUNNEL: + ItemData(258 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 28, SC2Race.ZERG, + parent_item=ItemNames.ROACH_RAVAGER_ASPECT, origin={"ext"}), + ItemNames.VIPER_PARASITIC_BOMB: + ItemData(259 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 2", 29, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_VIPER_ASPECT, origin={"ext"}), + ItemNames.VIPER_PARALYTIC_BARBS: + ItemData(260 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 0, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_VIPER_ASPECT, origin={"ext"}), + ItemNames.VIPER_VIRULENT_MICROBES: + ItemData(261 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 1, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_VIPER_ASPECT, origin={"ext"}), + ItemNames.BROOD_LORD_POROUS_CARTILAGE: + ItemData(262 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 2, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_BROOD_LORD_ASPECT, origin={"ext"}), + ItemNames.BROOD_LORD_EVOLVED_CARAPACE: + ItemData(263 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 3, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_BROOD_LORD_ASPECT, origin={"ext"}), + ItemNames.BROOD_LORD_SPLITTER_MITOSIS: + ItemData(264 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 4, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_BROOD_LORD_ASPECT, origin={"ext"}), + ItemNames.BROOD_LORD_RESOURCE_EFFICIENCY: + ItemData(265 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 5, SC2Race.ZERG, + parent_item=ItemNames.MUTALISK_CORRUPTOR_BROOD_LORD_ASPECT, origin={"ext"}), + ItemNames.INFESTOR_INFESTED_TERRAN: + ItemData(266 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 6, SC2Race.ZERG, parent_item=ItemNames.INFESTOR, + origin={"ext"}), + ItemNames.INFESTOR_MICROBIAL_SHROUD: + ItemData(267 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 7, SC2Race.ZERG, parent_item=ItemNames.INFESTOR, + origin={"ext"}), + ItemNames.SWARM_QUEEN_SPAWN_LARVAE: + ItemData(268 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 8, SC2Race.ZERG, parent_item=ItemNames.SWARM_QUEEN, + origin={"ext"}), + ItemNames.SWARM_QUEEN_DEEP_TUNNEL: + ItemData(269 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 9, SC2Race.ZERG, parent_item=ItemNames.SWARM_QUEEN, + origin={"ext"}), + ItemNames.SWARM_QUEEN_ORGANIC_CARAPACE: + ItemData(270 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 10, SC2Race.ZERG, parent_item=ItemNames.SWARM_QUEEN, + origin={"ext"}, classification=ItemClassification.filler), + ItemNames.SWARM_QUEEN_BIO_MECHANICAL_TRANSFUSION: + ItemData(271 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 11, SC2Race.ZERG, parent_item=ItemNames.SWARM_QUEEN, + origin={"ext"}), + ItemNames.SWARM_QUEEN_RESOURCE_EFFICIENCY: + ItemData(272 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 12, SC2Race.ZERG, parent_item=ItemNames.SWARM_QUEEN, + origin={"ext"}), + ItemNames.SWARM_QUEEN_INCUBATOR_CHAMBER: + ItemData(273 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 13, SC2Race.ZERG, parent_item=ItemNames.SWARM_QUEEN, + origin={"ext"}), + ItemNames.BROOD_QUEEN_FUNGAL_GROWTH: + ItemData(274 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 14, SC2Race.ZERG, parent_item=ItemNames.BROOD_QUEEN, + origin={"ext"}), + ItemNames.BROOD_QUEEN_ENSNARE: + ItemData(275 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 15, SC2Race.ZERG, parent_item=ItemNames.BROOD_QUEEN, + origin={"ext"}), + ItemNames.BROOD_QUEEN_ENHANCED_MITOCHONDRIA: + ItemData(276 + SC2HOTS_ITEM_ID_OFFSET, "Mutation 3", 16, SC2Race.ZERG, parent_item=ItemNames.BROOD_QUEEN, + origin={"ext"}), + + ItemNames.ZERGLING_RAPTOR_STRAIN: + ItemData(300 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 0, SC2Race.ZERG, parent_item=ItemNames.ZERGLING, + origin={"hots"}, + description="Allows Zerglings to jump up and down cliffs and leap onto enemies. Also increases Zergling attack damage by 2."), + ItemNames.ZERGLING_SWARMLING_STRAIN: + ItemData(301 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 1, SC2Race.ZERG, parent_item=ItemNames.ZERGLING, + origin={"hots"}, + description="Zerglings will spawn instantly and with an extra Zergling per egg at no additional cost."), + ItemNames.ROACH_VILE_STRAIN: + ItemData(302 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 2, SC2Race.ZERG, parent_item=ItemNames.ROACH, origin={"hots"}, + description="Roach attacks will slow the movement and attack speed of enemies."), + ItemNames.ROACH_CORPSER_STRAIN: + ItemData(303 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 3, SC2Race.ZERG, parent_item=ItemNames.ROACH, origin={"hots"}, + description="Units killed after being attacked by Roaches will spawn 2 Roachlings."), + ItemNames.HYDRALISK_IMPALER_ASPECT: + ItemData(304 + SC2HOTS_ITEM_ID_OFFSET, "Morph", 0, SC2Race.ZERG, origin={"hots"}, + classification=ItemClassification.progression, + description="Allows Hydralisks to morph into Impalers."), + ItemNames.HYDRALISK_LURKER_ASPECT: + ItemData(305 + SC2HOTS_ITEM_ID_OFFSET, "Morph", 1, SC2Race.ZERG, origin={"hots"}, + classification=ItemClassification.progression, description="Allows Hydralisks to morph into Lurkers."), + ItemNames.BANELING_SPLITTER_STRAIN: + ItemData(306 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 6, SC2Race.ZERG, + parent_item=ItemNames.ZERGLING_BANELING_ASPECT, origin={"hots"}, + description="Banelings will split into two smaller Splitterlings on exploding."), + ItemNames.BANELING_HUNTER_STRAIN: + ItemData(307 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 7, SC2Race.ZERG, + parent_item=ItemNames.ZERGLING_BANELING_ASPECT, origin={"hots"}, + description="Allows Banelings to jump up and down cliffs and leap onto enemies."), + ItemNames.MUTALISK_CORRUPTOR_BROOD_LORD_ASPECT: + ItemData(308 + SC2HOTS_ITEM_ID_OFFSET, "Morph", 2, SC2Race.ZERG, origin={"hots"}, + classification=ItemClassification.progression, + description="Allows Mutalisks and Corruptors to morph into Brood Lords."), + ItemNames.MUTALISK_CORRUPTOR_VIPER_ASPECT: + ItemData(309 + SC2HOTS_ITEM_ID_OFFSET, "Morph", 3, SC2Race.ZERG, origin={"hots"}, + classification=ItemClassification.progression, + description="Allows Mutalisks and Corruptors to morph into Vipers."), + ItemNames.SWARM_HOST_CARRION_STRAIN: + ItemData(310 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 10, SC2Race.ZERG, parent_item=ItemNames.SWARM_HOST, + origin={"hots"}, description="Swarm Hosts will spawn Flying Locusts."), + ItemNames.SWARM_HOST_CREEPER_STRAIN: + ItemData(311 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 11, SC2Race.ZERG, parent_item=ItemNames.SWARM_HOST, + origin={"hots"}, classification=ItemClassification.filler, + description="Allows Swarm Hosts to teleport to any creep on the map in vision. Swarm Hosts will spread creep around them when rooted or burrowed."), + ItemNames.ULTRALISK_NOXIOUS_STRAIN: + ItemData(312 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 12, SC2Race.ZERG, parent_item=ItemNames.ULTRALISK, + origin={"hots"}, classification=ItemClassification.filler, + description="Ultralisks will periodically spread poison, damaging nearby biological enemies."), + ItemNames.ULTRALISK_TORRASQUE_STRAIN: + ItemData(313 + SC2HOTS_ITEM_ID_OFFSET, "Strain", 13, SC2Race.ZERG, parent_item=ItemNames.ULTRALISK, + origin={"hots"}, description="Ultralisks will revive after being killed."), + + ItemNames.KERRIGAN_KINETIC_BLAST: ItemData(400 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 0, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_HEROIC_FORTITUDE: ItemData(401 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 1, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_LEAPING_STRIKE: ItemData(402 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 2, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_CRUSHING_GRIP: ItemData(403 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 3, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_CHAIN_REACTION: ItemData(404 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 4, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_PSIONIC_SHIFT: ItemData(405 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 5, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_ZERGLING_RECONSTITUTION: ItemData(406 + SC2HOTS_ITEM_ID_OFFSET, "Evolution Pit", 0, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.filler), + ItemNames.KERRIGAN_IMPROVED_OVERLORDS: ItemData(407 + SC2HOTS_ITEM_ID_OFFSET, "Evolution Pit", 1, SC2Race.ZERG, origin={"hots"}), + ItemNames.KERRIGAN_AUTOMATED_EXTRACTORS: ItemData(408 + SC2HOTS_ITEM_ID_OFFSET, "Evolution Pit", 2, SC2Race.ZERG, origin={"hots"}), + ItemNames.KERRIGAN_WILD_MUTATION: ItemData(409 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 6, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_SPAWN_BANELINGS: ItemData(410 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 7, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_MEND: ItemData(411 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 8, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_TWIN_DRONES: ItemData(412 + SC2HOTS_ITEM_ID_OFFSET, "Evolution Pit", 3, SC2Race.ZERG, origin={"hots"}), + ItemNames.KERRIGAN_MALIGNANT_CREEP: ItemData(413 + SC2HOTS_ITEM_ID_OFFSET, "Evolution Pit", 4, SC2Race.ZERG, origin={"hots"}), + ItemNames.KERRIGAN_VESPENE_EFFICIENCY: ItemData(414 + SC2HOTS_ITEM_ID_OFFSET, "Evolution Pit", 5, SC2Race.ZERG, origin={"hots"}), + ItemNames.KERRIGAN_INFEST_BROODLINGS: ItemData(415 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 9, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_FURY: ItemData(416 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 10, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_ABILITY_EFFICIENCY: ItemData(417 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 11, SC2Race.ZERG, origin={"hots"}), + ItemNames.KERRIGAN_APOCALYPSE: ItemData(418 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 12, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_SPAWN_LEVIATHAN: ItemData(419 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 13, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + ItemNames.KERRIGAN_DROP_PODS: ItemData(420 + SC2HOTS_ITEM_ID_OFFSET, "Ability", 14, SC2Race.ZERG, origin={"hots"}, classification=ItemClassification.progression), + # Handled separately from other abilities + ItemNames.KERRIGAN_PRIMAL_FORM: ItemData(421 + SC2HOTS_ITEM_ID_OFFSET, "Primal Form", 0, SC2Race.ZERG, origin={"hots"}), + + ItemNames.KERRIGAN_LEVELS_10: ItemData(500 + SC2HOTS_ITEM_ID_OFFSET, "Level", 10, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression), + ItemNames.KERRIGAN_LEVELS_9: ItemData(501 + SC2HOTS_ITEM_ID_OFFSET, "Level", 9, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression), + ItemNames.KERRIGAN_LEVELS_8: ItemData(502 + SC2HOTS_ITEM_ID_OFFSET, "Level", 8, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression), + ItemNames.KERRIGAN_LEVELS_7: ItemData(503 + SC2HOTS_ITEM_ID_OFFSET, "Level", 7, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression), + ItemNames.KERRIGAN_LEVELS_6: ItemData(504 + SC2HOTS_ITEM_ID_OFFSET, "Level", 6, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression), + ItemNames.KERRIGAN_LEVELS_5: ItemData(505 + SC2HOTS_ITEM_ID_OFFSET, "Level", 5, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression), + ItemNames.KERRIGAN_LEVELS_4: ItemData(506 + SC2HOTS_ITEM_ID_OFFSET, "Level", 4, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression_skip_balancing), + ItemNames.KERRIGAN_LEVELS_3: ItemData(507 + SC2HOTS_ITEM_ID_OFFSET, "Level", 3, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression_skip_balancing), + ItemNames.KERRIGAN_LEVELS_2: ItemData(508 + SC2HOTS_ITEM_ID_OFFSET, "Level", 2, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression_skip_balancing), + ItemNames.KERRIGAN_LEVELS_1: ItemData(509 + SC2HOTS_ITEM_ID_OFFSET, "Level", 1, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression_skip_balancing), + ItemNames.KERRIGAN_LEVELS_14: ItemData(510 + SC2HOTS_ITEM_ID_OFFSET, "Level", 14, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression), + ItemNames.KERRIGAN_LEVELS_35: ItemData(511 + SC2HOTS_ITEM_ID_OFFSET, "Level", 35, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression), + ItemNames.KERRIGAN_LEVELS_70: ItemData(512 + SC2HOTS_ITEM_ID_OFFSET, "Level", 70, SC2Race.ZERG, origin={"hots"}, quantity=0, classification=ItemClassification.progression), + + # Zerg Mercs + ItemNames.INFESTED_MEDICS: ItemData(600 + SC2HOTS_ITEM_ID_OFFSET, "Mercenary", 0, SC2Race.ZERG, origin={"ext"}), + ItemNames.INFESTED_SIEGE_TANKS: ItemData(601 + SC2HOTS_ITEM_ID_OFFSET, "Mercenary", 1, SC2Race.ZERG, origin={"ext"}), + ItemNames.INFESTED_BANSHEES: ItemData(602 + SC2HOTS_ITEM_ID_OFFSET, "Mercenary", 2, SC2Race.ZERG, origin={"ext"}), + + # Misc Upgrades + ItemNames.OVERLORD_VENTRAL_SACS: ItemData(700 + SC2HOTS_ITEM_ID_OFFSET, "Evolution Pit", 6, SC2Race.ZERG, origin={"bw"}), + + # Morphs + ItemNames.MUTALISK_CORRUPTOR_GUARDIAN_ASPECT: ItemData(800 + SC2HOTS_ITEM_ID_OFFSET, "Morph", 6, SC2Race.ZERG, origin={"bw"}), + ItemNames.MUTALISK_CORRUPTOR_DEVOURER_ASPECT: ItemData(801 + SC2HOTS_ITEM_ID_OFFSET, "Morph", 7, SC2Race.ZERG, origin={"bw"}), + ItemNames.ROACH_RAVAGER_ASPECT: ItemData(802 + SC2HOTS_ITEM_ID_OFFSET, "Morph", 8, SC2Race.ZERG, origin={"ext"}), + + + # Protoss Units (those that aren't as items in WoL (Prophecy)) + ItemNames.OBSERVER: ItemData(0 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 9, SC2Race.PROTOSS, + classification=ItemClassification.filler, origin={"wol"}, + description="Flying spy. Cloak renders the unit invisible to enemies without detection."), + ItemNames.CENTURION: ItemData(1 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 10, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Powerful melee warrior. Has the Shadow Charge and Darkcoil abilities."), + ItemNames.SENTINEL: ItemData(2 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 11, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Powerful melee warrior. Has the Charge and Reconstruction abilities."), + ItemNames.SUPPLICANT: ItemData(3 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 12, SC2Race.PROTOSS, + classification=ItemClassification.filler, important_for_filtering=True, origin={"ext"}, + description="Powerful melee warrior. Has powerful damage resistant shields."), + ItemNames.INSTIGATOR: ItemData(4 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 13, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"ext"}, + description="Ranged support strider. Can store multiple Blink charges."), + ItemNames.SLAYER: ItemData(5 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 14, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"ext"}, + description="Ranged attack strider. Can use the Phase Blink and Phasing Armor abilities."), + ItemNames.SENTRY: ItemData(6 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 15, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Robotic support unit can use the Guardian Shield ability and restore the shields of nearby Protoss units."), + ItemNames.ENERGIZER: ItemData(7 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 16, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Robotic support unit. Can use the Chrono Beam ability and become stationary to power nearby structures."), + ItemNames.HAVOC: ItemData(8 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 17, SC2Race.PROTOSS, + origin={"lotv"}, important_for_filtering=True, + description="Robotic support unit. Can use the Target Lock and Force Field abilities and increase the range of nearby Protoss units."), + ItemNames.SIGNIFIER: ItemData(9 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 18, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"ext"}, + description="Potent permanently cloaked psionic master. Can use the Feedback and Crippling Psionic Storm abilities. Can merge into an Archon."), + ItemNames.ASCENDANT: ItemData(10 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 19, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Potent psionic master. Can use the Psionic Orb, Mind Blast, and Sacrifice abilities."), + ItemNames.AVENGER: ItemData(11 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 20, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Deadly warrior-assassin. Permanently cloaked. Recalls to the nearest Dark Shrine upon death."), + ItemNames.BLOOD_HUNTER: ItemData(12 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 21, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Deadly warrior-assassin. Permanently cloaked. Can use the Void Stasis ability."), + ItemNames.DRAGOON: ItemData(13 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 22, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Ranged assault strider. Has enhanced health and damage."), + ItemNames.DARK_ARCHON: ItemData(14 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 23, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Potent psionic master. Can use the Confuse and Mind Control abilities."), + ItemNames.ADEPT: ItemData(15 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 24, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Ranged specialist. Can use the Psionic Transfer ability."), + ItemNames.WARP_PRISM: ItemData(16 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 25, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"ext"}, + description="Flying transport. Can carry units and become stationary to deploy a power field."), + ItemNames.ANNIHILATOR: ItemData(17 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 26, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Assault Strider. Can use the Shadow Cannon ability to damage air and ground units."), + ItemNames.VANGUARD: ItemData(18 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 27, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Assault Strider. Deals splash damage around the primary target."), + ItemNames.WRATHWALKER: ItemData(19 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 28, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Battle strider with a powerful single target attack. Can walk up and down cliffs."), + ItemNames.REAVER: ItemData(20 + SC2LOTV_ITEM_ID_OFFSET, "Unit", 29, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Area damage siege unit. Builds and launches explosive Scarabs for high burst damage."), + ItemNames.DISRUPTOR: ItemData(21 + SC2LOTV_ITEM_ID_OFFSET, "Unit 2", 0, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"ext"}, + description="Robotic disruption unit. Can use the Purification Nova ability to deal heavy area damage."), + ItemNames.MIRAGE: ItemData(22 + SC2LOTV_ITEM_ID_OFFSET, "Unit 2", 1, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Air superiority starfighter. Can use Graviton Beam and Phasing Armor abilities."), + ItemNames.CORSAIR: ItemData(23 + SC2LOTV_ITEM_ID_OFFSET, "Unit 2", 2, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Air superiority starfighter. Can use the Disruption Web ability."), + ItemNames.DESTROYER: ItemData(24 + SC2LOTV_ITEM_ID_OFFSET, "Unit 2", 3, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Area assault craft. Can use the Destruction Beam ability to attack multiple units at once."), + ItemNames.SCOUT: ItemData(25 + SC2LOTV_ITEM_ID_OFFSET, "Unit 2", 4, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"ext"}, + description="Versatile high-speed fighter."), + ItemNames.TEMPEST: ItemData(26 + SC2LOTV_ITEM_ID_OFFSET, "Unit 2", 5, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Siege artillery craft. Attacks from long range. Can use the Disintegration ability."), + ItemNames.MOTHERSHIP: ItemData(27 + SC2LOTV_ITEM_ID_OFFSET, "Unit 2", 6, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Ultimate Protoss vessel, Can use the Vortex and Mass Recall abilities. Cloaks nearby units and structures."), + ItemNames.ARBITER: ItemData(28 + SC2LOTV_ITEM_ID_OFFSET, "Unit 2", 7, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="Army support craft. Has the Stasis Field and Recall abilities. Cloaks nearby units."), + ItemNames.ORACLE: ItemData(29 + SC2LOTV_ITEM_ID_OFFSET, "Unit 2", 8, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"ext"}, + description="Flying caster. Can use the Revelation and Stasis Ward abilities."), + + # Protoss Upgrades + ItemNames.PROGRESSIVE_PROTOSS_GROUND_WEAPON: ItemData(100 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 0, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + ItemNames.PROGRESSIVE_PROTOSS_GROUND_ARMOR: ItemData(101 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 2, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + ItemNames.PROGRESSIVE_PROTOSS_SHIELDS: ItemData(102 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 4, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + ItemNames.PROGRESSIVE_PROTOSS_AIR_WEAPON: ItemData(103 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 6, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + ItemNames.PROGRESSIVE_PROTOSS_AIR_ARMOR: ItemData(104 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 8, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + # Upgrade bundle 'number' values are used as indices to get affected 'number's + ItemNames.PROGRESSIVE_PROTOSS_WEAPON_UPGRADE: ItemData(105 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 11, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + ItemNames.PROGRESSIVE_PROTOSS_ARMOR_UPGRADE: ItemData(106 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 12, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + ItemNames.PROGRESSIVE_PROTOSS_GROUND_UPGRADE: ItemData(107 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 13, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + ItemNames.PROGRESSIVE_PROTOSS_AIR_UPGRADE: ItemData(108 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 14, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + ItemNames.PROGRESSIVE_PROTOSS_WEAPON_ARMOR_UPGRADE: ItemData(109 + SC2LOTV_ITEM_ID_OFFSET, "Upgrade", 15, SC2Race.PROTOSS, quantity=3, origin={"wol", "lotv"}), + + # Protoss Buildings + ItemNames.PHOTON_CANNON: ItemData(200 + SC2LOTV_ITEM_ID_OFFSET, "Building", 0, SC2Race.PROTOSS, classification=ItemClassification.progression, origin={"wol", "lotv"}), + ItemNames.KHAYDARIN_MONOLITH: ItemData(201 + SC2LOTV_ITEM_ID_OFFSET, "Building", 1, SC2Race.PROTOSS, classification=ItemClassification.progression, origin={"lotv"}), + ItemNames.SHIELD_BATTERY: ItemData(202 + SC2LOTV_ITEM_ID_OFFSET, "Building", 2, SC2Race.PROTOSS, classification=ItemClassification.progression, origin={"lotv"}), + + # Protoss Unit Upgrades + ItemNames.SUPPLICANT_BLOOD_SHIELD: ItemData(300 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 0, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=ItemNames.SUPPLICANT), + ItemNames.SUPPLICANT_SOUL_AUGMENTATION: ItemData(301 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 1, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=ItemNames.SUPPLICANT), + ItemNames.SUPPLICANT_SHIELD_REGENERATION: ItemData(302 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 2, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=ItemNames.SUPPLICANT), + ItemNames.ADEPT_SHOCKWAVE: ItemData(303 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 3, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ADEPT), + ItemNames.ADEPT_RESONATING_GLAIVES: ItemData(304 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 4, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ADEPT), + ItemNames.ADEPT_PHASE_BULWARK: ItemData(305 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 5, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ADEPT), + ItemNames.STALKER_INSTIGATOR_SLAYER_DISINTEGRATING_PARTICLES: ItemData(306 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 6, SC2Race.PROTOSS, origin={"ext"}, classification=ItemClassification.progression), + ItemNames.STALKER_INSTIGATOR_SLAYER_PARTICLE_REFLECTION: ItemData(307 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 7, SC2Race.PROTOSS, origin={"ext"}, classification=ItemClassification.progression), + ItemNames.DRAGOON_HIGH_IMPACT_PHASE_DISRUPTORS: ItemData(308 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 8, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.DRAGOON), + ItemNames.DRAGOON_TRILLIC_COMPRESSION_SYSTEM: ItemData(309 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 9, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.DRAGOON), + ItemNames.DRAGOON_SINGULARITY_CHARGE: ItemData(310 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 10, SC2Race.PROTOSS, origin={"bw"}, parent_item=ItemNames.DRAGOON), + ItemNames.DRAGOON_ENHANCED_STRIDER_SERVOS: ItemData(311 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 11, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}, parent_item=ItemNames.DRAGOON), + ItemNames.SCOUT_COMBAT_SENSOR_ARRAY: ItemData(312 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 12, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.SCOUT), + ItemNames.SCOUT_APIAL_SENSORS: ItemData(313 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 13, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}, parent_item=ItemNames.SCOUT), + ItemNames.SCOUT_GRAVITIC_THRUSTERS: ItemData(314 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 14, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}, parent_item=ItemNames.SCOUT), + ItemNames.SCOUT_ADVANCED_PHOTON_BLASTERS: ItemData(315 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 15, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.SCOUT), + ItemNames.TEMPEST_TECTONIC_DESTABILIZERS: ItemData(316 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 16, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=ItemNames.TEMPEST), + ItemNames.TEMPEST_QUANTIC_REACTOR: ItemData(317 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 17, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=ItemNames.TEMPEST), + ItemNames.TEMPEST_GRAVITY_SLING: ItemData(318 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 18, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.TEMPEST), + ItemNames.PHOENIX_MIRAGE_IONIC_WAVELENGTH_FLUX: ItemData(319 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 19, SC2Race.PROTOSS, origin={"ext"}), + ItemNames.PHOENIX_MIRAGE_ANION_PULSE_CRYSTALS: ItemData(320 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 20, SC2Race.PROTOSS, origin={"ext"}), + ItemNames.CORSAIR_STEALTH_DRIVE: ItemData(321 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 21, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.CORSAIR), + ItemNames.CORSAIR_ARGUS_JEWEL: ItemData(322 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 22, SC2Race.PROTOSS, origin={"bw"}, parent_item=ItemNames.CORSAIR), + ItemNames.CORSAIR_SUSTAINING_DISRUPTION: ItemData(323 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 23, SC2Race.PROTOSS, origin={"bw"}, parent_item=ItemNames.CORSAIR), + ItemNames.CORSAIR_NEUTRON_SHIELDS: ItemData(324 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 24, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}, parent_item=ItemNames.CORSAIR), + ItemNames.ORACLE_STEALTH_DRIVE: ItemData(325 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 25, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ORACLE), + ItemNames.ORACLE_STASIS_CALIBRATION: ItemData(326 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 26, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ORACLE), + ItemNames.ORACLE_TEMPORAL_ACCELERATION_BEAM: ItemData(327 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 27, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ORACLE), + ItemNames.ARBITER_CHRONOSTATIC_REINFORCEMENT: ItemData(328 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 28, SC2Race.PROTOSS, origin={"bw"}, parent_item=ItemNames.ARBITER), + ItemNames.ARBITER_KHAYDARIN_CORE: ItemData(329 + SC2LOTV_ITEM_ID_OFFSET, "Forge 1", 29, SC2Race.PROTOSS, origin={"bw"}, parent_item=ItemNames.ARBITER), + ItemNames.ARBITER_SPACETIME_ANCHOR: ItemData(330 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 0, SC2Race.PROTOSS, origin={"bw"}, parent_item=ItemNames.ARBITER), + ItemNames.ARBITER_RESOURCE_EFFICIENCY: ItemData(331 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 1, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}, parent_item=ItemNames.ARBITER), + ItemNames.ARBITER_ENHANCED_CLOAK_FIELD: ItemData(332 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 2, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}, parent_item=ItemNames.ARBITER), + ItemNames.CARRIER_GRAVITON_CATAPULT: + ItemData(333 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 3, SC2Race.PROTOSS, origin={"wol"}, + parent_item=ItemNames.CARRIER, + description="Carriers can launch Interceptors more quickly."), + ItemNames.CARRIER_HULL_OF_PAST_GLORIES: + ItemData(334 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 4, SC2Race.PROTOSS, origin={"bw"}, + parent_item=ItemNames.CARRIER, + description="Carriers gain +2 armour."), + ItemNames.VOID_RAY_DESTROYER_FLUX_VANES: + ItemData(335 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 5, SC2Race.PROTOSS, classification=ItemClassification.filler, + origin={"ext"}, + description="Increases Void Ray and Destroyer movement speed."), + ItemNames.DESTROYER_REFORGED_BLOODSHARD_CORE: + ItemData(336 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 6, SC2Race.PROTOSS, origin={"ext"}, + parent_item=ItemNames.DESTROYER, + description="When fully charged, the Destroyer's Destruction Beam weapon does full damage to secondary targets."), + ItemNames.WARP_PRISM_GRAVITIC_DRIVE: + ItemData(337 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 7, SC2Race.PROTOSS, classification=ItemClassification.filler, + origin={"ext"}, parent_item=ItemNames.WARP_PRISM, + description="Increases the movement speed of Warp Prisms."), + ItemNames.WARP_PRISM_PHASE_BLASTER: + ItemData(338 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 8, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"ext"}, parent_item=ItemNames.WARP_PRISM, + description="Equips Warp Prisms with an auto-attack that can hit ground and air targets."), + ItemNames.WARP_PRISM_WAR_CONFIGURATION: ItemData(339 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 9, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.WARP_PRISM), + ItemNames.OBSERVER_GRAVITIC_BOOSTERS: ItemData(340 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 10, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}, parent_item=ItemNames.OBSERVER), + ItemNames.OBSERVER_SENSOR_ARRAY: ItemData(341 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 11, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}, parent_item=ItemNames.OBSERVER), + ItemNames.REAVER_SCARAB_DAMAGE: ItemData(342 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 12, SC2Race.PROTOSS, origin={"bw"}, parent_item=ItemNames.REAVER), + ItemNames.REAVER_SOLARITE_PAYLOAD: ItemData(343 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 13, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.REAVER), + ItemNames.REAVER_REAVER_CAPACITY: ItemData(344 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 14, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}, parent_item=ItemNames.REAVER), + ItemNames.REAVER_RESOURCE_EFFICIENCY: ItemData(345 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 15, SC2Race.PROTOSS, origin={"bw"}, parent_item=ItemNames.REAVER), + ItemNames.VANGUARD_AGONY_LAUNCHERS: ItemData(346 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 16, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.VANGUARD), + ItemNames.VANGUARD_MATTER_DISPERSION: ItemData(347 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 17, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.VANGUARD), + ItemNames.IMMORTAL_ANNIHILATOR_SINGULARITY_CHARGE: ItemData(348 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 18, SC2Race.PROTOSS, origin={"ext"}), + ItemNames.IMMORTAL_ANNIHILATOR_ADVANCED_TARGETING_MECHANICS: ItemData(349 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 19, SC2Race.PROTOSS, classification=ItemClassification.progression, origin={"ext"}), + ItemNames.COLOSSUS_PACIFICATION_PROTOCOL: ItemData(350 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 20, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.COLOSSUS), + ItemNames.WRATHWALKER_RAPID_POWER_CYCLING: ItemData(351 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 21, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.WRATHWALKER), + ItemNames.WRATHWALKER_EYE_OF_WRATH: ItemData(352 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 22, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=ItemNames.WRATHWALKER), + ItemNames.DARK_TEMPLAR_AVENGER_BLOOD_HUNTER_SHROUD_OF_ADUN: ItemData(353 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 23, SC2Race.PROTOSS, origin={"ext"}), + ItemNames.DARK_TEMPLAR_AVENGER_BLOOD_HUNTER_SHADOW_GUARD_TRAINING: ItemData(354 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 24, SC2Race.PROTOSS, origin={"bw"}), + ItemNames.DARK_TEMPLAR_AVENGER_BLOOD_HUNTER_BLINK: ItemData(355 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 25, SC2Race.PROTOSS, classification=ItemClassification.progression, origin={"ext"}), + ItemNames.DARK_TEMPLAR_AVENGER_BLOOD_HUNTER_RESOURCE_EFFICIENCY: ItemData(356 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 26, SC2Race.PROTOSS, origin={"ext"}), + ItemNames.DARK_TEMPLAR_DARK_ARCHON_MELD: ItemData(357 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 27, SC2Race.PROTOSS, origin={"bw"}, important_for_filtering=True ,parent_item=ItemNames.DARK_TEMPLAR), + ItemNames.HIGH_TEMPLAR_SIGNIFIER_UNSHACKLED_PSIONIC_STORM: ItemData(358 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 28, SC2Race.PROTOSS, origin={"bw"}), + ItemNames.HIGH_TEMPLAR_SIGNIFIER_HALLUCINATION: ItemData(359 + SC2LOTV_ITEM_ID_OFFSET, "Forge 2", 29, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"bw"}), + ItemNames.HIGH_TEMPLAR_SIGNIFIER_KHAYDARIN_AMULET: ItemData(360 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 0, SC2Race.PROTOSS, origin={"bw"}), + ItemNames.ARCHON_HIGH_ARCHON: ItemData(361 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 1, SC2Race.PROTOSS, origin={"ext"}, important_for_filtering=True), + ItemNames.DARK_ARCHON_FEEDBACK: ItemData(362 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 2, SC2Race.PROTOSS, origin={"bw"}), + ItemNames.DARK_ARCHON_MAELSTROM: ItemData(363 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 3, SC2Race.PROTOSS, origin={"bw"}), + ItemNames.DARK_ARCHON_ARGUS_TALISMAN: ItemData(364 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 4, SC2Race.PROTOSS, origin={"bw"}), + ItemNames.ASCENDANT_POWER_OVERWHELMING: ItemData(365 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 5, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ASCENDANT), + ItemNames.ASCENDANT_CHAOTIC_ATTUNEMENT: ItemData(366 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 6, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ASCENDANT), + ItemNames.ASCENDANT_BLOOD_AMULET: ItemData(367 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 7, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ASCENDANT), + ItemNames.SENTRY_ENERGIZER_HAVOC_CLOAKING_MODULE: ItemData(368 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 8, SC2Race.PROTOSS, origin={"ext"}), + ItemNames.SENTRY_ENERGIZER_HAVOC_SHIELD_BATTERY_RAPID_RECHARGING: ItemData(369 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 9, SC2Race.PROTOSS, origin={"ext"}), + ItemNames.SENTRY_FORCE_FIELD: ItemData(370 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 10, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=ItemNames.SENTRY), + ItemNames.SENTRY_HALLUCINATION: ItemData(371 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 11, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}, parent_item=ItemNames.SENTRY), + ItemNames.ENERGIZER_RECLAMATION: ItemData(372 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 12, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ENERGIZER), + ItemNames.ENERGIZER_FORGED_CHASSIS: ItemData(373 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 13, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.ENERGIZER), + ItemNames.HAVOC_DETECT_WEAKNESS: ItemData(374 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 14, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.HAVOC), + ItemNames.HAVOC_BLOODSHARD_RESONANCE: ItemData(375 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 15, SC2Race.PROTOSS, origin={"ext"}, parent_item=ItemNames.HAVOC), + ItemNames.ZEALOT_SENTINEL_CENTURION_LEG_ENHANCEMENTS: ItemData(376 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 16, SC2Race.PROTOSS, origin={"bw"}), + ItemNames.ZEALOT_SENTINEL_CENTURION_SHIELD_CAPACITY: ItemData(377 + SC2LOTV_ITEM_ID_OFFSET, "Forge 3", 17, SC2Race.PROTOSS, origin={"bw"}), + + # SoA Calldown powers + ItemNames.SOA_CHRONO_SURGE: ItemData(700 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 0, SC2Race.PROTOSS, origin={"lotv"}), + ItemNames.SOA_PROGRESSIVE_PROXY_PYLON: ItemData(701 + SC2LOTV_ITEM_ID_OFFSET, "Progressive Upgrade", 0, SC2Race.PROTOSS, origin={"lotv"}, quantity=2), + ItemNames.SOA_PYLON_OVERCHARGE: ItemData(702 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 1, SC2Race.PROTOSS, origin={"ext"}), + ItemNames.SOA_ORBITAL_STRIKE: ItemData(703 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 2, SC2Race.PROTOSS, origin={"lotv"}), + ItemNames.SOA_TEMPORAL_FIELD: ItemData(704 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 3, SC2Race.PROTOSS, origin={"lotv"}), + ItemNames.SOA_SOLAR_LANCE: ItemData(705 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 4, SC2Race.PROTOSS, classification=ItemClassification.progression, origin={"lotv"}), + ItemNames.SOA_MASS_RECALL: ItemData(706 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 5, SC2Race.PROTOSS, origin={"lotv"}), + ItemNames.SOA_SHIELD_OVERCHARGE: ItemData(707 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 6, SC2Race.PROTOSS, origin={"lotv"}), + ItemNames.SOA_DEPLOY_FENIX: ItemData(708 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 7, SC2Race.PROTOSS, classification=ItemClassification.progression, origin={"lotv"}), + ItemNames.SOA_PURIFIER_BEAM: ItemData(709 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 8, SC2Race.PROTOSS, origin={"lotv"}), + ItemNames.SOA_TIME_STOP: ItemData(710 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 9, SC2Race.PROTOSS, classification=ItemClassification.progression, origin={"lotv"}), + ItemNames.SOA_SOLAR_BOMBARDMENT: ItemData(711 + SC2LOTV_ITEM_ID_OFFSET, "Spear of Adun", 10, SC2Race.PROTOSS, origin={"lotv"}), + + # Generic Protoss Upgrades + ItemNames.MATRIX_OVERLOAD: + ItemData(800 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 0, SC2Race.PROTOSS, origin={"lotv"}, + description=r"All friendly units gain 25% movement speed and 15% attack speed within a Pylon's power field and for 15 seconds after leaving it."), + ItemNames.QUATRO: + ItemData(801 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 1, SC2Race.PROTOSS, origin={"ext"}, + description="All friendly Protoss units gain the equivalent of their +1 armour, attack, and shield upgrades."), + ItemNames.NEXUS_OVERCHARGE: + ItemData(802 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 2, SC2Race.PROTOSS, origin={"lotv"}, + important_for_filtering=True, description="The Protoss Nexus gains a long-range auto-attack."), + ItemNames.ORBITAL_ASSIMILATORS: + ItemData(803 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 3, SC2Race.PROTOSS, origin={"lotv"}, + description="Assimilators automatically harvest Vespene Gas without the need for Probes."), + ItemNames.WARP_HARMONIZATION: + ItemData(804 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 4, SC2Race.PROTOSS, origin={"lotv"}, + description=r"Stargates and Robotics Facilities can transform to utilize Warp In technology. Warp In cooldowns are 20% faster than original build times."), + ItemNames.GUARDIAN_SHELL: + ItemData(805 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 5, SC2Race.PROTOSS, origin={"lotv"}, + description="The Spear of Adun passively shields friendly Protoss units before death, making them invulnerable for 5 seconds. Each unit can only be shielded once every 60 seconds."), + ItemNames.RECONSTRUCTION_BEAM: + ItemData(806 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 6, SC2Race.PROTOSS, + classification=ItemClassification.progression, origin={"lotv"}, + description="The Spear of Adun will passively heal mechanical units for 5 and non-biological structures for 10 life per second. Up to 3 targets can be repaired at once."), + ItemNames.OVERWATCH: + ItemData(807 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 7, SC2Race.PROTOSS, origin={"ext"}, + description="Once per second, the Spear of Adun will last-hit a damaged enemy unit that is below 50 health."), + ItemNames.SUPERIOR_WARP_GATES: + ItemData(808 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 8, SC2Race.PROTOSS, origin={"ext"}, + description="Protoss Warp Gates can hold up to 3 charges of unit warp-ins."), + ItemNames.ENHANCED_TARGETING: + ItemData(809 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 9, SC2Race.PROTOSS, origin={"ext"}, + description="Protoss defensive structures gain +2 range."), + ItemNames.OPTIMIZED_ORDNANCE: + ItemData(810 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 10, SC2Race.PROTOSS, origin={"ext"}, + description="Increases the attack speed of Protoss defensive structures by 25%."), + ItemNames.KHALAI_INGENUITY: + ItemData(811 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 11, SC2Race.PROTOSS, origin={"ext"}, + description="Pylons, Photon Cannons, Monoliths, and Shield Batteries warp in near-instantly."), + ItemNames.AMPLIFIED_ASSIMILATORS: + ItemData(812 + SC2LOTV_ITEM_ID_OFFSET, "Solarite Core", 12, SC2Race.PROTOSS, origin={"ext"}, + description=r"Assimilators produce Vespene gas 25% faster."), +} + + +def get_item_table(): + return item_table + + +basic_units = { + SC2Race.TERRAN: { + ItemNames.MARINE, + ItemNames.MARAUDER, + ItemNames.GOLIATH, + ItemNames.HELLION, + ItemNames.VULTURE, + ItemNames.WARHOUND, + }, + SC2Race.ZERG: { + ItemNames.ZERGLING, + ItemNames.SWARM_QUEEN, + ItemNames.ROACH, + ItemNames.HYDRALISK, + }, + SC2Race.PROTOSS: { + ItemNames.ZEALOT, + ItemNames.CENTURION, + ItemNames.SENTINEL, + ItemNames.STALKER, + ItemNames.INSTIGATOR, + ItemNames.SLAYER, + ItemNames.DRAGOON, + ItemNames.ADEPT, + } +} + +advanced_basic_units = { + SC2Race.TERRAN: basic_units[SC2Race.TERRAN].union({ + ItemNames.REAPER, + ItemNames.DIAMONDBACK, + ItemNames.VIKING, + ItemNames.SIEGE_TANK, + ItemNames.BANSHEE, + ItemNames.THOR, + ItemNames.BATTLECRUISER, + ItemNames.CYCLONE + }), + SC2Race.ZERG: basic_units[SC2Race.ZERG].union({ + ItemNames.INFESTOR, + ItemNames.ABERRATION, + }), + SC2Race.PROTOSS: basic_units[SC2Race.PROTOSS].union({ + ItemNames.DARK_TEMPLAR, + ItemNames.BLOOD_HUNTER, + ItemNames.AVENGER, + ItemNames.IMMORTAL, + ItemNames.ANNIHILATOR, + ItemNames.VANGUARD, + }) +} + +no_logic_starting_units = { + SC2Race.TERRAN: advanced_basic_units[SC2Race.TERRAN].union({ + ItemNames.FIREBAT, + ItemNames.GHOST, + ItemNames.SPECTRE, + ItemNames.WRAITH, + ItemNames.RAVEN, + ItemNames.PREDATOR, + ItemNames.LIBERATOR, + ItemNames.HERC, + }), + SC2Race.ZERG: advanced_basic_units[SC2Race.ZERG].union({ + ItemNames.ULTRALISK, + ItemNames.SWARM_HOST + }), + SC2Race.PROTOSS: advanced_basic_units[SC2Race.PROTOSS].union({ + ItemNames.CARRIER, + ItemNames.TEMPEST, + ItemNames.VOID_RAY, + ItemNames.DESTROYER, + ItemNames.COLOSSUS, + ItemNames.WRATHWALKER, + ItemNames.SCOUT, + ItemNames.HIGH_TEMPLAR, + ItemNames.SIGNIFIER, + ItemNames.ASCENDANT, + ItemNames.DARK_ARCHON, + ItemNames.SUPPLICANT, + }) +} + +not_balanced_starting_units = { + ItemNames.SIEGE_TANK, + ItemNames.THOR, + ItemNames.BANSHEE, + ItemNames.BATTLECRUISER, + ItemNames.ULTRALISK, + ItemNames.CARRIER, + ItemNames.TEMPEST, +} + + +def get_basic_units(world: World, race: SC2Race) -> typing.Set[str]: + logic_level = get_option_value(world, 'required_tactics') + if logic_level == RequiredTactics.option_no_logic: + return no_logic_starting_units[race] + elif logic_level == RequiredTactics.option_advanced: + return advanced_basic_units[race] + else: + return basic_units[race] + + +# Items that can be placed before resources if not already in +# General upgrades and Mercs +second_pass_placeable_items: typing.Tuple[str, ...] = ( + # Global weapon/armor upgrades + ItemNames.PROGRESSIVE_TERRAN_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_TERRAN_WEAPON_UPGRADE, + ItemNames.PROGRESSIVE_TERRAN_WEAPON_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_ZERG_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_ZERG_WEAPON_UPGRADE, + ItemNames.PROGRESSIVE_ZERG_WEAPON_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_PROTOSS_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_PROTOSS_WEAPON_UPGRADE, + ItemNames.PROGRESSIVE_PROTOSS_WEAPON_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_PROTOSS_SHIELDS, + # Terran Buildings without upgrades + ItemNames.SENSOR_TOWER, + ItemNames.HIVE_MIND_EMULATOR, + ItemNames.PSI_DISRUPTER, + ItemNames.PERDITION_TURRET, + # Terran units without upgrades + ItemNames.HERC, + ItemNames.WARHOUND, + # General Terran upgrades without any dependencies + ItemNames.SCV_ADVANCED_CONSTRUCTION, + ItemNames.SCV_DUAL_FUSION_WELDERS, + ItemNames.PROGRESSIVE_FIRE_SUPPRESSION_SYSTEM, + ItemNames.PROGRESSIVE_ORBITAL_COMMAND, + ItemNames.ULTRA_CAPACITORS, + ItemNames.VANADIUM_PLATING, + ItemNames.ORBITAL_DEPOTS, + ItemNames.MICRO_FILTERING, + ItemNames.AUTOMATED_REFINERY, + ItemNames.COMMAND_CENTER_REACTOR, + ItemNames.TECH_REACTOR, + ItemNames.CELLULAR_REACTOR, + ItemNames.PROGRESSIVE_REGENERATIVE_BIO_STEEL, # Place only L1 + ItemNames.STRUCTURE_ARMOR, + ItemNames.HI_SEC_AUTO_TRACKING, + ItemNames.ADVANCED_OPTICS, + ItemNames.ROGUE_FORCES, + # Mercenaries (All races) + *[item_name for item_name, item_data in get_full_item_list().items() + if item_data.type == "Mercenary"], + # Kerrigan and Nova levels, abilities and generally useful stuff + *[item_name for item_name, item_data in get_full_item_list().items() + if item_data.type in ("Level", "Ability", "Evolution Pit", "Nova Gear")], + ItemNames.NOVA_PROGRESSIVE_STEALTH_SUIT_MODULE, + # Zerg static defenses + ItemNames.SPORE_CRAWLER, + ItemNames.SPINE_CRAWLER, + # Defiler, Aberration (no upgrades) + ItemNames.DEFILER, + ItemNames.ABERRATION, + # Spear of Adun Abilities + ItemNames.SOA_CHRONO_SURGE, + ItemNames.SOA_PROGRESSIVE_PROXY_PYLON, + ItemNames.SOA_PYLON_OVERCHARGE, + ItemNames.SOA_ORBITAL_STRIKE, + ItemNames.SOA_TEMPORAL_FIELD, + ItemNames.SOA_SOLAR_LANCE, + ItemNames.SOA_MASS_RECALL, + ItemNames.SOA_SHIELD_OVERCHARGE, + ItemNames.SOA_DEPLOY_FENIX, + ItemNames.SOA_PURIFIER_BEAM, + ItemNames.SOA_TIME_STOP, + ItemNames.SOA_SOLAR_BOMBARDMENT, + # Protoss generic upgrades + ItemNames.MATRIX_OVERLOAD, + ItemNames.QUATRO, + ItemNames.NEXUS_OVERCHARGE, + ItemNames.ORBITAL_ASSIMILATORS, + ItemNames.WARP_HARMONIZATION, + ItemNames.GUARDIAN_SHELL, + ItemNames.RECONSTRUCTION_BEAM, + ItemNames.OVERWATCH, + ItemNames.SUPERIOR_WARP_GATES, + ItemNames.KHALAI_INGENUITY, + ItemNames.AMPLIFIED_ASSIMILATORS, + # Protoss static defenses + ItemNames.PHOTON_CANNON, + ItemNames.KHAYDARIN_MONOLITH, + ItemNames.SHIELD_BATTERY +) + + +filler_items: typing.Tuple[str, ...] = ( + ItemNames.STARTING_MINERALS, + ItemNames.STARTING_VESPENE, + ItemNames.STARTING_SUPPLY, +) + +# Defense rating table +# Commented defense ratings are handled in LogicMixin +defense_ratings = { + ItemNames.SIEGE_TANK: 5, + # "Maelstrom Rounds": 2, + ItemNames.PLANETARY_FORTRESS: 3, + # Bunker w/ Marine/Marauder: 3, + ItemNames.PERDITION_TURRET: 2, + ItemNames.VULTURE: 1, + ItemNames.BANSHEE: 1, + ItemNames.BATTLECRUISER: 1, + ItemNames.LIBERATOR: 4, + ItemNames.WIDOW_MINE: 1, + # "Concealment (Widow Mine)": 1 +} +zerg_defense_ratings = { + ItemNames.PERDITION_TURRET: 2, + # Bunker w/ Firebat: 2, + ItemNames.LIBERATOR: -2, + ItemNames.HIVE_MIND_EMULATOR: 3, + ItemNames.PSI_DISRUPTER: 3, +} +air_defense_ratings = { + ItemNames.MISSILE_TURRET: 2, +} + +kerrigan_levels = [item_name for item_name, item_data in get_full_item_list().items() + if item_data.type == "Level" and item_data.race == SC2Race.ZERG] + +spider_mine_sources = { + ItemNames.VULTURE, + ItemNames.REAPER_SPIDER_MINES, + ItemNames.SIEGE_TANK_SPIDER_MINES, + ItemNames.RAVEN_SPIDER_MINES, +} + +progressive_if_nco = { + ItemNames.MARINE_PROGRESSIVE_STIMPACK, + ItemNames.FIREBAT_PROGRESSIVE_STIMPACK, + ItemNames.BANSHEE_PROGRESSIVE_CROSS_SPECTRUM_DAMPENERS, + ItemNames.PROGRESSIVE_REGENERATIVE_BIO_STEEL, +} + +progressive_if_ext = { + ItemNames.VULTURE_PROGRESSIVE_REPLENISHABLE_MAGAZINE, + ItemNames.WRAITH_PROGRESSIVE_TOMAHAWK_POWER_CELLS, + ItemNames.BATTLECRUISER_PROGRESSIVE_DEFENSIVE_MATRIX, + ItemNames.BATTLECRUISER_PROGRESSIVE_MISSILE_PODS, + ItemNames.THOR_PROGRESSIVE_IMMORTALITY_PROTOCOL, + ItemNames.PROGRESSIVE_FIRE_SUPPRESSION_SYSTEM, + ItemNames.DIAMONDBACK_PROGRESSIVE_TRI_LITHIUM_POWER_CELL +} + +kerrigan_actives: typing.List[typing.Set[str]] = [ + {ItemNames.KERRIGAN_KINETIC_BLAST, ItemNames.KERRIGAN_LEAPING_STRIKE}, + {ItemNames.KERRIGAN_CRUSHING_GRIP, ItemNames.KERRIGAN_PSIONIC_SHIFT}, + set(), + {ItemNames.KERRIGAN_WILD_MUTATION, ItemNames.KERRIGAN_SPAWN_BANELINGS, ItemNames.KERRIGAN_MEND}, + set(), + set(), + {ItemNames.KERRIGAN_APOCALYPSE, ItemNames.KERRIGAN_SPAWN_LEVIATHAN, ItemNames.KERRIGAN_DROP_PODS}, +] + +kerrigan_passives: typing.List[typing.Set[str]] = [ + {ItemNames.KERRIGAN_HEROIC_FORTITUDE}, + {ItemNames.KERRIGAN_CHAIN_REACTION}, + {ItemNames.KERRIGAN_ZERGLING_RECONSTITUTION, ItemNames.KERRIGAN_IMPROVED_OVERLORDS, ItemNames.KERRIGAN_AUTOMATED_EXTRACTORS}, + set(), + {ItemNames.KERRIGAN_TWIN_DRONES, ItemNames.KERRIGAN_MALIGNANT_CREEP, ItemNames.KERRIGAN_VESPENE_EFFICIENCY}, + {ItemNames.KERRIGAN_INFEST_BROODLINGS, ItemNames.KERRIGAN_FURY, ItemNames.KERRIGAN_ABILITY_EFFICIENCY}, + set(), +] + +kerrigan_only_passives = { + ItemNames.KERRIGAN_HEROIC_FORTITUDE, ItemNames.KERRIGAN_CHAIN_REACTION, + ItemNames.KERRIGAN_INFEST_BROODLINGS, ItemNames.KERRIGAN_FURY, ItemNames.KERRIGAN_ABILITY_EFFICIENCY, +} + +spear_of_adun_calldowns = { + ItemNames.SOA_CHRONO_SURGE, + ItemNames.SOA_PROGRESSIVE_PROXY_PYLON, + ItemNames.SOA_PYLON_OVERCHARGE, + ItemNames.SOA_ORBITAL_STRIKE, + ItemNames.SOA_TEMPORAL_FIELD, + ItemNames.SOA_SOLAR_LANCE, + ItemNames.SOA_MASS_RECALL, + ItemNames.SOA_SHIELD_OVERCHARGE, + ItemNames.SOA_DEPLOY_FENIX, + ItemNames.SOA_PURIFIER_BEAM, + ItemNames.SOA_TIME_STOP, + ItemNames.SOA_SOLAR_BOMBARDMENT +} + +spear_of_adun_castable_passives = { + ItemNames.RECONSTRUCTION_BEAM, + ItemNames.OVERWATCH, +} + +nova_equipment = { + *[item_name for item_name, item_data in get_full_item_list().items() + if item_data.type == "Nova Gear"], + ItemNames.NOVA_PROGRESSIVE_STEALTH_SUIT_MODULE +} + +# 'number' values of upgrades for upgrade bundle items +upgrade_numbers = [ + # Terran + {0, 4, 8}, # Weapon + {2, 6, 10}, # Armor + {0, 2}, # Infantry + {4, 6}, # Vehicle + {8, 10}, # Starship + {0, 2, 4, 6, 8, 10}, # All + # Zerg + {0, 2, 6}, # Weapon + {4, 8}, # Armor + {0, 2, 4}, # Ground + {6, 8}, # Flyer + {0, 2, 4, 6, 8}, # All + # Protoss + {0, 6}, # Weapon + {2, 4, 8}, # Armor + {0, 2}, # Ground, Shields are handled specially + {6, 8}, # Air, Shields are handled specially + {0, 2, 4, 6, 8}, # All +] +# 'upgrade_numbers' indices for all upgrades +upgrade_numbers_all = { + SC2Race.TERRAN: 5, + SC2Race.ZERG: 10, + SC2Race.PROTOSS: 15, +} + +# Names of upgrades to be included for different options +upgrade_included_names = [ + { # Individual Items + ItemNames.PROGRESSIVE_TERRAN_INFANTRY_WEAPON, + ItemNames.PROGRESSIVE_TERRAN_INFANTRY_ARMOR, + ItemNames.PROGRESSIVE_TERRAN_VEHICLE_WEAPON, + ItemNames.PROGRESSIVE_TERRAN_VEHICLE_ARMOR, + ItemNames.PROGRESSIVE_TERRAN_SHIP_WEAPON, + ItemNames.PROGRESSIVE_TERRAN_SHIP_ARMOR, + ItemNames.PROGRESSIVE_ZERG_MELEE_ATTACK, + ItemNames.PROGRESSIVE_ZERG_MISSILE_ATTACK, + ItemNames.PROGRESSIVE_ZERG_GROUND_CARAPACE, + ItemNames.PROGRESSIVE_ZERG_FLYER_ATTACK, + ItemNames.PROGRESSIVE_ZERG_FLYER_CARAPACE, + ItemNames.PROGRESSIVE_PROTOSS_GROUND_WEAPON, + ItemNames.PROGRESSIVE_PROTOSS_GROUND_ARMOR, + ItemNames.PROGRESSIVE_PROTOSS_SHIELDS, + ItemNames.PROGRESSIVE_PROTOSS_AIR_WEAPON, + ItemNames.PROGRESSIVE_PROTOSS_AIR_ARMOR, + }, + { # Bundle Weapon And Armor + ItemNames.PROGRESSIVE_TERRAN_WEAPON_UPGRADE, + ItemNames.PROGRESSIVE_TERRAN_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_ZERG_WEAPON_UPGRADE, + ItemNames.PROGRESSIVE_ZERG_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_PROTOSS_WEAPON_UPGRADE, + ItemNames.PROGRESSIVE_PROTOSS_ARMOR_UPGRADE, + }, + { # Bundle Unit Class + ItemNames.PROGRESSIVE_TERRAN_INFANTRY_UPGRADE, + ItemNames.PROGRESSIVE_TERRAN_VEHICLE_UPGRADE, + ItemNames.PROGRESSIVE_TERRAN_SHIP_UPGRADE, + ItemNames.PROGRESSIVE_ZERG_GROUND_UPGRADE, + ItemNames.PROGRESSIVE_ZERG_FLYER_UPGRADE, + ItemNames.PROGRESSIVE_PROTOSS_GROUND_UPGRADE, + ItemNames.PROGRESSIVE_PROTOSS_AIR_UPGRADE, + }, + { # Bundle All + ItemNames.PROGRESSIVE_TERRAN_WEAPON_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_ZERG_WEAPON_ARMOR_UPGRADE, + ItemNames.PROGRESSIVE_PROTOSS_WEAPON_ARMOR_UPGRADE, + } +] + +lookup_id_to_name: typing.Dict[int, str] = {data.code: item_name for item_name, data in get_full_item_list().items() if + data.code} + +# Map type to expected int +type_flaggroups: typing.Dict[SC2Race, typing.Dict[str, int]] = { + SC2Race.ANY: { + "Minerals": 0, + "Vespene": 1, + "Supply": 2, + "Goal": 3, + "Nothing Group": 4, + }, + SC2Race.TERRAN: { + "Armory 1": 0, + "Armory 2": 1, + "Armory 3": 2, + "Armory 4": 3, + "Armory 5": 4, + "Armory 6": 5, + "Progressive Upgrade": 6, # Unit upgrades that exist multiple times (Stimpack / Super Stimpack) + "Laboratory": 7, + "Upgrade": 8, # Weapon / Armor upgrades + "Unit": 9, + "Building": 10, + "Mercenary": 11, + "Nova Gear": 12, + "Progressive Upgrade 2": 13, + }, + SC2Race.ZERG: { + "Ability": 0, + "Mutation 1": 1, + "Strain": 2, + "Morph": 3, + "Upgrade": 4, + "Mercenary": 5, + "Unit": 6, + "Level": 7, + "Primal Form": 8, + "Evolution Pit": 9, + "Mutation 2": 10, + "Mutation 3": 11 + }, + SC2Race.PROTOSS: { + "Unit": 0, + "Unit 2": 1, + "Upgrade": 2, # Weapon / Armor upgrades + "Building": 3, + "Progressive Upgrade": 4, + "Spear of Adun": 5, + "Solarite Core": 6, + "Forge 1": 7, + "Forge 2": 8, + "Forge 3": 9, + } +} diff --git a/worlds/sc2/Locations.py b/worlds/sc2/Locations.py new file mode 100644 index 000000000000..5a03f2232348 --- /dev/null +++ b/worlds/sc2/Locations.py @@ -0,0 +1,1638 @@ +from enum import IntEnum +from typing import List, Tuple, Optional, Callable, NamedTuple, Set, Any +from BaseClasses import MultiWorld +from . import ItemNames +from .Options import get_option_value, kerrigan_unit_available, RequiredTactics, GrantStoryTech, LocationInclusion, \ + EnableHotsMissions +from .Rules import SC2Logic + +from BaseClasses import Location +from worlds.AutoWorld import World + +SC2WOL_LOC_ID_OFFSET = 1000 +SC2HOTS_LOC_ID_OFFSET = 20000000 # Avoid clashes with The Legend of Zelda +SC2LOTV_LOC_ID_OFFSET = SC2HOTS_LOC_ID_OFFSET + 2000 +SC2NCO_LOC_ID_OFFSET = SC2LOTV_LOC_ID_OFFSET + 2500 + + +class SC2Location(Location): + game: str = "Starcraft2" + + +class LocationType(IntEnum): + VICTORY = 0 # Winning a mission + VANILLA = 1 # Objectives that provided metaprogression in the original campaign, along with a few other locations for a balanced experience + EXTRA = 2 # Additional locations based on mission progression, collecting in-mission rewards, etc. that do not significantly increase the challenge. + CHALLENGE = 3 # Challenging objectives, often harder than just completing a mission, and often associated with Achievements + MASTERY = 4 # Extremely challenging objectives often associated with Masteries and Feats of Strength in the original campaign + + +class LocationData(NamedTuple): + region: str + name: str + code: Optional[int] + type: LocationType + rule: Optional[Callable[[Any], bool]] = Location.access_rule + + +def get_location_types(world: World, inclusion_type: LocationInclusion) -> Set[LocationType]: + """ + + :param multiworld: + :param player: + :param inclusion_type: Level of inclusion to check for + :return: A list of location types that match the inclusion type + """ + exclusion_options = [ + ("vanilla_locations", LocationType.VANILLA), + ("extra_locations", LocationType.EXTRA), + ("challenge_locations", LocationType.CHALLENGE), + ("mastery_locations", LocationType.MASTERY) + ] + excluded_location_types = set() + for option_name, location_type in exclusion_options: + if get_option_value(world, option_name) is inclusion_type: + excluded_location_types.add(location_type) + return excluded_location_types + + +def get_plando_locations(world: World) -> List[str]: + """ + + :param multiworld: + :param player: + :return: A list of locations affected by a plando in a world + """ + if world is None: + return [] + plando_locations = [] + for plando_setting in world.multiworld.plando_items[world.player]: + plando_locations += plando_setting.get("locations", []) + plando_setting_location = plando_setting.get("location", None) + if plando_setting_location is not None: + plando_locations.append(plando_setting_location) + + return plando_locations + + +def get_locations(world: Optional[World]) -> Tuple[LocationData, ...]: + # Note: rules which are ended with or True are rules identified as needed later when restricted units is an option + logic_level = get_option_value(world, 'required_tactics') + adv_tactics = logic_level != RequiredTactics.option_standard + kerriganless = get_option_value(world, 'kerrigan_presence') not in kerrigan_unit_available \ + or get_option_value(world, "enable_hots_missions") == EnableHotsMissions.option_false + story_tech_granted = get_option_value(world, "grant_story_tech") == GrantStoryTech.option_true + logic = SC2Logic(world) + player = None if world is None else world.player + location_table: List[LocationData] = [ + # WoL + LocationData("Liberation Day", "Liberation Day: Victory", SC2WOL_LOC_ID_OFFSET + 100, LocationType.VICTORY), + LocationData("Liberation Day", "Liberation Day: First Statue", SC2WOL_LOC_ID_OFFSET + 101, LocationType.VANILLA), + LocationData("Liberation Day", "Liberation Day: Second Statue", SC2WOL_LOC_ID_OFFSET + 102, LocationType.VANILLA), + LocationData("Liberation Day", "Liberation Day: Third Statue", SC2WOL_LOC_ID_OFFSET + 103, LocationType.VANILLA), + LocationData("Liberation Day", "Liberation Day: Fourth Statue", SC2WOL_LOC_ID_OFFSET + 104, LocationType.VANILLA), + LocationData("Liberation Day", "Liberation Day: Fifth Statue", SC2WOL_LOC_ID_OFFSET + 105, LocationType.VANILLA), + LocationData("Liberation Day", "Liberation Day: Sixth Statue", SC2WOL_LOC_ID_OFFSET + 106, LocationType.VANILLA), + LocationData("Liberation Day", "Liberation Day: Special Delivery", SC2WOL_LOC_ID_OFFSET + 107, LocationType.EXTRA), + LocationData("Liberation Day", "Liberation Day: Transport", SC2WOL_LOC_ID_OFFSET + 108, LocationType.EXTRA), + LocationData("The Outlaws", "The Outlaws: Victory", SC2WOL_LOC_ID_OFFSET + 200, LocationType.VICTORY, + lambda state: logic.terran_early_tech(state)), + LocationData("The Outlaws", "The Outlaws: Rebel Base", SC2WOL_LOC_ID_OFFSET + 201, LocationType.VANILLA, + lambda state: logic.terran_early_tech(state)), + LocationData("The Outlaws", "The Outlaws: North Resource Pickups", SC2WOL_LOC_ID_OFFSET + 202, LocationType.EXTRA, + lambda state: logic.terran_early_tech(state)), + LocationData("The Outlaws", "The Outlaws: Bunker", SC2WOL_LOC_ID_OFFSET + 203, LocationType.VANILLA, + lambda state: logic.terran_early_tech(state)), + LocationData("The Outlaws", "The Outlaws: Close Resource Pickups", SC2WOL_LOC_ID_OFFSET + 204, LocationType.EXTRA), + LocationData("Zero Hour", "Zero Hour: Victory", SC2WOL_LOC_ID_OFFSET + 300, LocationType.VICTORY, + lambda state: logic.terran_common_unit(state) and + logic.terran_defense_rating(state, True) >= 2 and + (adv_tactics or logic.terran_basic_anti_air(state))), + LocationData("Zero Hour", "Zero Hour: First Group Rescued", SC2WOL_LOC_ID_OFFSET + 301, LocationType.VANILLA), + LocationData("Zero Hour", "Zero Hour: Second Group Rescued", SC2WOL_LOC_ID_OFFSET + 302, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state)), + LocationData("Zero Hour", "Zero Hour: Third Group Rescued", SC2WOL_LOC_ID_OFFSET + 303, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state) and + logic.terran_defense_rating(state, True) >= 2), + LocationData("Zero Hour", "Zero Hour: First Hatchery", SC2WOL_LOC_ID_OFFSET + 304, LocationType.CHALLENGE, + lambda state: logic.terran_competent_comp(state)), + LocationData("Zero Hour", "Zero Hour: Second Hatchery", SC2WOL_LOC_ID_OFFSET + 305, LocationType.CHALLENGE, + lambda state: logic.terran_competent_comp(state)), + LocationData("Zero Hour", "Zero Hour: Third Hatchery", SC2WOL_LOC_ID_OFFSET + 306, LocationType.CHALLENGE, + lambda state: logic.terran_competent_comp(state)), + LocationData("Zero Hour", "Zero Hour: Fourth Hatchery", SC2WOL_LOC_ID_OFFSET + 307, LocationType.CHALLENGE, + lambda state: logic.terran_competent_comp(state)), + LocationData("Zero Hour", "Zero Hour: Ride's on its Way", SC2WOL_LOC_ID_OFFSET + 308, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state)), + LocationData("Zero Hour", "Zero Hour: Hold Just a Little Longer", SC2WOL_LOC_ID_OFFSET + 309, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + logic.terran_defense_rating(state, True) >= 2), + LocationData("Zero Hour", "Zero Hour: Cavalry's on the Way", SC2WOL_LOC_ID_OFFSET + 310, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + logic.terran_defense_rating(state, True) >= 2), + LocationData("Evacuation", "Evacuation: Victory", SC2WOL_LOC_ID_OFFSET + 400, LocationType.VICTORY, + lambda state: logic.terran_early_tech(state) and + (adv_tactics and logic.terran_basic_anti_air(state) + or logic.terran_competent_anti_air(state))), + LocationData("Evacuation", "Evacuation: North Chrysalis", SC2WOL_LOC_ID_OFFSET + 401, LocationType.VANILLA), + LocationData("Evacuation", "Evacuation: West Chrysalis", SC2WOL_LOC_ID_OFFSET + 402, LocationType.VANILLA, + lambda state: logic.terran_early_tech(state)), + LocationData("Evacuation", "Evacuation: East Chrysalis", SC2WOL_LOC_ID_OFFSET + 403, LocationType.VANILLA, + lambda state: logic.terran_early_tech(state)), + LocationData("Evacuation", "Evacuation: Reach Hanson", SC2WOL_LOC_ID_OFFSET + 404, LocationType.EXTRA), + LocationData("Evacuation", "Evacuation: Secret Resource Stash", SC2WOL_LOC_ID_OFFSET + 405, LocationType.EXTRA), + LocationData("Evacuation", "Evacuation: Flawless", SC2WOL_LOC_ID_OFFSET + 406, LocationType.CHALLENGE, + lambda state: logic.terran_early_tech(state) and + logic.terran_defense_rating(state, True, False) >= 2 and + (adv_tactics and logic.terran_basic_anti_air(state) + or logic.terran_competent_anti_air(state))), + LocationData("Outbreak", "Outbreak: Victory", SC2WOL_LOC_ID_OFFSET + 500, LocationType.VICTORY, + lambda state: logic.terran_defense_rating(state, True, False) >= 4 and + (logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Outbreak", "Outbreak: Left Infestor", SC2WOL_LOC_ID_OFFSET + 501, LocationType.VANILLA, + lambda state: logic.terran_defense_rating(state, True, False) >= 2 and + (logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Outbreak", "Outbreak: Right Infestor", SC2WOL_LOC_ID_OFFSET + 502, LocationType.VANILLA, + lambda state: logic.terran_defense_rating(state, True, False) >= 2 and + (logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Outbreak", "Outbreak: North Infested Command Center", SC2WOL_LOC_ID_OFFSET + 503, LocationType.EXTRA, + lambda state: logic.terran_defense_rating(state, True, False) >= 2 and + (logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Outbreak", "Outbreak: South Infested Command Center", SC2WOL_LOC_ID_OFFSET + 504, LocationType.EXTRA, + lambda state: logic.terran_defense_rating(state, True, False) >= 2 and + (logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Outbreak", "Outbreak: Northwest Bar", SC2WOL_LOC_ID_OFFSET + 505, LocationType.EXTRA, + lambda state: logic.terran_defense_rating(state, True, False) >= 2 and + (logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Outbreak", "Outbreak: North Bar", SC2WOL_LOC_ID_OFFSET + 506, LocationType.EXTRA, + lambda state: logic.terran_defense_rating(state, True, False) >= 2 and + (logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Outbreak", "Outbreak: South Bar", SC2WOL_LOC_ID_OFFSET + 507, LocationType.EXTRA, + lambda state: logic.terran_defense_rating(state, True, False) >= 2 and + (logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Safe Haven", "Safe Haven: Victory", SC2WOL_LOC_ID_OFFSET + 600, LocationType.VICTORY, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state)), + LocationData("Safe Haven", "Safe Haven: North Nexus", SC2WOL_LOC_ID_OFFSET + 601, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state)), + LocationData("Safe Haven", "Safe Haven: East Nexus", SC2WOL_LOC_ID_OFFSET + 602, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state)), + LocationData("Safe Haven", "Safe Haven: South Nexus", SC2WOL_LOC_ID_OFFSET + 603, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state)), + LocationData("Safe Haven", "Safe Haven: First Terror Fleet", SC2WOL_LOC_ID_OFFSET + 604, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state)), + LocationData("Safe Haven", "Safe Haven: Second Terror Fleet", SC2WOL_LOC_ID_OFFSET + 605, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state)), + LocationData("Safe Haven", "Safe Haven: Third Terror Fleet", SC2WOL_LOC_ID_OFFSET + 606, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state)), + LocationData("Haven's Fall", "Haven's Fall: Victory", SC2WOL_LOC_ID_OFFSET + 700, LocationType.VICTORY, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state) and + logic.terran_defense_rating(state, True) >= 3), + LocationData("Haven's Fall", "Haven's Fall: North Hive", SC2WOL_LOC_ID_OFFSET + 701, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state) and + logic.terran_defense_rating(state, True) >= 3), + LocationData("Haven's Fall", "Haven's Fall: East Hive", SC2WOL_LOC_ID_OFFSET + 702, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state) and + logic.terran_defense_rating(state, True) >= 3), + LocationData("Haven's Fall", "Haven's Fall: South Hive", SC2WOL_LOC_ID_OFFSET + 703, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state) and + logic.terran_defense_rating(state, True) >= 3), + LocationData("Haven's Fall", "Haven's Fall: Northeast Colony Base", SC2WOL_LOC_ID_OFFSET + 704, LocationType.CHALLENGE, + lambda state: logic.terran_respond_to_colony_infestations(state)), + LocationData("Haven's Fall", "Haven's Fall: East Colony Base", SC2WOL_LOC_ID_OFFSET + 705, LocationType.CHALLENGE, + lambda state: logic.terran_respond_to_colony_infestations(state)), + LocationData("Haven's Fall", "Haven's Fall: Middle Colony Base", SC2WOL_LOC_ID_OFFSET + 706, LocationType.CHALLENGE, + lambda state: logic.terran_respond_to_colony_infestations(state)), + LocationData("Haven's Fall", "Haven's Fall: Southeast Colony Base", SC2WOL_LOC_ID_OFFSET + 707, LocationType.CHALLENGE, + lambda state: logic.terran_respond_to_colony_infestations(state)), + LocationData("Haven's Fall", "Haven's Fall: Southwest Colony Base", SC2WOL_LOC_ID_OFFSET + 708, LocationType.CHALLENGE, + lambda state: logic.terran_respond_to_colony_infestations(state)), + LocationData("Haven's Fall", "Haven's Fall: Southwest Gas Pickups", SC2WOL_LOC_ID_OFFSET + 709, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state) and + logic.terran_defense_rating(state, True) >= 3), + LocationData("Haven's Fall", "Haven's Fall: East Gas Pickups", SC2WOL_LOC_ID_OFFSET + 710, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state) and + logic.terran_defense_rating(state, True) >= 3), + LocationData("Haven's Fall", "Haven's Fall: Southeast Gas Pickups", SC2WOL_LOC_ID_OFFSET + 711, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + logic.terran_competent_anti_air(state) and + logic.terran_defense_rating(state, True) >= 3), + LocationData("Smash and Grab", "Smash and Grab: Victory", SC2WOL_LOC_ID_OFFSET + 800, LocationType.VICTORY, + lambda state: logic.terran_common_unit(state) and + (adv_tactics and logic.terran_basic_anti_air(state) + or logic.terran_competent_anti_air(state))), + LocationData("Smash and Grab", "Smash and Grab: First Relic", SC2WOL_LOC_ID_OFFSET + 801, LocationType.VANILLA), + LocationData("Smash and Grab", "Smash and Grab: Second Relic", SC2WOL_LOC_ID_OFFSET + 802, LocationType.VANILLA), + LocationData("Smash and Grab", "Smash and Grab: Third Relic", SC2WOL_LOC_ID_OFFSET + 803, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state) and + (adv_tactics and logic.terran_basic_anti_air(state) + or logic.terran_competent_anti_air(state))), + LocationData("Smash and Grab", "Smash and Grab: Fourth Relic", SC2WOL_LOC_ID_OFFSET + 804, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state) and + (adv_tactics and logic.terran_basic_anti_air(state) + or logic.terran_competent_anti_air(state))), + LocationData("Smash and Grab", "Smash and Grab: First Forcefield Area Busted", SC2WOL_LOC_ID_OFFSET + 805, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + (adv_tactics and logic.terran_basic_anti_air(state) + or logic.terran_competent_anti_air(state))), + LocationData("Smash and Grab", "Smash and Grab: Second Forcefield Area Busted", SC2WOL_LOC_ID_OFFSET + 806, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state) and + (adv_tactics and logic.terran_basic_anti_air(state) + or logic.terran_competent_anti_air(state))), + LocationData("The Dig", "The Dig: Victory", SC2WOL_LOC_ID_OFFSET + 900, LocationType.VICTORY, + lambda state: logic.terran_basic_anti_air(state) + and logic.terran_defense_rating(state, False, True) >= 8 + and logic.terran_defense_rating(state, False, False) >= 6 + and logic.terran_common_unit(state) + and (logic.marine_medic_upgrade(state) or adv_tactics)), + LocationData("The Dig", "The Dig: Left Relic", SC2WOL_LOC_ID_OFFSET + 901, LocationType.VANILLA, + lambda state: logic.terran_defense_rating(state, False, False) >= 6 + and logic.terran_common_unit(state) + and (logic.marine_medic_upgrade(state) or adv_tactics)), + LocationData("The Dig", "The Dig: Right Ground Relic", SC2WOL_LOC_ID_OFFSET + 902, LocationType.VANILLA, + lambda state: logic.terran_defense_rating(state, False, False) >= 6 + and logic.terran_common_unit(state) + and (logic.marine_medic_upgrade(state) or adv_tactics)), + LocationData("The Dig", "The Dig: Right Cliff Relic", SC2WOL_LOC_ID_OFFSET + 903, LocationType.VANILLA, + lambda state: logic.terran_defense_rating(state, False, False) >= 6 + and logic.terran_common_unit(state) + and (logic.marine_medic_upgrade(state) or adv_tactics)), + LocationData("The Dig", "The Dig: Moebius Base", SC2WOL_LOC_ID_OFFSET + 904, LocationType.EXTRA, + lambda state: logic.marine_medic_upgrade(state) or adv_tactics), + LocationData("The Dig", "The Dig: Door Outer Layer", SC2WOL_LOC_ID_OFFSET + 905, LocationType.EXTRA, + lambda state: logic.terran_defense_rating(state, False, False) >= 6 + and logic.terran_common_unit(state) + and (logic.marine_medic_upgrade(state) or adv_tactics)), + LocationData("The Dig", "The Dig: Door Thermal Barrier", SC2WOL_LOC_ID_OFFSET + 906, LocationType.EXTRA, + lambda state: logic.terran_basic_anti_air(state) + and logic.terran_defense_rating(state, False, True) >= 8 + and logic.terran_defense_rating(state, False, False) >= 6 + and logic.terran_common_unit(state) + and (logic.marine_medic_upgrade(state) or adv_tactics)), + LocationData("The Dig", "The Dig: Cutting Through the Core", SC2WOL_LOC_ID_OFFSET + 907, LocationType.EXTRA, + lambda state: logic.terran_basic_anti_air(state) + and logic.terran_defense_rating(state, False, True) >= 8 + and logic.terran_defense_rating(state, False, False) >= 6 + and logic.terran_common_unit(state) + and (logic.marine_medic_upgrade(state) or adv_tactics)), + LocationData("The Dig", "The Dig: Structure Access Imminent", SC2WOL_LOC_ID_OFFSET + 908, LocationType.EXTRA, + lambda state: logic.terran_basic_anti_air(state) + and logic.terran_defense_rating(state, False, True) >= 8 + and logic.terran_defense_rating(state, False, False) >= 6 + and logic.terran_common_unit(state) + and (logic.marine_medic_upgrade(state) or adv_tactics)), + LocationData("The Moebius Factor", "The Moebius Factor: Victory", SC2WOL_LOC_ID_OFFSET + 1000, LocationType.VICTORY, + lambda state: logic.terran_basic_anti_air(state) and + (logic.terran_air(state) + or state.has_any({ItemNames.MEDIVAC, ItemNames.HERCULES}, player) + and logic.terran_common_unit(state))), + LocationData("The Moebius Factor", "The Moebius Factor: 1st Data Core", SC2WOL_LOC_ID_OFFSET + 1001, LocationType.VANILLA), + LocationData("The Moebius Factor", "The Moebius Factor: 2nd Data Core", SC2WOL_LOC_ID_OFFSET + 1002, LocationType.VANILLA, + lambda state: (logic.terran_air(state) + or state.has_any({ItemNames.MEDIVAC, ItemNames.HERCULES}, player) + and logic.terran_common_unit(state))), + LocationData("The Moebius Factor", "The Moebius Factor: South Rescue", SC2WOL_LOC_ID_OFFSET + 1003, LocationType.EXTRA, + lambda state: logic.terran_can_rescue(state)), + LocationData("The Moebius Factor", "The Moebius Factor: Wall Rescue", SC2WOL_LOC_ID_OFFSET + 1004, LocationType.EXTRA, + lambda state: logic.terran_can_rescue(state)), + LocationData("The Moebius Factor", "The Moebius Factor: Mid Rescue", SC2WOL_LOC_ID_OFFSET + 1005, LocationType.EXTRA, + lambda state: logic.terran_can_rescue(state)), + LocationData("The Moebius Factor", "The Moebius Factor: Nydus Roof Rescue", SC2WOL_LOC_ID_OFFSET + 1006, LocationType.EXTRA, + lambda state: logic.terran_can_rescue(state)), + LocationData("The Moebius Factor", "The Moebius Factor: Alive Inside Rescue", SC2WOL_LOC_ID_OFFSET + 1007, LocationType.EXTRA, + lambda state: logic.terran_can_rescue(state)), + LocationData("The Moebius Factor", "The Moebius Factor: Brutalisk", SC2WOL_LOC_ID_OFFSET + 1008, LocationType.VANILLA, + lambda state: logic.terran_basic_anti_air(state) and + (logic.terran_air(state) + or state.has_any({ItemNames.MEDIVAC, ItemNames.HERCULES}, player) + and logic.terran_common_unit(state))), + LocationData("The Moebius Factor", "The Moebius Factor: 3rd Data Core", SC2WOL_LOC_ID_OFFSET + 1009, LocationType.VANILLA, + lambda state: logic.terran_basic_anti_air(state) and + (logic.terran_air(state) + or state.has_any({ItemNames.MEDIVAC, ItemNames.HERCULES}, player) + and logic.terran_common_unit(state))), + LocationData("Supernova", "Supernova: Victory", SC2WOL_LOC_ID_OFFSET + 1100, LocationType.VICTORY, + lambda state: logic.terran_beats_protoss_deathball(state)), + LocationData("Supernova", "Supernova: West Relic", SC2WOL_LOC_ID_OFFSET + 1101, LocationType.VANILLA), + LocationData("Supernova", "Supernova: North Relic", SC2WOL_LOC_ID_OFFSET + 1102, LocationType.VANILLA), + LocationData("Supernova", "Supernova: South Relic", SC2WOL_LOC_ID_OFFSET + 1103, LocationType.VANILLA, + lambda state: logic.terran_beats_protoss_deathball(state)), + LocationData("Supernova", "Supernova: East Relic", SC2WOL_LOC_ID_OFFSET + 1104, LocationType.VANILLA, + lambda state: logic.terran_beats_protoss_deathball(state)), + LocationData("Supernova", "Supernova: Landing Zone Cleared", SC2WOL_LOC_ID_OFFSET + 1105, LocationType.EXTRA), + LocationData("Supernova", "Supernova: Middle Base", SC2WOL_LOC_ID_OFFSET + 1106, LocationType.EXTRA, + lambda state: logic.terran_beats_protoss_deathball(state)), + LocationData("Supernova", "Supernova: Southeast Base", SC2WOL_LOC_ID_OFFSET + 1107, LocationType.EXTRA, + lambda state: logic.terran_beats_protoss_deathball(state)), + LocationData("Maw of the Void", "Maw of the Void: Victory", SC2WOL_LOC_ID_OFFSET + 1200, LocationType.VICTORY, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: Landing Zone Cleared", SC2WOL_LOC_ID_OFFSET + 1201, LocationType.EXTRA), + LocationData("Maw of the Void", "Maw of the Void: Expansion Prisoners", SC2WOL_LOC_ID_OFFSET + 1202, LocationType.VANILLA, + lambda state: adv_tactics or logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: South Close Prisoners", SC2WOL_LOC_ID_OFFSET + 1203, LocationType.VANILLA, + lambda state: adv_tactics or logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: South Far Prisoners", SC2WOL_LOC_ID_OFFSET + 1204, LocationType.VANILLA, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: North Prisoners", SC2WOL_LOC_ID_OFFSET + 1205, LocationType.VANILLA, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: Mothership", SC2WOL_LOC_ID_OFFSET + 1206, LocationType.EXTRA, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: Expansion Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1207, LocationType.EXTRA, + lambda state: adv_tactics or logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: Middle Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1208, LocationType.EXTRA, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: Southeast Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1209, LocationType.EXTRA, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: Stargate Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1210, LocationType.EXTRA, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: Northwest Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1211, LocationType.CHALLENGE, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: West Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1212, LocationType.CHALLENGE, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Maw of the Void", "Maw of the Void: Southwest Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1213, LocationType.CHALLENGE, + lambda state: logic.terran_survives_rip_field(state)), + LocationData("Devil's Playground", "Devil's Playground: Victory", SC2WOL_LOC_ID_OFFSET + 1300, LocationType.VICTORY, + lambda state: adv_tactics or + logic.terran_basic_anti_air(state) and ( + logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Devil's Playground", "Devil's Playground: Tosh's Miners", SC2WOL_LOC_ID_OFFSET + 1301, LocationType.VANILLA), + LocationData("Devil's Playground", "Devil's Playground: Brutalisk", SC2WOL_LOC_ID_OFFSET + 1302, LocationType.VANILLA, + lambda state: adv_tactics or logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player)), + LocationData("Devil's Playground", "Devil's Playground: North Reapers", SC2WOL_LOC_ID_OFFSET + 1303, LocationType.EXTRA), + LocationData("Devil's Playground", "Devil's Playground: Middle Reapers", SC2WOL_LOC_ID_OFFSET + 1304, LocationType.EXTRA, + lambda state: adv_tactics or logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player)), + LocationData("Devil's Playground", "Devil's Playground: Southwest Reapers", SC2WOL_LOC_ID_OFFSET + 1305, LocationType.EXTRA, + lambda state: adv_tactics or logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player)), + LocationData("Devil's Playground", "Devil's Playground: Southeast Reapers", SC2WOL_LOC_ID_OFFSET + 1306, LocationType.EXTRA, + lambda state: adv_tactics or + logic.terran_basic_anti_air(state) and ( + logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Devil's Playground", "Devil's Playground: East Reapers", SC2WOL_LOC_ID_OFFSET + 1307, LocationType.CHALLENGE, + lambda state: logic.terran_basic_anti_air(state) and + (adv_tactics or + logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Devil's Playground", "Devil's Playground: Zerg Cleared", SC2WOL_LOC_ID_OFFSET + 1308, LocationType.CHALLENGE, + lambda state: logic.terran_competent_anti_air(state) and ( + logic.terran_common_unit(state) or state.has(ItemNames.REAPER, player))), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: Victory", SC2WOL_LOC_ID_OFFSET + 1400, LocationType.VICTORY, + lambda state: logic.welcome_to_the_jungle_requirement(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: Close Relic", SC2WOL_LOC_ID_OFFSET + 1401, LocationType.VANILLA), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: West Relic", SC2WOL_LOC_ID_OFFSET + 1402, LocationType.VANILLA, + lambda state: logic.welcome_to_the_jungle_requirement(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: North-East Relic", SC2WOL_LOC_ID_OFFSET + 1403, LocationType.VANILLA, + lambda state: logic.welcome_to_the_jungle_requirement(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: Middle Base", SC2WOL_LOC_ID_OFFSET + 1404, LocationType.EXTRA, + lambda state: logic.welcome_to_the_jungle_requirement(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: Main Base", SC2WOL_LOC_ID_OFFSET + 1405, + LocationType.MASTERY, + lambda state: logic.welcome_to_the_jungle_requirement(state) + and logic.terran_beats_protoss_deathball(state) + and logic.terran_base_trasher(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: No Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1406, LocationType.CHALLENGE, + lambda state: logic.welcome_to_the_jungle_requirement(state) + and logic.terran_competent_ground_to_air(state) + and logic.terran_beats_protoss_deathball(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 1 Terrazine Node Sealed", SC2WOL_LOC_ID_OFFSET + 1407, LocationType.CHALLENGE, + lambda state: logic.welcome_to_the_jungle_requirement(state) + and logic.terran_competent_ground_to_air(state) + and logic.terran_beats_protoss_deathball(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 2 Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1408, LocationType.CHALLENGE, + lambda state: logic.welcome_to_the_jungle_requirement(state) + and logic.terran_beats_protoss_deathball(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 3 Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1409, LocationType.CHALLENGE, + lambda state: logic.welcome_to_the_jungle_requirement(state) + and logic.terran_competent_comp(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 4 Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1410, LocationType.EXTRA, + lambda state: logic.welcome_to_the_jungle_requirement(state)), + LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 5 Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1411, LocationType.EXTRA, + lambda state: logic.welcome_to_the_jungle_requirement(state)), + LocationData("Breakout", "Breakout: Victory", SC2WOL_LOC_ID_OFFSET + 1500, LocationType.VICTORY), + LocationData("Breakout", "Breakout: Diamondback Prison", SC2WOL_LOC_ID_OFFSET + 1501, LocationType.VANILLA), + LocationData("Breakout", "Breakout: Siege Tank Prison", SC2WOL_LOC_ID_OFFSET + 1502, LocationType.VANILLA), + LocationData("Breakout", "Breakout: First Checkpoint", SC2WOL_LOC_ID_OFFSET + 1503, LocationType.EXTRA), + LocationData("Breakout", "Breakout: Second Checkpoint", SC2WOL_LOC_ID_OFFSET + 1504, LocationType.EXTRA), + LocationData("Ghost of a Chance", "Ghost of a Chance: Victory", SC2WOL_LOC_ID_OFFSET + 1600, LocationType.VICTORY), + LocationData("Ghost of a Chance", "Ghost of a Chance: Terrazine Tank", SC2WOL_LOC_ID_OFFSET + 1601, LocationType.EXTRA), + LocationData("Ghost of a Chance", "Ghost of a Chance: Jorium Stockpile", SC2WOL_LOC_ID_OFFSET + 1602, LocationType.EXTRA), + LocationData("Ghost of a Chance", "Ghost of a Chance: First Island Spectres", SC2WOL_LOC_ID_OFFSET + 1603, LocationType.VANILLA), + LocationData("Ghost of a Chance", "Ghost of a Chance: Second Island Spectres", SC2WOL_LOC_ID_OFFSET + 1604, LocationType.VANILLA), + LocationData("Ghost of a Chance", "Ghost of a Chance: Third Island Spectres", SC2WOL_LOC_ID_OFFSET + 1605, LocationType.VANILLA), + LocationData("The Great Train Robbery", "The Great Train Robbery: Victory", SC2WOL_LOC_ID_OFFSET + 1700, LocationType.VICTORY, + lambda state: logic.great_train_robbery_train_stopper(state) and + logic.terran_basic_anti_air(state)), + LocationData("The Great Train Robbery", "The Great Train Robbery: North Defiler", SC2WOL_LOC_ID_OFFSET + 1701, LocationType.VANILLA), + LocationData("The Great Train Robbery", "The Great Train Robbery: Mid Defiler", SC2WOL_LOC_ID_OFFSET + 1702, LocationType.VANILLA), + LocationData("The Great Train Robbery", "The Great Train Robbery: South Defiler", SC2WOL_LOC_ID_OFFSET + 1703, LocationType.VANILLA), + LocationData("The Great Train Robbery", "The Great Train Robbery: Close Diamondback", SC2WOL_LOC_ID_OFFSET + 1704, LocationType.EXTRA), + LocationData("The Great Train Robbery", "The Great Train Robbery: Northwest Diamondback", SC2WOL_LOC_ID_OFFSET + 1705, LocationType.EXTRA), + LocationData("The Great Train Robbery", "The Great Train Robbery: North Diamondback", SC2WOL_LOC_ID_OFFSET + 1706, LocationType.EXTRA), + LocationData("The Great Train Robbery", "The Great Train Robbery: Northeast Diamondback", SC2WOL_LOC_ID_OFFSET + 1707, LocationType.EXTRA), + LocationData("The Great Train Robbery", "The Great Train Robbery: Southwest Diamondback", SC2WOL_LOC_ID_OFFSET + 1708, LocationType.EXTRA), + LocationData("The Great Train Robbery", "The Great Train Robbery: Southeast Diamondback", SC2WOL_LOC_ID_OFFSET + 1709, LocationType.EXTRA), + LocationData("The Great Train Robbery", "The Great Train Robbery: Kill Team", SC2WOL_LOC_ID_OFFSET + 1710, LocationType.CHALLENGE, + lambda state: (adv_tactics or logic.terran_common_unit(state)) and + logic.great_train_robbery_train_stopper(state) and + logic.terran_basic_anti_air(state)), + LocationData("The Great Train Robbery", "The Great Train Robbery: Flawless", SC2WOL_LOC_ID_OFFSET + 1711, LocationType.CHALLENGE, + lambda state: logic.great_train_robbery_train_stopper(state) and + logic.terran_basic_anti_air(state)), + LocationData("The Great Train Robbery", "The Great Train Robbery: 2 Trains Destroyed", SC2WOL_LOC_ID_OFFSET + 1712, LocationType.EXTRA, + lambda state: logic.great_train_robbery_train_stopper(state)), + LocationData("The Great Train Robbery", "The Great Train Robbery: 4 Trains Destroyed", SC2WOL_LOC_ID_OFFSET + 1713, LocationType.EXTRA, + lambda state: logic.great_train_robbery_train_stopper(state) and + logic.terran_basic_anti_air(state)), + LocationData("The Great Train Robbery", "The Great Train Robbery: 6 Trains Destroyed", SC2WOL_LOC_ID_OFFSET + 1714, LocationType.EXTRA, + lambda state: logic.great_train_robbery_train_stopper(state) and + logic.terran_basic_anti_air(state)), + LocationData("Cutthroat", "Cutthroat: Victory", SC2WOL_LOC_ID_OFFSET + 1800, LocationType.VICTORY, + lambda state: logic.terran_common_unit(state) and + (adv_tactics or logic.terran_basic_anti_air)), + LocationData("Cutthroat", "Cutthroat: Mira Han", SC2WOL_LOC_ID_OFFSET + 1801, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state)), + LocationData("Cutthroat", "Cutthroat: North Relic", SC2WOL_LOC_ID_OFFSET + 1802, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state)), + LocationData("Cutthroat", "Cutthroat: Mid Relic", SC2WOL_LOC_ID_OFFSET + 1803, LocationType.VANILLA), + LocationData("Cutthroat", "Cutthroat: Southwest Relic", SC2WOL_LOC_ID_OFFSET + 1804, LocationType.VANILLA, + lambda state: logic.terran_common_unit(state)), + LocationData("Cutthroat", "Cutthroat: North Command Center", SC2WOL_LOC_ID_OFFSET + 1805, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state)), + LocationData("Cutthroat", "Cutthroat: South Command Center", SC2WOL_LOC_ID_OFFSET + 1806, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state)), + LocationData("Cutthroat", "Cutthroat: West Command Center", SC2WOL_LOC_ID_OFFSET + 1807, LocationType.EXTRA, + lambda state: logic.terran_common_unit(state)), + LocationData("Engine of Destruction", "Engine of Destruction: Victory", SC2WOL_LOC_ID_OFFSET + 1900, LocationType.VICTORY, + lambda state: logic.engine_of_destruction_requirement(state)), + LocationData("Engine of Destruction", "Engine of Destruction: Odin", SC2WOL_LOC_ID_OFFSET + 1901, LocationType.EXTRA, + lambda state: logic.marine_medic_upgrade(state)), + LocationData("Engine of Destruction", "Engine of Destruction: Loki", SC2WOL_LOC_ID_OFFSET + 1902, + LocationType.CHALLENGE, + lambda state: logic.engine_of_destruction_requirement(state)), + LocationData("Engine of Destruction", "Engine of Destruction: Lab Devourer", SC2WOL_LOC_ID_OFFSET + 1903, LocationType.VANILLA, + lambda state: logic.marine_medic_upgrade(state)), + LocationData("Engine of Destruction", "Engine of Destruction: North Devourer", SC2WOL_LOC_ID_OFFSET + 1904, LocationType.VANILLA, + lambda state: logic.engine_of_destruction_requirement(state)), + LocationData("Engine of Destruction", "Engine of Destruction: Southeast Devourer", SC2WOL_LOC_ID_OFFSET + 1905, LocationType.VANILLA, + lambda state: logic.engine_of_destruction_requirement(state)), + LocationData("Engine of Destruction", "Engine of Destruction: West Base", SC2WOL_LOC_ID_OFFSET + 1906, LocationType.EXTRA, + lambda state: logic.engine_of_destruction_requirement(state)), + LocationData("Engine of Destruction", "Engine of Destruction: Northwest Base", SC2WOL_LOC_ID_OFFSET + 1907, LocationType.EXTRA, + lambda state: logic.engine_of_destruction_requirement(state)), + LocationData("Engine of Destruction", "Engine of Destruction: Northeast Base", SC2WOL_LOC_ID_OFFSET + 1908, LocationType.EXTRA, + lambda state: logic.engine_of_destruction_requirement(state)), + LocationData("Engine of Destruction", "Engine of Destruction: Southeast Base", SC2WOL_LOC_ID_OFFSET + 1909, LocationType.EXTRA, + lambda state: logic.engine_of_destruction_requirement(state)), + LocationData("Media Blitz", "Media Blitz: Victory", SC2WOL_LOC_ID_OFFSET + 2000, LocationType.VICTORY, + lambda state: logic.terran_competent_comp(state)), + LocationData("Media Blitz", "Media Blitz: Tower 1", SC2WOL_LOC_ID_OFFSET + 2001, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Media Blitz", "Media Blitz: Tower 2", SC2WOL_LOC_ID_OFFSET + 2002, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Media Blitz", "Media Blitz: Tower 3", SC2WOL_LOC_ID_OFFSET + 2003, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Media Blitz", "Media Blitz: Science Facility", SC2WOL_LOC_ID_OFFSET + 2004, LocationType.VANILLA), + LocationData("Media Blitz", "Media Blitz: All Barracks", SC2WOL_LOC_ID_OFFSET + 2005, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Media Blitz", "Media Blitz: All Factories", SC2WOL_LOC_ID_OFFSET + 2006, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Media Blitz", "Media Blitz: All Starports", SC2WOL_LOC_ID_OFFSET + 2007, LocationType.EXTRA, + lambda state: adv_tactics or logic.terran_competent_comp(state)), + LocationData("Media Blitz", "Media Blitz: Odin Not Trashed", SC2WOL_LOC_ID_OFFSET + 2008, LocationType.CHALLENGE, + lambda state: logic.terran_competent_comp(state)), + LocationData("Media Blitz", "Media Blitz: Surprise Attack Ends", SC2WOL_LOC_ID_OFFSET + 2009, LocationType.EXTRA), + LocationData("Piercing the Shroud", "Piercing the Shroud: Victory", SC2WOL_LOC_ID_OFFSET + 2100, LocationType.VICTORY, + lambda state: logic.marine_medic_upgrade(state)), + LocationData("Piercing the Shroud", "Piercing the Shroud: Holding Cell Relic", SC2WOL_LOC_ID_OFFSET + 2101, LocationType.VANILLA), + LocationData("Piercing the Shroud", "Piercing the Shroud: Brutalisk Relic", SC2WOL_LOC_ID_OFFSET + 2102, LocationType.VANILLA, + lambda state: logic.marine_medic_upgrade(state)), + LocationData("Piercing the Shroud", "Piercing the Shroud: First Escape Relic", SC2WOL_LOC_ID_OFFSET + 2103, LocationType.VANILLA, + lambda state: logic.marine_medic_upgrade(state)), + LocationData("Piercing the Shroud", "Piercing the Shroud: Second Escape Relic", SC2WOL_LOC_ID_OFFSET + 2104, LocationType.VANILLA, + lambda state: logic.marine_medic_upgrade(state)), + LocationData("Piercing the Shroud", "Piercing the Shroud: Brutalisk", SC2WOL_LOC_ID_OFFSET + 2105, LocationType.VANILLA, + lambda state: logic.marine_medic_upgrade(state)), + LocationData("Piercing the Shroud", "Piercing the Shroud: Fusion Reactor", SC2WOL_LOC_ID_OFFSET + 2106, LocationType.EXTRA, + lambda state: logic.marine_medic_upgrade(state)), + LocationData("Piercing the Shroud", "Piercing the Shroud: Entrance Holding Pen", SC2WOL_LOC_ID_OFFSET + 2107, LocationType.EXTRA), + LocationData("Piercing the Shroud", "Piercing the Shroud: Cargo Bay Warbot", SC2WOL_LOC_ID_OFFSET + 2108, LocationType.EXTRA), + LocationData("Piercing the Shroud", "Piercing the Shroud: Escape Warbot", SC2WOL_LOC_ID_OFFSET + 2109, LocationType.EXTRA, + lambda state: logic.marine_medic_upgrade(state)), + LocationData("Whispers of Doom", "Whispers of Doom: Victory", SC2WOL_LOC_ID_OFFSET + 2200, LocationType.VICTORY), + LocationData("Whispers of Doom", "Whispers of Doom: First Hatchery", SC2WOL_LOC_ID_OFFSET + 2201, LocationType.VANILLA), + LocationData("Whispers of Doom", "Whispers of Doom: Second Hatchery", SC2WOL_LOC_ID_OFFSET + 2202, LocationType.VANILLA), + LocationData("Whispers of Doom", "Whispers of Doom: Third Hatchery", SC2WOL_LOC_ID_OFFSET + 2203, LocationType.VANILLA), + LocationData("Whispers of Doom", "Whispers of Doom: First Prophecy Fragment", SC2WOL_LOC_ID_OFFSET + 2204, LocationType.EXTRA), + LocationData("Whispers of Doom", "Whispers of Doom: Second Prophecy Fragment", SC2WOL_LOC_ID_OFFSET + 2205, LocationType.EXTRA), + LocationData("Whispers of Doom", "Whispers of Doom: Third Prophecy Fragment", SC2WOL_LOC_ID_OFFSET + 2206, LocationType.EXTRA), + LocationData("A Sinister Turn", "A Sinister Turn: Victory", SC2WOL_LOC_ID_OFFSET + 2300, LocationType.VICTORY, + lambda state: logic.protoss_common_unit(state) and logic.protoss_competent_anti_air(state)), + LocationData("A Sinister Turn", "A Sinister Turn: Robotics Facility", SC2WOL_LOC_ID_OFFSET + 2301, LocationType.VANILLA, + lambda state: adv_tactics or logic.protoss_common_unit(state)), + LocationData("A Sinister Turn", "A Sinister Turn: Dark Shrine", SC2WOL_LOC_ID_OFFSET + 2302, LocationType.VANILLA, + lambda state: adv_tactics or logic.protoss_common_unit(state)), + LocationData("A Sinister Turn", "A Sinister Turn: Templar Archives", SC2WOL_LOC_ID_OFFSET + 2303, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) and logic.protoss_competent_anti_air(state)), + LocationData("A Sinister Turn", "A Sinister Turn: Northeast Base", SC2WOL_LOC_ID_OFFSET + 2304, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) and logic.protoss_competent_anti_air(state)), + LocationData("A Sinister Turn", "A Sinister Turn: Southwest Base", SC2WOL_LOC_ID_OFFSET + 2305, LocationType.CHALLENGE, + lambda state: logic.protoss_common_unit(state) and logic.protoss_competent_anti_air(state)), + LocationData("A Sinister Turn", "A Sinister Turn: Maar", SC2WOL_LOC_ID_OFFSET + 2306, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state)), + LocationData("A Sinister Turn", "A Sinister Turn: Northwest Preserver", SC2WOL_LOC_ID_OFFSET + 2307, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) and logic.protoss_competent_anti_air(state)), + LocationData("A Sinister Turn", "A Sinister Turn: Southwest Preserver", SC2WOL_LOC_ID_OFFSET + 2308, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) and logic.protoss_competent_anti_air(state)), + LocationData("A Sinister Turn", "A Sinister Turn: East Preserver", SC2WOL_LOC_ID_OFFSET + 2309, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) and logic.protoss_competent_anti_air(state)), + LocationData("Echoes of the Future", "Echoes of the Future: Victory", SC2WOL_LOC_ID_OFFSET + 2400, LocationType.VICTORY, + lambda state: adv_tactics and logic.protoss_static_defense(state) or logic.protoss_common_unit(state) and logic.protoss_competent_anti_air(state)), + LocationData("Echoes of the Future", "Echoes of the Future: Close Obelisk", SC2WOL_LOC_ID_OFFSET + 2401, LocationType.VANILLA), + LocationData("Echoes of the Future", "Echoes of the Future: West Obelisk", SC2WOL_LOC_ID_OFFSET + 2402, LocationType.VANILLA, + lambda state: adv_tactics and logic.protoss_static_defense(state) or logic.protoss_common_unit(state)), + LocationData("Echoes of the Future", "Echoes of the Future: Base", SC2WOL_LOC_ID_OFFSET + 2403, LocationType.EXTRA), + LocationData("Echoes of the Future", "Echoes of the Future: Southwest Tendril", SC2WOL_LOC_ID_OFFSET + 2404, LocationType.EXTRA), + LocationData("Echoes of the Future", "Echoes of the Future: Southeast Tendril", SC2WOL_LOC_ID_OFFSET + 2405, LocationType.EXTRA, + lambda state: adv_tactics and logic.protoss_static_defense(state) or logic.protoss_common_unit(state)), + LocationData("Echoes of the Future", "Echoes of the Future: Northeast Tendril", SC2WOL_LOC_ID_OFFSET + 2406, LocationType.EXTRA, + lambda state: adv_tactics and logic.protoss_static_defense(state) or logic.protoss_common_unit(state)), + LocationData("Echoes of the Future", "Echoes of the Future: Northwest Tendril", SC2WOL_LOC_ID_OFFSET + 2407, LocationType.EXTRA, + lambda state: adv_tactics and logic.protoss_static_defense(state) or logic.protoss_common_unit(state)), + LocationData("In Utter Darkness", "In Utter Darkness: Defeat", SC2WOL_LOC_ID_OFFSET + 2500, LocationType.VICTORY), + LocationData("In Utter Darkness", "In Utter Darkness: Protoss Archive", SC2WOL_LOC_ID_OFFSET + 2501, LocationType.VANILLA, + lambda state: logic.last_stand_requirement(state)), + LocationData("In Utter Darkness", "In Utter Darkness: Kills", SC2WOL_LOC_ID_OFFSET + 2502, LocationType.VANILLA, + lambda state: logic.last_stand_requirement(state)), + LocationData("In Utter Darkness", "In Utter Darkness: Urun", SC2WOL_LOC_ID_OFFSET + 2503, LocationType.EXTRA), + LocationData("In Utter Darkness", "In Utter Darkness: Mohandar", SC2WOL_LOC_ID_OFFSET + 2504, LocationType.EXTRA, + lambda state: logic.last_stand_requirement(state)), + LocationData("In Utter Darkness", "In Utter Darkness: Selendis", SC2WOL_LOC_ID_OFFSET + 2505, LocationType.EXTRA, + lambda state: logic.last_stand_requirement(state)), + LocationData("In Utter Darkness", "In Utter Darkness: Artanis", SC2WOL_LOC_ID_OFFSET + 2506, LocationType.EXTRA, + lambda state: logic.last_stand_requirement(state)), + LocationData("Gates of Hell", "Gates of Hell: Victory", SC2WOL_LOC_ID_OFFSET + 2600, LocationType.VICTORY, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: Large Army", SC2WOL_LOC_ID_OFFSET + 2601, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: 2 Drop Pods", SC2WOL_LOC_ID_OFFSET + 2602, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: 4 Drop Pods", SC2WOL_LOC_ID_OFFSET + 2603, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: 6 Drop Pods", SC2WOL_LOC_ID_OFFSET + 2604, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: 8 Drop Pods", SC2WOL_LOC_ID_OFFSET + 2605, LocationType.CHALLENGE, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: Southwest Spore Cannon", SC2WOL_LOC_ID_OFFSET + 2606, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: Northwest Spore Cannon", SC2WOL_LOC_ID_OFFSET + 2607, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: Northeast Spore Cannon", SC2WOL_LOC_ID_OFFSET + 2608, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: East Spore Cannon", SC2WOL_LOC_ID_OFFSET + 2609, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: Southeast Spore Cannon", SC2WOL_LOC_ID_OFFSET + 2610, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Gates of Hell", "Gates of Hell: Expansion Spore Cannon", SC2WOL_LOC_ID_OFFSET + 2611, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state) and + logic.terran_defense_rating(state, True) > 6), + LocationData("Belly of the Beast", "Belly of the Beast: Victory", SC2WOL_LOC_ID_OFFSET + 2700, LocationType.VICTORY), + LocationData("Belly of the Beast", "Belly of the Beast: First Charge", SC2WOL_LOC_ID_OFFSET + 2701, LocationType.EXTRA), + LocationData("Belly of the Beast", "Belly of the Beast: Second Charge", SC2WOL_LOC_ID_OFFSET + 2702, LocationType.EXTRA), + LocationData("Belly of the Beast", "Belly of the Beast: Third Charge", SC2WOL_LOC_ID_OFFSET + 2703, LocationType.EXTRA), + LocationData("Belly of the Beast", "Belly of the Beast: First Group Rescued", SC2WOL_LOC_ID_OFFSET + 2704, LocationType.VANILLA), + LocationData("Belly of the Beast", "Belly of the Beast: Second Group Rescued", SC2WOL_LOC_ID_OFFSET + 2705, LocationType.VANILLA), + LocationData("Belly of the Beast", "Belly of the Beast: Third Group Rescued", SC2WOL_LOC_ID_OFFSET + 2706, LocationType.VANILLA), + LocationData("Shatter the Sky", "Shatter the Sky: Victory", SC2WOL_LOC_ID_OFFSET + 2800, LocationType.VICTORY, + lambda state: logic.terran_competent_comp(state)), + LocationData("Shatter the Sky", "Shatter the Sky: Close Coolant Tower", SC2WOL_LOC_ID_OFFSET + 2801, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Shatter the Sky", "Shatter the Sky: Northwest Coolant Tower", SC2WOL_LOC_ID_OFFSET + 2802, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Shatter the Sky", "Shatter the Sky: Southeast Coolant Tower", SC2WOL_LOC_ID_OFFSET + 2803, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Shatter the Sky", "Shatter the Sky: Southwest Coolant Tower", SC2WOL_LOC_ID_OFFSET + 2804, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Shatter the Sky", "Shatter the Sky: Leviathan", SC2WOL_LOC_ID_OFFSET + 2805, LocationType.VANILLA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Shatter the Sky", "Shatter the Sky: East Hatchery", SC2WOL_LOC_ID_OFFSET + 2806, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Shatter the Sky", "Shatter the Sky: North Hatchery", SC2WOL_LOC_ID_OFFSET + 2807, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state)), + LocationData("Shatter the Sky", "Shatter the Sky: Mid Hatchery", SC2WOL_LOC_ID_OFFSET + 2808, LocationType.EXTRA, + lambda state: logic.terran_competent_comp(state)), + LocationData("All-In", "All-In: Victory", SC2WOL_LOC_ID_OFFSET + 2900, LocationType.VICTORY, + lambda state: logic.all_in_requirement(state)), + LocationData("All-In", "All-In: First Kerrigan Attack", SC2WOL_LOC_ID_OFFSET + 2901, LocationType.EXTRA, + lambda state: logic.all_in_requirement(state)), + LocationData("All-In", "All-In: Second Kerrigan Attack", SC2WOL_LOC_ID_OFFSET + 2902, LocationType.EXTRA, + lambda state: logic.all_in_requirement(state)), + LocationData("All-In", "All-In: Third Kerrigan Attack", SC2WOL_LOC_ID_OFFSET + 2903, LocationType.EXTRA, + lambda state: logic.all_in_requirement(state)), + LocationData("All-In", "All-In: Fourth Kerrigan Attack", SC2WOL_LOC_ID_OFFSET + 2904, LocationType.EXTRA, + lambda state: logic.all_in_requirement(state)), + LocationData("All-In", "All-In: Fifth Kerrigan Attack", SC2WOL_LOC_ID_OFFSET + 2905, LocationType.EXTRA, + lambda state: logic.all_in_requirement(state)), + + # HotS + LocationData("Lab Rat", "Lab Rat: Victory", SC2HOTS_LOC_ID_OFFSET + 100, LocationType.VICTORY, + lambda state: logic.zerg_common_unit(state)), + LocationData("Lab Rat", "Lab Rat: Gather Minerals", SC2HOTS_LOC_ID_OFFSET + 101, LocationType.VANILLA), + LocationData("Lab Rat", "Lab Rat: South Zergling Group", SC2HOTS_LOC_ID_OFFSET + 102, LocationType.VANILLA, + lambda state: adv_tactics or logic.zerg_common_unit(state)), + LocationData("Lab Rat", "Lab Rat: East Zergling Group", SC2HOTS_LOC_ID_OFFSET + 103, LocationType.VANILLA, + lambda state: adv_tactics or logic.zerg_common_unit(state)), + LocationData("Lab Rat", "Lab Rat: West Zergling Group", SC2HOTS_LOC_ID_OFFSET + 104, LocationType.VANILLA, + lambda state: adv_tactics or logic.zerg_common_unit(state)), + LocationData("Lab Rat", "Lab Rat: Hatchery", SC2HOTS_LOC_ID_OFFSET + 105, LocationType.EXTRA), + LocationData("Lab Rat", "Lab Rat: Overlord", SC2HOTS_LOC_ID_OFFSET + 106, LocationType.EXTRA), + LocationData("Lab Rat", "Lab Rat: Gas Turrets", SC2HOTS_LOC_ID_OFFSET + 107, LocationType.EXTRA, + lambda state: adv_tactics or logic.zerg_common_unit(state)), + LocationData("Back in the Saddle", "Back in the Saddle: Victory", SC2HOTS_LOC_ID_OFFSET + 200, LocationType.VICTORY, + lambda state: logic.basic_kerrigan(state) or kerriganless or logic.story_tech_granted), + LocationData("Back in the Saddle", "Back in the Saddle: Defend the Tram", SC2HOTS_LOC_ID_OFFSET + 201, LocationType.EXTRA, + lambda state: logic.basic_kerrigan(state) or kerriganless or logic.story_tech_granted), + LocationData("Back in the Saddle", "Back in the Saddle: Kinetic Blast", SC2HOTS_LOC_ID_OFFSET + 202, LocationType.VANILLA), + LocationData("Back in the Saddle", "Back in the Saddle: Crushing Grip", SC2HOTS_LOC_ID_OFFSET + 203, LocationType.VANILLA), + LocationData("Back in the Saddle", "Back in the Saddle: Reach the Sublevel", SC2HOTS_LOC_ID_OFFSET + 204, LocationType.EXTRA), + LocationData("Back in the Saddle", "Back in the Saddle: Door Section Cleared", SC2HOTS_LOC_ID_OFFSET + 205, LocationType.EXTRA, + lambda state: logic.basic_kerrigan(state) or kerriganless or logic.story_tech_granted), + LocationData("Rendezvous", "Rendezvous: Victory", SC2HOTS_LOC_ID_OFFSET + 300, LocationType.VICTORY, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Rendezvous", "Rendezvous: Right Queen", SC2HOTS_LOC_ID_OFFSET + 301, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Rendezvous", "Rendezvous: Center Queen", SC2HOTS_LOC_ID_OFFSET + 302, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Rendezvous", "Rendezvous: Left Queen", SC2HOTS_LOC_ID_OFFSET + 303, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Rendezvous", "Rendezvous: Hold Out Finished", SC2HOTS_LOC_ID_OFFSET + 304, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Harvest of Screams", "Harvest of Screams: Victory", SC2HOTS_LOC_ID_OFFSET + 400, LocationType.VICTORY, + lambda state: logic.zerg_common_unit(state) + and logic.zerg_basic_anti_air(state)), + LocationData("Harvest of Screams", "Harvest of Screams: First Ursadon Matriarch", SC2HOTS_LOC_ID_OFFSET + 401, LocationType.VANILLA), + LocationData("Harvest of Screams", "Harvest of Screams: North Ursadon Matriarch", SC2HOTS_LOC_ID_OFFSET + 402, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Harvest of Screams", "Harvest of Screams: West Ursadon Matriarch", SC2HOTS_LOC_ID_OFFSET + 403, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Harvest of Screams", "Harvest of Screams: Lost Brood", SC2HOTS_LOC_ID_OFFSET + 404, LocationType.EXTRA), + LocationData("Harvest of Screams", "Harvest of Screams: Northeast Psi-link Spire", SC2HOTS_LOC_ID_OFFSET + 405, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Harvest of Screams", "Harvest of Screams: Northwest Psi-link Spire", SC2HOTS_LOC_ID_OFFSET + 406, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) + and logic.zerg_basic_anti_air(state)), + LocationData("Harvest of Screams", "Harvest of Screams: Southwest Psi-link Spire", SC2HOTS_LOC_ID_OFFSET + 407, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) + and logic.zerg_basic_anti_air(state)), + LocationData("Harvest of Screams", "Harvest of Screams: Nafash", SC2HOTS_LOC_ID_OFFSET + 408, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) + and logic.zerg_basic_anti_air(state)), + LocationData("Shoot the Messenger", "Shoot the Messenger: Victory", SC2HOTS_LOC_ID_OFFSET + 500, LocationType.VICTORY, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Shoot the Messenger", "Shoot the Messenger: East Stasis Chamber", SC2HOTS_LOC_ID_OFFSET + 501, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and logic.zerg_basic_anti_air(state)), + LocationData("Shoot the Messenger", "Shoot the Messenger: Center Stasis Chamber", SC2HOTS_LOC_ID_OFFSET + 502, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) or adv_tactics), + LocationData("Shoot the Messenger", "Shoot the Messenger: West Stasis Chamber", SC2HOTS_LOC_ID_OFFSET + 503, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and logic.zerg_basic_anti_air(state)), + LocationData("Shoot the Messenger", "Shoot the Messenger: Destroy 4 Shuttles", SC2HOTS_LOC_ID_OFFSET + 504, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) and logic.zerg_basic_anti_air(state)), + LocationData("Shoot the Messenger", "Shoot the Messenger: Frozen Expansion", SC2HOTS_LOC_ID_OFFSET + 505, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Shoot the Messenger", "Shoot the Messenger: Southwest Frozen Zerg", SC2HOTS_LOC_ID_OFFSET + 506, LocationType.EXTRA), + LocationData("Shoot the Messenger", "Shoot the Messenger: Southeast Frozen Zerg", SC2HOTS_LOC_ID_OFFSET + 507, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) or adv_tactics), + LocationData("Shoot the Messenger", "Shoot the Messenger: West Frozen Zerg", SC2HOTS_LOC_ID_OFFSET + 508, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) and logic.zerg_basic_anti_air(state)), + LocationData("Shoot the Messenger", "Shoot the Messenger: East Frozen Zerg", SC2HOTS_LOC_ID_OFFSET + 509, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) and logic.zerg_competent_anti_air(state)), + LocationData("Enemy Within", "Enemy Within: Victory", SC2HOTS_LOC_ID_OFFSET + 600, LocationType.VICTORY, + lambda state: logic.zerg_pass_vents(state) + and (logic.story_tech_granted + or state.has_any({ItemNames.ZERGLING_RAPTOR_STRAIN, ItemNames.ROACH, + ItemNames.HYDRALISK, ItemNames.INFESTOR}, player)) + ), + LocationData("Enemy Within", "Enemy Within: Infest Giant Ursadon", SC2HOTS_LOC_ID_OFFSET + 601, LocationType.VANILLA, + lambda state: logic.zerg_pass_vents(state)), + LocationData("Enemy Within", "Enemy Within: First Niadra Evolution", SC2HOTS_LOC_ID_OFFSET + 602, LocationType.VANILLA, + lambda state: logic.zerg_pass_vents(state)), + LocationData("Enemy Within", "Enemy Within: Second Niadra Evolution", SC2HOTS_LOC_ID_OFFSET + 603, LocationType.VANILLA, + lambda state: logic.zerg_pass_vents(state)), + LocationData("Enemy Within", "Enemy Within: Third Niadra Evolution", SC2HOTS_LOC_ID_OFFSET + 604, LocationType.VANILLA, + lambda state: logic.zerg_pass_vents(state)), + LocationData("Enemy Within", "Enemy Within: Warp Drive", SC2HOTS_LOC_ID_OFFSET + 605, LocationType.EXTRA, + lambda state: logic.zerg_pass_vents(state)), + LocationData("Enemy Within", "Enemy Within: Stasis Quadrant", SC2HOTS_LOC_ID_OFFSET + 606, LocationType.EXTRA, + lambda state: logic.zerg_pass_vents(state)), + LocationData("Domination", "Domination: Victory", SC2HOTS_LOC_ID_OFFSET + 700, LocationType.VICTORY, + lambda state: logic.zerg_common_unit(state) and logic.zerg_basic_anti_air(state)), + LocationData("Domination", "Domination: Center Infested Command Center", SC2HOTS_LOC_ID_OFFSET + 701, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Domination", "Domination: North Infested Command Center", SC2HOTS_LOC_ID_OFFSET + 702, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Domination", "Domination: Repel Zagara", SC2HOTS_LOC_ID_OFFSET + 703, LocationType.EXTRA), + LocationData("Domination", "Domination: Close Baneling Nest", SC2HOTS_LOC_ID_OFFSET + 704, LocationType.EXTRA), + LocationData("Domination", "Domination: South Baneling Nest", SC2HOTS_LOC_ID_OFFSET + 705, LocationType.EXTRA, + lambda state: adv_tactics or logic.zerg_common_unit(state)), + LocationData("Domination", "Domination: Southwest Baneling Nest", SC2HOTS_LOC_ID_OFFSET + 706, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Domination", "Domination: Southeast Baneling Nest", SC2HOTS_LOC_ID_OFFSET + 707, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) and logic.zerg_basic_anti_air(state)), + LocationData("Domination", "Domination: North Baneling Nest", SC2HOTS_LOC_ID_OFFSET + 708, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Domination", "Domination: Northeast Baneling Nest", SC2HOTS_LOC_ID_OFFSET + 709, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Fire in the Sky", "Fire in the Sky: Victory", SC2HOTS_LOC_ID_OFFSET + 800, LocationType.VICTORY, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Fire in the Sky", "Fire in the Sky: West Biomass", SC2HOTS_LOC_ID_OFFSET + 801, LocationType.VANILLA), + LocationData("Fire in the Sky", "Fire in the Sky: North Biomass", SC2HOTS_LOC_ID_OFFSET + 802, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Fire in the Sky", "Fire in the Sky: South Biomass", SC2HOTS_LOC_ID_OFFSET + 803, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Fire in the Sky", "Fire in the Sky: Destroy 3 Gorgons", SC2HOTS_LOC_ID_OFFSET + 804, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Fire in the Sky", "Fire in the Sky: Close Zerg Rescue", SC2HOTS_LOC_ID_OFFSET + 805, LocationType.EXTRA), + LocationData("Fire in the Sky", "Fire in the Sky: South Zerg Rescue", SC2HOTS_LOC_ID_OFFSET + 806, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state)), + LocationData("Fire in the Sky", "Fire in the Sky: North Zerg Rescue", SC2HOTS_LOC_ID_OFFSET + 807, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Fire in the Sky", "Fire in the Sky: West Queen Rescue", SC2HOTS_LOC_ID_OFFSET + 808, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Fire in the Sky", "Fire in the Sky: East Queen Rescue", SC2HOTS_LOC_ID_OFFSET + 809, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Old Soldiers", "Old Soldiers: Victory", SC2HOTS_LOC_ID_OFFSET + 900, LocationType.VICTORY, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Old Soldiers", "Old Soldiers: East Science Lab", SC2HOTS_LOC_ID_OFFSET + 901, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Old Soldiers", "Old Soldiers: North Science Lab", SC2HOTS_LOC_ID_OFFSET + 902, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Old Soldiers", "Old Soldiers: Get Nuked", SC2HOTS_LOC_ID_OFFSET + 903, LocationType.EXTRA), + LocationData("Old Soldiers", "Old Soldiers: Entrance Gate", SC2HOTS_LOC_ID_OFFSET + 904, LocationType.EXTRA), + LocationData("Old Soldiers", "Old Soldiers: Citadel Gate", SC2HOTS_LOC_ID_OFFSET + 905, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Old Soldiers", "Old Soldiers: South Expansion", SC2HOTS_LOC_ID_OFFSET + 906, LocationType.EXTRA), + LocationData("Old Soldiers", "Old Soldiers: Rich Mineral Expansion", SC2HOTS_LOC_ID_OFFSET + 907, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Waking the Ancient", "Waking the Ancient: Victory", SC2HOTS_LOC_ID_OFFSET + 1000, LocationType.VICTORY, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Waking the Ancient", "Waking the Ancient: Center Essence Pool", SC2HOTS_LOC_ID_OFFSET + 1001, LocationType.VANILLA), + LocationData("Waking the Ancient", "Waking the Ancient: East Essence Pool", SC2HOTS_LOC_ID_OFFSET + 1002, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and + (adv_tactics and logic.zerg_basic_anti_air(state) + or logic.zerg_competent_anti_air(state))), + LocationData("Waking the Ancient", "Waking the Ancient: South Essence Pool", SC2HOTS_LOC_ID_OFFSET + 1003, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and + (adv_tactics and logic.zerg_basic_anti_air(state) + or logic.zerg_competent_anti_air(state))), + LocationData("Waking the Ancient", "Waking the Ancient: Finish Feeding", SC2HOTS_LOC_ID_OFFSET + 1004, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Waking the Ancient", "Waking the Ancient: South Proxy Primal Hive", SC2HOTS_LOC_ID_OFFSET + 1005, LocationType.CHALLENGE, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Waking the Ancient", "Waking the Ancient: East Proxy Primal Hive", SC2HOTS_LOC_ID_OFFSET + 1006, LocationType.CHALLENGE, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Waking the Ancient", "Waking the Ancient: South Main Primal Hive", SC2HOTS_LOC_ID_OFFSET + 1007, LocationType.CHALLENGE, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Waking the Ancient", "Waking the Ancient: East Main Primal Hive", SC2HOTS_LOC_ID_OFFSET + 1008, LocationType.CHALLENGE, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_competent_anti_air(state)), + LocationData("The Crucible", "The Crucible: Victory", SC2HOTS_LOC_ID_OFFSET + 1100, LocationType.VICTORY, + lambda state: logic.zerg_competent_defense(state) and + logic.zerg_competent_anti_air(state)), + LocationData("The Crucible", "The Crucible: Tyrannozor", SC2HOTS_LOC_ID_OFFSET + 1101, LocationType.VANILLA, + lambda state: logic.zerg_competent_defense(state) and + logic.zerg_competent_anti_air(state)), + LocationData("The Crucible", "The Crucible: Reach the Pool", SC2HOTS_LOC_ID_OFFSET + 1102, LocationType.VANILLA), + LocationData("The Crucible", "The Crucible: 15 Minutes Remaining", SC2HOTS_LOC_ID_OFFSET + 1103, LocationType.EXTRA, + lambda state: logic.zerg_competent_defense(state) and + logic.zerg_competent_anti_air(state)), + LocationData("The Crucible", "The Crucible: 5 Minutes Remaining", SC2HOTS_LOC_ID_OFFSET + 1104, LocationType.EXTRA, + lambda state: logic.zerg_competent_defense(state) and + logic.zerg_competent_anti_air(state)), + LocationData("The Crucible", "The Crucible: Pincer Attack", SC2HOTS_LOC_ID_OFFSET + 1105, LocationType.EXTRA, + lambda state: logic.zerg_competent_defense(state) and + logic.zerg_competent_anti_air(state)), + LocationData("The Crucible", "The Crucible: Yagdra Claims Brakk's Pack", SC2HOTS_LOC_ID_OFFSET + 1106, LocationType.EXTRA, + lambda state: logic.zerg_competent_defense(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Supreme", "Supreme: Victory", SC2HOTS_LOC_ID_OFFSET + 1200, LocationType.VICTORY, + lambda state: logic.supreme_requirement(state)), + LocationData("Supreme", "Supreme: First Relic", SC2HOTS_LOC_ID_OFFSET + 1201, LocationType.VANILLA, + lambda state: logic.supreme_requirement(state)), + LocationData("Supreme", "Supreme: Second Relic", SC2HOTS_LOC_ID_OFFSET + 1202, LocationType.VANILLA, + lambda state: logic.supreme_requirement(state)), + LocationData("Supreme", "Supreme: Third Relic", SC2HOTS_LOC_ID_OFFSET + 1203, LocationType.VANILLA, + lambda state: logic.supreme_requirement(state)), + LocationData("Supreme", "Supreme: Fourth Relic", SC2HOTS_LOC_ID_OFFSET + 1204, LocationType.VANILLA, + lambda state: logic.supreme_requirement(state)), + LocationData("Supreme", "Supreme: Yagdra", SC2HOTS_LOC_ID_OFFSET + 1205, LocationType.EXTRA, + lambda state: logic.supreme_requirement(state)), + LocationData("Supreme", "Supreme: Kraith", SC2HOTS_LOC_ID_OFFSET + 1206, LocationType.EXTRA, + lambda state: logic.supreme_requirement(state)), + LocationData("Supreme", "Supreme: Slivan", SC2HOTS_LOC_ID_OFFSET + 1207, LocationType.EXTRA, + lambda state: logic.supreme_requirement(state)), + LocationData("Infested", "Infested: Victory", SC2HOTS_LOC_ID_OFFSET + 1300, LocationType.VICTORY, + lambda state: logic.zerg_common_unit(state) and + ((logic.zerg_competent_anti_air(state) and state.has(ItemNames.INFESTOR, player)) or + (adv_tactics and logic.zerg_basic_anti_air(state)))), + LocationData("Infested", "Infested: East Science Facility", SC2HOTS_LOC_ID_OFFSET + 1301, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Infested", "Infested: Center Science Facility", SC2HOTS_LOC_ID_OFFSET + 1302, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Infested", "Infested: West Science Facility", SC2HOTS_LOC_ID_OFFSET + 1303, LocationType.VANILLA, + lambda state: logic.zerg_common_unit(state) and + logic.zerg_basic_anti_air(state) and + logic.spread_creep(state)), + LocationData("Infested", "Infested: First Intro Garrison", SC2HOTS_LOC_ID_OFFSET + 1304, LocationType.EXTRA), + LocationData("Infested", "Infested: Second Intro Garrison", SC2HOTS_LOC_ID_OFFSET + 1305, LocationType.EXTRA), + LocationData("Infested", "Infested: Base Garrison", SC2HOTS_LOC_ID_OFFSET + 1306, LocationType.EXTRA), + LocationData("Infested", "Infested: East Garrison", SC2HOTS_LOC_ID_OFFSET + 1307, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) + and logic.zerg_basic_anti_air(state) + and (adv_tactics or state.has(ItemNames.INFESTOR, player))), + LocationData("Infested", "Infested: Mid Garrison", SC2HOTS_LOC_ID_OFFSET + 1308, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) + and logic.zerg_basic_anti_air(state) + and (adv_tactics or state.has(ItemNames.INFESTOR, player))), + LocationData("Infested", "Infested: North Garrison", SC2HOTS_LOC_ID_OFFSET + 1309, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) + and logic.zerg_basic_anti_air(state) + and (adv_tactics or state.has(ItemNames.INFESTOR, player))), + LocationData("Infested", "Infested: Close Southwest Garrison", SC2HOTS_LOC_ID_OFFSET + 1310, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) + and logic.zerg_basic_anti_air(state) + and (adv_tactics or state.has(ItemNames.INFESTOR, player))), + LocationData("Infested", "Infested: Far Southwest Garrison", SC2HOTS_LOC_ID_OFFSET + 1311, LocationType.EXTRA, + lambda state: logic.zerg_common_unit(state) + and logic.zerg_basic_anti_air(state) + and (adv_tactics or state.has(ItemNames.INFESTOR, player))), + LocationData("Hand of Darkness", "Hand of Darkness: Victory", SC2HOTS_LOC_ID_OFFSET + 1400, LocationType.VICTORY, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Hand of Darkness", "Hand of Darkness: North Brutalisk", SC2HOTS_LOC_ID_OFFSET + 1401, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Hand of Darkness", "Hand of Darkness: South Brutalisk", SC2HOTS_LOC_ID_OFFSET + 1402, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Hand of Darkness", "Hand of Darkness: Kill 1 Hybrid", SC2HOTS_LOC_ID_OFFSET + 1403, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Hand of Darkness", "Hand of Darkness: Kill 2 Hybrid", SC2HOTS_LOC_ID_OFFSET + 1404, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Hand of Darkness", "Hand of Darkness: Kill 3 Hybrid", SC2HOTS_LOC_ID_OFFSET + 1405, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Hand of Darkness", "Hand of Darkness: Kill 4 Hybrid", SC2HOTS_LOC_ID_OFFSET + 1406, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Hand of Darkness", "Hand of Darkness: Kill 5 Hybrid", SC2HOTS_LOC_ID_OFFSET + 1407, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Hand of Darkness", "Hand of Darkness: Kill 6 Hybrid", SC2HOTS_LOC_ID_OFFSET + 1408, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Hand of Darkness", "Hand of Darkness: Kill 7 Hybrid", SC2HOTS_LOC_ID_OFFSET + 1409, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_basic_anti_air(state)), + LocationData("Phantoms of the Void", "Phantoms of the Void: Victory", SC2HOTS_LOC_ID_OFFSET + 1500, LocationType.VICTORY, + lambda state: logic.zerg_competent_comp(state) and + (logic.zerg_competent_anti_air(state) or adv_tactics)), + LocationData("Phantoms of the Void", "Phantoms of the Void: Northwest Crystal", SC2HOTS_LOC_ID_OFFSET + 1501, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + (logic.zerg_competent_anti_air(state) or adv_tactics)), + LocationData("Phantoms of the Void", "Phantoms of the Void: Northeast Crystal", SC2HOTS_LOC_ID_OFFSET + 1502, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + (logic.zerg_competent_anti_air(state) or adv_tactics)), + LocationData("Phantoms of the Void", "Phantoms of the Void: South Crystal", SC2HOTS_LOC_ID_OFFSET + 1503, LocationType.VANILLA), + LocationData("Phantoms of the Void", "Phantoms of the Void: Base Established", SC2HOTS_LOC_ID_OFFSET + 1504, LocationType.EXTRA), + LocationData("Phantoms of the Void", "Phantoms of the Void: Close Temple", SC2HOTS_LOC_ID_OFFSET + 1505, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + (logic.zerg_competent_anti_air(state) or adv_tactics)), + LocationData("Phantoms of the Void", "Phantoms of the Void: Mid Temple", SC2HOTS_LOC_ID_OFFSET + 1506, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + (logic.zerg_competent_anti_air(state) or adv_tactics)), + LocationData("Phantoms of the Void", "Phantoms of the Void: Southeast Temple", SC2HOTS_LOC_ID_OFFSET + 1507, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + (logic.zerg_competent_anti_air(state) or adv_tactics)), + LocationData("Phantoms of the Void", "Phantoms of the Void: Northeast Temple", SC2HOTS_LOC_ID_OFFSET + 1508, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + (logic.zerg_competent_anti_air(state) or adv_tactics)), + LocationData("Phantoms of the Void", "Phantoms of the Void: Northwest Temple", SC2HOTS_LOC_ID_OFFSET + 1509, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + (logic.zerg_competent_anti_air(state) or adv_tactics)), + LocationData("With Friends Like These", "With Friends Like These: Victory", SC2HOTS_LOC_ID_OFFSET + 1600, LocationType.VICTORY), + LocationData("With Friends Like These", "With Friends Like These: Pirate Capital Ship", SC2HOTS_LOC_ID_OFFSET + 1601, LocationType.VANILLA), + LocationData("With Friends Like These", "With Friends Like These: First Mineral Patch", SC2HOTS_LOC_ID_OFFSET + 1602, LocationType.VANILLA), + LocationData("With Friends Like These", "With Friends Like These: Second Mineral Patch", SC2HOTS_LOC_ID_OFFSET + 1603, LocationType.VANILLA), + LocationData("With Friends Like These", "With Friends Like These: Third Mineral Patch", SC2HOTS_LOC_ID_OFFSET + 1604, LocationType.VANILLA), + LocationData("Conviction", "Conviction: Victory", SC2HOTS_LOC_ID_OFFSET + 1700, LocationType.VICTORY, + lambda state: logic.two_kerrigan_actives(state) and + (logic.basic_kerrigan(state) or logic.story_tech_granted) or kerriganless), + LocationData("Conviction", "Conviction: First Secret Documents", SC2HOTS_LOC_ID_OFFSET + 1701, LocationType.VANILLA, + lambda state: logic.two_kerrigan_actives(state) or kerriganless), + LocationData("Conviction", "Conviction: Second Secret Documents", SC2HOTS_LOC_ID_OFFSET + 1702, LocationType.VANILLA, + lambda state: logic.two_kerrigan_actives(state) and + (logic.basic_kerrigan(state) or logic.story_tech_granted) or kerriganless), + LocationData("Conviction", "Conviction: Power Coupling", SC2HOTS_LOC_ID_OFFSET + 1703, LocationType.EXTRA, + lambda state: logic.two_kerrigan_actives(state) or kerriganless), + LocationData("Conviction", "Conviction: Door Blasted", SC2HOTS_LOC_ID_OFFSET + 1704, LocationType.EXTRA, + lambda state: logic.two_kerrigan_actives(state) or kerriganless), + LocationData("Planetfall", "Planetfall: Victory", SC2HOTS_LOC_ID_OFFSET + 1800, LocationType.VICTORY, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: East Gate", SC2HOTS_LOC_ID_OFFSET + 1801, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: Northwest Gate", SC2HOTS_LOC_ID_OFFSET + 1802, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: North Gate", SC2HOTS_LOC_ID_OFFSET + 1803, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: 1 Bile Launcher Deployed", SC2HOTS_LOC_ID_OFFSET + 1804, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: 2 Bile Launchers Deployed", SC2HOTS_LOC_ID_OFFSET + 1805, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: 3 Bile Launchers Deployed", SC2HOTS_LOC_ID_OFFSET + 1806, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: 4 Bile Launchers Deployed", SC2HOTS_LOC_ID_OFFSET + 1807, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: 5 Bile Launchers Deployed", SC2HOTS_LOC_ID_OFFSET + 1808, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: Sons of Korhal", SC2HOTS_LOC_ID_OFFSET + 1809, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: Night Wolves", SC2HOTS_LOC_ID_OFFSET + 1810, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: West Expansion", SC2HOTS_LOC_ID_OFFSET + 1811, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Planetfall", "Planetfall: Mid Expansion", SC2HOTS_LOC_ID_OFFSET + 1812, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Death From Above", "Death From Above: Victory", SC2HOTS_LOC_ID_OFFSET + 1900, LocationType.VICTORY, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Death From Above", "Death From Above: First Power Link", SC2HOTS_LOC_ID_OFFSET + 1901, LocationType.VANILLA), + LocationData("Death From Above", "Death From Above: Second Power Link", SC2HOTS_LOC_ID_OFFSET + 1902, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Death From Above", "Death From Above: Third Power Link", SC2HOTS_LOC_ID_OFFSET + 1903, LocationType.VANILLA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Death From Above", "Death From Above: Expansion Command Center", SC2HOTS_LOC_ID_OFFSET + 1904, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("Death From Above", "Death From Above: Main Path Command Center", SC2HOTS_LOC_ID_OFFSET + 1905, LocationType.EXTRA, + lambda state: logic.zerg_competent_comp(state) and + logic.zerg_competent_anti_air(state)), + LocationData("The Reckoning", "The Reckoning: Victory", SC2HOTS_LOC_ID_OFFSET + 2000, LocationType.VICTORY, + lambda state: logic.the_reckoning_requirement(state)), + LocationData("The Reckoning", "The Reckoning: South Lane", SC2HOTS_LOC_ID_OFFSET + 2001, LocationType.VANILLA, + lambda state: logic.the_reckoning_requirement(state)), + LocationData("The Reckoning", "The Reckoning: North Lane", SC2HOTS_LOC_ID_OFFSET + 2002, LocationType.VANILLA, + lambda state: logic.the_reckoning_requirement(state)), + LocationData("The Reckoning", "The Reckoning: East Lane", SC2HOTS_LOC_ID_OFFSET + 2003, LocationType.VANILLA, + lambda state: logic.the_reckoning_requirement(state)), + LocationData("The Reckoning", "The Reckoning: Odin", SC2HOTS_LOC_ID_OFFSET + 2004, LocationType.EXTRA, + lambda state: logic.the_reckoning_requirement(state)), + + # LotV Prologue + LocationData("Dark Whispers", "Dark Whispers: Victory", SC2LOTV_LOC_ID_OFFSET + 100, LocationType.VICTORY, + lambda state: logic.protoss_common_unit(state) \ + and logic.protoss_basic_anti_air(state)), + LocationData("Dark Whispers", "Dark Whispers: First Prisoner Group", SC2LOTV_LOC_ID_OFFSET + 101, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) \ + and logic.protoss_basic_anti_air(state)), + LocationData("Dark Whispers", "Dark Whispers: Second Prisoner Group", SC2LOTV_LOC_ID_OFFSET + 102, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) \ + and logic.protoss_basic_anti_air(state)), + LocationData("Dark Whispers", "Dark Whispers: First Pylon", SC2LOTV_LOC_ID_OFFSET + 103, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) \ + and logic.protoss_basic_anti_air(state)), + LocationData("Dark Whispers", "Dark Whispers: Second Pylon", SC2LOTV_LOC_ID_OFFSET + 104, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) \ + and logic.protoss_basic_anti_air(state)), + LocationData("Ghosts in the Fog", "Ghosts in the Fog: Victory", SC2LOTV_LOC_ID_OFFSET + 200, LocationType.VICTORY, + lambda state: logic.protoss_common_unit(state) \ + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Ghosts in the Fog", "Ghosts in the Fog: South Rock Formation", SC2LOTV_LOC_ID_OFFSET + 201, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) \ + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Ghosts in the Fog", "Ghosts in the Fog: West Rock Formation", SC2LOTV_LOC_ID_OFFSET + 202, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) \ + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Ghosts in the Fog", "Ghosts in the Fog: East Rock Formation", SC2LOTV_LOC_ID_OFFSET + 203, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) \ + and logic.protoss_anti_armor_anti_air(state) \ + and logic.protoss_can_attack_behind_chasm(state)), + LocationData("Evil Awoken", "Evil Awoken: Victory", SC2LOTV_LOC_ID_OFFSET + 300, LocationType.VICTORY, + lambda state: adv_tactics or logic.protoss_stalker_upgrade(state)), + LocationData("Evil Awoken", "Evil Awoken: Temple Investigated", SC2LOTV_LOC_ID_OFFSET + 301, LocationType.EXTRA), + LocationData("Evil Awoken", "Evil Awoken: Void Catalyst", SC2LOTV_LOC_ID_OFFSET + 302, LocationType.EXTRA), + LocationData("Evil Awoken", "Evil Awoken: First Particle Cannon", SC2LOTV_LOC_ID_OFFSET + 303, LocationType.VANILLA), + LocationData("Evil Awoken", "Evil Awoken: Second Particle Cannon", SC2LOTV_LOC_ID_OFFSET + 304, LocationType.VANILLA), + LocationData("Evil Awoken", "Evil Awoken: Third Particle Cannon", SC2LOTV_LOC_ID_OFFSET + 305, LocationType.VANILLA), + + + # LotV + LocationData("For Aiur!", "For Aiur!: Victory", SC2LOTV_LOC_ID_OFFSET + 400, LocationType.VICTORY), + LocationData("For Aiur!", "For Aiur!: Southwest Hive", SC2LOTV_LOC_ID_OFFSET + 401, LocationType.VANILLA), + LocationData("For Aiur!", "For Aiur!: Northwest Hive", SC2LOTV_LOC_ID_OFFSET + 402, LocationType.VANILLA), + LocationData("For Aiur!", "For Aiur!: Northeast Hive", SC2LOTV_LOC_ID_OFFSET + 403, LocationType.VANILLA), + LocationData("For Aiur!", "For Aiur!: East Hive", SC2LOTV_LOC_ID_OFFSET + 404, LocationType.VANILLA), + LocationData("For Aiur!", "For Aiur!: West Conduit", SC2LOTV_LOC_ID_OFFSET + 405, LocationType.EXTRA), + LocationData("For Aiur!", "For Aiur!: Middle Conduit", SC2LOTV_LOC_ID_OFFSET + 406, LocationType.EXTRA), + LocationData("For Aiur!", "For Aiur!: Northeast Conduit", SC2LOTV_LOC_ID_OFFSET + 407, LocationType.EXTRA), + LocationData("The Growing Shadow", "The Growing Shadow: Victory", SC2LOTV_LOC_ID_OFFSET + 500, LocationType.VICTORY, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("The Growing Shadow", "The Growing Shadow: Close Pylon", SC2LOTV_LOC_ID_OFFSET + 501, LocationType.VANILLA), + LocationData("The Growing Shadow", "The Growing Shadow: East Pylon", SC2LOTV_LOC_ID_OFFSET + 502, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("The Growing Shadow", "The Growing Shadow: West Pylon", SC2LOTV_LOC_ID_OFFSET + 503, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("The Growing Shadow", "The Growing Shadow: Nexus", SC2LOTV_LOC_ID_OFFSET + 504, LocationType.EXTRA), + LocationData("The Growing Shadow", "The Growing Shadow: Templar Base", SC2LOTV_LOC_ID_OFFSET + 505, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("The Spear of Adun", "The Spear of Adun: Victory", SC2LOTV_LOC_ID_OFFSET + 600, LocationType.VICTORY, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("The Spear of Adun", "The Spear of Adun: Close Warp Gate", SC2LOTV_LOC_ID_OFFSET + 601, LocationType.VANILLA), + LocationData("The Spear of Adun", "The Spear of Adun: West Warp Gate", SC2LOTV_LOC_ID_OFFSET + 602, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("The Spear of Adun", "The Spear of Adun: North Warp Gate", SC2LOTV_LOC_ID_OFFSET + 603, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("The Spear of Adun", "The Spear of Adun: North Power Cell", SC2LOTV_LOC_ID_OFFSET + 604, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("The Spear of Adun", "The Spear of Adun: East Power Cell", SC2LOTV_LOC_ID_OFFSET + 605, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("The Spear of Adun", "The Spear of Adun: South Power Cell", SC2LOTV_LOC_ID_OFFSET + 606, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("The Spear of Adun", "The Spear of Adun: Southeast Power Cell", SC2LOTV_LOC_ID_OFFSET + 607, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: Victory", SC2LOTV_LOC_ID_OFFSET + 700, LocationType.VICTORY, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: Mid EMP Scrambler", SC2LOTV_LOC_ID_OFFSET + 701, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: Southeast EMP Scrambler", SC2LOTV_LOC_ID_OFFSET + 702, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: North EMP Scrambler", SC2LOTV_LOC_ID_OFFSET + 703, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: Mid Stabilizer", SC2LOTV_LOC_ID_OFFSET + 704, LocationType.EXTRA), + LocationData("Sky Shield", "Sky Shield: Southwest Stabilizer", SC2LOTV_LOC_ID_OFFSET + 705, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: Northwest Stabilizer", SC2LOTV_LOC_ID_OFFSET + 706, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: Northeast Stabilizer", SC2LOTV_LOC_ID_OFFSET + 707, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: Southeast Stabilizer", SC2LOTV_LOC_ID_OFFSET + 708, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: West Raynor Base", SC2LOTV_LOC_ID_OFFSET + 709, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Sky Shield", "Sky Shield: East Raynor Base", SC2LOTV_LOC_ID_OFFSET + 710, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_basic_anti_air(state)), + LocationData("Brothers in Arms", "Brothers in Arms: Victory", SC2LOTV_LOC_ID_OFFSET + 800, LocationType.VICTORY, + lambda state: logic.brothers_in_arms_requirement(state)), + LocationData("Brothers in Arms", "Brothers in Arms: Mid Science Facility", SC2LOTV_LOC_ID_OFFSET + 801, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) or logic.take_over_ai_allies), + LocationData("Brothers in Arms", "Brothers in Arms: North Science Facility", SC2LOTV_LOC_ID_OFFSET + 802, LocationType.VANILLA, + lambda state: logic.brothers_in_arms_requirement(state) + or logic.take_over_ai_allies + and logic.advanced_tactics + and ( + logic.terran_common_unit(state) + or logic.protoss_common_unit(state) + ) + ), + LocationData("Brothers in Arms", "Brothers in Arms: South Science Facility", SC2LOTV_LOC_ID_OFFSET + 803, LocationType.VANILLA, + lambda state: logic.brothers_in_arms_requirement(state)), + LocationData("Amon's Reach", "Amon's Reach: Victory", SC2LOTV_LOC_ID_OFFSET + 900, LocationType.VICTORY, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Amon's Reach", "Amon's Reach: Close Solarite Reserve", SC2LOTV_LOC_ID_OFFSET + 901, LocationType.VANILLA), + LocationData("Amon's Reach", "Amon's Reach: North Solarite Reserve", SC2LOTV_LOC_ID_OFFSET + 902, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Amon's Reach", "Amon's Reach: East Solarite Reserve", SC2LOTV_LOC_ID_OFFSET + 903, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Amon's Reach", "Amon's Reach: West Launch Bay", SC2LOTV_LOC_ID_OFFSET + 904, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Amon's Reach", "Amon's Reach: South Launch Bay", SC2LOTV_LOC_ID_OFFSET + 905, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Amon's Reach", "Amon's Reach: Northwest Launch Bay", SC2LOTV_LOC_ID_OFFSET + 906, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Amon's Reach", "Amon's Reach: East Launch Bay", SC2LOTV_LOC_ID_OFFSET + 907, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Last Stand", "Last Stand: Victory", SC2LOTV_LOC_ID_OFFSET + 1000, LocationType.VICTORY, + lambda state: logic.last_stand_requirement(state)), + LocationData("Last Stand", "Last Stand: West Zenith Stone", SC2LOTV_LOC_ID_OFFSET + 1001, LocationType.VANILLA, + lambda state: logic.last_stand_requirement(state)), + LocationData("Last Stand", "Last Stand: North Zenith Stone", SC2LOTV_LOC_ID_OFFSET + 1002, LocationType.VANILLA, + lambda state: logic.last_stand_requirement(state)), + LocationData("Last Stand", "Last Stand: East Zenith Stone", SC2LOTV_LOC_ID_OFFSET + 1003, LocationType.VANILLA, + lambda state: logic.last_stand_requirement(state)), + LocationData("Last Stand", "Last Stand: 1 Billion Zerg", SC2LOTV_LOC_ID_OFFSET + 1004, LocationType.EXTRA, + lambda state: logic.last_stand_requirement(state)), + LocationData("Last Stand", "Last Stand: 1.5 Billion Zerg", SC2LOTV_LOC_ID_OFFSET + 1005, LocationType.VANILLA, + lambda state: logic.last_stand_requirement(state) and ( + state.has_all({ItemNames.KHAYDARIN_MONOLITH, ItemNames.PHOTON_CANNON, ItemNames.SHIELD_BATTERY}, player) + or state.has_any({ItemNames.SOA_SOLAR_LANCE, ItemNames.SOA_DEPLOY_FENIX}, player) + )), + LocationData("Forbidden Weapon", "Forbidden Weapon: Victory", SC2LOTV_LOC_ID_OFFSET + 1100, LocationType.VICTORY, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Forbidden Weapon", "Forbidden Weapon: South Solarite", SC2LOTV_LOC_ID_OFFSET + 1101, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Forbidden Weapon", "Forbidden Weapon: North Solarite", SC2LOTV_LOC_ID_OFFSET + 1102, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Forbidden Weapon", "Forbidden Weapon: Northwest Solarite", SC2LOTV_LOC_ID_OFFSET + 1103, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Temple of Unification", "Temple of Unification: Victory", SC2LOTV_LOC_ID_OFFSET + 1200, LocationType.VICTORY, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Temple of Unification", "Temple of Unification: Mid Celestial Lock", SC2LOTV_LOC_ID_OFFSET + 1201, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Temple of Unification", "Temple of Unification: West Celestial Lock", SC2LOTV_LOC_ID_OFFSET + 1202, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Temple of Unification", "Temple of Unification: South Celestial Lock", SC2LOTV_LOC_ID_OFFSET + 1203, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Temple of Unification", "Temple of Unification: East Celestial Lock", SC2LOTV_LOC_ID_OFFSET + 1204, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Temple of Unification", "Temple of Unification: North Celestial Lock", SC2LOTV_LOC_ID_OFFSET + 1205, LocationType.EXTRA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("Temple of Unification", "Temple of Unification: Titanic Warp Prism", SC2LOTV_LOC_ID_OFFSET + 1206, LocationType.VANILLA, + lambda state: logic.protoss_common_unit(state) + and logic.protoss_anti_armor_anti_air(state)), + LocationData("The Infinite Cycle", "The Infinite Cycle: Victory", SC2LOTV_LOC_ID_OFFSET + 1300, LocationType.VICTORY, + lambda state: logic.the_infinite_cycle_requirement(state)), + LocationData("The Infinite Cycle", "The Infinite Cycle: First Hall of Revelation", SC2LOTV_LOC_ID_OFFSET + 1301, LocationType.EXTRA, + lambda state: logic.the_infinite_cycle_requirement(state)), + LocationData("The Infinite Cycle", "The Infinite Cycle: Second Hall of Revelation", SC2LOTV_LOC_ID_OFFSET + 1302, LocationType.EXTRA, + lambda state: logic.the_infinite_cycle_requirement(state)), + LocationData("The Infinite Cycle", "The Infinite Cycle: First Xel'Naga Device", SC2LOTV_LOC_ID_OFFSET + 1303, LocationType.VANILLA, + lambda state: logic.the_infinite_cycle_requirement(state)), + LocationData("The Infinite Cycle", "The Infinite Cycle: Second Xel'Naga Device", SC2LOTV_LOC_ID_OFFSET + 1304, LocationType.VANILLA, + lambda state: logic.the_infinite_cycle_requirement(state)), + LocationData("The Infinite Cycle", "The Infinite Cycle: Third Xel'Naga Device", SC2LOTV_LOC_ID_OFFSET + 1305, LocationType.VANILLA, + lambda state: logic.the_infinite_cycle_requirement(state)), + LocationData("Harbinger of Oblivion", "Harbinger of Oblivion: Victory", SC2LOTV_LOC_ID_OFFSET + 1400, LocationType.VICTORY, + lambda state: logic.harbinger_of_oblivion_requirement(state)), + LocationData("Harbinger of Oblivion", "Harbinger of Oblivion: Artanis", SC2LOTV_LOC_ID_OFFSET + 1401, LocationType.EXTRA), + LocationData("Harbinger of Oblivion", "Harbinger of Oblivion: Northwest Void Crystal", SC2LOTV_LOC_ID_OFFSET + 1402, LocationType.EXTRA, + lambda state: logic.harbinger_of_oblivion_requirement(state)), + LocationData("Harbinger of Oblivion", "Harbinger of Oblivion: Northeast Void Crystal", SC2LOTV_LOC_ID_OFFSET + 1403, LocationType.EXTRA, + lambda state: logic.harbinger_of_oblivion_requirement(state)), + LocationData("Harbinger of Oblivion", "Harbinger of Oblivion: Southwest Void Crystal", SC2LOTV_LOC_ID_OFFSET + 1404, LocationType.EXTRA, + lambda state: logic.harbinger_of_oblivion_requirement(state)), + LocationData("Harbinger of Oblivion", "Harbinger of Oblivion: Southeast Void Crystal", SC2LOTV_LOC_ID_OFFSET + 1405, LocationType.EXTRA, + lambda state: logic.harbinger_of_oblivion_requirement(state)), + LocationData("Harbinger of Oblivion", "Harbinger of Oblivion: South Xel'Naga Vessel", SC2LOTV_LOC_ID_OFFSET + 1406, LocationType.VANILLA), + LocationData("Harbinger of Oblivion", "Harbinger of Oblivion: Mid Xel'Naga Vessel", SC2LOTV_LOC_ID_OFFSET + 1407, LocationType.VANILLA, + lambda state: logic.harbinger_of_oblivion_requirement(state)), + LocationData("Harbinger of Oblivion", "Harbinger of Oblivion: North Xel'Naga Vessel", SC2LOTV_LOC_ID_OFFSET + 1408, LocationType.VANILLA, + lambda state: logic.harbinger_of_oblivion_requirement(state)), + LocationData("Unsealing the Past", "Unsealing the Past: Victory", SC2LOTV_LOC_ID_OFFSET + 1500, LocationType.VICTORY, + lambda state: logic.protoss_basic_splash(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Unsealing the Past", "Unsealing the Past: Zerg Cleared", SC2LOTV_LOC_ID_OFFSET + 1501, LocationType.EXTRA), + LocationData("Unsealing the Past", "Unsealing the Past: First Stasis Lock", SC2LOTV_LOC_ID_OFFSET + 1502, LocationType.EXTRA, + lambda state: logic.advanced_tactics \ + or logic.protoss_basic_splash(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Unsealing the Past", "Unsealing the Past: Second Stasis Lock", SC2LOTV_LOC_ID_OFFSET + 1503, LocationType.EXTRA, + lambda state: logic.protoss_basic_splash(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Unsealing the Past", "Unsealing the Past: Third Stasis Lock", SC2LOTV_LOC_ID_OFFSET + 1504, LocationType.EXTRA, + lambda state: logic.protoss_basic_splash(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Unsealing the Past", "Unsealing the Past: Fourth Stasis Lock", SC2LOTV_LOC_ID_OFFSET + 1505, LocationType.EXTRA, + lambda state: logic.protoss_basic_splash(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Unsealing the Past", "Unsealing the Past: South Power Core", SC2LOTV_LOC_ID_OFFSET + 1506, LocationType.VANILLA, + lambda state: logic.protoss_basic_splash(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Unsealing the Past", "Unsealing the Past: East Power Core", SC2LOTV_LOC_ID_OFFSET + 1507, LocationType.VANILLA, + lambda state: logic.protoss_basic_splash(state) + and logic.protoss_anti_light_anti_air(state)), + LocationData("Purification", "Purification: Victory", SC2LOTV_LOC_ID_OFFSET + 1600, LocationType.VICTORY, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: North Sector: West Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1601, LocationType.VANILLA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: North Sector: Northeast Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1602, LocationType.EXTRA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: North Sector: Southeast Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1603, LocationType.EXTRA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: South Sector: West Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1604, LocationType.VANILLA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: South Sector: North Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1605, LocationType.EXTRA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: South Sector: East Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1606, LocationType.EXTRA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: West Sector: West Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1607, LocationType.VANILLA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: West Sector: Mid Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1608, LocationType.EXTRA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: West Sector: East Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1609, LocationType.EXTRA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: East Sector: North Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1610, LocationType.VANILLA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: East Sector: West Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1611, LocationType.EXTRA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: East Sector: South Null Circuit", SC2LOTV_LOC_ID_OFFSET + 1612, LocationType.EXTRA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Purification", "Purification: Purifier Warden", SC2LOTV_LOC_ID_OFFSET + 1613, LocationType.VANILLA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Steps of the Rite", "Steps of the Rite: Victory", SC2LOTV_LOC_ID_OFFSET + 1700, LocationType.VICTORY, + lambda state: logic.steps_of_the_rite_requirement(state)), + LocationData("Steps of the Rite", "Steps of the Rite: First Terrazine Fog", SC2LOTV_LOC_ID_OFFSET + 1701, LocationType.EXTRA, + lambda state: logic.steps_of_the_rite_requirement(state)), + LocationData("Steps of the Rite", "Steps of the Rite: Southwest Guardian", SC2LOTV_LOC_ID_OFFSET + 1702, LocationType.EXTRA, + lambda state: logic.steps_of_the_rite_requirement(state)), + LocationData("Steps of the Rite", "Steps of the Rite: West Guardian", SC2LOTV_LOC_ID_OFFSET + 1703, LocationType.EXTRA, + lambda state: logic.steps_of_the_rite_requirement(state)), + LocationData("Steps of the Rite", "Steps of the Rite: Northwest Guardian", SC2LOTV_LOC_ID_OFFSET + 1704, LocationType.EXTRA, + lambda state: logic.steps_of_the_rite_requirement(state)), + LocationData("Steps of the Rite", "Steps of the Rite: Northeast Guardian", SC2LOTV_LOC_ID_OFFSET + 1705, LocationType.EXTRA, + lambda state: logic.steps_of_the_rite_requirement(state)), + LocationData("Steps of the Rite", "Steps of the Rite: North Mothership", SC2LOTV_LOC_ID_OFFSET + 1706, LocationType.VANILLA, + lambda state: logic.steps_of_the_rite_requirement(state)), + LocationData("Steps of the Rite", "Steps of the Rite: South Mothership", SC2LOTV_LOC_ID_OFFSET + 1707, LocationType.VANILLA, + lambda state: logic.steps_of_the_rite_requirement(state)), + LocationData("Rak'Shir", "Rak'Shir: Victory", SC2LOTV_LOC_ID_OFFSET + 1800, LocationType.VICTORY, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Rak'Shir", "Rak'Shir: North Slayn Elemental", SC2LOTV_LOC_ID_OFFSET + 1801, LocationType.VANILLA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Rak'Shir", "Rak'Shir: Southwest Slayn Elemental", SC2LOTV_LOC_ID_OFFSET + 1802, LocationType.VANILLA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Rak'Shir", "Rak'Shir: East Slayn Elemental", SC2LOTV_LOC_ID_OFFSET + 1803, LocationType.VANILLA, + lambda state: logic.protoss_competent_comp(state)), + LocationData("Templar's Charge", "Templar's Charge: Victory", SC2LOTV_LOC_ID_OFFSET + 1900, LocationType.VICTORY, + lambda state: logic.templars_charge_requirement(state)), + LocationData("Templar's Charge", "Templar's Charge: Northwest Power Core", SC2LOTV_LOC_ID_OFFSET + 1901, LocationType.EXTRA, + lambda state: logic.templars_charge_requirement(state)), + LocationData("Templar's Charge", "Templar's Charge: Northeast Power Core", SC2LOTV_LOC_ID_OFFSET + 1902, LocationType.EXTRA, + lambda state: logic.templars_charge_requirement(state)), + LocationData("Templar's Charge", "Templar's Charge: Southeast Power Core", SC2LOTV_LOC_ID_OFFSET + 1903, LocationType.EXTRA, + lambda state: logic.templars_charge_requirement(state)), + LocationData("Templar's Charge", "Templar's Charge: West Hybrid Statis Chamber", SC2LOTV_LOC_ID_OFFSET + 1904, LocationType.VANILLA, + lambda state: logic.templars_charge_requirement(state)), + LocationData("Templar's Charge", "Templar's Charge: Southeast Hybrid Statis Chamber", SC2LOTV_LOC_ID_OFFSET + 1905, LocationType.VANILLA, + lambda state: logic.protoss_fleet(state)), + LocationData("Templar's Return", "Templar's Return: Victory", SC2LOTV_LOC_ID_OFFSET + 2000, LocationType.VICTORY, + lambda state: logic.templars_return_requirement(state)), + LocationData("Templar's Return", "Templar's Return: Citadel: First Gate", SC2LOTV_LOC_ID_OFFSET + 2001, LocationType.EXTRA), + LocationData("Templar's Return", "Templar's Return: Citadel: Second Gate", SC2LOTV_LOC_ID_OFFSET + 2002, LocationType.EXTRA), + LocationData("Templar's Return", "Templar's Return: Citadel: Power Structure", SC2LOTV_LOC_ID_OFFSET + 2003, LocationType.VANILLA), + LocationData("Templar's Return", "Templar's Return: Temple Grounds: Gather Army", SC2LOTV_LOC_ID_OFFSET + 2004, LocationType.VANILLA, + lambda state: logic.templars_return_requirement(state)), + LocationData("Templar's Return", "Templar's Return: Temple Grounds: Power Structure", SC2LOTV_LOC_ID_OFFSET + 2005, LocationType.VANILLA, + lambda state: logic.templars_return_requirement(state)), + LocationData("Templar's Return", "Templar's Return: Caverns: Purifier", SC2LOTV_LOC_ID_OFFSET + 2006, LocationType.EXTRA, + lambda state: logic.templars_return_requirement(state)), + LocationData("Templar's Return", "Templar's Return: Caverns: Dark Templar", SC2LOTV_LOC_ID_OFFSET + 2007, LocationType.EXTRA, + lambda state: logic.templars_return_requirement(state)), + LocationData("The Host", "The Host: Victory", SC2LOTV_LOC_ID_OFFSET + 2100, LocationType.VICTORY, + lambda state: logic.the_host_requirement(state)), + LocationData("The Host", "The Host: Southeast Void Shard", SC2LOTV_LOC_ID_OFFSET + 2101, LocationType.VICTORY, + lambda state: logic.the_host_requirement(state)), + LocationData("The Host", "The Host: South Void Shard", SC2LOTV_LOC_ID_OFFSET + 2102, LocationType.EXTRA, + lambda state: logic.the_host_requirement(state)), + LocationData("The Host", "The Host: Southwest Void Shard", SC2LOTV_LOC_ID_OFFSET + 2103, LocationType.EXTRA, + lambda state: logic.the_host_requirement(state)), + LocationData("The Host", "The Host: North Void Shard", SC2LOTV_LOC_ID_OFFSET + 2104, LocationType.EXTRA, + lambda state: logic.the_host_requirement(state)), + LocationData("The Host", "The Host: Northwest Void Shard", SC2LOTV_LOC_ID_OFFSET + 2105, LocationType.EXTRA, + lambda state: logic.the_host_requirement(state)), + LocationData("The Host", "The Host: Nerazim Warp in Zone", SC2LOTV_LOC_ID_OFFSET + 2106, LocationType.VANILLA, + lambda state: logic.the_host_requirement(state)), + LocationData("The Host", "The Host: Tal'darim Warp in Zone", SC2LOTV_LOC_ID_OFFSET + 2107, LocationType.VANILLA, + lambda state: logic.the_host_requirement(state)), + LocationData("The Host", "The Host: Purifier Warp in Zone", SC2LOTV_LOC_ID_OFFSET + 2108, LocationType.VANILLA, + lambda state: logic.the_host_requirement(state)), + LocationData("Salvation", "Salvation: Victory", SC2LOTV_LOC_ID_OFFSET + 2200, LocationType.VICTORY, + lambda state: logic.salvation_requirement(state)), + LocationData("Salvation", "Salvation: Fabrication Matrix", SC2LOTV_LOC_ID_OFFSET + 2201, LocationType.EXTRA, + lambda state: logic.salvation_requirement(state)), + LocationData("Salvation", "Salvation: Assault Cluster", SC2LOTV_LOC_ID_OFFSET + 2202, LocationType.EXTRA, + lambda state: logic.salvation_requirement(state)), + LocationData("Salvation", "Salvation: Hull Breach", SC2LOTV_LOC_ID_OFFSET + 2203, LocationType.EXTRA, + lambda state: logic.salvation_requirement(state)), + LocationData("Salvation", "Salvation: Core Critical", SC2LOTV_LOC_ID_OFFSET + 2204, LocationType.EXTRA, + lambda state: logic.salvation_requirement(state)), + + # Epilogue + LocationData("Into the Void", "Into the Void: Victory", SC2LOTV_LOC_ID_OFFSET + 2300, LocationType.VICTORY, + lambda state: logic.into_the_void_requirement(state)), + LocationData("Into the Void", "Into the Void: Corruption Source", SC2LOTV_LOC_ID_OFFSET + 2301, LocationType.EXTRA), + LocationData("Into the Void", "Into the Void: Southwest Forward Position", SC2LOTV_LOC_ID_OFFSET + 2302, LocationType.VANILLA, + lambda state: logic.into_the_void_requirement(state)), + LocationData("Into the Void", "Into the Void: Northwest Forward Position", SC2LOTV_LOC_ID_OFFSET + 2303, LocationType.VANILLA, + lambda state: logic.into_the_void_requirement(state)), + LocationData("Into the Void", "Into the Void: Southeast Forward Position", SC2LOTV_LOC_ID_OFFSET + 2304, LocationType.VANILLA, + lambda state: logic.into_the_void_requirement(state)), + LocationData("Into the Void", "Into the Void: Northeast Forward Position", SC2LOTV_LOC_ID_OFFSET + 2305, LocationType.VANILLA), + LocationData("The Essence of Eternity", "The Essence of Eternity: Victory", SC2LOTV_LOC_ID_OFFSET + 2400, LocationType.VICTORY, + lambda state: logic.essence_of_eternity_requirement(state)), + LocationData("The Essence of Eternity", "The Essence of Eternity: Void Trashers", SC2LOTV_LOC_ID_OFFSET + 2401, LocationType.EXTRA), + LocationData("Amon's Fall", "Amon's Fall: Victory", SC2LOTV_LOC_ID_OFFSET + 2500, LocationType.VICTORY, + lambda state: logic.amons_fall_requirement(state)), + + # Nova Covert Ops + LocationData("The Escape", "The Escape: Victory", SC2NCO_LOC_ID_OFFSET + 100, LocationType.VICTORY, + lambda state: logic.the_escape_requirement(state)), + LocationData("The Escape", "The Escape: Rifle", SC2NCO_LOC_ID_OFFSET + 101, LocationType.VANILLA, + lambda state: logic.the_escape_first_stage_requirement(state)), + LocationData("The Escape", "The Escape: Grenades", SC2NCO_LOC_ID_OFFSET + 102, LocationType.VANILLA, + lambda state: logic.the_escape_first_stage_requirement(state)), + LocationData("The Escape", "The Escape: Agent Delta", SC2NCO_LOC_ID_OFFSET + 103, LocationType.VANILLA, + lambda state: logic.the_escape_requirement(state)), + LocationData("The Escape", "The Escape: Agent Pierce", SC2NCO_LOC_ID_OFFSET + 104, LocationType.VANILLA, + lambda state: logic.the_escape_requirement(state)), + LocationData("The Escape", "The Escape: Agent Stone", SC2NCO_LOC_ID_OFFSET + 105, LocationType.VANILLA, + lambda state: logic.the_escape_requirement(state)), + LocationData("Sudden Strike", "Sudden Strike: Victory", SC2NCO_LOC_ID_OFFSET + 200, LocationType.VICTORY, + lambda state: logic.sudden_strike_can_reach_objectives(state)), + LocationData("Sudden Strike", "Sudden Strike: Research Center", SC2NCO_LOC_ID_OFFSET + 201, LocationType.VANILLA, + lambda state: logic.sudden_strike_can_reach_objectives(state)), + LocationData("Sudden Strike", "Sudden Strike: Weaponry Labs", SC2NCO_LOC_ID_OFFSET + 202, LocationType.VANILLA, + lambda state: logic.sudden_strike_requirement(state)), + LocationData("Sudden Strike", "Sudden Strike: Brutalisk", SC2NCO_LOC_ID_OFFSET + 203, LocationType.EXTRA, + lambda state: logic.sudden_strike_requirement(state)), + LocationData("Enemy Intelligence", "Enemy Intelligence: Victory", SC2NCO_LOC_ID_OFFSET + 300, LocationType.VICTORY, + lambda state: logic.enemy_intelligence_third_stage_requirement(state)), + LocationData("Enemy Intelligence", "Enemy Intelligence: West Garrison", SC2NCO_LOC_ID_OFFSET + 301, LocationType.EXTRA, + lambda state: logic.enemy_intelligence_first_stage_requirement(state)), + LocationData("Enemy Intelligence", "Enemy Intelligence: Close Garrison", SC2NCO_LOC_ID_OFFSET + 302, LocationType.EXTRA, + lambda state: logic.enemy_intelligence_first_stage_requirement(state)), + LocationData("Enemy Intelligence", "Enemy Intelligence: Northeast Garrison", SC2NCO_LOC_ID_OFFSET + 303, LocationType.EXTRA, + lambda state: logic.enemy_intelligence_first_stage_requirement(state)), + LocationData("Enemy Intelligence", "Enemy Intelligence: Southeast Garrison", SC2NCO_LOC_ID_OFFSET + 304, LocationType.EXTRA, + lambda state: logic.enemy_intelligence_first_stage_requirement(state) + and logic.enemy_intelligence_cliff_garrison(state)), + LocationData("Enemy Intelligence", "Enemy Intelligence: South Garrison", SC2NCO_LOC_ID_OFFSET + 305, LocationType.EXTRA, + lambda state: logic.enemy_intelligence_first_stage_requirement(state)), + LocationData("Enemy Intelligence", "Enemy Intelligence: All Garrisons", SC2NCO_LOC_ID_OFFSET + 306, LocationType.VANILLA, + lambda state: logic.enemy_intelligence_first_stage_requirement(state) + and logic.enemy_intelligence_cliff_garrison(state)), + LocationData("Enemy Intelligence", "Enemy Intelligence: Forces Rescued", SC2NCO_LOC_ID_OFFSET + 307, LocationType.VANILLA, + lambda state: logic.enemy_intelligence_first_stage_requirement(state)), + LocationData("Enemy Intelligence", "Enemy Intelligence: Communications Hub", SC2NCO_LOC_ID_OFFSET + 308, LocationType.VANILLA, + lambda state: logic.enemy_intelligence_second_stage_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: Victory", SC2NCO_LOC_ID_OFFSET + 400, LocationType.VICTORY, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: North Base: West Hatchery", SC2NCO_LOC_ID_OFFSET + 401, LocationType.VANILLA, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: North Base: North Hatchery", SC2NCO_LOC_ID_OFFSET + 402, LocationType.VANILLA, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: North Base: East Hatchery", SC2NCO_LOC_ID_OFFSET + 403, LocationType.VANILLA), + LocationData("Trouble In Paradise", "Trouble In Paradise: South Base: Northwest Hatchery", SC2NCO_LOC_ID_OFFSET + 404, LocationType.VANILLA, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: South Base: Southwest Hatchery", SC2NCO_LOC_ID_OFFSET + 405, LocationType.VANILLA, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: South Base: East Hatchery", SC2NCO_LOC_ID_OFFSET + 406, LocationType.VANILLA), + LocationData("Trouble In Paradise", "Trouble In Paradise: North Shield Projector", SC2NCO_LOC_ID_OFFSET + 407, LocationType.EXTRA, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: East Shield Projector", SC2NCO_LOC_ID_OFFSET + 408, LocationType.EXTRA, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: South Shield Projector", SC2NCO_LOC_ID_OFFSET + 409, LocationType.EXTRA, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: West Shield Projector", SC2NCO_LOC_ID_OFFSET + 410, LocationType.EXTRA, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Trouble In Paradise", "Trouble In Paradise: Fleet Beacon", SC2NCO_LOC_ID_OFFSET + 411, LocationType.VANILLA, + lambda state: logic.trouble_in_paradise_requirement(state)), + LocationData("Night Terrors", "Night Terrors: Victory", SC2NCO_LOC_ID_OFFSET + 500, LocationType.VICTORY, + lambda state: logic.night_terrors_requirement(state)), + LocationData("Night Terrors", "Night Terrors: 1 Terrazine Node Collected", SC2NCO_LOC_ID_OFFSET + 501, LocationType.EXTRA, + lambda state: logic.night_terrors_requirement(state)), + LocationData("Night Terrors", "Night Terrors: 2 Terrazine Nodes Collected", SC2NCO_LOC_ID_OFFSET + 502, LocationType.EXTRA, + lambda state: logic.night_terrors_requirement(state)), + LocationData("Night Terrors", "Night Terrors: 3 Terrazine Nodes Collected", SC2NCO_LOC_ID_OFFSET + 503, LocationType.EXTRA, + lambda state: logic.night_terrors_requirement(state)), + LocationData("Night Terrors", "Night Terrors: 4 Terrazine Nodes Collected", SC2NCO_LOC_ID_OFFSET + 504, LocationType.EXTRA, + lambda state: logic.night_terrors_requirement(state)), + LocationData("Night Terrors", "Night Terrors: 5 Terrazine Nodes Collected", SC2NCO_LOC_ID_OFFSET + 505, LocationType.EXTRA, + lambda state: logic.night_terrors_requirement(state)), + LocationData("Night Terrors", "Night Terrors: HERC Outpost", SC2NCO_LOC_ID_OFFSET + 506, LocationType.VANILLA, + lambda state: logic.night_terrors_requirement(state)), + LocationData("Night Terrors", "Night Terrors: Umojan Mine", SC2NCO_LOC_ID_OFFSET + 507, LocationType.EXTRA, + lambda state: logic.night_terrors_requirement(state)), + LocationData("Night Terrors", "Night Terrors: Blightbringer", SC2NCO_LOC_ID_OFFSET + 508, LocationType.VANILLA, + lambda state: logic.night_terrors_requirement(state) + and logic.nova_ranged_weapon(state) + and state.has_any( + {ItemNames.NOVA_HELLFIRE_SHOTGUN, ItemNames.NOVA_PULSE_GRENADES, ItemNames.NOVA_STIM_INFUSION, + ItemNames.NOVA_HOLO_DECOY}, player)), + LocationData("Night Terrors", "Night Terrors: Science Facility", SC2NCO_LOC_ID_OFFSET + 509, LocationType.EXTRA, + lambda state: logic.night_terrors_requirement(state)), + LocationData("Night Terrors", "Night Terrors: Eradicators", SC2NCO_LOC_ID_OFFSET + 510, LocationType.VANILLA, + lambda state: logic.night_terrors_requirement(state) + and logic.nova_any_weapon(state)), + LocationData("Flashpoint", "Flashpoint: Victory", SC2NCO_LOC_ID_OFFSET + 600, LocationType.VICTORY, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Close North Evidence Coordinates", SC2NCO_LOC_ID_OFFSET + 601, LocationType.EXTRA, + lambda state: state.has_any( + {ItemNames.LIBERATOR_RAID_ARTILLERY, ItemNames.RAVEN_HUNTER_SEEKER_WEAPON}, player) + or logic.terran_common_unit(state)), + LocationData("Flashpoint", "Flashpoint: Close East Evidence Coordinates", SC2NCO_LOC_ID_OFFSET + 602, LocationType.EXTRA, + lambda state: state.has_any( + {ItemNames.LIBERATOR_RAID_ARTILLERY, ItemNames.RAVEN_HUNTER_SEEKER_WEAPON}, player) + or logic.terran_common_unit(state)), + LocationData("Flashpoint", "Flashpoint: Far North Evidence Coordinates", SC2NCO_LOC_ID_OFFSET + 603, LocationType.EXTRA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Far East Evidence Coordinates", SC2NCO_LOC_ID_OFFSET + 604, LocationType.EXTRA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Experimental Weapon", SC2NCO_LOC_ID_OFFSET + 605, LocationType.VANILLA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Northwest Subway Entrance", SC2NCO_LOC_ID_OFFSET + 606, LocationType.VANILLA, + lambda state: state.has_any( + {ItemNames.LIBERATOR_RAID_ARTILLERY, ItemNames.RAVEN_HUNTER_SEEKER_WEAPON}, player) + and logic.terran_common_unit(state) + or logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Southeast Subway Entrance", SC2NCO_LOC_ID_OFFSET + 607, LocationType.VANILLA, + lambda state: state.has_any( + {ItemNames.LIBERATOR_RAID_ARTILLERY, ItemNames.RAVEN_HUNTER_SEEKER_WEAPON}, player) + and logic.terran_common_unit(state) + or logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Northeast Subway Entrance", SC2NCO_LOC_ID_OFFSET + 608, LocationType.VANILLA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Expansion Hatchery", SC2NCO_LOC_ID_OFFSET + 609, LocationType.EXTRA, + lambda state: state.has(ItemNames.LIBERATOR_RAID_ARTILLERY, player) and logic.terran_common_unit(state) + or logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Baneling Spawns", SC2NCO_LOC_ID_OFFSET + 610, LocationType.EXTRA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Mutalisk Spawns", SC2NCO_LOC_ID_OFFSET + 611, LocationType.EXTRA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Nydus Worm Spawns", SC2NCO_LOC_ID_OFFSET + 612, LocationType.EXTRA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Lurker Spawns", SC2NCO_LOC_ID_OFFSET + 613, LocationType.EXTRA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Brood Lord Spawns", SC2NCO_LOC_ID_OFFSET + 614, LocationType.EXTRA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("Flashpoint", "Flashpoint: Ultralisk Spawns", SC2NCO_LOC_ID_OFFSET + 615, LocationType.EXTRA, + lambda state: logic.flashpoint_far_requirement(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Victory", SC2NCO_LOC_ID_OFFSET + 700, LocationType.VICTORY, + lambda state: logic.enemy_shadow_victory(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Sewers: Domination Visor", SC2NCO_LOC_ID_OFFSET + 701, LocationType.VANILLA, + lambda state: logic.enemy_shadow_domination(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Sewers: Resupply Crate", SC2NCO_LOC_ID_OFFSET + 702, LocationType.EXTRA, + lambda state: logic.enemy_shadow_first_stage(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Sewers: Facility Access", SC2NCO_LOC_ID_OFFSET + 703, LocationType.VANILLA, + lambda state: logic.enemy_shadow_first_stage(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: Northwest Door Lock", SC2NCO_LOC_ID_OFFSET + 704, LocationType.VANILLA, + lambda state: logic.enemy_shadow_door_controls(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: Southeast Door Lock", SC2NCO_LOC_ID_OFFSET + 705, LocationType.VANILLA, + lambda state: logic.enemy_shadow_door_controls(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: Blazefire Gunblade", SC2NCO_LOC_ID_OFFSET + 706, LocationType.VANILLA, + lambda state: logic.enemy_shadow_second_stage(state) + and (story_tech_granted + or state.has(ItemNames.NOVA_BLINK, player) + or (adv_tactics and state.has_all({ItemNames.NOVA_DOMINATION, ItemNames.NOVA_HOLO_DECOY, ItemNames.NOVA_JUMP_SUIT_MODULE}, player)) + ) + ), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: Blink Suit", SC2NCO_LOC_ID_OFFSET + 707, LocationType.VANILLA, + lambda state: logic.enemy_shadow_second_stage(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: Advanced Weaponry", SC2NCO_LOC_ID_OFFSET + 708, LocationType.VANILLA, + lambda state: logic.enemy_shadow_second_stage(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: Entrance Resupply Crate", SC2NCO_LOC_ID_OFFSET + 709, LocationType.EXTRA, + lambda state: logic.enemy_shadow_first_stage(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: West Resupply Crate", SC2NCO_LOC_ID_OFFSET + 710, LocationType.EXTRA, + lambda state: logic.enemy_shadow_second_stage(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: North Resupply Crate", SC2NCO_LOC_ID_OFFSET + 711, LocationType.EXTRA, + lambda state: logic.enemy_shadow_second_stage(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: East Resupply Crate", SC2NCO_LOC_ID_OFFSET + 712, LocationType.EXTRA, + lambda state: logic.enemy_shadow_second_stage(state)), + LocationData("In the Enemy's Shadow", "In the Enemy's Shadow: Facility: South Resupply Crate", SC2NCO_LOC_ID_OFFSET + 713, LocationType.EXTRA, + lambda state: logic.enemy_shadow_second_stage(state)), + LocationData("Dark Skies", "Dark Skies: Victory", SC2NCO_LOC_ID_OFFSET + 800, LocationType.VICTORY, + lambda state: logic.dark_skies_requirement(state)), + LocationData("Dark Skies", "Dark Skies: First Squadron of Dominion Fleet", SC2NCO_LOC_ID_OFFSET + 801, LocationType.EXTRA, + lambda state: logic.dark_skies_requirement(state)), + LocationData("Dark Skies", "Dark Skies: Remainder of Dominion Fleet", SC2NCO_LOC_ID_OFFSET + 802, LocationType.EXTRA, + lambda state: logic.dark_skies_requirement(state)), + LocationData("Dark Skies", "Dark Skies: Ji'nara", SC2NCO_LOC_ID_OFFSET + 803, LocationType.EXTRA, + lambda state: logic.dark_skies_requirement(state)), + LocationData("Dark Skies", "Dark Skies: Science Facility", SC2NCO_LOC_ID_OFFSET + 804, LocationType.VANILLA, + lambda state: logic.dark_skies_requirement(state)), + LocationData("End Game", "End Game: Victory", SC2NCO_LOC_ID_OFFSET + 900, LocationType.VICTORY, + lambda state: logic.end_game_requirement(state) and logic.nova_any_weapon(state)), + LocationData("End Game", "End Game: Xanthos", SC2NCO_LOC_ID_OFFSET + 901, LocationType.VANILLA, + lambda state: logic.end_game_requirement(state)), + ] + + beat_events = [] + # Filtering out excluded locations + if world is not None: + excluded_location_types = get_location_types(world, LocationInclusion.option_disabled) + plando_locations = get_plando_locations(world) + exclude_locations = get_option_value(world, "exclude_locations") + location_table = [location for location in location_table + if (LocationType is LocationType.VICTORY or location.name not in exclude_locations) + and location.type not in excluded_location_types + or location.name in plando_locations] + for i, location_data in enumerate(location_table): + # Removing all item-based logic on No Logic + if logic_level == RequiredTactics.option_no_logic: + location_data = location_data._replace(rule=Location.access_rule) + location_table[i] = location_data + # Generating Beat event locations + if location_data.name.endswith((": Victory", ": Defeat")): + beat_events.append( + location_data._replace(name="Beat " + location_data.name.rsplit(": ", 1)[0], code=None) + ) + return tuple(location_table + beat_events) + +lookup_location_id_to_type = {loc.code: loc.type for loc in get_locations(None) if loc.code is not None} \ No newline at end of file diff --git a/worlds/sc2/MissionTables.py b/worlds/sc2/MissionTables.py new file mode 100644 index 000000000000..99b6448aff35 --- /dev/null +++ b/worlds/sc2/MissionTables.py @@ -0,0 +1,737 @@ +from typing import NamedTuple, Dict, List, Set, Union, Literal, Iterable, Callable +from enum import IntEnum, Enum + + +class SC2Race(IntEnum): + ANY = 0 + TERRAN = 1 + ZERG = 2 + PROTOSS = 3 + + +class MissionPools(IntEnum): + STARTER = 0 + EASY = 1 + MEDIUM = 2 + HARD = 3 + VERY_HARD = 4 + FINAL = 5 + + +class SC2CampaignGoalPriority(IntEnum): + """ + Campaign's priority to goal election + """ + NONE = 0 + MINI_CAMPAIGN = 1 # A goal shouldn't be in a mini-campaign if there's at least one 'big' campaign + HARD = 2 # A campaign ending with a hard mission + VERY_HARD = 3 # A campaign ending with a very hard mission + EPILOGUE = 4 # Epilogue shall be always preferred as the goal if present + + +class SC2Campaign(Enum): + + def __new__(cls, *args, **kwargs): + value = len(cls.__members__) + 1 + obj = object.__new__(cls) + obj._value_ = value + return obj + + def __init__(self, campaign_id: int, name: str, goal_priority: SC2CampaignGoalPriority, race: SC2Race): + self.id = campaign_id + self.campaign_name = name + self.goal_priority = goal_priority + self.race = race + + GLOBAL = 0, "Global", SC2CampaignGoalPriority.NONE, SC2Race.ANY + WOL = 1, "Wings of Liberty", SC2CampaignGoalPriority.VERY_HARD, SC2Race.TERRAN + PROPHECY = 2, "Prophecy", SC2CampaignGoalPriority.MINI_CAMPAIGN, SC2Race.PROTOSS + HOTS = 3, "Heart of the Swarm", SC2CampaignGoalPriority.HARD, SC2Race.ZERG + PROLOGUE = 4, "Whispers of Oblivion (Legacy of the Void: Prologue)", SC2CampaignGoalPriority.MINI_CAMPAIGN, SC2Race.PROTOSS + LOTV = 5, "Legacy of the Void", SC2CampaignGoalPriority.VERY_HARD, SC2Race.PROTOSS + EPILOGUE = 6, "Into the Void (Legacy of the Void: Epilogue)", SC2CampaignGoalPriority.EPILOGUE, SC2Race.ANY + NCO = 7, "Nova Covert Ops", SC2CampaignGoalPriority.HARD, SC2Race.TERRAN + + +class SC2Mission(Enum): + + def __new__(cls, *args, **kwargs): + value = len(cls.__members__) + 1 + obj = object.__new__(cls) + obj._value_ = value + return obj + + def __init__(self, mission_id: int, name: str, campaign: SC2Campaign, area: str, race: SC2Race, pool: MissionPools, map_file: str, build: bool = True): + self.id = mission_id + self.mission_name = name + self.campaign = campaign + self.area = area + self.race = race + self.pool = pool + self.map_file = map_file + self.build = build + + # Wings of Liberty + LIBERATION_DAY = 1, "Liberation Day", SC2Campaign.WOL, "Mar Sara", SC2Race.ANY, MissionPools.STARTER, "ap_liberation_day", False + THE_OUTLAWS = 2, "The Outlaws", SC2Campaign.WOL, "Mar Sara", SC2Race.TERRAN, MissionPools.EASY, "ap_the_outlaws" + ZERO_HOUR = 3, "Zero Hour", SC2Campaign.WOL, "Mar Sara", SC2Race.TERRAN, MissionPools.EASY, "ap_zero_hour" + EVACUATION = 4, "Evacuation", SC2Campaign.WOL, "Colonist", SC2Race.TERRAN, MissionPools.EASY, "ap_evacuation" + OUTBREAK = 5, "Outbreak", SC2Campaign.WOL, "Colonist", SC2Race.TERRAN, MissionPools.EASY, "ap_outbreak" + SAFE_HAVEN = 6, "Safe Haven", SC2Campaign.WOL, "Colonist", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_safe_haven" + HAVENS_FALL = 7, "Haven's Fall", SC2Campaign.WOL, "Colonist", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_havens_fall" + SMASH_AND_GRAB = 8, "Smash and Grab", SC2Campaign.WOL, "Artifact", SC2Race.TERRAN, MissionPools.EASY, "ap_smash_and_grab" + THE_DIG = 9, "The Dig", SC2Campaign.WOL, "Artifact", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_the_dig" + THE_MOEBIUS_FACTOR = 10, "The Moebius Factor", SC2Campaign.WOL, "Artifact", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_the_moebius_factor" + SUPERNOVA = 11, "Supernova", SC2Campaign.WOL, "Artifact", SC2Race.TERRAN, MissionPools.HARD, "ap_supernova" + MAW_OF_THE_VOID = 12, "Maw of the Void", SC2Campaign.WOL, "Artifact", SC2Race.TERRAN, MissionPools.HARD, "ap_maw_of_the_void" + DEVILS_PLAYGROUND = 13, "Devil's Playground", SC2Campaign.WOL, "Covert", SC2Race.TERRAN, MissionPools.EASY, "ap_devils_playground" + WELCOME_TO_THE_JUNGLE = 14, "Welcome to the Jungle", SC2Campaign.WOL, "Covert", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_welcome_to_the_jungle" + BREAKOUT = 15, "Breakout", SC2Campaign.WOL, "Covert", SC2Race.ANY, MissionPools.STARTER, "ap_breakout", False + GHOST_OF_A_CHANCE = 16, "Ghost of a Chance", SC2Campaign.WOL, "Covert", SC2Race.ANY, MissionPools.STARTER, "ap_ghost_of_a_chance", False + THE_GREAT_TRAIN_ROBBERY = 17, "The Great Train Robbery", SC2Campaign.WOL, "Rebellion", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_the_great_train_robbery" + CUTTHROAT = 18, "Cutthroat", SC2Campaign.WOL, "Rebellion", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_cutthroat" + ENGINE_OF_DESTRUCTION = 19, "Engine of Destruction", SC2Campaign.WOL, "Rebellion", SC2Race.TERRAN, MissionPools.HARD, "ap_engine_of_destruction" + MEDIA_BLITZ = 20, "Media Blitz", SC2Campaign.WOL, "Rebellion", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_media_blitz" + PIERCING_OF_THE_SHROUD = 21, "Piercing the Shroud", SC2Campaign.WOL, "Rebellion", SC2Race.TERRAN, MissionPools.STARTER, "ap_piercing_the_shroud", False + GATES_OF_HELL = 26, "Gates of Hell", SC2Campaign.WOL, "Char", SC2Race.TERRAN, MissionPools.HARD, "ap_gates_of_hell" + BELLY_OF_THE_BEAST = 27, "Belly of the Beast", SC2Campaign.WOL, "Char", SC2Race.ANY, MissionPools.STARTER, "ap_belly_of_the_beast", False + SHATTER_THE_SKY = 28, "Shatter the Sky", SC2Campaign.WOL, "Char", SC2Race.TERRAN, MissionPools.HARD, "ap_shatter_the_sky" + ALL_IN = 29, "All-In", SC2Campaign.WOL, "Char", SC2Race.TERRAN, MissionPools.VERY_HARD, "ap_all_in" + + # Prophecy + WHISPERS_OF_DOOM = 22, "Whispers of Doom", SC2Campaign.PROPHECY, "_1", SC2Race.ANY, MissionPools.STARTER, "ap_whispers_of_doom", False + A_SINISTER_TURN = 23, "A Sinister Turn", SC2Campaign.PROPHECY, "_2", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_a_sinister_turn" + ECHOES_OF_THE_FUTURE = 24, "Echoes of the Future", SC2Campaign.PROPHECY, "_3", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_echoes_of_the_future" + IN_UTTER_DARKNESS = 25, "In Utter Darkness", SC2Campaign.PROPHECY, "_4", SC2Race.PROTOSS, MissionPools.HARD, "ap_in_utter_darkness" + + # Heart of the Swarm + LAB_RAT = 30, "Lab Rat", SC2Campaign.HOTS, "Umoja", SC2Race.ZERG, MissionPools.STARTER, "ap_lab_rat" + BACK_IN_THE_SADDLE = 31, "Back in the Saddle", SC2Campaign.HOTS, "Umoja", SC2Race.ANY, MissionPools.STARTER, "ap_back_in_the_saddle", False + RENDEZVOUS = 32, "Rendezvous", SC2Campaign.HOTS, "Umoja", SC2Race.ZERG, MissionPools.EASY, "ap_rendezvous" + HARVEST_OF_SCREAMS = 33, "Harvest of Screams", SC2Campaign.HOTS, "Kaldir", SC2Race.ZERG, MissionPools.EASY, "ap_harvest_of_screams" + SHOOT_THE_MESSENGER = 34, "Shoot the Messenger", SC2Campaign.HOTS, "Kaldir", SC2Race.ZERG, MissionPools.EASY, "ap_shoot_the_messenger" + ENEMY_WITHIN = 35, "Enemy Within", SC2Campaign.HOTS, "Kaldir", SC2Race.ANY, MissionPools.EASY, "ap_enemy_within", False + DOMINATION = 36, "Domination", SC2Campaign.HOTS, "Char", SC2Race.ZERG, MissionPools.EASY, "ap_domination" + FIRE_IN_THE_SKY = 37, "Fire in the Sky", SC2Campaign.HOTS, "Char", SC2Race.ZERG, MissionPools.MEDIUM, "ap_fire_in_the_sky" + OLD_SOLDIERS = 38, "Old Soldiers", SC2Campaign.HOTS, "Char", SC2Race.ZERG, MissionPools.MEDIUM, "ap_old_soldiers" + WAKING_THE_ANCIENT = 39, "Waking the Ancient", SC2Campaign.HOTS, "Zerus", SC2Race.ZERG, MissionPools.MEDIUM, "ap_waking_the_ancient" + THE_CRUCIBLE = 40, "The Crucible", SC2Campaign.HOTS, "Zerus", SC2Race.ZERG, MissionPools.MEDIUM, "ap_the_crucible" + SUPREME = 41, "Supreme", SC2Campaign.HOTS, "Zerus", SC2Race.ANY, MissionPools.MEDIUM, "ap_supreme", False + INFESTED = 42, "Infested", SC2Campaign.HOTS, "Skygeirr Station", SC2Race.ZERG, MissionPools.MEDIUM, "ap_infested" + HAND_OF_DARKNESS = 43, "Hand of Darkness", SC2Campaign.HOTS, "Skygeirr Station", SC2Race.ZERG, MissionPools.HARD, "ap_hand_of_darkness" + PHANTOMS_OF_THE_VOID = 44, "Phantoms of the Void", SC2Campaign.HOTS, "Skygeirr Station", SC2Race.ZERG, MissionPools.HARD, "ap_phantoms_of_the_void" + WITH_FRIENDS_LIKE_THESE = 45, "With Friends Like These", SC2Campaign.HOTS, "Dominion Space", SC2Race.ANY, MissionPools.STARTER, "ap_with_friends_like_these", False + CONVICTION = 46, "Conviction", SC2Campaign.HOTS, "Dominion Space", SC2Race.ANY, MissionPools.MEDIUM, "ap_conviction", False + PLANETFALL = 47, "Planetfall", SC2Campaign.HOTS, "Korhal", SC2Race.ZERG, MissionPools.HARD, "ap_planetfall" + DEATH_FROM_ABOVE = 48, "Death From Above", SC2Campaign.HOTS, "Korhal", SC2Race.ZERG, MissionPools.HARD, "ap_death_from_above" + THE_RECKONING = 49, "The Reckoning", SC2Campaign.HOTS, "Korhal", SC2Race.ZERG, MissionPools.HARD, "ap_the_reckoning" + + # Prologue + DARK_WHISPERS = 50, "Dark Whispers", SC2Campaign.PROLOGUE, "_1", SC2Race.PROTOSS, MissionPools.EASY, "ap_dark_whispers" + GHOSTS_IN_THE_FOG = 51, "Ghosts in the Fog", SC2Campaign.PROLOGUE, "_2", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_ghosts_in_the_fog" + EVIL_AWOKEN = 52, "Evil Awoken", SC2Campaign.PROLOGUE, "_3", SC2Race.PROTOSS, MissionPools.STARTER, "ap_evil_awoken", False + + # LotV + FOR_AIUR = 53, "For Aiur!", SC2Campaign.LOTV, "Aiur", SC2Race.ANY, MissionPools.STARTER, "ap_for_aiur", False + THE_GROWING_SHADOW = 54, "The Growing Shadow", SC2Campaign.LOTV, "Aiur", SC2Race.PROTOSS, MissionPools.EASY, "ap_the_growing_shadow" + THE_SPEAR_OF_ADUN = 55, "The Spear of Adun", SC2Campaign.LOTV, "Aiur", SC2Race.PROTOSS, MissionPools.EASY, "ap_the_spear_of_adun" + SKY_SHIELD = 56, "Sky Shield", SC2Campaign.LOTV, "Korhal", SC2Race.PROTOSS, MissionPools.EASY, "ap_sky_shield" + BROTHERS_IN_ARMS = 57, "Brothers in Arms", SC2Campaign.LOTV, "Korhal", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_brothers_in_arms" + AMON_S_REACH = 58, "Amon's Reach", SC2Campaign.LOTV, "Shakuras", SC2Race.PROTOSS, MissionPools.EASY, "ap_amon_s_reach" + LAST_STAND = 59, "Last Stand", SC2Campaign.LOTV, "Shakuras", SC2Race.PROTOSS, MissionPools.HARD, "ap_last_stand" + FORBIDDEN_WEAPON = 60, "Forbidden Weapon", SC2Campaign.LOTV, "Purifier", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_forbidden_weapon" + TEMPLE_OF_UNIFICATION = 61, "Temple of Unification", SC2Campaign.LOTV, "Ulnar", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_temple_of_unification" + THE_INFINITE_CYCLE = 62, "The Infinite Cycle", SC2Campaign.LOTV, "Ulnar", SC2Race.ANY, MissionPools.HARD, "ap_the_infinite_cycle", False + HARBINGER_OF_OBLIVION = 63, "Harbinger of Oblivion", SC2Campaign.LOTV, "Ulnar", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_harbinger_of_oblivion" + UNSEALING_THE_PAST = 64, "Unsealing the Past", SC2Campaign.LOTV, "Purifier", SC2Race.PROTOSS, MissionPools.MEDIUM, "ap_unsealing_the_past" + PURIFICATION = 65, "Purification", SC2Campaign.LOTV, "Purifier", SC2Race.PROTOSS, MissionPools.HARD, "ap_purification" + STEPS_OF_THE_RITE = 66, "Steps of the Rite", SC2Campaign.LOTV, "Tal'darim", SC2Race.PROTOSS, MissionPools.HARD, "ap_steps_of_the_rite" + RAK_SHIR = 67, "Rak'Shir", SC2Campaign.LOTV, "Tal'darim", SC2Race.PROTOSS, MissionPools.HARD, "ap_rak_shir" + TEMPLAR_S_CHARGE = 68, "Templar's Charge", SC2Campaign.LOTV, "Moebius", SC2Race.PROTOSS, MissionPools.HARD, "ap_templar_s_charge" + TEMPLAR_S_RETURN = 69, "Templar's Return", SC2Campaign.LOTV, "Return to Aiur", SC2Race.PROTOSS, MissionPools.EASY, "ap_templar_s_return", False + THE_HOST = 70, "The Host", SC2Campaign.LOTV, "Return to Aiur", SC2Race.PROTOSS, MissionPools.HARD, "ap_the_host", + SALVATION = 71, "Salvation", SC2Campaign.LOTV, "Return to Aiur", SC2Race.PROTOSS, MissionPools.VERY_HARD, "ap_salvation" + + # Epilogue + INTO_THE_VOID = 72, "Into the Void", SC2Campaign.EPILOGUE, "_1", SC2Race.PROTOSS, MissionPools.VERY_HARD, "ap_into_the_void" + THE_ESSENCE_OF_ETERNITY = 73, "The Essence of Eternity", SC2Campaign.EPILOGUE, "_2", SC2Race.TERRAN, MissionPools.VERY_HARD, "ap_the_essence_of_eternity" + AMON_S_FALL = 74, "Amon's Fall", SC2Campaign.EPILOGUE, "_3", SC2Race.ZERG, MissionPools.VERY_HARD, "ap_amon_s_fall" + + # Nova Covert Ops + THE_ESCAPE = 75, "The Escape", SC2Campaign.NCO, "_1", SC2Race.ANY, MissionPools.MEDIUM, "ap_the_escape", False + SUDDEN_STRIKE = 76, "Sudden Strike", SC2Campaign.NCO, "_1", SC2Race.TERRAN, MissionPools.EASY, "ap_sudden_strike" + ENEMY_INTELLIGENCE = 77, "Enemy Intelligence", SC2Campaign.NCO, "_1", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_enemy_intelligence" + TROUBLE_IN_PARADISE = 78, "Trouble In Paradise", SC2Campaign.NCO, "_2", SC2Race.TERRAN, MissionPools.HARD, "ap_trouble_in_paradise" + NIGHT_TERRORS = 79, "Night Terrors", SC2Campaign.NCO, "_2", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_night_terrors" + FLASHPOINT = 80, "Flashpoint", SC2Campaign.NCO, "_2", SC2Race.TERRAN, MissionPools.HARD, "ap_flashpoint" + IN_THE_ENEMY_S_SHADOW = 81, "In the Enemy's Shadow", SC2Campaign.NCO, "_3", SC2Race.TERRAN, MissionPools.MEDIUM, "ap_in_the_enemy_s_shadow", False + DARK_SKIES = 82, "Dark Skies", SC2Campaign.NCO, "_3", SC2Race.TERRAN, MissionPools.HARD, "ap_dark_skies" + END_GAME = 83, "End Game", SC2Campaign.NCO, "_3", SC2Race.TERRAN, MissionPools.VERY_HARD, "ap_end_game" + + +class MissionConnection: + campaign: SC2Campaign + connect_to: int # -1 connects to Menu + + def __init__(self, connect_to, campaign = SC2Campaign.GLOBAL): + self.campaign = campaign + self.connect_to = connect_to + + def _asdict(self): + return { + "campaign": self.campaign.id, + "connect_to": self.connect_to + } + + +class MissionInfo(NamedTuple): + mission: SC2Mission + required_world: List[Union[MissionConnection, Dict[Literal["campaign", "connect_to"], int]]] + category: str + number: int = 0 # number of worlds need beaten + completion_critical: bool = False # missions needed to beat game + or_requirements: bool = False # true if the requirements should be or-ed instead of and-ed + ui_vertical_padding: int = 0 + + +class FillMission(NamedTuple): + type: MissionPools + connect_to: List[MissionConnection] + category: str + number: int = 0 # number of worlds need beaten + completion_critical: bool = False # missions needed to beat game + or_requirements: bool = False # true if the requirements should be or-ed instead of and-ed + removal_priority: int = 0 # how many missions missing from the pool required to remove this mission + + + +def vanilla_shuffle_order() -> Dict[SC2Campaign, List[FillMission]]: + return { + SC2Campaign.WOL: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1, SC2Campaign.WOL)], "Mar Sara", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(0, SC2Campaign.WOL)], "Mar Sara", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(1, SC2Campaign.WOL)], "Mar Sara", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(2, SC2Campaign.WOL)], "Colonist"), + FillMission(MissionPools.MEDIUM, [MissionConnection(3, SC2Campaign.WOL)], "Colonist"), + FillMission(MissionPools.HARD, [MissionConnection(4, SC2Campaign.WOL)], "Colonist", number=7), + FillMission(MissionPools.HARD, [MissionConnection(4, SC2Campaign.WOL)], "Colonist", number=7, removal_priority=1), + FillMission(MissionPools.EASY, [MissionConnection(2, SC2Campaign.WOL)], "Artifact", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(7, SC2Campaign.WOL)], "Artifact", number=8, completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(8, SC2Campaign.WOL)], "Artifact", number=11, completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(9, SC2Campaign.WOL)], "Artifact", number=14, completion_critical=True, removal_priority=7), + FillMission(MissionPools.HARD, [MissionConnection(10, SC2Campaign.WOL)], "Artifact", completion_critical=True, removal_priority=6), + FillMission(MissionPools.MEDIUM, [MissionConnection(2, SC2Campaign.WOL)], "Covert", number=4), + FillMission(MissionPools.MEDIUM, [MissionConnection(12, SC2Campaign.WOL)], "Covert"), + FillMission(MissionPools.HARD, [MissionConnection(13, SC2Campaign.WOL)], "Covert", number=8, removal_priority=3), + FillMission(MissionPools.HARD, [MissionConnection(13, SC2Campaign.WOL)], "Covert", number=8, removal_priority=2), + FillMission(MissionPools.MEDIUM, [MissionConnection(2, SC2Campaign.WOL)], "Rebellion", number=6), + FillMission(MissionPools.HARD, [MissionConnection(16, SC2Campaign.WOL)], "Rebellion"), + FillMission(MissionPools.HARD, [MissionConnection(17, SC2Campaign.WOL)], "Rebellion"), + FillMission(MissionPools.HARD, [MissionConnection(18, SC2Campaign.WOL)], "Rebellion", removal_priority=8), + FillMission(MissionPools.HARD, [MissionConnection(19, SC2Campaign.WOL)], "Rebellion", removal_priority=5), + FillMission(MissionPools.HARD, [MissionConnection(11, SC2Campaign.WOL)], "Char", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(21, SC2Campaign.WOL)], "Char", completion_critical=True, removal_priority=4), + FillMission(MissionPools.HARD, [MissionConnection(21, SC2Campaign.WOL)], "Char", completion_critical=True), + FillMission(MissionPools.FINAL, [MissionConnection(22, SC2Campaign.WOL), MissionConnection(23, SC2Campaign.WOL)], "Char", completion_critical=True, or_requirements=True) + ], + SC2Campaign.PROPHECY: [ + FillMission(MissionPools.MEDIUM, [MissionConnection(8, SC2Campaign.WOL)], "_1"), + FillMission(MissionPools.HARD, [MissionConnection(0, SC2Campaign.PROPHECY)], "_2", removal_priority=2), + FillMission(MissionPools.HARD, [MissionConnection(1, SC2Campaign.PROPHECY)], "_3", removal_priority=1), + FillMission(MissionPools.FINAL, [MissionConnection(2, SC2Campaign.PROPHECY)], "_4"), + ], + SC2Campaign.HOTS: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1, SC2Campaign.HOTS)], "Umoja", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(0, SC2Campaign.HOTS)], "Umoja", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(1, SC2Campaign.HOTS)], "Umoja", completion_critical=True, removal_priority=1), + FillMission(MissionPools.EASY, [MissionConnection(2, SC2Campaign.HOTS)], "Kaldir", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(3, SC2Campaign.HOTS)], "Kaldir", completion_critical=True, removal_priority=2), + FillMission(MissionPools.MEDIUM, [MissionConnection(4, SC2Campaign.HOTS)], "Kaldir", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(2, SC2Campaign.HOTS)], "Char", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(6, SC2Campaign.HOTS)], "Char", completion_critical=True, removal_priority=3), + FillMission(MissionPools.MEDIUM, [MissionConnection(7, SC2Campaign.HOTS)], "Char", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(5, SC2Campaign.HOTS), MissionConnection(8, SC2Campaign.HOTS)], "Zerus", completion_critical=True, or_requirements=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(9, SC2Campaign.HOTS)], "Zerus", completion_critical=True, removal_priority=4), + FillMission(MissionPools.MEDIUM, [MissionConnection(10, SC2Campaign.HOTS)], "Zerus", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(5, SC2Campaign.HOTS), MissionConnection(8, SC2Campaign.HOTS), MissionConnection(11, SC2Campaign.HOTS)], "Skygeirr Station", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(12, SC2Campaign.HOTS)], "Skygeirr Station", completion_critical=True, removal_priority=5), + FillMission(MissionPools.HARD, [MissionConnection(13, SC2Campaign.HOTS)], "Skygeirr Station", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(5, SC2Campaign.HOTS), MissionConnection(8, SC2Campaign.HOTS), MissionConnection(11, SC2Campaign.HOTS)], "Dominion Space", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(15, SC2Campaign.HOTS)], "Dominion Space", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(14, SC2Campaign.HOTS), MissionConnection(16, SC2Campaign.HOTS)], "Korhal", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(17, SC2Campaign.HOTS)], "Korhal", completion_critical=True), + FillMission(MissionPools.FINAL, [MissionConnection(18, SC2Campaign.HOTS)], "Korhal", completion_critical=True), + ], + SC2Campaign.PROLOGUE: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1, SC2Campaign.PROLOGUE)], "_1"), + FillMission(MissionPools.MEDIUM, [MissionConnection(0, SC2Campaign.PROLOGUE)], "_2", removal_priority=1), + FillMission(MissionPools.FINAL, [MissionConnection(1, SC2Campaign.PROLOGUE)], "_3") + ], + SC2Campaign.LOTV: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1, SC2Campaign.LOTV)], "Aiur", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(0, SC2Campaign.LOTV)], "Aiur", completion_critical=True, removal_priority=3), + FillMission(MissionPools.EASY, [MissionConnection(1, SC2Campaign.LOTV)], "Aiur", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(2, SC2Campaign.LOTV)], "Korhal", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(3, SC2Campaign.LOTV)], "Korhal", completion_critical=True, removal_priority=7), + FillMission(MissionPools.MEDIUM, [MissionConnection(2, SC2Campaign.LOTV)], "Shakuras", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(5, SC2Campaign.LOTV)], "Shakuras", completion_critical=True, removal_priority=6), + FillMission(MissionPools.HARD, [MissionConnection(4, SC2Campaign.LOTV), MissionConnection(6, SC2Campaign.LOTV)], "Purifier", completion_critical=True, or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(4, SC2Campaign.LOTV), MissionConnection(6, SC2Campaign.LOTV), MissionConnection(7, SC2Campaign.LOTV)], "Ulnar", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(8, SC2Campaign.LOTV)], "Ulnar", completion_critical=True, removal_priority=1), + FillMission(MissionPools.HARD, [MissionConnection(9, SC2Campaign.LOTV)], "Ulnar", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(10, SC2Campaign.LOTV)], "Purifier", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(11, SC2Campaign.LOTV)], "Purifier", completion_critical=True, removal_priority=5), + FillMission(MissionPools.HARD, [MissionConnection(10, SC2Campaign.LOTV)], "Tal'darim", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(13, SC2Campaign.LOTV)], "Tal'darim", completion_critical=True, removal_priority=4), + FillMission(MissionPools.HARD, [MissionConnection(12, SC2Campaign.LOTV), MissionConnection(14, SC2Campaign.LOTV)], "Moebius", completion_critical=True, or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(12, SC2Campaign.LOTV), MissionConnection(14, SC2Campaign.LOTV), MissionConnection(15, SC2Campaign.LOTV)], "Return to Aiur", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(16, SC2Campaign.LOTV)], "Return to Aiur", completion_critical=True, removal_priority=2), + FillMission(MissionPools.FINAL, [MissionConnection(17, SC2Campaign.LOTV)], "Return to Aiur", completion_critical=True), + ], + SC2Campaign.EPILOGUE: [ + FillMission(MissionPools.VERY_HARD, [MissionConnection(24, SC2Campaign.WOL), MissionConnection(19, SC2Campaign.HOTS), MissionConnection(18, SC2Campaign.LOTV)], "_1", completion_critical=True), + FillMission(MissionPools.VERY_HARD, [MissionConnection(0, SC2Campaign.EPILOGUE)], "_2", completion_critical=True, removal_priority=1), + FillMission(MissionPools.FINAL, [MissionConnection(1, SC2Campaign.EPILOGUE)], "_3", completion_critical=True), + ], + SC2Campaign.NCO: [ + FillMission(MissionPools.EASY, [MissionConnection(-1, SC2Campaign.NCO)], "_1", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(0, SC2Campaign.NCO)], "_1", completion_critical=True, removal_priority=6), + FillMission(MissionPools.MEDIUM, [MissionConnection(1, SC2Campaign.NCO)], "_1", completion_critical=True, removal_priority=5), + FillMission(MissionPools.HARD, [MissionConnection(2, SC2Campaign.NCO)], "_2", completion_critical=True, removal_priority=7), + FillMission(MissionPools.HARD, [MissionConnection(3, SC2Campaign.NCO)], "_2", completion_critical=True, removal_priority=4), + FillMission(MissionPools.HARD, [MissionConnection(4, SC2Campaign.NCO)], "_2", completion_critical=True, removal_priority=3), + FillMission(MissionPools.HARD, [MissionConnection(5, SC2Campaign.NCO)], "_3", completion_critical=True, removal_priority=2), + FillMission(MissionPools.HARD, [MissionConnection(6, SC2Campaign.NCO)], "_3", completion_critical=True, removal_priority=1), + FillMission(MissionPools.FINAL, [MissionConnection(7, SC2Campaign.NCO)], "_3", completion_critical=True), + ] + } + + +def mini_campaign_order() -> Dict[SC2Campaign, List[FillMission]]: + return { + SC2Campaign.WOL: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1, SC2Campaign.WOL)], "Mar Sara", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(0, SC2Campaign.WOL)], "Colonist"), + FillMission(MissionPools.MEDIUM, [MissionConnection(1, SC2Campaign.WOL)], "Colonist"), + FillMission(MissionPools.EASY, [MissionConnection(0, SC2Campaign.WOL)], "Artifact", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(3, SC2Campaign.WOL)], "Artifact", number=4, completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(4, SC2Campaign.WOL)], "Artifact", number=8, completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(0, SC2Campaign.WOL)], "Covert", number=2), + FillMission(MissionPools.HARD, [MissionConnection(6, SC2Campaign.WOL)], "Covert"), + FillMission(MissionPools.MEDIUM, [MissionConnection(0, SC2Campaign.WOL)], "Rebellion", number=3), + FillMission(MissionPools.HARD, [MissionConnection(8, SC2Campaign.WOL)], "Rebellion"), + FillMission(MissionPools.HARD, [MissionConnection(5, SC2Campaign.WOL)], "Char", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(5, SC2Campaign.WOL)], "Char", completion_critical=True), + FillMission(MissionPools.FINAL, [MissionConnection(10, SC2Campaign.WOL), MissionConnection(11, SC2Campaign.WOL)], "Char", completion_critical=True, or_requirements=True) + ], + SC2Campaign.PROPHECY: [ + FillMission(MissionPools.MEDIUM, [MissionConnection(4, SC2Campaign.WOL)], "_1"), + FillMission(MissionPools.FINAL, [MissionConnection(0, SC2Campaign.PROPHECY)], "_2"), + ], + SC2Campaign.HOTS: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1, SC2Campaign.HOTS)], "Umoja", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(0, SC2Campaign.HOTS)], "Kaldir"), + FillMission(MissionPools.MEDIUM, [MissionConnection(1, SC2Campaign.HOTS)], "Kaldir"), + FillMission(MissionPools.EASY, [MissionConnection(0, SC2Campaign.HOTS)], "Char"), + FillMission(MissionPools.MEDIUM, [MissionConnection(3, SC2Campaign.HOTS)], "Char"), + FillMission(MissionPools.MEDIUM, [MissionConnection(0, SC2Campaign.HOTS)], "Zerus", number=3), + FillMission(MissionPools.MEDIUM, [MissionConnection(5, SC2Campaign.HOTS)], "Zerus"), + FillMission(MissionPools.HARD, [MissionConnection(6, SC2Campaign.HOTS)], "Skygeirr Station", number=5), + FillMission(MissionPools.HARD, [MissionConnection(7, SC2Campaign.HOTS)], "Skygeirr Station"), + FillMission(MissionPools.HARD, [MissionConnection(6, SC2Campaign.HOTS)], "Dominion Space", number=5), + FillMission(MissionPools.HARD, [MissionConnection(9, SC2Campaign.HOTS)], "Dominion Space"), + FillMission(MissionPools.HARD, [MissionConnection(6, SC2Campaign.HOTS)], "Korhal", completion_critical=True, number=8), + FillMission(MissionPools.FINAL, [MissionConnection(11, SC2Campaign.HOTS)], "Korhal", completion_critical=True), + ], + SC2Campaign.PROLOGUE: [ + FillMission(MissionPools.EASY, [MissionConnection(-1, SC2Campaign.PROLOGUE)], "_1"), + FillMission(MissionPools.FINAL, [MissionConnection(0, SC2Campaign.PROLOGUE)], "_2") + ], + SC2Campaign.LOTV: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1, SC2Campaign.LOTV)], "Aiur",completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(0, SC2Campaign.LOTV)], "Aiur", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(1, SC2Campaign.LOTV)], "Korhal", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(1, SC2Campaign.LOTV)], "Shakuras", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(2, SC2Campaign.LOTV), MissionConnection(3, SC2Campaign.LOTV)], "Purifier", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(6, SC2Campaign.LOTV)], "Purifier", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(4, SC2Campaign.LOTV)], "Ulnar", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(6, SC2Campaign.LOTV)], "Tal'darim", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(5, SC2Campaign.LOTV), MissionConnection(7, SC2Campaign.LOTV)], "Return to Aiur", completion_critical=True), + FillMission(MissionPools.FINAL, [MissionConnection(8, SC2Campaign.LOTV)], "Return to Aiur", completion_critical=True), + ], + SC2Campaign.EPILOGUE: [ + FillMission(MissionPools.VERY_HARD, [MissionConnection(12, SC2Campaign.WOL), MissionConnection(12, SC2Campaign.HOTS), MissionConnection(9, SC2Campaign.LOTV)], "_1", completion_critical=True), + FillMission(MissionPools.FINAL, [MissionConnection(0, SC2Campaign.EPILOGUE)], "_2", completion_critical=True), + ], + SC2Campaign.NCO: [ + FillMission(MissionPools.EASY, [MissionConnection(-1, SC2Campaign.NCO)], "_1", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(0, SC2Campaign.NCO)], "_1", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(1, SC2Campaign.NCO)], "_2", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(2, SC2Campaign.NCO)], "_3", completion_critical=True), + FillMission(MissionPools.FINAL, [MissionConnection(3, SC2Campaign.NCO)], "_3", completion_critical=True), + ] + } + + +def gauntlet_order() -> Dict[SC2Campaign, List[FillMission]]: + return { + SC2Campaign.GLOBAL: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1)], "I", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(0)], "II", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(1)], "III", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(2)], "IV", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(3)], "V", completion_critical=True), + FillMission(MissionPools.HARD, [MissionConnection(4)], "VI", completion_critical=True), + FillMission(MissionPools.FINAL, [MissionConnection(5)], "Final", completion_critical=True) + ] + } + + +def mini_gauntlet_order() -> Dict[SC2Campaign, List[FillMission]]: + return { + SC2Campaign.GLOBAL: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1)], "I", completion_critical=True), + FillMission(MissionPools.EASY, [MissionConnection(0)], "II", completion_critical=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(1)], "III", completion_critical=True), + FillMission(MissionPools.FINAL, [MissionConnection(2)], "Final", completion_critical=True) + ] + } + + +def grid_order() -> Dict[SC2Campaign, List[FillMission]]: + return { + SC2Campaign.GLOBAL: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1)], "_1"), + FillMission(MissionPools.EASY, [MissionConnection(0)], "_1"), + FillMission(MissionPools.MEDIUM, [MissionConnection(1), MissionConnection(6), MissionConnection( 3)], "_1", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(2), MissionConnection(7)], "_1", or_requirements=True), + FillMission(MissionPools.EASY, [MissionConnection(0)], "_2"), + FillMission(MissionPools.MEDIUM, [MissionConnection(1), MissionConnection(4)], "_2", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(2), MissionConnection(5), MissionConnection(10), MissionConnection(7)], "_2", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(3), MissionConnection(6), MissionConnection(11)], "_2", or_requirements=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(4), MissionConnection(9), MissionConnection(12)], "_3", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(5), MissionConnection(8), MissionConnection(10), MissionConnection(13)], "_3", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(6), MissionConnection(9), MissionConnection(11), MissionConnection(14)], "_3", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(7), MissionConnection(10)], "_3", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(8), MissionConnection(13)], "_4", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(9), MissionConnection(12), MissionConnection(14)], "_4", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(10), MissionConnection(13)], "_4", or_requirements=True), + FillMission(MissionPools.FINAL, [MissionConnection(11), MissionConnection(14)], "_4", or_requirements=True) + ] + } + +def mini_grid_order() -> Dict[SC2Campaign, List[FillMission]]: + return { + SC2Campaign.GLOBAL: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1)], "_1"), + FillMission(MissionPools.EASY, [MissionConnection(0)], "_1"), + FillMission(MissionPools.MEDIUM, [MissionConnection(1), MissionConnection(5)], "_1", or_requirements=True), + FillMission(MissionPools.EASY, [MissionConnection(0)], "_2"), + FillMission(MissionPools.MEDIUM, [MissionConnection(1), MissionConnection(3)], "_2", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(2), MissionConnection(4)], "_2", or_requirements=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(3), MissionConnection(7)], "_3", or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(4), MissionConnection(6)], "_3", or_requirements=True), + FillMission(MissionPools.FINAL, [MissionConnection(5), MissionConnection(7)], "_3", or_requirements=True) + ] + } + +def tiny_grid_order() -> Dict[SC2Campaign, List[FillMission]]: + return { + SC2Campaign.GLOBAL: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1)], "_1"), + FillMission(MissionPools.MEDIUM, [MissionConnection(0)], "_1"), + FillMission(MissionPools.EASY, [MissionConnection(0)], "_2"), + FillMission(MissionPools.FINAL, [MissionConnection(1), MissionConnection(2)], "_2", or_requirements=True), + ] + } + +def blitz_order() -> Dict[SC2Campaign, List[FillMission]]: + return { + SC2Campaign.GLOBAL: [ + FillMission(MissionPools.STARTER, [MissionConnection(-1)], "I"), + FillMission(MissionPools.EASY, [MissionConnection(-1)], "I"), + FillMission(MissionPools.MEDIUM, [MissionConnection(0), MissionConnection(1)], "II", number=1, or_requirements=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(0), MissionConnection(1)], "II", number=1, or_requirements=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(0), MissionConnection(1)], "III", number=2, or_requirements=True), + FillMission(MissionPools.MEDIUM, [MissionConnection(0), MissionConnection(1)], "III", number=2, or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(0), MissionConnection(1)], "IV", number=3, or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(0), MissionConnection(1)], "IV", number=3, or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(0), MissionConnection(1)], "V", number=4, or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(0), MissionConnection(1)], "V", number=4, or_requirements=True), + FillMission(MissionPools.HARD, [MissionConnection(0), MissionConnection(1)], "Final", number=5, or_requirements=True), + FillMission(MissionPools.FINAL, [MissionConnection(0), MissionConnection(1)], "Final", number=5, or_requirements=True) + ] + } + + +mission_orders: List[Callable[[], Dict[SC2Campaign, List[FillMission]]]] = [ + vanilla_shuffle_order, + vanilla_shuffle_order, + mini_campaign_order, + grid_order, + mini_grid_order, + blitz_order, + gauntlet_order, + mini_gauntlet_order, + tiny_grid_order +] + + +vanilla_mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]] = { + SC2Campaign.WOL: { + SC2Mission.LIBERATION_DAY.mission_name: MissionInfo(SC2Mission.LIBERATION_DAY, [], SC2Mission.LIBERATION_DAY.area, completion_critical=True), + SC2Mission.THE_OUTLAWS.mission_name: MissionInfo(SC2Mission.THE_OUTLAWS, [MissionConnection(1, SC2Campaign.WOL)], SC2Mission.THE_OUTLAWS.area, completion_critical=True), + SC2Mission.ZERO_HOUR.mission_name: MissionInfo(SC2Mission.ZERO_HOUR, [MissionConnection(2, SC2Campaign.WOL)], SC2Mission.ZERO_HOUR.area, completion_critical=True), + SC2Mission.EVACUATION.mission_name: MissionInfo(SC2Mission.EVACUATION, [MissionConnection(3, SC2Campaign.WOL)], SC2Mission.EVACUATION.area), + SC2Mission.OUTBREAK.mission_name: MissionInfo(SC2Mission.OUTBREAK, [MissionConnection(4, SC2Campaign.WOL)], SC2Mission.OUTBREAK.area), + SC2Mission.SAFE_HAVEN.mission_name: MissionInfo(SC2Mission.SAFE_HAVEN, [MissionConnection(5, SC2Campaign.WOL)], SC2Mission.SAFE_HAVEN.area, number=7), + SC2Mission.HAVENS_FALL.mission_name: MissionInfo(SC2Mission.HAVENS_FALL, [MissionConnection(5, SC2Campaign.WOL)], SC2Mission.HAVENS_FALL.area, number=7), + SC2Mission.SMASH_AND_GRAB.mission_name: MissionInfo(SC2Mission.SMASH_AND_GRAB, [MissionConnection(3, SC2Campaign.WOL)], SC2Mission.SMASH_AND_GRAB.area, completion_critical=True), + SC2Mission.THE_DIG.mission_name: MissionInfo(SC2Mission.THE_DIG, [MissionConnection(8, SC2Campaign.WOL)], SC2Mission.THE_DIG.area, number=8, completion_critical=True), + SC2Mission.THE_MOEBIUS_FACTOR.mission_name: MissionInfo(SC2Mission.THE_MOEBIUS_FACTOR, [MissionConnection(9, SC2Campaign.WOL)], SC2Mission.THE_MOEBIUS_FACTOR.area, number=11, completion_critical=True), + SC2Mission.SUPERNOVA.mission_name: MissionInfo(SC2Mission.SUPERNOVA, [MissionConnection(10, SC2Campaign.WOL)], SC2Mission.SUPERNOVA.area, number=14, completion_critical=True), + SC2Mission.MAW_OF_THE_VOID.mission_name: MissionInfo(SC2Mission.MAW_OF_THE_VOID, [MissionConnection(11, SC2Campaign.WOL)], SC2Mission.MAW_OF_THE_VOID.area, completion_critical=True), + SC2Mission.DEVILS_PLAYGROUND.mission_name: MissionInfo(SC2Mission.DEVILS_PLAYGROUND, [MissionConnection(3, SC2Campaign.WOL)], SC2Mission.DEVILS_PLAYGROUND.area, number=4), + SC2Mission.WELCOME_TO_THE_JUNGLE.mission_name: MissionInfo(SC2Mission.WELCOME_TO_THE_JUNGLE, [MissionConnection(13, SC2Campaign.WOL)], SC2Mission.WELCOME_TO_THE_JUNGLE.area), + SC2Mission.BREAKOUT.mission_name: MissionInfo(SC2Mission.BREAKOUT, [MissionConnection(14, SC2Campaign.WOL)], SC2Mission.BREAKOUT.area, number=8), + SC2Mission.GHOST_OF_A_CHANCE.mission_name: MissionInfo(SC2Mission.GHOST_OF_A_CHANCE, [MissionConnection(14, SC2Campaign.WOL)], SC2Mission.GHOST_OF_A_CHANCE.area, number=8), + SC2Mission.THE_GREAT_TRAIN_ROBBERY.mission_name: MissionInfo(SC2Mission.THE_GREAT_TRAIN_ROBBERY, [MissionConnection(3, SC2Campaign.WOL)], SC2Mission.THE_GREAT_TRAIN_ROBBERY.area, number=6), + SC2Mission.CUTTHROAT.mission_name: MissionInfo(SC2Mission.CUTTHROAT, [MissionConnection(17, SC2Campaign.WOL)], SC2Mission.THE_GREAT_TRAIN_ROBBERY.area), + SC2Mission.ENGINE_OF_DESTRUCTION.mission_name: MissionInfo(SC2Mission.ENGINE_OF_DESTRUCTION, [MissionConnection(18, SC2Campaign.WOL)], SC2Mission.ENGINE_OF_DESTRUCTION.area), + SC2Mission.MEDIA_BLITZ.mission_name: MissionInfo(SC2Mission.MEDIA_BLITZ, [MissionConnection(19, SC2Campaign.WOL)], SC2Mission.MEDIA_BLITZ.area), + SC2Mission.PIERCING_OF_THE_SHROUD.mission_name: MissionInfo(SC2Mission.PIERCING_OF_THE_SHROUD, [MissionConnection(20, SC2Campaign.WOL)], SC2Mission.PIERCING_OF_THE_SHROUD.area), + SC2Mission.GATES_OF_HELL.mission_name: MissionInfo(SC2Mission.GATES_OF_HELL, [MissionConnection(12, SC2Campaign.WOL)], SC2Mission.GATES_OF_HELL.area, completion_critical=True), + SC2Mission.BELLY_OF_THE_BEAST.mission_name: MissionInfo(SC2Mission.BELLY_OF_THE_BEAST, [MissionConnection(22, SC2Campaign.WOL)], SC2Mission.BELLY_OF_THE_BEAST.area, completion_critical=True), + SC2Mission.SHATTER_THE_SKY.mission_name: MissionInfo(SC2Mission.SHATTER_THE_SKY, [MissionConnection(22, SC2Campaign.WOL)], SC2Mission.SHATTER_THE_SKY.area, completion_critical=True), + SC2Mission.ALL_IN.mission_name: MissionInfo(SC2Mission.ALL_IN, [MissionConnection(23, SC2Campaign.WOL), MissionConnection(24, SC2Campaign.WOL)], SC2Mission.ALL_IN.area, or_requirements=True, completion_critical=True) + }, + SC2Campaign.PROPHECY: { + SC2Mission.WHISPERS_OF_DOOM.mission_name: MissionInfo(SC2Mission.WHISPERS_OF_DOOM, [MissionConnection(9, SC2Campaign.WOL)], SC2Mission.WHISPERS_OF_DOOM.area), + SC2Mission.A_SINISTER_TURN.mission_name: MissionInfo(SC2Mission.A_SINISTER_TURN, [MissionConnection(1, SC2Campaign.PROPHECY)], SC2Mission.A_SINISTER_TURN.area), + SC2Mission.ECHOES_OF_THE_FUTURE.mission_name: MissionInfo(SC2Mission.ECHOES_OF_THE_FUTURE, [MissionConnection(2, SC2Campaign.PROPHECY)], SC2Mission.ECHOES_OF_THE_FUTURE.area), + SC2Mission.IN_UTTER_DARKNESS.mission_name: MissionInfo(SC2Mission.IN_UTTER_DARKNESS, [MissionConnection(3, SC2Campaign.PROPHECY)], SC2Mission.IN_UTTER_DARKNESS.area) + }, + SC2Campaign.HOTS: { + SC2Mission.LAB_RAT.mission_name: MissionInfo(SC2Mission.LAB_RAT, [], SC2Mission.LAB_RAT.area, completion_critical=True), + SC2Mission.BACK_IN_THE_SADDLE.mission_name: MissionInfo(SC2Mission.BACK_IN_THE_SADDLE, [MissionConnection(1, SC2Campaign.HOTS)], SC2Mission.BACK_IN_THE_SADDLE.area, completion_critical=True), + SC2Mission.RENDEZVOUS.mission_name: MissionInfo(SC2Mission.RENDEZVOUS, [MissionConnection(2, SC2Campaign.HOTS)], SC2Mission.RENDEZVOUS.area, completion_critical=True), + SC2Mission.HARVEST_OF_SCREAMS.mission_name: MissionInfo(SC2Mission.HARVEST_OF_SCREAMS, [MissionConnection(3, SC2Campaign.HOTS)], SC2Mission.HARVEST_OF_SCREAMS.area), + SC2Mission.SHOOT_THE_MESSENGER.mission_name: MissionInfo(SC2Mission.SHOOT_THE_MESSENGER, [MissionConnection(4, SC2Campaign.HOTS)], SC2Mission.SHOOT_THE_MESSENGER.area), + SC2Mission.ENEMY_WITHIN.mission_name: MissionInfo(SC2Mission.ENEMY_WITHIN, [MissionConnection(5, SC2Campaign.HOTS)], SC2Mission.ENEMY_WITHIN.area), + SC2Mission.DOMINATION.mission_name: MissionInfo(SC2Mission.DOMINATION, [MissionConnection(3, SC2Campaign.HOTS)], SC2Mission.DOMINATION.area), + SC2Mission.FIRE_IN_THE_SKY.mission_name: MissionInfo(SC2Mission.FIRE_IN_THE_SKY, [MissionConnection(7, SC2Campaign.HOTS)], SC2Mission.FIRE_IN_THE_SKY.area), + SC2Mission.OLD_SOLDIERS.mission_name: MissionInfo(SC2Mission.OLD_SOLDIERS, [MissionConnection(8, SC2Campaign.HOTS)], SC2Mission.OLD_SOLDIERS.area), + SC2Mission.WAKING_THE_ANCIENT.mission_name: MissionInfo(SC2Mission.WAKING_THE_ANCIENT, [MissionConnection(6, SC2Campaign.HOTS), MissionConnection(9, SC2Campaign.HOTS)], SC2Mission.WAKING_THE_ANCIENT.area, completion_critical=True, or_requirements=True), + SC2Mission.THE_CRUCIBLE.mission_name: MissionInfo(SC2Mission.THE_CRUCIBLE, [MissionConnection(10, SC2Campaign.HOTS)], SC2Mission.THE_CRUCIBLE.area, completion_critical=True), + SC2Mission.SUPREME.mission_name: MissionInfo(SC2Mission.SUPREME, [MissionConnection(11, SC2Campaign.HOTS)], SC2Mission.SUPREME.area, completion_critical=True), + SC2Mission.INFESTED.mission_name: MissionInfo(SC2Mission.INFESTED, [MissionConnection(6, SC2Campaign.HOTS), MissionConnection(9, SC2Campaign.HOTS), MissionConnection(12, SC2Campaign.HOTS)], SC2Mission.INFESTED.area), + SC2Mission.HAND_OF_DARKNESS.mission_name: MissionInfo(SC2Mission.HAND_OF_DARKNESS, [MissionConnection(13, SC2Campaign.HOTS)], SC2Mission.HAND_OF_DARKNESS.area), + SC2Mission.PHANTOMS_OF_THE_VOID.mission_name: MissionInfo(SC2Mission.PHANTOMS_OF_THE_VOID, [MissionConnection(14, SC2Campaign.HOTS)], SC2Mission.PHANTOMS_OF_THE_VOID.area), + SC2Mission.WITH_FRIENDS_LIKE_THESE.mission_name: MissionInfo(SC2Mission.WITH_FRIENDS_LIKE_THESE, [MissionConnection(6, SC2Campaign.HOTS), MissionConnection(9, SC2Campaign.HOTS), MissionConnection(12, SC2Campaign.HOTS)], SC2Mission.WITH_FRIENDS_LIKE_THESE.area), + SC2Mission.CONVICTION.mission_name: MissionInfo(SC2Mission.CONVICTION, [MissionConnection(16, SC2Campaign.HOTS)], SC2Mission.CONVICTION.area), + SC2Mission.PLANETFALL.mission_name: MissionInfo(SC2Mission.PLANETFALL, [MissionConnection(15, SC2Campaign.HOTS), MissionConnection(17, SC2Campaign.HOTS)], SC2Mission.PLANETFALL.area, completion_critical=True), + SC2Mission.DEATH_FROM_ABOVE.mission_name: MissionInfo(SC2Mission.DEATH_FROM_ABOVE, [MissionConnection(18, SC2Campaign.HOTS)], SC2Mission.DEATH_FROM_ABOVE.area, completion_critical=True), + SC2Mission.THE_RECKONING.mission_name: MissionInfo(SC2Mission.THE_RECKONING, [MissionConnection(19, SC2Campaign.HOTS)], SC2Mission.THE_RECKONING.area, completion_critical=True), + }, + SC2Campaign.PROLOGUE: { + SC2Mission.DARK_WHISPERS.mission_name: MissionInfo(SC2Mission.DARK_WHISPERS, [], SC2Mission.DARK_WHISPERS.area), + SC2Mission.GHOSTS_IN_THE_FOG.mission_name: MissionInfo(SC2Mission.GHOSTS_IN_THE_FOG, [MissionConnection(1, SC2Campaign.PROLOGUE)], SC2Mission.GHOSTS_IN_THE_FOG.area), + SC2Mission.EVIL_AWOKEN.mission_name: MissionInfo(SC2Mission.EVIL_AWOKEN, [MissionConnection(2, SC2Campaign.PROLOGUE)], SC2Mission.EVIL_AWOKEN.area) + }, + SC2Campaign.LOTV: { + SC2Mission.FOR_AIUR.mission_name: MissionInfo(SC2Mission.FOR_AIUR, [], SC2Mission.FOR_AIUR.area, completion_critical=True), + SC2Mission.THE_GROWING_SHADOW.mission_name: MissionInfo(SC2Mission.THE_GROWING_SHADOW, [MissionConnection(1, SC2Campaign.LOTV)], SC2Mission.THE_GROWING_SHADOW.area, completion_critical=True), + SC2Mission.THE_SPEAR_OF_ADUN.mission_name: MissionInfo(SC2Mission.THE_SPEAR_OF_ADUN, [MissionConnection(2, SC2Campaign.LOTV)], SC2Mission.THE_SPEAR_OF_ADUN.area, completion_critical=True), + SC2Mission.SKY_SHIELD.mission_name: MissionInfo(SC2Mission.SKY_SHIELD, [MissionConnection(3, SC2Campaign.LOTV)], SC2Mission.SKY_SHIELD.area, completion_critical=True), + SC2Mission.BROTHERS_IN_ARMS.mission_name: MissionInfo(SC2Mission.BROTHERS_IN_ARMS, [MissionConnection(4, SC2Campaign.LOTV)], SC2Mission.BROTHERS_IN_ARMS.area, completion_critical=True), + SC2Mission.AMON_S_REACH.mission_name: MissionInfo(SC2Mission.AMON_S_REACH, [MissionConnection(3, SC2Campaign.LOTV)], SC2Mission.AMON_S_REACH.area, completion_critical=True), + SC2Mission.LAST_STAND.mission_name: MissionInfo(SC2Mission.LAST_STAND, [MissionConnection(6, SC2Campaign.LOTV)], SC2Mission.LAST_STAND.area, completion_critical=True), + SC2Mission.FORBIDDEN_WEAPON.mission_name: MissionInfo(SC2Mission.FORBIDDEN_WEAPON, [MissionConnection(5, SC2Campaign.LOTV), MissionConnection(7, SC2Campaign.LOTV)], SC2Mission.FORBIDDEN_WEAPON.area, completion_critical=True, or_requirements=True), + SC2Mission.TEMPLE_OF_UNIFICATION.mission_name: MissionInfo(SC2Mission.TEMPLE_OF_UNIFICATION, [MissionConnection(5, SC2Campaign.LOTV), MissionConnection(7, SC2Campaign.LOTV), MissionConnection(8, SC2Campaign.LOTV)], SC2Mission.TEMPLE_OF_UNIFICATION.area, completion_critical=True), + SC2Mission.THE_INFINITE_CYCLE.mission_name: MissionInfo(SC2Mission.THE_INFINITE_CYCLE, [MissionConnection(9, SC2Campaign.LOTV)], SC2Mission.THE_INFINITE_CYCLE.area, completion_critical=True), + SC2Mission.HARBINGER_OF_OBLIVION.mission_name: MissionInfo(SC2Mission.HARBINGER_OF_OBLIVION, [MissionConnection(10, SC2Campaign.LOTV)], SC2Mission.HARBINGER_OF_OBLIVION.area, completion_critical=True), + SC2Mission.UNSEALING_THE_PAST.mission_name: MissionInfo(SC2Mission.UNSEALING_THE_PAST, [MissionConnection(11, SC2Campaign.LOTV)], SC2Mission.UNSEALING_THE_PAST.area, completion_critical=True), + SC2Mission.PURIFICATION.mission_name: MissionInfo(SC2Mission.PURIFICATION, [MissionConnection(12, SC2Campaign.LOTV)], SC2Mission.PURIFICATION.area, completion_critical=True), + SC2Mission.STEPS_OF_THE_RITE.mission_name: MissionInfo(SC2Mission.STEPS_OF_THE_RITE, [MissionConnection(11, SC2Campaign.LOTV)], SC2Mission.STEPS_OF_THE_RITE.area, completion_critical=True), + SC2Mission.RAK_SHIR.mission_name: MissionInfo(SC2Mission.RAK_SHIR, [MissionConnection(14, SC2Campaign.LOTV)], SC2Mission.RAK_SHIR.area, completion_critical=True), + SC2Mission.TEMPLAR_S_CHARGE.mission_name: MissionInfo(SC2Mission.TEMPLAR_S_CHARGE, [MissionConnection(13, SC2Campaign.LOTV), MissionConnection(15, SC2Campaign.LOTV)], SC2Mission.TEMPLAR_S_CHARGE.area, completion_critical=True, or_requirements=True), + SC2Mission.TEMPLAR_S_RETURN.mission_name: MissionInfo(SC2Mission.TEMPLAR_S_RETURN, [MissionConnection(13, SC2Campaign.LOTV), MissionConnection(15, SC2Campaign.LOTV), MissionConnection(16, SC2Campaign.LOTV)], SC2Mission.TEMPLAR_S_RETURN.area, completion_critical=True), + SC2Mission.THE_HOST.mission_name: MissionInfo(SC2Mission.THE_HOST, [MissionConnection(17, SC2Campaign.LOTV)], SC2Mission.THE_HOST.area, completion_critical=True), + SC2Mission.SALVATION.mission_name: MissionInfo(SC2Mission.SALVATION, [MissionConnection(18, SC2Campaign.LOTV)], SC2Mission.SALVATION.area, completion_critical=True), + }, + SC2Campaign.EPILOGUE: { + SC2Mission.INTO_THE_VOID.mission_name: MissionInfo(SC2Mission.INTO_THE_VOID, [MissionConnection(25, SC2Campaign.WOL), MissionConnection(20, SC2Campaign.HOTS), MissionConnection(19, SC2Campaign.LOTV)], SC2Mission.INTO_THE_VOID.area, completion_critical=True), + SC2Mission.THE_ESSENCE_OF_ETERNITY.mission_name: MissionInfo(SC2Mission.THE_ESSENCE_OF_ETERNITY, [MissionConnection(1, SC2Campaign.EPILOGUE)], SC2Mission.THE_ESSENCE_OF_ETERNITY.area, completion_critical=True), + SC2Mission.AMON_S_FALL.mission_name: MissionInfo(SC2Mission.AMON_S_FALL, [MissionConnection(2, SC2Campaign.EPILOGUE)], SC2Mission.AMON_S_FALL.area, completion_critical=True), + }, + SC2Campaign.NCO: { + SC2Mission.THE_ESCAPE.mission_name: MissionInfo(SC2Mission.THE_ESCAPE, [], SC2Mission.THE_ESCAPE.area, completion_critical=True), + SC2Mission.SUDDEN_STRIKE.mission_name: MissionInfo(SC2Mission.SUDDEN_STRIKE, [MissionConnection(1, SC2Campaign.NCO)], SC2Mission.SUDDEN_STRIKE.area, completion_critical=True), + SC2Mission.ENEMY_INTELLIGENCE.mission_name: MissionInfo(SC2Mission.ENEMY_INTELLIGENCE, [MissionConnection(2, SC2Campaign.NCO)], SC2Mission.ENEMY_INTELLIGENCE.area, completion_critical=True), + SC2Mission.TROUBLE_IN_PARADISE.mission_name: MissionInfo(SC2Mission.TROUBLE_IN_PARADISE, [MissionConnection(3, SC2Campaign.NCO)], SC2Mission.TROUBLE_IN_PARADISE.area, completion_critical=True), + SC2Mission.NIGHT_TERRORS.mission_name: MissionInfo(SC2Mission.NIGHT_TERRORS, [MissionConnection(4, SC2Campaign.NCO)], SC2Mission.NIGHT_TERRORS.area, completion_critical=True), + SC2Mission.FLASHPOINT.mission_name: MissionInfo(SC2Mission.FLASHPOINT, [MissionConnection(5, SC2Campaign.NCO)], SC2Mission.FLASHPOINT.area, completion_critical=True), + SC2Mission.IN_THE_ENEMY_S_SHADOW.mission_name: MissionInfo(SC2Mission.IN_THE_ENEMY_S_SHADOW, [MissionConnection(6, SC2Campaign.NCO)], SC2Mission.IN_THE_ENEMY_S_SHADOW.area, completion_critical=True), + SC2Mission.DARK_SKIES.mission_name: MissionInfo(SC2Mission.DARK_SKIES, [MissionConnection(7, SC2Campaign.NCO)], SC2Mission.DARK_SKIES.area, completion_critical=True), + SC2Mission.END_GAME.mission_name: MissionInfo(SC2Mission.END_GAME, [MissionConnection(8, SC2Campaign.NCO)], SC2Mission.END_GAME.area, completion_critical=True), + } +} + +lookup_id_to_mission: Dict[int, SC2Mission] = { + mission.id: mission for mission in SC2Mission +} + +lookup_name_to_mission: Dict[str, SC2Mission] = { + mission.mission_name: mission for mission in SC2Mission +} + +lookup_id_to_campaign: Dict[int, SC2Campaign] = { + campaign.id: campaign for campaign in SC2Campaign +} + + +campaign_mission_table: Dict[SC2Campaign, Set[SC2Mission]] = { + campaign: set() for campaign in SC2Campaign +} +for mission in SC2Mission: + campaign_mission_table[mission.campaign].add(mission) + + +def get_campaign_difficulty(campaign: SC2Campaign, excluded_missions: Iterable[SC2Mission] = ()) -> MissionPools: + """ + + :param campaign: + :param excluded_missions: + :return: Campaign's the most difficult non-excluded mission + """ + excluded_mission_set = set(excluded_missions) + included_missions = campaign_mission_table[campaign].difference(excluded_mission_set) + return max([mission.pool for mission in included_missions]) + + +def get_campaign_goal_priority(campaign: SC2Campaign, excluded_missions: Iterable[SC2Mission] = ()) -> SC2CampaignGoalPriority: + """ + Gets a modified campaign goal priority. + If all the campaign's goal missions are excluded, it's ineligible to have the goal + If the campaign's very hard missions are excluded, the priority is lowered to hard + :param campaign: + :param excluded_missions: + :return: + """ + if excluded_missions is None: + return campaign.goal_priority + else: + goal_missions = set(get_campaign_potential_goal_missions(campaign)) + excluded_mission_set = set(excluded_missions) + remaining_goals = goal_missions.difference(excluded_mission_set) + if remaining_goals == set(): + # All potential goals are excluded, the campaign can't be a goal + return SC2CampaignGoalPriority.NONE + elif campaign.goal_priority == SC2CampaignGoalPriority.VERY_HARD: + # Check if a very hard campaign doesn't get rid of it's last very hard mission + difficulty = get_campaign_difficulty(campaign, excluded_missions) + if difficulty == MissionPools.VERY_HARD: + return SC2CampaignGoalPriority.VERY_HARD + else: + return SC2CampaignGoalPriority.HARD + else: + return campaign.goal_priority + + +class SC2CampaignGoal(NamedTuple): + mission: SC2Mission + location: str + + +campaign_final_mission_locations: Dict[SC2Campaign, SC2CampaignGoal] = { + SC2Campaign.WOL: SC2CampaignGoal(SC2Mission.ALL_IN, "All-In: Victory"), + SC2Campaign.PROPHECY: SC2CampaignGoal(SC2Mission.IN_UTTER_DARKNESS, "In Utter Darkness: Kills"), + SC2Campaign.HOTS: None, + SC2Campaign.PROLOGUE: SC2CampaignGoal(SC2Mission.EVIL_AWOKEN, "Evil Awoken: Victory"), + SC2Campaign.LOTV: SC2CampaignGoal(SC2Mission.SALVATION, "Salvation: Victory"), + SC2Campaign.EPILOGUE: None, + SC2Campaign.NCO: None, +} + +campaign_alt_final_mission_locations: Dict[SC2Campaign, Dict[SC2Mission, str]] = { + SC2Campaign.WOL: { + SC2Mission.MAW_OF_THE_VOID: "Maw of the Void: Victory", + SC2Mission.ENGINE_OF_DESTRUCTION: "Engine of Destruction: Victory", + SC2Mission.SUPERNOVA: "Supernova: Victory", + SC2Mission.GATES_OF_HELL: "Gates of Hell: Victory", + SC2Mission.SHATTER_THE_SKY: "Shatter the Sky: Victory" + }, + SC2Campaign.PROPHECY: None, + SC2Campaign.HOTS: { + SC2Mission.THE_RECKONING: "The Reckoning: Victory", + SC2Mission.THE_CRUCIBLE: "The Crucible: Victory", + SC2Mission.HAND_OF_DARKNESS: "Hand of Darkness: Victory", + SC2Mission.PHANTOMS_OF_THE_VOID: "Phantoms of the Void: Victory", + SC2Mission.PLANETFALL: "Planetfall: Victory", + SC2Mission.DEATH_FROM_ABOVE: "Death From Above: Victory" + }, + SC2Campaign.PROLOGUE: { + SC2Mission.GHOSTS_IN_THE_FOG: "Ghosts in the Fog: Victory" + }, + SC2Campaign.LOTV: { + SC2Mission.THE_HOST: "The Host: Victory", + SC2Mission.TEMPLAR_S_CHARGE: "Templar's Charge: Victory" + }, + SC2Campaign.EPILOGUE: { + SC2Mission.AMON_S_FALL: "Amon's Fall: Victory", + SC2Mission.INTO_THE_VOID: "Into the Void: Victory", + SC2Mission.THE_ESSENCE_OF_ETERNITY: "The Essence of Eternity: Victory", + }, + SC2Campaign.NCO: { + SC2Mission.END_GAME: "End Game: Victory", + SC2Mission.FLASHPOINT: "Flashpoint: Victory", + SC2Mission.DARK_SKIES: "Dark Skies: Victory", + SC2Mission.NIGHT_TERRORS: "Night Terrors: Victory", + SC2Mission.TROUBLE_IN_PARADISE: "Trouble In Paradise: Victory" + } +} + +campaign_race_exceptions: Dict[SC2Mission, SC2Race] = { + SC2Mission.WITH_FRIENDS_LIKE_THESE: SC2Race.TERRAN +} + + +def get_goal_location(mission: SC2Mission) -> Union[str, None]: + """ + + :param mission: + :return: Goal location assigned to the goal mission + """ + campaign = mission.campaign + primary_campaign_goal = campaign_final_mission_locations[campaign] + if primary_campaign_goal is not None: + if primary_campaign_goal.mission == mission: + return primary_campaign_goal.location + + campaign_alt_goals = campaign_alt_final_mission_locations[campaign] + if campaign_alt_goals is not None: + return campaign_alt_goals.get(mission) + + return None + + +def get_campaign_potential_goal_missions(campaign: SC2Campaign) -> List[SC2Mission]: + """ + + :param campaign: + :return: All missions that can be the campaign's goal + """ + missions: List[SC2Mission] = list() + primary_goal_mission = campaign_final_mission_locations[campaign] + if primary_goal_mission is not None: + missions.append(primary_goal_mission.mission) + alt_goal_locations = campaign_alt_final_mission_locations[campaign] + if alt_goal_locations is not None: + for mission in alt_goal_locations.keys(): + missions.append(mission) + + return missions + + +def get_no_build_missions() -> List[SC2Mission]: + return [mission for mission in SC2Mission if not mission.build] diff --git a/worlds/sc2/Options.py b/worlds/sc2/Options.py new file mode 100644 index 000000000000..88febb7096ef --- /dev/null +++ b/worlds/sc2/Options.py @@ -0,0 +1,908 @@ +from dataclasses import dataclass, fields, Field +from typing import FrozenSet, Union, Set + +from Options import Choice, Toggle, DefaultOnToggle, ItemSet, OptionSet, Range, PerGameCommonOptions +from .MissionTables import SC2Campaign, SC2Mission, lookup_name_to_mission, MissionPools, get_no_build_missions, \ + campaign_mission_table +from worlds.AutoWorld import World + + +class GameDifficulty(Choice): + """ + The difficulty of the campaign, affects enemy AI, starting units, and game speed. + + For those unfamiliar with the Archipelago randomizer, the recommended settings are one difficulty level + lower than the vanilla game + """ + display_name = "Game Difficulty" + option_casual = 0 + option_normal = 1 + option_hard = 2 + option_brutal = 3 + default = 1 + + +class GameSpeed(Choice): + """Optional setting to override difficulty-based game speed.""" + display_name = "Game Speed" + option_default = 0 + option_slower = 1 + option_slow = 2 + option_normal = 3 + option_fast = 4 + option_faster = 5 + default = option_default + + +class DisableForcedCamera(Toggle): + """ + Prevents the game from moving or locking the camera without the player's consent. + """ + display_name = "Disable Forced Camera Movement" + + +class SkipCutscenes(Toggle): + """ + Skips all cutscenes and prevents dialog from blocking progress. + """ + display_name = "Skip Cutscenes" + + +class AllInMap(Choice): + """Determines what version of All-In (WoL final map) that will be generated for the campaign.""" + display_name = "All In Map" + option_ground = 0 + option_air = 1 + + +class MissionOrder(Choice): + """ + Determines the order the missions are played in. The last three mission orders end in a random mission. + Vanilla (83 total if all campaigns enabled): Keeps the standard mission order and branching from the vanilla Campaigns. + Vanilla Shuffled (83 total if all campaigns enabled): Keeps same branching paths from the vanilla Campaigns but randomizes the order of missions within. + Mini Campaign (47 total if all campaigns enabled): Shorter version of the campaign with randomized missions and optional branches. + Medium Grid (16): A 4x4 grid of random missions. Start at the top-left and forge a path towards bottom-right mission to win. + Mini Grid (9): A 3x3 version of Grid. Complete the bottom-right mission to win. + Blitz (12): 12 random missions that open up very quickly. Complete the bottom-right mission to win. + Gauntlet (7): Linear series of 7 random missions to complete the campaign. + Mini Gauntlet (4): Linear series of 4 random missions to complete the campaign. + Tiny Grid (4): A 2x2 version of Grid. Complete the bottom-right mission to win. + Grid (variable): A grid that will resize to use all non-excluded missions. Corners may be omitted to make the grid more square. Complete the bottom-right mission to win. + """ + display_name = "Mission Order" + option_vanilla = 0 + option_vanilla_shuffled = 1 + option_mini_campaign = 2 + option_medium_grid = 3 + option_mini_grid = 4 + option_blitz = 5 + option_gauntlet = 6 + option_mini_gauntlet = 7 + option_tiny_grid = 8 + option_grid = 9 + + +class MaximumCampaignSize(Range): + """ + Sets an upper bound on how many missions to include when a variable-size mission order is selected. + If a set-size mission order is selected, does nothing. + """ + display_name = "Maximum Campaign Size" + range_start = 1 + range_end = 83 + default = 83 + + +class GridTwoStartPositions(Toggle): + """ + If turned on and 'grid' mission order is selected, removes a mission from the starting + corner sets the adjacent two missions as the starter missions. + """ + display_name = "Start with two unlocked missions on grid" + default = Toggle.option_false + + +class ColorChoice(Choice): + option_white = 0 + option_red = 1 + option_blue = 2 + option_teal = 3 + option_purple = 4 + option_yellow = 5 + option_orange = 6 + option_green = 7 + option_light_pink = 8 + option_violet = 9 + option_light_grey = 10 + option_dark_green = 11 + option_brown = 12 + option_light_green = 13 + option_dark_grey = 14 + option_pink = 15 + option_rainbow = 16 + option_default = 17 + default = option_default + + +class PlayerColorTerranRaynor(ColorChoice): + """Determines in-game team color for playable Raynor's Raiders (Terran) factions.""" + display_name = "Terran Player Color (Raynor)" + + +class PlayerColorProtoss(ColorChoice): + """Determines in-game team color for playable Protoss factions.""" + display_name = "Protoss Player Color" + + +class PlayerColorZerg(ColorChoice): + """Determines in-game team color for playable Zerg factions before Kerrigan becomes Primal Kerrigan.""" + display_name = "Zerg Player Color" + + +class PlayerColorZergPrimal(ColorChoice): + """Determines in-game team color for playable Zerg factions after Kerrigan becomes Primal Kerrigan.""" + display_name = "Zerg Player Color (Primal)" + + +class EnableWolMissions(DefaultOnToggle): + """ + Enables missions from main Wings of Liberty campaign. + """ + display_name = "Enable Wings of Liberty missions" + + +class EnableProphecyMissions(DefaultOnToggle): + """ + Enables missions from Prophecy mini-campaign. + """ + display_name = "Enable Prophecy missions" + + +class EnableHotsMissions(DefaultOnToggle): + """ + Enables missions from Heart of the Swarm campaign. + """ + display_name = "Enable Heart of the Swarm missions" + + +class EnableLotVPrologueMissions(DefaultOnToggle): + """ + Enables missions from Prologue campaign. + """ + display_name = "Enable Prologue (Legacy of the Void) missions" + + +class EnableLotVMissions(DefaultOnToggle): + """ + Enables missions from Legacy of the Void campaign. + """ + display_name = "Enable Legacy of the Void (main campaign) missions" + + +class EnableEpilogueMissions(DefaultOnToggle): + """ + Enables missions from Epilogue campaign. + These missions are considered very hard. + + Enabling Wings of Liberty, Heart of the Swarm and Legacy of the Void is strongly recommended in order to play Epilogue. + Not recommended for short mission orders. + See also: Exclude Very Hard Missions + """ + display_name = "Enable Epilogue missions" + + +class EnableNCOMissions(DefaultOnToggle): + """ + Enables missions from Nova Covert Ops campaign. + + Note: For best gameplay experience it's recommended to also enable Wings of Liberty campaign. + """ + display_name = "Enable Nova Covert Ops missions" + + +class ShuffleCampaigns(DefaultOnToggle): + """ + Shuffles the missions between campaigns if enabled. + Only available for Vanilla Shuffled and Mini Campaign mission order + """ + display_name = "Shuffle Campaigns" + + +class ShuffleNoBuild(DefaultOnToggle): + """ + Determines if the no-build missions are included in the shuffle. + If turned off, the no-build missions will not appear. Has no effect for Vanilla mission order. + """ + display_name = "Shuffle No-Build Missions" + + +class StarterUnit(Choice): + """ + Unlocks a random unit at the start of the game. + + Off: No units are provided, the first unit must be obtained from the randomizer + Balanced: A unit that doesn't give the player too much power early on is given + Any Starter Unit: Any starter unit can be given + """ + display_name = "Starter Unit" + option_off = 0 + option_balanced = 1 + option_any_starter_unit = 2 + + +class RequiredTactics(Choice): + """ + Determines the maximum tactical difficulty of the world (separate from mission difficulty). Higher settings + increase randomness. + + Standard: All missions can be completed with good micro and macro. + Advanced: Completing missions may require relying on starting units and micro-heavy units. + No Logic: Units and upgrades may be placed anywhere. LIKELY TO RENDER THE RUN IMPOSSIBLE ON HARDER DIFFICULTIES! + Locks Grant Story Tech option to true. + """ + display_name = "Required Tactics" + option_standard = 0 + option_advanced = 1 + option_no_logic = 2 + + +class GenericUpgradeMissions(Range): + """Determines the percentage of missions in the mission order that must be completed before + level 1 of all weapon and armor upgrades is unlocked. Level 2 upgrades require double the amount of missions, + and level 3 requires triple the amount. The required amounts are always rounded down. + If set to 0, upgrades are instead added to the item pool and must be found to be used.""" + display_name = "Generic Upgrade Missions" + range_start = 0 + range_end = 100 + default = 0 + + +class GenericUpgradeResearch(Choice): + """Determines how weapon and armor upgrades affect missions once unlocked. + + Vanilla: Upgrades must be researched as normal. + Auto In No-Build: In No-Build missions, upgrades are automatically researched. + In all other missions, upgrades must be researched as normal. + Auto In Build: In No-Build missions, upgrades are unavailable as normal. + In all other missions, upgrades are automatically researched. + Always Auto: Upgrades are automatically researched in all missions.""" + display_name = "Generic Upgrade Research" + option_vanilla = 0 + option_auto_in_no_build = 1 + option_auto_in_build = 2 + option_always_auto = 3 + + +class GenericUpgradeItems(Choice): + """Determines how weapon and armor upgrades are split into items. All options produce 3 levels of each item. + Does nothing if upgrades are unlocked by completed mission counts. + + Individual Items: All weapon and armor upgrades are each an item, + resulting in 18 total upgrade items for Terran and 15 total items for Zerg and Protoss each. + Bundle Weapon And Armor: All types of weapon upgrades are one item per race, + and all types of armor upgrades are one item per race, + resulting in 18 total items. + Bundle Unit Class: Weapon and armor upgrades are merged, + but upgrades are bundled separately for each race: + Infantry, Vehicle, and Starship upgrades for Terran (9 items), + Ground and Flyer upgrades for Zerg (6 items), + Ground and Air upgrades for Protoss (6 items), + resulting in 21 total items. + Bundle All: All weapon and armor upgrades are one item per race, + resulting in 9 total items.""" + display_name = "Generic Upgrade Items" + option_individual_items = 0 + option_bundle_weapon_and_armor = 1 + option_bundle_unit_class = 2 + option_bundle_all = 3 + + +class NovaCovertOpsItems(Toggle): + """ + If turned on, the equipment upgrades from Nova Covert Ops may be present in the world. + + If Nova Covert Ops campaign is enabled, this option is locked to be turned on. + """ + display_name = "Nova Covert Ops Items" + default = Toggle.option_true + + +class BroodWarItems(Toggle): + """If turned on, returning items from StarCraft: Brood War may appear in the world.""" + display_name = "Brood War Items" + default = Toggle.option_true + + +class ExtendedItems(Toggle): + """If turned on, original items that did not appear in Campaign mode may appear in the world.""" + display_name = "Extended Items" + default = Toggle.option_true + + +# Current maximum number of upgrades for a unit +MAX_UPGRADES_OPTION = 12 + + +class EnsureGenericItems(Range): + """ + Specifies a minimum percentage of the generic item pool that will be present for the slot. + The generic item pool is the pool of all generically useful items after all exclusions. + Generically-useful items include: Worker upgrades, Building upgrades, economy upgrades, + Mercenaries, Kerrigan levels and abilities, and Spear of Adun abilities + Increasing this percentage will make units less common. + """ + display_name = "Ensure Generic Items" + range_start = 0 + range_end = 100 + default = 25 + + +class MinNumberOfUpgrades(Range): + """ + Set a minimum to the number of upgrades a unit/structure can have. + Note that most units have 4 or 6 upgrades. + If a unit has fewer upgrades than the minimum, it will have all of its upgrades. + + Doesn't affect shared unit upgrades. + """ + display_name = "Minimum number of upgrades per unit/structure" + range_start = 0 + range_end = MAX_UPGRADES_OPTION + default = 2 + + +class MaxNumberOfUpgrades(Range): + """ + Set a maximum to the number of upgrades a unit/structure can have. -1 is used to define unlimited. + Note that most unit have 4 to 6 upgrades. + + Doesn't affect shared unit upgrades. + """ + display_name = "Maximum number of upgrades per unit/structure" + range_start = -1 + range_end = MAX_UPGRADES_OPTION + default = -1 + + +class KerriganPresence(Choice): + """ + Determines whether Kerrigan is playable outside of missions that require her. + + Vanilla: Kerrigan is playable as normal, appears in the same missions as in vanilla game. + Not Present: Kerrigan is not playable, unless the mission requires her to be present. Other hero units stay playable, + and locations normally requiring Kerrigan can be checked by any unit. + Kerrigan level items, active abilities and passive abilities affecting her will not appear. + In missions where the Kerrigan unit is required, story abilities are given in same way as Grant Story Tech is set to true + Not Present And No Passives: In addition to the above, Kerrigan's passive abilities affecting other units (such as Twin Drones) will not appear. + + Note: Always set to "Not Present" if Heart of the Swarm campaign is disabled. + """ + display_name = "Kerrigan Presence" + option_vanilla = 0 + option_not_present = 1 + option_not_present_and_no_passives = 2 + + +class KerriganLevelsPerMissionCompleted(Range): + """ + Determines how many levels Kerrigan gains when a mission is beaten. + + NOTE: Setting this too low can result in generation failures if The Infinite Cycle or Supreme are in the mission pool. + """ + display_name = "Levels Per Mission Beaten" + range_start = 0 + range_end = 20 + default = 0 + + +class KerriganLevelsPerMissionCompletedCap(Range): + """ + Limits how many total levels Kerrigan can gain from beating missions. This does not affect levels gained from items. + Set to -1 to disable this limit. + + NOTE: The following missions have these level requirements: + Supreme: 35 + The Infinite Cycle: 70 + See Grant Story Levels for more details. + """ + display_name = "Levels Per Mission Beaten Cap" + range_start = -1 + range_end = 140 + default = -1 + + +class KerriganLevelItemSum(Range): + """ + Determines the sum of the level items in the world. This does not affect levels gained from beating missions. + + NOTE: The following missions have these level requirements: + Supreme: 35 + The Infinite Cycle: 70 + See Grant Story Levels for more details. + """ + display_name = "Kerrigan Level Item Sum" + range_start = 0 + range_end = 140 + default = 70 + + +class KerriganLevelItemDistribution(Choice): + """Determines the amount and size of Kerrigan level items. + + Vanilla: Uses the distribution in the vanilla campaign. + This entails 32 individual levels and 6 packs of varying sizes. + This distribution always adds up to 70, ignoring the Level Item Sum setting. + Smooth: Uses a custom, condensed distribution of 10 items between sizes 4 and 10, + intended to fit more levels into settings with little room for filler while keeping some variance in level gains. + This distribution always adds up to 70, ignoring the Level Item Sum setting. + Size 70: Uses items worth 70 levels each. + Size 35: Uses items worth 35 levels each. + Size 14: Uses items worth 14 levels each. + Size 10: Uses items worth 10 levels each. + Size 7: Uses items worth 7 levels each. + Size 5: Uses items worth 5 levels each. + Size 2: Uses items worth 2 level eachs. + Size 1: Uses individual levels. As there are not enough locations in the game for this distribution, + this will result in a greatly reduced total level, and is likely to remove many other items.""" + display_name = "Kerrigan Level Item Distribution" + option_vanilla = 0 + option_smooth = 1 + option_size_70 = 2 + option_size_35 = 3 + option_size_14 = 4 + option_size_10 = 5 + option_size_7 = 6 + option_size_5 = 7 + option_size_2 = 8 + option_size_1 = 9 + default = option_smooth + + +class KerriganTotalLevelCap(Range): + """ + Limits how many total levels Kerrigan can gain from any source. Depending on your other settings, + there may be more levels available in the world, but they will not affect Kerrigan. + Set to -1 to disable this limit. + + NOTE: The following missions have these level requirements: + Supreme: 35 + The Infinite Cycle: 70 + See Grant Story Levels for more details. + """ + display_name = "Total Level Cap" + range_start = -1 + range_end = 140 + default = -1 + + +class StartPrimaryAbilities(Range): + """Number of Primary Abilities (Kerrigan Tier 1, 2, and 4) to start the game with. + If set to 4, a Tier 7 ability is also included.""" + display_name = "Starting Primary Abilities" + range_start = 0 + range_end = 4 + default = 0 + + +class KerriganPrimalStatus(Choice): + """Determines when Kerrigan appears in her Primal Zerg form. + This greatly increases her energy regeneration. + + Vanilla: Kerrigan is human in missions that canonically appear before The Crucible, + and zerg thereafter. + Always Zerg: Kerrigan is always zerg. + Always Human: Kerrigan is always human. + Level 35: Kerrigan is human until reaching level 35, and zerg thereafter. + Half Completion: Kerrigan is human until half of the missions in the world are completed, + and zerg thereafter. + Item: Kerrigan's Primal Form is an item. She is human until it is found, and zerg thereafter.""" + display_name = "Kerrigan Primal Status" + option_vanilla = 0 + option_always_zerg = 1 + option_always_human = 2 + option_level_35 = 3 + option_half_completion = 4 + option_item = 5 + + +class SpearOfAdunPresence(Choice): + """ + Determines in which missions Spear of Adun calldowns will be available. + Affects only abilities used from Spear of Adun top menu. + + Not Present: Spear of Adun calldowns are unavailable. + LotV Protoss: Spear of Adun calldowns are only available in LotV main campaign + Protoss: Spear od Adun calldowns are available in any Protoss mission + Everywhere: Spear od Adun calldowns are available in any mission of any race + """ + display_name = "Spear of Adun Presence" + option_not_present = 0 + option_lotv_protoss = 1 + option_protoss = 2 + option_everywhere = 3 + default = option_lotv_protoss + + # Fix case + @classmethod + def get_option_name(cls, value: int) -> str: + if value == SpearOfAdunPresence.option_lotv_protoss: + return "LotV Protoss" + else: + return super().get_option_name(value) + + +class SpearOfAdunPresentInNoBuild(Toggle): + """ + Determines if Spear of Adun calldowns are available in no-build missions. + + If turned on, Spear of Adun calldown powers are available in missions specified under "Spear of Adun Presence". + If turned off, Spear of Adun calldown powers are unavailable in all no-build missions + """ + display_name = "Spear of Adun Present in No-Build" + + +class SpearOfAdunAutonomouslyCastAbilityPresence(Choice): + """ + Determines availability of Spear of Adun powers, that are autonomously cast. + Affects abilities like Reconstruction Beam or Overwatch + + Not Presents: Autocasts are not available. + LotV Protoss: Spear of Adun autocasts are only available in LotV main campaign + Protoss: Spear od Adun autocasts are available in any Protoss mission + Everywhere: Spear od Adun autocasts are available in any mission of any race + """ + display_name = "Spear of Adun Autonomously Cast Powers Presence" + option_not_present = 0 + option_lotv_protoss = 1 + option_protoss = 2 + option_everywhere = 3 + default = option_lotv_protoss + + # Fix case + @classmethod + def get_option_name(cls, value: int) -> str: + if value == SpearOfAdunPresence.option_lotv_protoss: + return "LotV Protoss" + else: + return super().get_option_name(value) + + +class SpearOfAdunAutonomouslyCastPresentInNoBuild(Toggle): + """ + Determines if Spear of Adun autocasts are available in no-build missions. + + If turned on, Spear of Adun autocasts are available in missions specified under "Spear of Adun Autonomously Cast Powers Presence". + If turned off, Spear of Adun autocasts are unavailable in all no-build missions + """ + display_name = "Spear of Adun Autonomously Cast Powers Present in No-Build" + + +class GrantStoryTech(Toggle): + """ + If set true, grants special tech required for story mission completion for duration of the mission. + Otherwise, you need to find these tech by a normal means as items. + Affects story missions like Back in the Saddle and Supreme + + Locked to true if Required Tactics is set to no logic. + """ + display_name = "Grant Story Tech" + + +class GrantStoryLevels(Choice): + """ + If enabled, grants Kerrigan the required minimum levels for the following missions: + Supreme: 35 + The Infinite Cycle: 70 + The bonus levels only apply during the listed missions, and can exceed the Total Level Cap. + + If disabled, either of these missions is included, and there are not enough levels in the world, generation may fail. + To prevent this, either increase the amount of levels in the world, or enable this option. + + If disabled and Required Tactics is set to no logic, this option is forced to Minimum. + + Disabled: Kerrigan does not get bonus levels for these missions, + instead the levels must be gained from items or beating missions. + Additive: Kerrigan gains bonus levels equal to the mission's required level. + Minimum: Kerrigan is either at her real level, or at the mission's required level, + depending on which is higher. + """ + display_name = "Grant Story Levels" + option_disabled = 0 + option_additive = 1 + option_minimum = 2 + default = option_minimum + + +class TakeOverAIAllies(Toggle): + """ + On maps supporting this feature allows you to take control over an AI Ally. + """ + display_name = "Take Over AI Allies" + + +class LockedItems(ItemSet): + """Guarantees that these items will be unlockable""" + display_name = "Locked Items" + + +class ExcludedItems(ItemSet): + """Guarantees that these items will not be unlockable""" + display_name = "Excluded Items" + + +class ExcludedMissions(OptionSet): + """Guarantees that these missions will not appear in the campaign + Doesn't apply to vanilla mission order. + It may be impossible to build a valid campaign if too many missions are excluded.""" + display_name = "Excluded Missions" + valid_keys = {mission.mission_name for mission in SC2Mission} + + +class ExcludeVeryHardMissions(Choice): + """ + Excludes Very Hard missions outside of Epilogue campaign (All-In, Salvation, and all Epilogue missions are considered Very Hard). + Doesn't apply to "Vanilla" mission order. + + Default: Not excluded for mission orders "Vanilla Shuffled" or "Grid" with Maximum Campaign Size >= 20, + excluded for any other order + Yes: Non-Epilogue Very Hard missions are excluded and won't be generated + No: Non-Epilogue Very Hard missions can appear normally. Not recommended for too short mission orders. + + See also: Excluded Missions, Enable Epilogue Missions, Maximum Campaign Size + """ + display_name = "Exclude Very Hard Missions" + option_default = 0 + option_true = 1 + option_false = 2 + + @classmethod + def get_option_name(cls, value): + return ["Default", "Yes", "No"][int(value)] + + +class LocationInclusion(Choice): + option_enabled = 0 + option_resources = 1 + option_disabled = 2 + + +class VanillaLocations(LocationInclusion): + """ + Enables or disables item rewards for completing vanilla objectives. + Vanilla objectives are bonus objectives from the vanilla game, + along with some additional objectives to balance the missions. + Enable these locations for a balanced experience. + + Enabled: All locations fitting into this do their normal rewards + Resources: Forces these locations to contain Starting Resources + Disabled: Removes item rewards from these locations. + + Note: Individual locations subject to plando are always enabled, so the plando can be placed properly. + See also: Excluded Locations, Item Plando (https://archipelago.gg/tutorial/Archipelago/plando/en#item-plando) + """ + display_name = "Vanilla Locations" + + +class ExtraLocations(LocationInclusion): + """ + Enables or disables item rewards for mission progress and minor objectives. + This includes mandatory mission objectives, + collecting reinforcements and resource pickups, + destroying structures, and overcoming minor challenges. + Enables these locations to add more checks and items to your world. + + Enabled: All locations fitting into this do their normal rewards + Resources: Forces these locations to contain Starting Resources + Disabled: Removes item rewards from these locations. + + Note: Individual locations subject to plando are always enabled, so the plando can be placed properly. + See also: Excluded Locations, Item Plando (https://archipelago.gg/tutorial/Archipelago/plando/en#item-plando) + """ + display_name = "Extra Locations" + + +class ChallengeLocations(LocationInclusion): + """ + Enables or disables item rewards for completing challenge tasks. + Challenges are tasks that are more difficult than completing the mission, and are often based on achievements. + You might be required to visit the same mission later after getting stronger in order to finish these tasks. + Enable these locations to increase the difficulty of completing the multiworld. + + Enabled: All locations fitting into this do their normal rewards + Resources: Forces these locations to contain Starting Resources + Disabled: Removes item rewards from these locations. + + Note: Individual locations subject to plando are always enabled, so the plando can be placed properly. + See also: Excluded Locations, Item Plando (https://archipelago.gg/tutorial/Archipelago/plando/en#item-plando) + """ + display_name = "Challenge Locations" + + +class MasteryLocations(LocationInclusion): + """ + Enables or disables item rewards for overcoming especially difficult challenges. + These challenges are often based on Mastery achievements and Feats of Strength. + Enable these locations to add the most difficult checks to the world. + + Enabled: All locations fitting into this do their normal rewards + Resources: Forces these locations to contain Starting Resources + Disabled: Removes item rewards from these locations. + + Note: Individual locations subject to plando are always enabled, so the plando can be placed properly. + See also: Excluded Locations, Item Plando (https://archipelago.gg/tutorial/Archipelago/plando/en#item-plando) + """ + display_name = "Mastery Locations" + + +class MineralsPerItem(Range): + """ + Configures how many minerals are given per resource item. + """ + display_name = "Minerals Per Item" + range_start = 0 + range_end = 500 + default = 25 + + +class VespenePerItem(Range): + """ + Configures how much vespene gas is given per resource item. + """ + display_name = "Vespene Per Item" + range_start = 0 + range_end = 500 + default = 25 + + +class StartingSupplyPerItem(Range): + """ + Configures how much starting supply per is given per item. + """ + display_name = "Starting Supply Per Item" + range_start = 0 + range_end = 200 + default = 5 + + +@dataclass +class Starcraft2Options(PerGameCommonOptions): + game_difficulty: GameDifficulty + game_speed: GameSpeed + disable_forced_camera: DisableForcedCamera + skip_cutscenes: SkipCutscenes + all_in_map: AllInMap + mission_order: MissionOrder + maximum_campaign_size: MaximumCampaignSize + grid_two_start_positions: GridTwoStartPositions + player_color_terran_raynor: PlayerColorTerranRaynor + player_color_protoss: PlayerColorProtoss + player_color_zerg: PlayerColorZerg + player_color_zerg_primal: PlayerColorZergPrimal + enable_wol_missions: EnableWolMissions + enable_prophecy_missions: EnableProphecyMissions + enable_hots_missions: EnableHotsMissions + enable_lotv_prologue_missions: EnableLotVPrologueMissions + enable_lotv_missions: EnableLotVMissions + enable_epilogue_missions: EnableEpilogueMissions + enable_nco_missions: EnableNCOMissions + shuffle_campaigns: ShuffleCampaigns + shuffle_no_build: ShuffleNoBuild + starter_unit: StarterUnit + required_tactics: RequiredTactics + ensure_generic_items: EnsureGenericItems + min_number_of_upgrades: MinNumberOfUpgrades + max_number_of_upgrades: MaxNumberOfUpgrades + generic_upgrade_missions: GenericUpgradeMissions + generic_upgrade_research: GenericUpgradeResearch + generic_upgrade_items: GenericUpgradeItems + kerrigan_presence: KerriganPresence + kerrigan_levels_per_mission_completed: KerriganLevelsPerMissionCompleted + kerrigan_levels_per_mission_completed_cap: KerriganLevelsPerMissionCompletedCap + kerrigan_level_item_sum: KerriganLevelItemSum + kerrigan_level_item_distribution: KerriganLevelItemDistribution + kerrigan_total_level_cap: KerriganTotalLevelCap + start_primary_abilities: StartPrimaryAbilities + kerrigan_primal_status: KerriganPrimalStatus + spear_of_adun_presence: SpearOfAdunPresence + spear_of_adun_present_in_no_build: SpearOfAdunPresentInNoBuild + spear_of_adun_autonomously_cast_ability_presence: SpearOfAdunAutonomouslyCastAbilityPresence + spear_of_adun_autonomously_cast_present_in_no_build: SpearOfAdunAutonomouslyCastPresentInNoBuild + grant_story_tech: GrantStoryTech + grant_story_levels: GrantStoryLevels + take_over_ai_allies: TakeOverAIAllies + locked_items: LockedItems + excluded_items: ExcludedItems + excluded_missions: ExcludedMissions + exclude_very_hard_missions: ExcludeVeryHardMissions + nco_items: NovaCovertOpsItems + bw_items: BroodWarItems + ext_items: ExtendedItems + vanilla_locations: VanillaLocations + extra_locations: ExtraLocations + challenge_locations: ChallengeLocations + mastery_locations: MasteryLocations + minerals_per_item: MineralsPerItem + vespene_per_item: VespenePerItem + starting_supply_per_item: StartingSupplyPerItem + + +def get_option_value(world: World, name: str) -> Union[int, FrozenSet]: + if world is None: + field: Field = [class_field for class_field in fields(Starcraft2Options) if class_field.name == name][0] + return field.type.default + + player_option = getattr(world.options, name) + + return player_option.value + + +def get_enabled_campaigns(world: World) -> Set[SC2Campaign]: + enabled_campaigns = set() + if get_option_value(world, "enable_wol_missions"): + enabled_campaigns.add(SC2Campaign.WOL) + if get_option_value(world, "enable_prophecy_missions"): + enabled_campaigns.add(SC2Campaign.PROPHECY) + if get_option_value(world, "enable_hots_missions"): + enabled_campaigns.add(SC2Campaign.HOTS) + if get_option_value(world, "enable_lotv_prologue_missions"): + enabled_campaigns.add(SC2Campaign.PROLOGUE) + if get_option_value(world, "enable_lotv_missions"): + enabled_campaigns.add(SC2Campaign.LOTV) + if get_option_value(world, "enable_epilogue_missions"): + enabled_campaigns.add(SC2Campaign.EPILOGUE) + if get_option_value(world, "enable_nco_missions"): + enabled_campaigns.add(SC2Campaign.NCO) + return enabled_campaigns + + +def get_disabled_campaigns(world: World) -> Set[SC2Campaign]: + all_campaigns = set(SC2Campaign) + enabled_campaigns = get_enabled_campaigns(world) + disabled_campaigns = all_campaigns.difference(enabled_campaigns) + disabled_campaigns.remove(SC2Campaign.GLOBAL) + return disabled_campaigns + + +def get_excluded_missions(world: World) -> Set[SC2Mission]: + mission_order_type = get_option_value(world, "mission_order") + excluded_mission_names = get_option_value(world, "excluded_missions") + shuffle_no_build = get_option_value(world, "shuffle_no_build") + disabled_campaigns = get_disabled_campaigns(world) + + excluded_missions: Set[SC2Mission] = set([lookup_name_to_mission[name] for name in excluded_mission_names]) + + # Excluding Very Hard missions depending on options + if (get_option_value(world, "exclude_very_hard_missions") == ExcludeVeryHardMissions.option_true + ) or ( + get_option_value(world, "exclude_very_hard_missions") == ExcludeVeryHardMissions.option_default + and ( + mission_order_type not in [MissionOrder.option_vanilla_shuffled, MissionOrder.option_grid] + or ( + mission_order_type == MissionOrder.option_grid + and get_option_value(world, "maximum_campaign_size") < 20 + ) + ) + ): + excluded_missions = excluded_missions.union( + [mission for mission in SC2Mission if + mission.pool == MissionPools.VERY_HARD and mission.campaign != SC2Campaign.EPILOGUE] + ) + # Omitting No-Build missions if not shuffling no-build + if not shuffle_no_build: + excluded_missions = excluded_missions.union(get_no_build_missions()) + # Omitting missions not in enabled campaigns + for campaign in disabled_campaigns: + excluded_missions = excluded_missions.union(campaign_mission_table[campaign]) + + return excluded_missions + + +campaign_depending_orders = [ + MissionOrder.option_vanilla, + MissionOrder.option_vanilla_shuffled, + MissionOrder.option_mini_campaign +] + +kerrigan_unit_available = [ + KerriganPresence.option_vanilla, +] \ No newline at end of file diff --git a/worlds/sc2/PoolFilter.py b/worlds/sc2/PoolFilter.py new file mode 100644 index 000000000000..5f8151ed399f --- /dev/null +++ b/worlds/sc2/PoolFilter.py @@ -0,0 +1,595 @@ +from typing import Callable, Dict, List, Set, Union, Tuple +from BaseClasses import Item, Location +from .Items import get_full_item_list, spider_mine_sources, second_pass_placeable_items, progressive_if_nco, \ + progressive_if_ext, spear_of_adun_calldowns, spear_of_adun_castable_passives, nova_equipment +from .MissionTables import mission_orders, MissionInfo, MissionPools, \ + get_campaign_goal_priority, campaign_final_mission_locations, campaign_alt_final_mission_locations, \ + SC2Campaign, SC2Race, SC2CampaignGoalPriority, SC2Mission +from .Options import get_option_value, MissionOrder, \ + get_enabled_campaigns, get_disabled_campaigns, RequiredTactics, kerrigan_unit_available, GrantStoryTech, \ + TakeOverAIAllies, SpearOfAdunPresence, SpearOfAdunAutonomouslyCastAbilityPresence, campaign_depending_orders, \ + ShuffleCampaigns, get_excluded_missions, ShuffleNoBuild, ExtraLocations, GrantStoryLevels +from . import ItemNames +from worlds.AutoWorld import World + +# Items with associated upgrades +UPGRADABLE_ITEMS = {item.parent_item for item in get_full_item_list().values() if item.parent_item} + +BARRACKS_UNITS = { + ItemNames.MARINE, ItemNames.MEDIC, ItemNames.FIREBAT, ItemNames.MARAUDER, + ItemNames.REAPER, ItemNames.GHOST, ItemNames.SPECTRE, ItemNames.HERC, +} +FACTORY_UNITS = { + ItemNames.HELLION, ItemNames.VULTURE, ItemNames.GOLIATH, ItemNames.DIAMONDBACK, + ItemNames.SIEGE_TANK, ItemNames.THOR, ItemNames.PREDATOR, ItemNames.WIDOW_MINE, + ItemNames.CYCLONE, ItemNames.WARHOUND, +} +STARPORT_UNITS = { + ItemNames.MEDIVAC, ItemNames.WRAITH, ItemNames.VIKING, ItemNames.BANSHEE, + ItemNames.BATTLECRUISER, ItemNames.HERCULES, ItemNames.SCIENCE_VESSEL, ItemNames.RAVEN, + ItemNames.LIBERATOR, ItemNames.VALKYRIE, +} + + +def filter_missions(world: World) -> Dict[MissionPools, List[SC2Mission]]: + + """ + Returns a semi-randomly pruned tuple of no-build, easy, medium, and hard mission sets + """ + world: World = world + mission_order_type = get_option_value(world, "mission_order") + shuffle_no_build = get_option_value(world, "shuffle_no_build") + enabled_campaigns = get_enabled_campaigns(world) + grant_story_tech = get_option_value(world, "grant_story_tech") == GrantStoryTech.option_true + grant_story_levels = get_option_value(world, "grant_story_levels") != GrantStoryLevels.option_disabled + extra_locations = get_option_value(world, "extra_locations") + excluded_missions: Set[SC2Mission] = get_excluded_missions(world) + mission_pools: Dict[MissionPools, List[SC2Mission]] = {} + for mission in SC2Mission: + if not mission_pools.get(mission.pool): + mission_pools[mission.pool] = list() + mission_pools[mission.pool].append(mission) + # A bit of safeguard: + for mission_pool in MissionPools: + if not mission_pools.get(mission_pool): + mission_pools[mission_pool] = [] + + if mission_order_type == MissionOrder.option_vanilla: + # Vanilla uses the entire mission pool + goal_priorities: Dict[SC2Campaign, SC2CampaignGoalPriority] = {campaign: get_campaign_goal_priority(campaign) for campaign in enabled_campaigns} + goal_level = max(goal_priorities.values()) + candidate_campaigns = [campaign for campaign, goal_priority in goal_priorities.items() if goal_priority == goal_level] + goal_campaign = world.random.choice(candidate_campaigns) + if campaign_final_mission_locations[goal_campaign] is not None: + mission_pools[MissionPools.FINAL] = [campaign_final_mission_locations[goal_campaign].mission] + else: + mission_pools[MissionPools.FINAL] = [list(campaign_alt_final_mission_locations[goal_campaign].keys())[0]] + remove_final_mission_from_other_pools(mission_pools) + return mission_pools + + # Finding the goal map + goal_priorities = {campaign: get_campaign_goal_priority(campaign, excluded_missions) for campaign in enabled_campaigns} + goal_level = max(goal_priorities.values()) + candidate_campaigns = [campaign for campaign, goal_priority in goal_priorities.items() if goal_priority == goal_level] + goal_campaign = world.random.choice(candidate_campaigns) + primary_goal = campaign_final_mission_locations[goal_campaign] + if primary_goal is None or primary_goal.mission in excluded_missions: + # No primary goal or its mission is excluded + candidate_missions = list(campaign_alt_final_mission_locations[goal_campaign].keys()) + candidate_missions = [mission for mission in candidate_missions if mission not in excluded_missions] + if len(candidate_missions) == 0: + raise Exception("There are no valid goal missions. Please exclude fewer missions.") + goal_mission = world.random.choice(candidate_missions) + else: + goal_mission = primary_goal.mission + + # Excluding missions + for difficulty, mission_pool in mission_pools.items(): + mission_pools[difficulty] = [mission for mission in mission_pool if mission not in excluded_missions] + mission_pools[MissionPools.FINAL] = [goal_mission] + + # Mission pool changes + adv_tactics = get_option_value(world, "required_tactics") != RequiredTactics.option_standard + + def move_mission(mission: SC2Mission, current_pool, new_pool): + if mission in mission_pools[current_pool]: + mission_pools[current_pool].remove(mission) + mission_pools[new_pool].append(mission) + # WoL + if shuffle_no_build == ShuffleNoBuild.option_false or adv_tactics: + # Replacing No Build missions with Easy missions + # WoL + move_mission(SC2Mission.ZERO_HOUR, MissionPools.EASY, MissionPools.STARTER) + move_mission(SC2Mission.EVACUATION, MissionPools.EASY, MissionPools.STARTER) + move_mission(SC2Mission.DEVILS_PLAYGROUND, MissionPools.EASY, MissionPools.STARTER) + # LotV + move_mission(SC2Mission.THE_GROWING_SHADOW, MissionPools.EASY, MissionPools.STARTER) + move_mission(SC2Mission.THE_SPEAR_OF_ADUN, MissionPools.EASY, MissionPools.STARTER) + if extra_locations == ExtraLocations.option_enabled: + move_mission(SC2Mission.SKY_SHIELD, MissionPools.EASY, MissionPools.STARTER) + # Pushing this to Easy + move_mission(SC2Mission.THE_GREAT_TRAIN_ROBBERY, MissionPools.MEDIUM, MissionPools.EASY) + if shuffle_no_build == ShuffleNoBuild.option_false: + # Pushing Outbreak to Normal, as it cannot be placed as the second mission on Build-Only + move_mission(SC2Mission.OUTBREAK, MissionPools.EASY, MissionPools.MEDIUM) + # Pushing extra Normal missions to Easy + move_mission(SC2Mission.ECHOES_OF_THE_FUTURE, MissionPools.MEDIUM, MissionPools.EASY) + move_mission(SC2Mission.CUTTHROAT, MissionPools.MEDIUM, MissionPools.EASY) + # Additional changes on Advanced Tactics + if adv_tactics: + # WoL + move_mission(SC2Mission.THE_GREAT_TRAIN_ROBBERY, MissionPools.EASY, MissionPools.STARTER) + move_mission(SC2Mission.SMASH_AND_GRAB, MissionPools.EASY, MissionPools.STARTER) + move_mission(SC2Mission.THE_MOEBIUS_FACTOR, MissionPools.MEDIUM, MissionPools.EASY) + move_mission(SC2Mission.WELCOME_TO_THE_JUNGLE, MissionPools.MEDIUM, MissionPools.EASY) + move_mission(SC2Mission.ENGINE_OF_DESTRUCTION, MissionPools.HARD, MissionPools.MEDIUM) + # LotV + move_mission(SC2Mission.AMON_S_REACH, MissionPools.EASY, MissionPools.STARTER) + # Prophecy needs to be adjusted on tiny grid + if enabled_campaigns == {SC2Campaign.PROPHECY} and mission_order_type == MissionOrder.option_tiny_grid: + move_mission(SC2Mission.A_SINISTER_TURN, MissionPools.MEDIUM, MissionPools.EASY) + # Prologue's only valid starter is the goal mission + if enabled_campaigns == {SC2Campaign.PROLOGUE} \ + or mission_order_type in campaign_depending_orders \ + and get_option_value(world, "shuffle_campaigns") == ShuffleCampaigns.option_false: + move_mission(SC2Mission.DARK_WHISPERS, MissionPools.EASY, MissionPools.STARTER) + # HotS + kerriganless = get_option_value(world, "kerrigan_presence") not in kerrigan_unit_available \ + or SC2Campaign.HOTS not in enabled_campaigns + if adv_tactics: + # Medium -> Easy + for mission in (SC2Mission.FIRE_IN_THE_SKY, SC2Mission.WAKING_THE_ANCIENT, SC2Mission.CONVICTION): + move_mission(mission, MissionPools.MEDIUM, MissionPools.EASY) + # Hard -> Medium + move_mission(SC2Mission.PHANTOMS_OF_THE_VOID, MissionPools.HARD, MissionPools.MEDIUM) + if not kerriganless: + # Additional starter mission assuming player starts with minimal anti-air + move_mission(SC2Mission.WAKING_THE_ANCIENT, MissionPools.EASY, MissionPools.STARTER) + if grant_story_tech: + # Additional starter mission if player is granted story tech + move_mission(SC2Mission.ENEMY_WITHIN, MissionPools.EASY, MissionPools.STARTER) + move_mission(SC2Mission.TEMPLAR_S_RETURN, MissionPools.EASY, MissionPools.STARTER) + move_mission(SC2Mission.THE_ESCAPE, MissionPools.MEDIUM, MissionPools.STARTER) + move_mission(SC2Mission.IN_THE_ENEMY_S_SHADOW, MissionPools.MEDIUM, MissionPools.STARTER) + if (grant_story_tech and grant_story_levels) or kerriganless: + # The player has, all the stuff he needs, provided under these settings + move_mission(SC2Mission.SUPREME, MissionPools.MEDIUM, MissionPools.STARTER) + move_mission(SC2Mission.THE_INFINITE_CYCLE, MissionPools.HARD, MissionPools.STARTER) + if get_option_value(world, "take_over_ai_allies") == TakeOverAIAllies.option_true: + move_mission(SC2Mission.HARBINGER_OF_OBLIVION, MissionPools.MEDIUM, MissionPools.STARTER) + if len(mission_pools[MissionPools.STARTER]) < 2 and not kerriganless or adv_tactics: + # Conditionally moving Easy missions to Starter + move_mission(SC2Mission.HARVEST_OF_SCREAMS, MissionPools.EASY, MissionPools.STARTER) + move_mission(SC2Mission.DOMINATION, MissionPools.EASY, MissionPools.STARTER) + if len(mission_pools[MissionPools.STARTER]) < 2: + move_mission(SC2Mission.TEMPLAR_S_RETURN, MissionPools.EASY, MissionPools.STARTER) + if len(mission_pools[MissionPools.STARTER]) + len(mission_pools[MissionPools.EASY]) < 2: + # Flashpoint needs just a few items at start but competent comp at the end + move_mission(SC2Mission.FLASHPOINT, MissionPools.HARD, MissionPools.EASY) + + remove_final_mission_from_other_pools(mission_pools) + return mission_pools + + +def remove_final_mission_from_other_pools(mission_pools: Dict[MissionPools, List[SC2Mission]]): + final_missions = mission_pools[MissionPools.FINAL] + for pool, missions in mission_pools.items(): + if pool == MissionPools.FINAL: + continue + for final_mission in final_missions: + while final_mission in missions: + missions.remove(final_mission) + + +def get_item_upgrades(inventory: List[Item], parent_item: Union[Item, str]) -> List[Item]: + item_name = parent_item.name if isinstance(parent_item, Item) else parent_item + return [ + inv_item for inv_item in inventory + if get_full_item_list()[inv_item.name].parent_item == item_name + ] + + +def get_item_quantity(item: Item, world: World): + if (not get_option_value(world, "nco_items")) \ + and SC2Campaign.NCO in get_disabled_campaigns(world) \ + and item.name in progressive_if_nco: + return 1 + if (not get_option_value(world, "ext_items")) \ + and item.name in progressive_if_ext: + return 1 + return get_full_item_list()[item.name].quantity + + +def copy_item(item: Item): + return Item(item.name, item.classification, item.code, item.player) + + +def num_missions(world: World) -> int: + mission_order_type = get_option_value(world, "mission_order") + if mission_order_type != MissionOrder.option_grid: + mission_order = mission_orders[mission_order_type]() + misssions = [mission for campaign in mission_order for mission in mission_order[campaign]] + return len(misssions) - 1 # Menu + else: + mission_pools = filter_missions(world) + return sum(len(pool) for _, pool in mission_pools.items()) + + +class ValidInventory: + + def has(self, item: str, player: int): + return item in self.logical_inventory + + def has_any(self, items: Set[str], player: int): + return any(item in self.logical_inventory for item in items) + + def has_all(self, items: Set[str], player: int): + return all(item in self.logical_inventory for item in items) + + def has_group(self, item_group: str, player: int, count: int = 1): + return False # Deliberately fails here, as item pooling is not aware about mission layout + + def count_group(self, item_name_group: str, player: int) -> int: + return 0 # For item filtering assume no missions are beaten + + def count(self, item: str, player: int) -> int: + return len([inventory_item for inventory_item in self.logical_inventory if inventory_item == item]) + + def has_units_per_structure(self) -> bool: + return len(BARRACKS_UNITS.intersection(self.logical_inventory)) > self.min_units_per_structure and \ + len(FACTORY_UNITS.intersection(self.logical_inventory)) > self.min_units_per_structure and \ + len(STARPORT_UNITS.intersection(self.logical_inventory)) > self.min_units_per_structure + + def generate_reduced_inventory(self, inventory_size: int, mission_requirements: List[Tuple[str, Callable]]) -> List[Item]: + """Attempts to generate a reduced inventory that can fulfill the mission requirements.""" + inventory = list(self.item_pool) + locked_items = list(self.locked_items) + item_list = get_full_item_list() + self.logical_inventory = [ + item.name for item in inventory + locked_items + self.existing_items + if item_list[item.name].is_important_for_filtering() # Track all Progression items and those with complex rules for filtering + ] + requirements = mission_requirements + parent_items = self.item_children.keys() + parent_lookup = {child: parent for parent, children in self.item_children.items() for child in children} + minimum_upgrades = get_option_value(self.world, "min_number_of_upgrades") + + def attempt_removal(item: Item) -> bool: + inventory.remove(item) + # Only run logic checks when removing logic items + if item.name in self.logical_inventory: + self.logical_inventory.remove(item.name) + if not all(requirement(self) for (_, requirement) in mission_requirements): + # If item cannot be removed, lock or revert + self.logical_inventory.append(item.name) + for _ in range(get_item_quantity(item, self.world)): + locked_items.append(copy_item(item)) + return False + return True + + # Limit the maximum number of upgrades + maxNbUpgrade = get_option_value(self.world, "max_number_of_upgrades") + if maxNbUpgrade != -1: + unit_avail_upgrades = {} + # Needed to take into account locked/existing items + unit_nb_upgrades = {} + for item in inventory: + cItem = item_list[item.name] + if item.name in UPGRADABLE_ITEMS and item.name not in unit_avail_upgrades: + unit_avail_upgrades[item.name] = [] + unit_nb_upgrades[item.name] = 0 + elif cItem.parent_item is not None: + if cItem.parent_item not in unit_avail_upgrades: + unit_avail_upgrades[cItem.parent_item] = [item] + unit_nb_upgrades[cItem.parent_item] = 1 + else: + unit_avail_upgrades[cItem.parent_item].append(item) + unit_nb_upgrades[cItem.parent_item] += 1 + # For those two categories, we count them but dont include them in removal + for item in locked_items + self.existing_items: + cItem = item_list[item.name] + if item.name in UPGRADABLE_ITEMS and item.name not in unit_avail_upgrades: + unit_avail_upgrades[item.name] = [] + unit_nb_upgrades[item.name] = 0 + elif cItem.parent_item is not None: + if cItem.parent_item not in unit_avail_upgrades: + unit_nb_upgrades[cItem.parent_item] = 1 + else: + unit_nb_upgrades[cItem.parent_item] += 1 + # Making sure that the upgrades being removed is random + shuffled_unit_upgrade_list = list(unit_avail_upgrades.keys()) + self.world.random.shuffle(shuffled_unit_upgrade_list) + for unit in shuffled_unit_upgrade_list: + while (unit_nb_upgrades[unit] > maxNbUpgrade) \ + and (len(unit_avail_upgrades[unit]) > 0): + itemCandidate = self.world.random.choice(unit_avail_upgrades[unit]) + success = attempt_removal(itemCandidate) + # Whatever it succeed to remove the iventory or it fails and thus + # lock it, the upgrade is no longer available for removal + unit_avail_upgrades[unit].remove(itemCandidate) + if success: + unit_nb_upgrades[unit] -= 1 + + # Locking minimum upgrades for items that have already been locked/placed when minimum required + if minimum_upgrades > 0: + known_items = self.existing_items + locked_items + known_parents = [item for item in known_items if item in parent_items] + for parent in known_parents: + child_items = self.item_children[parent] + removable_upgrades = [item for item in inventory if item in child_items] + locked_upgrade_count = sum(1 if item in child_items else 0 for item in known_items) + self.world.random.shuffle(removable_upgrades) + while len(removable_upgrades) > 0 and locked_upgrade_count < minimum_upgrades: + item_to_lock = removable_upgrades.pop() + inventory.remove(item_to_lock) + locked_items.append(copy_item(item_to_lock)) + locked_upgrade_count += 1 + + if self.min_units_per_structure > 0 and self.has_units_per_structure(): + requirements.append(("Minimum units per structure", lambda state: state.has_units_per_structure())) + + # Determining if the full-size inventory can complete campaign + failed_locations: List[str] = [location for (location, requirement) in requirements if not requirement(self)] + if len(failed_locations) > 0: + raise Exception(f"Too many items excluded - couldn't satisfy access rules for the following locations:\n{failed_locations}") + + # Optionally locking generic items + generic_items = [item for item in inventory if item.name in second_pass_placeable_items] + reserved_generic_percent = get_option_value(self.world, "ensure_generic_items") / 100 + reserved_generic_amount = int(len(generic_items) * reserved_generic_percent) + removable_generic_items = [] + self.world.random.shuffle(generic_items) + for item in generic_items[:reserved_generic_amount]: + locked_items.append(copy_item(item)) + inventory.remove(item) + if item.name not in self.logical_inventory and item.name not in self.locked_items: + removable_generic_items.append(item) + + # Main cull process + unused_items = [] # Reusable items for the second pass + while len(inventory) + len(locked_items) > inventory_size: + if len(inventory) == 0: + # There are more items than locations and all of them are already locked due to YAML or logic. + # First, drop non-logic generic items to free up space + while len(removable_generic_items) > 0 and len(locked_items) > inventory_size: + removed_item = removable_generic_items.pop() + locked_items.remove(removed_item) + # If there still isn't enough space, push locked items into start inventory + self.world.random.shuffle(locked_items) + while len(locked_items) > inventory_size: + item: Item = locked_items.pop() + self.multiworld.push_precollected(item) + break + # Select random item from removable items + item = self.world.random.choice(inventory) + # Do not remove item if it would drop upgrades below minimum + if minimum_upgrades > 0: + parent_item = parent_lookup.get(item, None) + if parent_item: + count = sum(1 if item in self.item_children[parent_item] else 0 for item in inventory + locked_items) + if count <= minimum_upgrades: + if parent_item in inventory: + # Attempt to remove parent instead, if possible + item = parent_item + else: + # Lock remaining upgrades + for item in self.item_children[parent_item]: + if item in inventory: + inventory.remove(item) + locked_items.append(copy_item(item)) + continue + + # Drop child items when removing a parent + if item in parent_items: + items_to_remove = [item for item in self.item_children[item] if item in inventory] + success = attempt_removal(item) + if success: + while len(items_to_remove) > 0: + item_to_remove = items_to_remove.pop() + if item_to_remove not in inventory: + continue + attempt_removal(item_to_remove) + else: + # Unimportant upgrades may be added again in the second pass + if attempt_removal(item): + unused_items.append(item.name) + + # Removing extra dependencies + # WoL + logical_inventory_set = set(self.logical_inventory) + if not spider_mine_sources & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Spider Mine)")] + if not BARRACKS_UNITS & logical_inventory_set: + inventory = [item for item in inventory if + not (item.name.startswith(ItemNames.TERRAN_INFANTRY_UPGRADE_PREFIX) or item.name == ItemNames.ORBITAL_STRIKE)] + if not FACTORY_UNITS & logical_inventory_set: + inventory = [item for item in inventory if not item.name.startswith(ItemNames.TERRAN_VEHICLE_UPGRADE_PREFIX)] + if not STARPORT_UNITS & logical_inventory_set: + inventory = [item for item in inventory if not item.name.startswith(ItemNames.TERRAN_SHIP_UPGRADE_PREFIX)] + # HotS + # Baneling without sources => remove Baneling and upgrades + if (ItemNames.ZERGLING_BANELING_ASPECT in self.logical_inventory + and ItemNames.ZERGLING not in self.logical_inventory + and ItemNames.KERRIGAN_SPAWN_BANELINGS not in self.logical_inventory + ): + inventory = [item for item in inventory if item.name != ItemNames.ZERGLING_BANELING_ASPECT] + inventory = [item for item in inventory if item_list[item.name].parent_item != ItemNames.ZERGLING_BANELING_ASPECT] + # Spawn Banelings without Zergling => remove Baneling unit, keep upgrades except macro ones + if (ItemNames.ZERGLING_BANELING_ASPECT in self.logical_inventory + and ItemNames.ZERGLING not in self.logical_inventory + and ItemNames.KERRIGAN_SPAWN_BANELINGS in self.logical_inventory + ): + inventory = [item for item in inventory if item.name != ItemNames.ZERGLING_BANELING_ASPECT] + inventory = [item for item in inventory if item.name != ItemNames.BANELING_RAPID_METAMORPH] + if not {ItemNames.MUTALISK, ItemNames.CORRUPTOR, ItemNames.SCOURGE} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.startswith(ItemNames.ZERG_FLYER_UPGRADE_PREFIX)] + locked_items = [item for item in locked_items if not item.name.startswith(ItemNames.ZERG_FLYER_UPGRADE_PREFIX)] + # T3 items removal rules - remove morph and its upgrades if the basic unit isn't in + if not {ItemNames.MUTALISK, ItemNames.CORRUPTOR} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Mutalisk/Corruptor)")] + inventory = [item for item in inventory if item_list[item.name].parent_item != ItemNames.MUTALISK_CORRUPTOR_GUARDIAN_ASPECT] + inventory = [item for item in inventory if item_list[item.name].parent_item != ItemNames.MUTALISK_CORRUPTOR_DEVOURER_ASPECT] + inventory = [item for item in inventory if item_list[item.name].parent_item != ItemNames.MUTALISK_CORRUPTOR_BROOD_LORD_ASPECT] + inventory = [item for item in inventory if item_list[item.name].parent_item != ItemNames.MUTALISK_CORRUPTOR_VIPER_ASPECT] + if ItemNames.ROACH not in logical_inventory_set: + inventory = [item for item in inventory if item.name != ItemNames.ROACH_RAVAGER_ASPECT] + inventory = [item for item in inventory if item_list[item.name].parent_item != ItemNames.ROACH_RAVAGER_ASPECT] + if ItemNames.HYDRALISK not in logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Hydralisk)")] + inventory = [item for item in inventory if item_list[item.name].parent_item != ItemNames.HYDRALISK_LURKER_ASPECT] + inventory = [item for item in inventory if item_list[item.name].parent_item != ItemNames.HYDRALISK_IMPALER_ASPECT] + # LotV + # Shared unit upgrades between several units + if not {ItemNames.STALKER, ItemNames.INSTIGATOR, ItemNames.SLAYER} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Stalker/Instigator/Slayer)")] + if not {ItemNames.PHOENIX, ItemNames.MIRAGE} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Phoenix/Mirage)")] + if not {ItemNames.VOID_RAY, ItemNames.DESTROYER} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Void Ray/Destroyer)")] + if not {ItemNames.IMMORTAL, ItemNames.ANNIHILATOR} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Immortal/Annihilator)")] + if not {ItemNames.DARK_TEMPLAR, ItemNames.AVENGER, ItemNames.BLOOD_HUNTER} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Dark Templar/Avenger/Blood Hunter)")] + if not {ItemNames.HIGH_TEMPLAR, ItemNames.SIGNIFIER, ItemNames.ASCENDANT, ItemNames.DARK_TEMPLAR} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Archon)")] + logical_inventory_set.difference_update([item_name for item_name in logical_inventory_set if item_name.endswith("(Archon)")]) + if not {ItemNames.HIGH_TEMPLAR, ItemNames.SIGNIFIER, ItemNames.ARCHON_HIGH_ARCHON} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(High Templar/Signifier)")] + if ItemNames.SUPPLICANT not in logical_inventory_set: + inventory = [item for item in inventory if item.name != ItemNames.ASCENDANT_POWER_OVERWHELMING] + if not {ItemNames.DARK_ARCHON, ItemNames.DARK_TEMPLAR_DARK_ARCHON_MELD} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Dark Archon)")] + if not {ItemNames.SENTRY, ItemNames.ENERGIZER, ItemNames.HAVOC} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Sentry/Energizer/Havoc)")] + if not {ItemNames.SENTRY, ItemNames.ENERGIZER, ItemNames.HAVOC, ItemNames.SHIELD_BATTERY} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Sentry/Energizer/Havoc/Shield Battery)")] + if not {ItemNames.ZEALOT, ItemNames.CENTURION, ItemNames.SENTINEL} & logical_inventory_set: + inventory = [item for item in inventory if not item.name.endswith("(Zealot/Sentinel/Centurion)")] + # Static defense upgrades only if static defense present + if not {ItemNames.PHOTON_CANNON, ItemNames.KHAYDARIN_MONOLITH, ItemNames.NEXUS_OVERCHARGE, ItemNames.SHIELD_BATTERY} & logical_inventory_set: + inventory = [item for item in inventory if item.name != ItemNames.ENHANCED_TARGETING] + if not {ItemNames.PHOTON_CANNON, ItemNames.KHAYDARIN_MONOLITH, ItemNames.NEXUS_OVERCHARGE} & logical_inventory_set: + inventory = [item for item in inventory if item.name != ItemNames.OPTIMIZED_ORDNANCE] + + # Cull finished, adding locked items back into inventory + inventory += locked_items + + # Replacing empty space with generically useful items + replacement_items = [item for item in self.item_pool + if (item not in inventory + and item not in self.locked_items + and ( + item.name in second_pass_placeable_items + or item.name in unused_items))] + self.world.random.shuffle(replacement_items) + while len(inventory) < inventory_size and len(replacement_items) > 0: + item = replacement_items.pop() + inventory.append(item) + + return inventory + + def __init__(self, world: World , + item_pool: List[Item], existing_items: List[Item], locked_items: List[Item], + used_races: Set[SC2Race], nova_equipment_used: bool): + self.multiworld = world.multiworld + self.player = world.player + self.world: World = world + self.logical_inventory = list() + self.locked_items = locked_items[:] + self.existing_items = existing_items + soa_presence = get_option_value(world, "spear_of_adun_presence") + soa_autocast_presence = get_option_value(world, "spear_of_adun_autonomously_cast_ability_presence") + # Initial filter of item pool + self.item_pool = [] + item_quantities: dict[str, int] = dict() + # Inventory restrictiveness based on number of missions with checks + mission_count = num_missions(world) + self.min_units_per_structure = int(mission_count / 7) + min_upgrades = 1 if mission_count < 10 else 2 + for item in item_pool: + item_info = get_full_item_list()[item.name] + if item_info.race != SC2Race.ANY and item_info.race not in used_races: + if soa_presence == SpearOfAdunPresence.option_everywhere \ + and item.name in spear_of_adun_calldowns: + # Add SoA powers regardless of used races as it's present everywhere + self.item_pool.append(item) + if soa_autocast_presence == SpearOfAdunAutonomouslyCastAbilityPresence.option_everywhere \ + and item.name in spear_of_adun_castable_passives: + self.item_pool.append(item) + # Drop any item belonging to a race not used in the campaign + continue + if item.name in nova_equipment and not nova_equipment_used: + # Drop Nova equipment if there's no NCO mission generated + continue + if item_info.type == "Upgrade": + # Locking upgrades based on mission duration + if item.name not in item_quantities: + item_quantities[item.name] = 0 + item_quantities[item.name] += 1 + if item_quantities[item.name] <= min_upgrades: + self.locked_items.append(item) + else: + self.item_pool.append(item) + elif item_info.type == "Goal": + self.locked_items.append(item) + else: + self.item_pool.append(item) + self.item_children: Dict[Item, List[Item]] = dict() + for item in self.item_pool + locked_items + existing_items: + if item.name in UPGRADABLE_ITEMS: + self.item_children[item] = get_item_upgrades(self.item_pool, item) + + +def filter_items(world: World, mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]], location_cache: List[Location], + item_pool: List[Item], existing_items: List[Item], locked_items: List[Item]) -> List[Item]: + """ + Returns a semi-randomly pruned set of items based on number of available locations. + The returned inventory must be capable of logically accessing every location in the world. + """ + open_locations = [location for location in location_cache if location.item is None] + inventory_size = len(open_locations) + used_races = get_used_races(mission_req_table, world) + nova_equipment_used = is_nova_equipment_used(mission_req_table) + mission_requirements = [(location.name, location.access_rule) for location in location_cache] + valid_inventory = ValidInventory(world, item_pool, existing_items, locked_items, used_races, nova_equipment_used) + + valid_items = valid_inventory.generate_reduced_inventory(inventory_size, mission_requirements) + return valid_items + + +def get_used_races(mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]], world: World) -> Set[SC2Race]: + grant_story_tech = get_option_value(world, "grant_story_tech") + take_over_ai_allies = get_option_value(world, "take_over_ai_allies") + kerrigan_presence = get_option_value(world, "kerrigan_presence") \ + and SC2Campaign.HOTS in get_enabled_campaigns(world) + missions = missions_in_mission_table(mission_req_table) + + # By missions + races = set([mission.race for mission in missions]) + + # Conditionally logic-less no-builds (They're set to SC2Race.ANY): + if grant_story_tech == GrantStoryTech.option_false: + if SC2Mission.ENEMY_WITHIN in missions: + # Zerg units need to be unlocked + races.add(SC2Race.ZERG) + if kerrigan_presence in kerrigan_unit_available \ + and not missions.isdisjoint({SC2Mission.BACK_IN_THE_SADDLE, SC2Mission.SUPREME, SC2Mission.CONVICTION, SC2Mission.THE_INFINITE_CYCLE}): + # You need some Kerrigan abilities (they're granted if Kerriganless or story tech granted) + races.add(SC2Race.ZERG) + + # If you take over the AI Ally, you need to have its race stuff + if take_over_ai_allies == TakeOverAIAllies.option_true \ + and not missions.isdisjoint({SC2Mission.THE_RECKONING}): + # Jimmy in The Reckoning + races.add(SC2Race.TERRAN) + + return races + +def is_nova_equipment_used(mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]]) -> bool: + missions = missions_in_mission_table(mission_req_table) + return any([mission.campaign == SC2Campaign.NCO for mission in missions]) + + +def missions_in_mission_table(mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]]) -> Set[SC2Mission]: + return set([mission.mission for campaign_missions in mission_req_table.values() for mission in + campaign_missions.values()]) diff --git a/worlds/sc2/Regions.py b/worlds/sc2/Regions.py new file mode 100644 index 000000000000..e6c001b186a7 --- /dev/null +++ b/worlds/sc2/Regions.py @@ -0,0 +1,691 @@ +from typing import List, Dict, Tuple, Optional, Callable, NamedTuple, Union +import math + +from BaseClasses import MultiWorld, Region, Entrance, Location, CollectionState +from .Locations import LocationData +from .Options import get_option_value, MissionOrder, get_enabled_campaigns, campaign_depending_orders, \ + GridTwoStartPositions +from .MissionTables import MissionInfo, mission_orders, vanilla_mission_req_table, \ + MissionPools, SC2Campaign, get_goal_location, SC2Mission, MissionConnection +from .PoolFilter import filter_missions +from worlds.AutoWorld import World + + +class SC2MissionSlot(NamedTuple): + campaign: SC2Campaign + slot: Union[MissionPools, SC2Mission, None] + + +def create_regions( + world: World, locations: Tuple[LocationData, ...], location_cache: List[Location] +) -> Tuple[Dict[SC2Campaign, Dict[str, MissionInfo]], int, str]: + """ + Creates region connections by calling the multiworld's `connect()` methods + Returns a 3-tuple containing: + * dict[SC2Campaign, Dict[str, MissionInfo]] mapping a campaign and mission name to its data + * int The number of missions in the world + * str The name of the goal location + """ + mission_order_type: int = get_option_value(world, "mission_order") + + if mission_order_type == MissionOrder.option_vanilla: + return create_vanilla_regions(world, locations, location_cache) + elif mission_order_type == MissionOrder.option_grid: + return create_grid_regions(world, locations, location_cache) + else: + return create_structured_regions(world, locations, location_cache, mission_order_type) + +def create_vanilla_regions( + world: World, + locations: Tuple[LocationData, ...], + location_cache: List[Location], +) -> Tuple[Dict[SC2Campaign, Dict[str, MissionInfo]], int, str]: + locations_per_region = get_locations_per_region(locations) + regions = [create_region(world, locations_per_region, location_cache, "Menu")] + + mission_pools: Dict[MissionPools, List[SC2Mission]] = filter_missions(world) + final_mission = mission_pools[MissionPools.FINAL][0] + + enabled_campaigns = get_enabled_campaigns(world) + names: Dict[str, int] = {} + + # Generating all regions and locations for each enabled campaign + for campaign in enabled_campaigns: + for region_name in vanilla_mission_req_table[campaign].keys(): + regions.append(create_region(world, locations_per_region, location_cache, region_name)) + world.multiworld.regions += regions + vanilla_mission_reqs = {campaign: missions for campaign, missions in vanilla_mission_req_table.items() if campaign in enabled_campaigns} + + def wol_cleared_missions(state: CollectionState, mission_count: int) -> bool: + return state.has_group("WoL Missions", world.player, mission_count) + + player: int = world.player + if SC2Campaign.WOL in enabled_campaigns: + connect(world, names, 'Menu', 'Liberation Day') + connect(world, names, 'Liberation Day', 'The Outlaws', + lambda state: state.has("Beat Liberation Day", player)) + connect(world, names, 'The Outlaws', 'Zero Hour', + lambda state: state.has("Beat The Outlaws", player)) + connect(world, names, 'Zero Hour', 'Evacuation', + lambda state: state.has("Beat Zero Hour", player)) + connect(world, names, 'Evacuation', 'Outbreak', + lambda state: state.has("Beat Evacuation", player)) + connect(world, names, "Outbreak", "Safe Haven", + lambda state: wol_cleared_missions(state, 7) and state.has("Beat Outbreak", player)) + connect(world, names, "Outbreak", "Haven's Fall", + lambda state: wol_cleared_missions(state, 7) and state.has("Beat Outbreak", player)) + connect(world, names, 'Zero Hour', 'Smash and Grab', + lambda state: state.has("Beat Zero Hour", player)) + connect(world, names, 'Smash and Grab', 'The Dig', + lambda state: wol_cleared_missions(state, 8) and state.has("Beat Smash and Grab", player)) + connect(world, names, 'The Dig', 'The Moebius Factor', + lambda state: wol_cleared_missions(state, 11) and state.has("Beat The Dig", player)) + connect(world, names, 'The Moebius Factor', 'Supernova', + lambda state: wol_cleared_missions(state, 14) and state.has("Beat The Moebius Factor", player)) + connect(world, names, 'Supernova', 'Maw of the Void', + lambda state: state.has("Beat Supernova", player)) + connect(world, names, 'Zero Hour', "Devil's Playground", + lambda state: wol_cleared_missions(state, 4) and state.has("Beat Zero Hour", player)) + connect(world, names, "Devil's Playground", 'Welcome to the Jungle', + lambda state: state.has("Beat Devil's Playground", player)) + connect(world, names, "Welcome to the Jungle", 'Breakout', + lambda state: wol_cleared_missions(state, 8) and state.has("Beat Welcome to the Jungle", player)) + connect(world, names, "Welcome to the Jungle", 'Ghost of a Chance', + lambda state: wol_cleared_missions(state, 8) and state.has("Beat Welcome to the Jungle", player)) + connect(world, names, "Zero Hour", 'The Great Train Robbery', + lambda state: wol_cleared_missions(state, 6) and state.has("Beat Zero Hour", player)) + connect(world, names, 'The Great Train Robbery', 'Cutthroat', + lambda state: state.has("Beat The Great Train Robbery", player)) + connect(world, names, 'Cutthroat', 'Engine of Destruction', + lambda state: state.has("Beat Cutthroat", player)) + connect(world, names, 'Engine of Destruction', 'Media Blitz', + lambda state: state.has("Beat Engine of Destruction", player)) + connect(world, names, 'Media Blitz', 'Piercing the Shroud', + lambda state: state.has("Beat Media Blitz", player)) + connect(world, names, 'Maw of the Void', 'Gates of Hell', + lambda state: state.has("Beat Maw of the Void", player)) + connect(world, names, 'Gates of Hell', 'Belly of the Beast', + lambda state: state.has("Beat Gates of Hell", player)) + connect(world, names, 'Gates of Hell', 'Shatter the Sky', + lambda state: state.has("Beat Gates of Hell", player)) + connect(world, names, 'Gates of Hell', 'All-In', + lambda state: state.has('Beat Gates of Hell', player) and ( + state.has('Beat Shatter the Sky', player) or state.has('Beat Belly of the Beast', player))) + + if SC2Campaign.PROPHECY in enabled_campaigns: + if SC2Campaign.WOL in enabled_campaigns: + connect(world, names, 'The Dig', 'Whispers of Doom', + lambda state: state.has("Beat The Dig", player)), + else: + vanilla_mission_reqs[SC2Campaign.PROPHECY] = vanilla_mission_reqs[SC2Campaign.PROPHECY].copy() + vanilla_mission_reqs[SC2Campaign.PROPHECY][SC2Mission.WHISPERS_OF_DOOM.mission_name] = MissionInfo( + SC2Mission.WHISPERS_OF_DOOM, [], SC2Mission.WHISPERS_OF_DOOM.area) + connect(world, names, 'Menu', 'Whispers of Doom'), + connect(world, names, 'Whispers of Doom', 'A Sinister Turn', + lambda state: state.has("Beat Whispers of Doom", player)) + connect(world, names, 'A Sinister Turn', 'Echoes of the Future', + lambda state: state.has("Beat A Sinister Turn", player)) + connect(world, names, 'Echoes of the Future', 'In Utter Darkness', + lambda state: state.has("Beat Echoes of the Future", player)) + + if SC2Campaign.HOTS in enabled_campaigns: + connect(world, names, 'Menu', 'Lab Rat'), + connect(world, names, 'Lab Rat', 'Back in the Saddle', + lambda state: state.has("Beat Lab Rat", player)), + connect(world, names, 'Back in the Saddle', 'Rendezvous', + lambda state: state.has("Beat Back in the Saddle", player)), + connect(world, names, 'Rendezvous', 'Harvest of Screams', + lambda state: state.has("Beat Rendezvous", player)), + connect(world, names, 'Harvest of Screams', 'Shoot the Messenger', + lambda state: state.has("Beat Harvest of Screams", player)), + connect(world, names, 'Shoot the Messenger', 'Enemy Within', + lambda state: state.has("Beat Shoot the Messenger", player)), + connect(world, names, 'Rendezvous', 'Domination', + lambda state: state.has("Beat Rendezvous", player)), + connect(world, names, 'Domination', 'Fire in the Sky', + lambda state: state.has("Beat Domination", player)), + connect(world, names, 'Fire in the Sky', 'Old Soldiers', + lambda state: state.has("Beat Fire in the Sky", player)), + connect(world, names, 'Old Soldiers', 'Waking the Ancient', + lambda state: state.has("Beat Old Soldiers", player)), + connect(world, names, 'Enemy Within', 'Waking the Ancient', + lambda state: state.has("Beat Enemy Within", player)), + connect(world, names, 'Waking the Ancient', 'The Crucible', + lambda state: state.has("Beat Waking the Ancient", player)), + connect(world, names, 'The Crucible', 'Supreme', + lambda state: state.has("Beat The Crucible", player)), + connect(world, names, 'Supreme', 'Infested', + lambda state: state.has("Beat Supreme", player) and + state.has("Beat Old Soldiers", player) and + state.has("Beat Enemy Within", player)), + connect(world, names, 'Infested', 'Hand of Darkness', + lambda state: state.has("Beat Infested", player)), + connect(world, names, 'Hand of Darkness', 'Phantoms of the Void', + lambda state: state.has("Beat Hand of Darkness", player)), + connect(world, names, 'Supreme', 'With Friends Like These', + lambda state: state.has("Beat Supreme", player) and + state.has("Beat Old Soldiers", player) and + state.has("Beat Enemy Within", player)), + connect(world, names, 'With Friends Like These', 'Conviction', + lambda state: state.has("Beat With Friends Like These", player)), + connect(world, names, 'Conviction', 'Planetfall', + lambda state: state.has("Beat Conviction", player) and + state.has("Beat Phantoms of the Void", player)), + connect(world, names, 'Planetfall', 'Death From Above', + lambda state: state.has("Beat Planetfall", player)), + connect(world, names, 'Death From Above', 'The Reckoning', + lambda state: state.has("Beat Death From Above", player)), + + if SC2Campaign.PROLOGUE in enabled_campaigns: + connect(world, names, "Menu", "Dark Whispers") + connect(world, names, "Dark Whispers", "Ghosts in the Fog", + lambda state: state.has("Beat Dark Whispers", player)) + connect(world, names, "Dark Whispers", "Evil Awoken", + lambda state: state.has("Beat Ghosts in the Fog", player)) + + if SC2Campaign.LOTV in enabled_campaigns: + connect(world, names, "Menu", "For Aiur!") + connect(world, names, "For Aiur!", "The Growing Shadow", + lambda state: state.has("Beat For Aiur!", player)), + connect(world, names, "The Growing Shadow", "The Spear of Adun", + lambda state: state.has("Beat The Growing Shadow", player)), + connect(world, names, "The Spear of Adun", "Sky Shield", + lambda state: state.has("Beat The Spear of Adun", player)), + connect(world, names, "Sky Shield", "Brothers in Arms", + lambda state: state.has("Beat Sky Shield", player)), + connect(world, names, "Brothers in Arms", "Forbidden Weapon", + lambda state: state.has("Beat Brothers in Arms", player)), + connect(world, names, "The Spear of Adun", "Amon's Reach", + lambda state: state.has("Beat The Spear of Adun", player)), + connect(world, names, "Amon's Reach", "Last Stand", + lambda state: state.has("Beat Amon's Reach", player)), + connect(world, names, "Last Stand", "Forbidden Weapon", + lambda state: state.has("Beat Last Stand", player)), + connect(world, names, "Forbidden Weapon", "Temple of Unification", + lambda state: state.has("Beat Brothers in Arms", player) + and state.has("Beat Last Stand", player) + and state.has("Beat Forbidden Weapon", player)), + connect(world, names, "Temple of Unification", "The Infinite Cycle", + lambda state: state.has("Beat Temple of Unification", player)), + connect(world, names, "The Infinite Cycle", "Harbinger of Oblivion", + lambda state: state.has("Beat The Infinite Cycle", player)), + connect(world, names, "Harbinger of Oblivion", "Unsealing the Past", + lambda state: state.has("Beat Harbinger of Oblivion", player)), + connect(world, names, "Unsealing the Past", "Purification", + lambda state: state.has("Beat Unsealing the Past", player)), + connect(world, names, "Purification", "Templar's Charge", + lambda state: state.has("Beat Purification", player)), + connect(world, names, "Harbinger of Oblivion", "Steps of the Rite", + lambda state: state.has("Beat Harbinger of Oblivion", player)), + connect(world, names, "Steps of the Rite", "Rak'Shir", + lambda state: state.has("Beat Steps of the Rite", player)), + connect(world, names, "Rak'Shir", "Templar's Charge", + lambda state: state.has("Beat Rak'Shir", player)), + connect(world, names, "Templar's Charge", "Templar's Return", + lambda state: state.has("Beat Purification", player) + and state.has("Beat Rak'Shir", player) + and state.has("Beat Templar's Charge", player)), + connect(world, names, "Templar's Return", "The Host", + lambda state: state.has("Beat Templar's Return", player)), + connect(world, names, "The Host", "Salvation", + lambda state: state.has("Beat The Host", player)), + + if SC2Campaign.EPILOGUE in enabled_campaigns: + # TODO: Make this aware about excluded campaigns + connect(world, names, "Salvation", "Into the Void", + lambda state: state.has("Beat Salvation", player) + and state.has("Beat The Reckoning", player) + and state.has("Beat All-In", player)), + connect(world, names, "Into the Void", "The Essence of Eternity", + lambda state: state.has("Beat Into the Void", player)), + connect(world, names, "The Essence of Eternity", "Amon's Fall", + lambda state: state.has("Beat The Essence of Eternity", player)), + + if SC2Campaign.NCO in enabled_campaigns: + connect(world, names, "Menu", "The Escape") + connect(world, names, "The Escape", "Sudden Strike", + lambda state: state.has("Beat The Escape", player)) + connect(world, names, "Sudden Strike", "Enemy Intelligence", + lambda state: state.has("Beat Sudden Strike", player)) + connect(world, names, "Enemy Intelligence", "Trouble In Paradise", + lambda state: state.has("Beat Enemy Intelligence", player)) + connect(world, names, "Trouble In Paradise", "Night Terrors", + lambda state: state.has("Beat Evacuation", player)) + connect(world, names, "Night Terrors", "Flashpoint", + lambda state: state.has("Beat Night Terrors", player)) + connect(world, names, "Flashpoint", "In the Enemy's Shadow", + lambda state: state.has("Beat Flashpoint", player)) + connect(world, names, "In the Enemy's Shadow", "Dark Skies", + lambda state: state.has("Beat In the Enemy's Shadow", player)) + connect(world, names, "Dark Skies", "End Game", + lambda state: state.has("Beat Dark Skies", player)) + + goal_location = get_goal_location(final_mission) + assert goal_location, f"Unable to find a goal location for mission {final_mission}" + setup_final_location(goal_location, location_cache) + + return (vanilla_mission_reqs, final_mission.id, goal_location) + + +def create_grid_regions( + world: World, + locations: Tuple[LocationData, ...], + location_cache: List[Location], +) -> Tuple[Dict[SC2Campaign, Dict[str, MissionInfo]], int, str]: + locations_per_region = get_locations_per_region(locations) + + mission_pools = filter_missions(world) + final_mission = mission_pools[MissionPools.FINAL][0] + + mission_pool = [mission for mission_pool in mission_pools.values() for mission in mission_pool] + + num_missions = min(len(mission_pool), get_option_value(world, "maximum_campaign_size")) + remove_top_left: bool = get_option_value(world, "grid_two_start_positions") == GridTwoStartPositions.option_true + + regions = [create_region(world, locations_per_region, location_cache, "Menu")] + names: Dict[str, int] = {} + missions: Dict[Tuple[int, int], SC2Mission] = {} + + grid_size_x, grid_size_y, num_corners_to_remove = get_grid_dimensions(num_missions + remove_top_left) + # pick missions in order along concentric diagonals + # each diagonal will have the same difficulty + # this keeps long sides from possibly stealing lower-difficulty missions from future columns + num_diagonals = grid_size_x + grid_size_y - 1 + diagonal_difficulty = MissionPools.STARTER + missions_to_add = mission_pools[MissionPools.STARTER] + for diagonal in range(num_diagonals): + if diagonal == num_diagonals - 1: + diagonal_difficulty = MissionPools.FINAL + grid_coords = (grid_size_x-1, grid_size_y-1) + missions[grid_coords] = final_mission + break + if diagonal == 0 and remove_top_left: + continue + diagonal_length = min(diagonal + 1, num_diagonals - diagonal, grid_size_x, grid_size_y) + if len(missions_to_add) < diagonal_length: + raise Exception(f"There are not enough {diagonal_difficulty.name} missions to fill the campaign. Please exclude fewer missions.") + for i in range(diagonal_length): + # (0,0) + (0,1)*diagonal + (1,-1)*i + (1,-1)*max(diagonal - grid_size_y + 1, 0) + grid_coords = (i + max(diagonal - grid_size_y + 1, 0), diagonal - i - max(diagonal - grid_size_y + 1, 0)) + if grid_coords == (grid_size_x - 1, 0) and num_corners_to_remove >= 2: + pass + elif grid_coords == (0, grid_size_y - 1) and num_corners_to_remove >= 1: + pass + else: + mission_index = world.random.randint(0, len(missions_to_add) - 1) + missions[grid_coords] = missions_to_add.pop(mission_index) + + if diagonal_difficulty < MissionPools.VERY_HARD: + diagonal_difficulty = MissionPools(diagonal_difficulty.value + 1) + missions_to_add.extend(mission_pools[diagonal_difficulty]) + + # Generating regions and locations from selected missions + for x in range(grid_size_x): + for y in range(grid_size_y): + if missions.get((x, y)): + regions.append(create_region(world, locations_per_region, location_cache, missions[(x, y)].mission_name)) + world.multiworld.regions += regions + + # This pattern is horrifying, why are we using the dict as an ordered dict??? + slot_map: Dict[Tuple[int, int], int] = {} + for index, coords in enumerate(missions): + slot_map[coords] = index + 1 + + mission_req_table: Dict[str, MissionInfo] = {} + for coords, mission in missions.items(): + prepend_vertical = 0 + if not mission: + continue + connections: List[MissionConnection] = [] + if coords == (0, 0) or (remove_top_left and sum(coords) == 1): + # Connect to the "Menu" starting region + connect(world, names, "Menu", mission.mission_name) + else: + for dx, dy in ((-1, 0), (1, 0), (0, -1), (0, 1)): + connected_coords = (coords[0] + dx, coords[1] + dy) + if connected_coords in missions: + # connections.append(missions[connected_coords]) + connections.append(MissionConnection(slot_map[connected_coords])) + connect(world, names, missions[connected_coords].mission_name, mission.mission_name, + make_grid_connect_rule(missions, connected_coords, world.player), + ) + if coords[1] == 1 and not missions.get((coords[0], 0)): + prepend_vertical = 1 + mission_req_table[mission.mission_name] = MissionInfo( + mission, + connections, + category=f'_{coords[0] + 1}', + or_requirements=True, + ui_vertical_padding=prepend_vertical, + ) + + final_mission_id = final_mission.id + # Changing the completion condition for alternate final missions into an event + final_location = get_goal_location(final_mission) + setup_final_location(final_location, location_cache) + + return {SC2Campaign.GLOBAL: mission_req_table}, final_mission_id, final_location + + +def make_grid_connect_rule( + missions: Dict[Tuple[int, int], SC2Mission], + connected_coords: Tuple[int, int], + player: int +) -> Callable[[CollectionState], bool]: + return lambda state: state.has(f"Beat {missions[connected_coords].mission_name}", player) + + +def create_structured_regions( + world: World, + locations: Tuple[LocationData, ...], + location_cache: List[Location], + mission_order_type: int, +) -> Tuple[Dict[SC2Campaign, Dict[str, MissionInfo]], int, str]: + locations_per_region = get_locations_per_region(locations) + + mission_order = mission_orders[mission_order_type]() + enabled_campaigns = get_enabled_campaigns(world) + shuffle_campaigns = get_option_value(world, "shuffle_campaigns") + + mission_pools: Dict[MissionPools, List[SC2Mission]] = filter_missions(world) + final_mission = mission_pools[MissionPools.FINAL][0] + + regions = [create_region(world, locations_per_region, location_cache, "Menu")] + + names: Dict[str, int] = {} + + mission_slots: List[SC2MissionSlot] = [] + mission_pool = [mission for mission_pool in mission_pools.values() for mission in mission_pool] + + if mission_order_type in campaign_depending_orders: + # Do slot removal per campaign + for campaign in enabled_campaigns: + campaign_mission_pool = [mission for mission in mission_pool if mission.campaign == campaign] + campaign_mission_pool_size = len(campaign_mission_pool) + + removals = len(mission_order[campaign]) - campaign_mission_pool_size + + for mission in mission_order[campaign]: + # Removing extra missions if mission pool is too small + if 0 < mission.removal_priority <= removals: + mission_slots.append(SC2MissionSlot(campaign, None)) + elif mission.type == MissionPools.FINAL: + if campaign == final_mission.campaign: + # Campaign is elected to be goal + mission_slots.append(SC2MissionSlot(campaign, final_mission)) + else: + # Not the goal, find the most difficult mission in the pool and set the difficulty + campaign_difficulty = max(mission.pool for mission in campaign_mission_pool) + mission_slots.append(SC2MissionSlot(campaign, campaign_difficulty)) + else: + mission_slots.append(SC2MissionSlot(campaign, mission.type)) + else: + order = mission_order[SC2Campaign.GLOBAL] + # Determining if missions must be removed + mission_pool_size = sum(len(mission_pool) for mission_pool in mission_pools.values()) + removals = len(order) - mission_pool_size + + # Initial fill out of mission list and marking All-In mission + for mission in order: + # Removing extra missions if mission pool is too small + if 0 < mission.removal_priority <= removals: + mission_slots.append(SC2MissionSlot(SC2Campaign.GLOBAL, None)) + elif mission.type == MissionPools.FINAL: + mission_slots.append(SC2MissionSlot(SC2Campaign.GLOBAL, final_mission)) + else: + mission_slots.append(SC2MissionSlot(SC2Campaign.GLOBAL, mission.type)) + + no_build_slots = [] + easy_slots = [] + medium_slots = [] + hard_slots = [] + very_hard_slots = [] + + # Search through missions to find slots needed to fill + for i in range(len(mission_slots)): + mission_slot = mission_slots[i] + if mission_slot is None: + continue + if isinstance(mission_slot, SC2MissionSlot): + if mission_slot.slot is None: + continue + if mission_slot.slot == MissionPools.STARTER: + no_build_slots.append(i) + elif mission_slot.slot == MissionPools.EASY: + easy_slots.append(i) + elif mission_slot.slot == MissionPools.MEDIUM: + medium_slots.append(i) + elif mission_slot.slot == MissionPools.HARD: + hard_slots.append(i) + elif mission_slot.slot == MissionPools.VERY_HARD: + very_hard_slots.append(i) + + def pick_mission(slot): + if shuffle_campaigns or mission_order_type not in campaign_depending_orders: + # Pick a mission from any campaign + filler = world.random.randint(0, len(missions_to_add) - 1) + mission = missions_to_add.pop(filler) + slot_campaign = mission_slots[slot].campaign + mission_slots[slot] = SC2MissionSlot(slot_campaign, mission) + else: + # Pick a mission from required campaign + slot_campaign = mission_slots[slot].campaign + campaign_mission_candidates = [mission for mission in missions_to_add if mission.campaign == slot_campaign] + mission = world.random.choice(campaign_mission_candidates) + missions_to_add.remove(mission) + mission_slots[slot] = SC2MissionSlot(slot_campaign, mission) + + # Add no_build missions to the pool and fill in no_build slots + missions_to_add: List[SC2Mission] = mission_pools[MissionPools.STARTER] + if len(no_build_slots) > len(missions_to_add): + raise Exception("There are no valid No-Build missions. Please exclude fewer missions.") + for slot in no_build_slots: + pick_mission(slot) + + # Add easy missions into pool and fill in easy slots + missions_to_add = missions_to_add + mission_pools[MissionPools.EASY] + if len(easy_slots) > len(missions_to_add): + raise Exception("There are not enough Easy missions to fill the campaign. Please exclude fewer missions.") + for slot in easy_slots: + pick_mission(slot) + + # Add medium missions into pool and fill in medium slots + missions_to_add = missions_to_add + mission_pools[MissionPools.MEDIUM] + if len(medium_slots) > len(missions_to_add): + raise Exception("There are not enough Easy and Medium missions to fill the campaign. Please exclude fewer missions.") + for slot in medium_slots: + pick_mission(slot) + + # Add hard missions into pool and fill in hard slots + missions_to_add = missions_to_add + mission_pools[MissionPools.HARD] + if len(hard_slots) > len(missions_to_add): + raise Exception("There are not enough missions to fill the campaign. Please exclude fewer missions.") + for slot in hard_slots: + pick_mission(slot) + + # Add very hard missions into pool and fill in very hard slots + missions_to_add = missions_to_add + mission_pools[MissionPools.VERY_HARD] + if len(very_hard_slots) > len(missions_to_add): + raise Exception("There are not enough missions to fill the campaign. Please exclude fewer missions.") + for slot in very_hard_slots: + pick_mission(slot) + + # Generating regions and locations from selected missions + for mission_slot in mission_slots: + if isinstance(mission_slot.slot, SC2Mission): + regions.append(create_region(world, locations_per_region, location_cache, mission_slot.slot.mission_name)) + world.multiworld.regions += regions + + campaigns: List[SC2Campaign] + if mission_order_type in campaign_depending_orders: + campaigns = list(enabled_campaigns) + else: + campaigns = [SC2Campaign.GLOBAL] + + mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]] = {} + campaign_mission_slots: Dict[SC2Campaign, List[SC2MissionSlot]] = \ + { + campaign: [mission_slot for mission_slot in mission_slots if campaign == mission_slot.campaign] + for campaign in campaigns + } + + slot_map: Dict[SC2Campaign, List[int]] = dict() + + for campaign in campaigns: + mission_req_table.update({campaign: dict()}) + + # Mapping original mission slots to shifted mission slots when missions are removed + slot_map[campaign] = [] + slot_offset = 0 + for position, mission in enumerate(campaign_mission_slots[campaign]): + slot_map[campaign].append(position - slot_offset + 1) + if mission is None or mission.slot is None: + slot_offset += 1 + + def build_connection_rule(mission_names: List[str], missions_req: int) -> Callable: + player = world.player + if len(mission_names) > 1: + return lambda state: state.has_all({f"Beat {name}" for name in mission_names}, player) \ + and state.has_group("Missions", player, missions_req) + else: + return lambda state: state.has(f"Beat {mission_names[0]}", player) \ + and state.has_group("Missions", player, missions_req) + + for campaign in campaigns: + # Loop through missions to create requirements table and connect regions + for i, mission in enumerate(campaign_mission_slots[campaign]): + if mission is None or mission.slot is None: + continue + connections: List[MissionConnection] = [] + all_connections: List[SC2MissionSlot] = [] + connection: MissionConnection + for connection in mission_order[campaign][i].connect_to: + if connection.connect_to == -1: + continue + # If mission normally connects to an excluded campaign, connect to menu instead + if connection.campaign not in campaign_mission_slots: + connection.connect_to = -1 + continue + while campaign_mission_slots[connection.campaign][connection.connect_to].slot is None: + connection.connect_to -= 1 + all_connections.append(campaign_mission_slots[connection.campaign][connection.connect_to]) + for connection in mission_order[campaign][i].connect_to: + if connection.connect_to == -1: + connect(world, names, "Menu", mission.slot.mission_name) + else: + required_mission = campaign_mission_slots[connection.campaign][connection.connect_to] + if ((required_mission is None or required_mission.slot is None) + and not mission_order[campaign][i].completion_critical): # Drop non-critical null slots + continue + while required_mission is None or required_mission.slot is None: # Substituting null slot with prior slot + connection.connect_to -= 1 + required_mission = campaign_mission_slots[connection.campaign][connection.connect_to] + required_missions = [required_mission] if mission_order[campaign][i].or_requirements else all_connections + if isinstance(required_mission.slot, SC2Mission): + required_mission_name = required_mission.slot.mission_name + required_missions_names = [mission.slot.mission_name for mission in required_missions] + connect(world, names, required_mission_name, mission.slot.mission_name, + build_connection_rule(required_missions_names, mission_order[campaign][i].number)) + connections.append(MissionConnection(slot_map[connection.campaign][connection.connect_to], connection.campaign)) + + mission_req_table[campaign].update({mission.slot.mission_name: MissionInfo( + mission.slot, connections, mission_order[campaign][i].category, + number=mission_order[campaign][i].number, + completion_critical=mission_order[campaign][i].completion_critical, + or_requirements=mission_order[campaign][i].or_requirements)}) + + final_mission_id = final_mission.id + # Changing the completion condition for alternate final missions into an event + final_location = get_goal_location(final_mission) + setup_final_location(final_location, location_cache) + + return mission_req_table, final_mission_id, final_location + + +def setup_final_location(final_location, location_cache): + # Final location should be near the end of the cache + for i in range(len(location_cache) - 1, -1, -1): + if location_cache[i].name == final_location: + location_cache[i].address = None + break + + +def create_location(player: int, location_data: LocationData, region: Region, + location_cache: List[Location]) -> Location: + location = Location(player, location_data.name, location_data.code, region) + location.access_rule = location_data.rule + + location_cache.append(location) + + return location + + +def create_region(world: World, locations_per_region: Dict[str, List[LocationData]], + location_cache: List[Location], name: str) -> Region: + region = Region(name, world.player, world.multiworld) + + if name in locations_per_region: + for location_data in locations_per_region[name]: + location = create_location(world.player, location_data, region, location_cache) + region.locations.append(location) + + return region + + +def connect(world: World, used_names: Dict[str, int], source: str, target: str, + rule: Optional[Callable] = None): + source_region = world.get_region(source) + target_region = world.get_region(target) + + if target not in used_names: + used_names[target] = 1 + name = target + else: + used_names[target] += 1 + name = target + (' ' * used_names[target]) + + connection = Entrance(world.player, name, source_region) + + if rule: + connection.access_rule = rule + + source_region.exits.append(connection) + connection.connect(target_region) + + +def get_locations_per_region(locations: Tuple[LocationData, ...]) -> Dict[str, List[LocationData]]: + per_region: Dict[str, List[LocationData]] = {} + + for location in locations: + per_region.setdefault(location.region, []).append(location) + + return per_region + + +def get_factors(number: int) -> Tuple[int, int]: + """ + Simple factorization into pairs of numbers (x, y) using a sieve method. + Returns the factorization that is most square, i.e. where x + y is minimized. + Factor order is such that x <= y. + """ + assert number > 0 + for divisor in range(math.floor(math.sqrt(number)), 1, -1): + quotient = number // divisor + if quotient * divisor == number: + return divisor, quotient + return 1, number + + +def get_grid_dimensions(size: int) -> Tuple[int, int, int]: + """ + Get the dimensions of a grid mission order from the number of missions, int the format (x, y, error). + * Error will always be 0, 1, or 2, so the missions can be removed from the corners that aren't the start or end. + * Dimensions are chosen such that x <= y, as buttons in the UI are wider than they are tall. + * Dimensions are chosen to be maximally square. That is, x + y + error is minimized. + * If multiple options of the same rating are possible, the one with the larger error is chosen, + as it will appear more square. Compare 3x11 to 5x7-2 for an example of this. + """ + dimension_candidates: List[Tuple[int, int, int]] = [(*get_factors(size + x), x) for x in (2, 1, 0)] + best_dimension = min(dimension_candidates, key=sum) + return best_dimension + diff --git a/worlds/sc2/Rules.py b/worlds/sc2/Rules.py new file mode 100644 index 000000000000..8b9097ea1d78 --- /dev/null +++ b/worlds/sc2/Rules.py @@ -0,0 +1,952 @@ +from typing import Set + +from BaseClasses import CollectionState +from .Options import get_option_value, RequiredTactics, kerrigan_unit_available, AllInMap, \ + GrantStoryTech, GrantStoryLevels, TakeOverAIAllies, SpearOfAdunAutonomouslyCastAbilityPresence, \ + get_enabled_campaigns, MissionOrder +from .Items import get_basic_units, defense_ratings, zerg_defense_ratings, kerrigan_actives, air_defense_ratings, \ + kerrigan_levels, get_full_item_list +from .MissionTables import SC2Race, SC2Campaign +from . import ItemNames +from worlds.AutoWorld import World + + +class SC2Logic: + + def lock_any_item(self, state: CollectionState, items: Set[str]) -> bool: + """ + Guarantees that at least one of these items will remain in the world. Doesn't affect placement. + Needed for cases when the dynamic pool filtering could remove all the item prerequisites + :param state: + :param items: + :return: + """ + return self.is_item_placement(state) \ + or state.has_any(items, self.player) + + def is_item_placement(self, state): + """ + Tells if it's item placement or item pool filter + :param state: + :return: True for item placement, False for pool filter + """ + # has_group with count = 0 is always true for item placement and always false for SC2 item filtering + return state.has_group("Missions", self.player, 0) + + # WoL + def terran_common_unit(self, state: CollectionState) -> bool: + return state.has_any(self.basic_terran_units, self.player) + + def terran_early_tech(self, state: CollectionState): + """ + Basic combat unit that can be deployed quickly from mission start + :param state + :return: + """ + return ( + state.has_any({ItemNames.MARINE, ItemNames.FIREBAT, ItemNames.MARAUDER, ItemNames.REAPER, ItemNames.HELLION}, self.player) + or (self.advanced_tactics and state.has_any({ItemNames.GOLIATH, ItemNames.DIAMONDBACK, ItemNames.VIKING, ItemNames.BANSHEE}, self.player)) + ) + + def terran_air(self, state: CollectionState) -> bool: + """ + Air units or drops on advanced tactics + :param state: + :return: + """ + return (state.has_any({ItemNames.VIKING, ItemNames.WRAITH, ItemNames.BANSHEE, ItemNames.BATTLECRUISER}, self.player) or self.advanced_tactics + and state.has_any({ItemNames.HERCULES, ItemNames.MEDIVAC}, self.player) and self.terran_common_unit(state) + ) + + def terran_air_anti_air(self, state: CollectionState) -> bool: + """ + Air-to-air + :param state: + :return: + """ + return ( + state.has(ItemNames.VIKING, self.player) + or state.has_all({ItemNames.WRAITH, ItemNames.WRAITH_ADVANCED_LASER_TECHNOLOGY}, self.player) + or state.has_all({ItemNames.BATTLECRUISER, ItemNames.BATTLECRUISER_ATX_LASER_BATTERY}, self.player) + or self.advanced_tactics and state.has_any({ItemNames.WRAITH, ItemNames.VALKYRIE, ItemNames.BATTLECRUISER}, self.player) + ) + + def terran_competent_ground_to_air(self, state: CollectionState) -> bool: + """ + Ground-to-air + :param state: + :return: + """ + return ( + state.has(ItemNames.GOLIATH, self.player) + or state.has(ItemNames.MARINE, self.player) and self.terran_bio_heal(state) + or self.advanced_tactics and state.has(ItemNames.CYCLONE, self.player) + ) + + def terran_competent_anti_air(self, state: CollectionState) -> bool: + """ + Good AA unit + :param state: + :return: + """ + return ( + self.terran_competent_ground_to_air(state) + or self.terran_air_anti_air(state) + ) + + def welcome_to_the_jungle_requirement(self, state: CollectionState) -> bool: + """ + Welcome to the Jungle requirements - able to deal with Scouts, Void Rays, Zealots and Stalkers + :param state: + :return: + """ + return ( + self.terran_common_unit(state) + and self.terran_competent_ground_to_air(state) + ) or ( + self.advanced_tactics + and state.has_any({ItemNames.MARINE, ItemNames.VULTURE}, self.player) + and self.terran_air_anti_air(state) + ) + + def terran_basic_anti_air(self, state: CollectionState) -> bool: + """ + Basic AA to deal with few air units + :param state: + :return: + """ + return ( + state.has_any({ + ItemNames.MISSILE_TURRET, ItemNames.THOR, ItemNames.WAR_PIGS, ItemNames.SPARTAN_COMPANY, + ItemNames.HELS_ANGELS, ItemNames.BATTLECRUISER, ItemNames.MARINE, ItemNames.WRAITH, + ItemNames.VALKYRIE, ItemNames.CYCLONE, ItemNames.WINGED_NIGHTMARES, ItemNames.BRYNHILDS + }, self.player) + or self.terran_competent_anti_air(state) + or self.advanced_tactics and state.has_any({ItemNames.GHOST, ItemNames.SPECTRE, ItemNames.WIDOW_MINE, ItemNames.LIBERATOR}, self.player) + ) + + def terran_defense_rating(self, state: CollectionState, zerg_enemy: bool, air_enemy: bool = True) -> int: + """ + Ability to handle defensive missions + :param state: + :param zerg_enemy: + :param air_enemy: + :return: + """ + defense_score = sum((defense_ratings[item] for item in defense_ratings if state.has(item, self.player))) + # Manned Bunker + if state.has_any({ItemNames.MARINE, ItemNames.MARAUDER}, self.player) and state.has(ItemNames.BUNKER, self.player): + defense_score += 3 + elif zerg_enemy and state.has(ItemNames.FIREBAT, self.player) and state.has(ItemNames.BUNKER, self.player): + defense_score += 2 + # Siege Tank upgrades + if state.has_all({ItemNames.SIEGE_TANK, ItemNames.SIEGE_TANK_MAELSTROM_ROUNDS}, self.player): + defense_score += 2 + if state.has_all({ItemNames.SIEGE_TANK, ItemNames.SIEGE_TANK_GRADUATING_RANGE}, self.player): + defense_score += 1 + # Widow Mine upgrade + if state.has_all({ItemNames.WIDOW_MINE, ItemNames.WIDOW_MINE_CONCEALMENT}, self.player): + defense_score += 1 + # Viking with splash + if state.has_all({ItemNames.VIKING, ItemNames.VIKING_SHREDDER_ROUNDS}, self.player): + defense_score += 2 + + # General enemy-based rules + if zerg_enemy: + defense_score += sum((zerg_defense_ratings[item] for item in zerg_defense_ratings if state.has(item, self.player))) + if air_enemy: + defense_score += sum((air_defense_ratings[item] for item in air_defense_ratings if state.has(item, self.player))) + if air_enemy and zerg_enemy and state.has(ItemNames.VALKYRIE, self.player): + # Valkyries shred mass Mutas, most common air enemy that's massed in these cases + defense_score += 2 + # Advanced Tactics bumps defense rating requirements down by 2 + if self.advanced_tactics: + defense_score += 2 + return defense_score + + def terran_competent_comp(self, state: CollectionState) -> bool: + """ + Ability to deal with most of hard missions + :param state: + :return: + """ + return ( + ( + (state.has_any({ItemNames.MARINE, ItemNames.MARAUDER}, self.player) and self.terran_bio_heal(state)) + or state.has_any({ItemNames.THOR, ItemNames.BANSHEE, ItemNames.SIEGE_TANK}, self.player) + or state.has_all({ItemNames.LIBERATOR, ItemNames.LIBERATOR_RAID_ARTILLERY}, self.player) + ) + and self.terran_competent_anti_air(state) + ) or ( + state.has(ItemNames.BATTLECRUISER, self.player) and self.terran_common_unit(state) + ) + + def great_train_robbery_train_stopper(self, state: CollectionState) -> bool: + """ + Ability to deal with trains (moving target with a lot of HP) + :param state: + :return: + """ + return ( + state.has_any({ItemNames.SIEGE_TANK, ItemNames.DIAMONDBACK, ItemNames.MARAUDER, ItemNames.CYCLONE, ItemNames.BANSHEE}, self.player) + or self.advanced_tactics + and ( + state.has_all({ItemNames.REAPER, ItemNames.REAPER_G4_CLUSTERBOMB}, self.player) + or state.has_all({ItemNames.SPECTRE, ItemNames.SPECTRE_PSIONIC_LASH}, self.player) + or state.has_any({ItemNames.VULTURE, ItemNames.LIBERATOR}, self.player) + ) + ) + + def terran_can_rescue(self, state) -> bool: + """ + Rescuing in The Moebius Factor + :param state: + :return: + """ + return state.has_any({ItemNames.MEDIVAC, ItemNames.HERCULES, ItemNames.RAVEN, ItemNames.VIKING}, self.player) or self.advanced_tactics + + def terran_beats_protoss_deathball(self, state: CollectionState) -> bool: + """ + Ability to deal with Immortals, Colossi with some air support + :param state: + :return: + """ + return ( + ( + state.has_any({ItemNames.BANSHEE, ItemNames.BATTLECRUISER}, self.player) + or state.has_all({ItemNames.LIBERATOR, ItemNames.LIBERATOR_RAID_ARTILLERY}, self.player) + ) and self.terran_competent_anti_air(state) + or self.terran_competent_comp(state) and self.terran_air_anti_air(state) + ) + + def marine_medic_upgrade(self, state: CollectionState) -> bool: + """ + Infantry upgrade to infantry-only no-build segments + :param state: + :return: + """ + return state.has_any({ + ItemNames.MARINE_COMBAT_SHIELD, ItemNames.MARINE_MAGRAIL_MUNITIONS, ItemNames.MEDIC_STABILIZER_MEDPACKS + }, self.player) \ + or (state.count(ItemNames.MARINE_PROGRESSIVE_STIMPACK, self.player) >= 2 + and state.has_group("Missions", self.player, 1)) + + def terran_survives_rip_field(self, state: CollectionState) -> bool: + """ + Ability to deal with large areas with environment damage + :param state: + :return: + """ + return (state.has(ItemNames.BATTLECRUISER, self.player) + or self.terran_air(state) and self.terran_competent_anti_air(state) and self.terran_sustainable_mech_heal(state)) + + def terran_sustainable_mech_heal(self, state: CollectionState) -> bool: + """ + Can heal mech units without spending resources + :param state: + :return: + """ + return state.has(ItemNames.SCIENCE_VESSEL, self.player) \ + or state.has_all({ItemNames.MEDIC, ItemNames.MEDIC_ADAPTIVE_MEDPACKS}, self.player) \ + or state.count(ItemNames.PROGRESSIVE_REGENERATIVE_BIO_STEEL, self.player) >= 3 \ + or (self.advanced_tactics + and ( + state.has_all({ItemNames.RAVEN, ItemNames.RAVEN_BIO_MECHANICAL_REPAIR_DRONE}, self.player) + or state.count(ItemNames.PROGRESSIVE_REGENERATIVE_BIO_STEEL, self.player) >= 2) + ) + + def terran_bio_heal(self, state: CollectionState) -> bool: + """ + Ability to heal bio units + :param state: + :return: + """ + return state.has_any({ItemNames.MEDIC, ItemNames.MEDIVAC}, self.player) \ + or self.advanced_tactics and state.has_all({ItemNames.RAVEN, ItemNames.RAVEN_BIO_MECHANICAL_REPAIR_DRONE}, self.player) + + def terran_base_trasher(self, state: CollectionState) -> bool: + """ + Can attack heavily defended bases + :param state: + :return: + """ + return state.has(ItemNames.SIEGE_TANK, self.player) \ + or state.has_all({ItemNames.BATTLECRUISER, ItemNames.BATTLECRUISER_ATX_LASER_BATTERY}, self.player) \ + or state.has_all({ItemNames.LIBERATOR, ItemNames.LIBERATOR_RAID_ARTILLERY}, self.player) \ + or (self.advanced_tactics + and ((state.has_all({ItemNames.RAVEN, ItemNames.RAVEN_HUNTER_SEEKER_WEAPON}, self.player) + or self.can_nuke(state)) + and ( + state.has_all({ItemNames.VIKING, ItemNames.VIKING_SHREDDER_ROUNDS}, self.player) + or state.has_all({ItemNames.BANSHEE, ItemNames.BANSHEE_SHOCKWAVE_MISSILE_BATTERY}, self.player)) + ) + ) + + def terran_mobile_detector(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.RAVEN, ItemNames.SCIENCE_VESSEL, ItemNames.PROGRESSIVE_ORBITAL_COMMAND}, self.player) + + def can_nuke(self, state: CollectionState) -> bool: + """ + Ability to launch nukes + :param state: + :return: + """ + return (self.advanced_tactics + and (state.has_any({ItemNames.GHOST, ItemNames.SPECTRE}, self.player) + or state.has_all({ItemNames.THOR, ItemNames.THOR_BUTTON_WITH_A_SKULL_ON_IT}, self.player))) + + def terran_respond_to_colony_infestations(self, state: CollectionState) -> bool: + """ + Can deal quickly with Brood Lords and Mutas in Haven's Fall and being able to progress the mission + :param state: + :return: + """ + return ( + self.terran_common_unit(state) + and self.terran_competent_anti_air(state) + and ( + self.terran_air_anti_air(state) + or state.has_any({ItemNames.BATTLECRUISER, ItemNames.VALKYRIE}, self.player) + ) + and self.terran_defense_rating(state, True) >= 3 + ) + + def engine_of_destruction_requirement(self, state: CollectionState): + return self.marine_medic_upgrade(state) \ + and ( + self.terran_competent_anti_air(state) + and self.terran_common_unit(state) or state.has(ItemNames.WRAITH, self.player) + ) + + def all_in_requirement(self, state: CollectionState): + """ + All-in + :param state: + :return: + """ + beats_kerrigan = state.has_any({ItemNames.MARINE, ItemNames.BANSHEE, ItemNames.GHOST}, self.player) or self.advanced_tactics + if get_option_value(self.world, 'all_in_map') == AllInMap.option_ground: + # Ground + defense_rating = self.terran_defense_rating(state, True, False) + if state.has_any({ItemNames.BATTLECRUISER, ItemNames.BANSHEE}, self.player): + defense_rating += 2 + return defense_rating >= 13 and beats_kerrigan + else: + # Air + defense_rating = self.terran_defense_rating(state, True, True) + return defense_rating >= 9 and beats_kerrigan \ + and state.has_any({ItemNames.VIKING, ItemNames.BATTLECRUISER, ItemNames.VALKYRIE}, self.player) \ + and state.has_any({ItemNames.HIVE_MIND_EMULATOR, ItemNames.PSI_DISRUPTER, ItemNames.MISSILE_TURRET}, self.player) + + # HotS + def zerg_common_unit(self, state: CollectionState) -> bool: + return state.has_any(self.basic_zerg_units, self.player) + + def zerg_competent_anti_air(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.HYDRALISK, ItemNames.MUTALISK, ItemNames.CORRUPTOR, ItemNames.BROOD_QUEEN}, self.player) \ + or state.has_all({ItemNames.SWARM_HOST, ItemNames.SWARM_HOST_PRESSURIZED_GLANDS}, self.player) \ + or state.has_all({ItemNames.SCOURGE, ItemNames.SCOURGE_RESOURCE_EFFICIENCY}, self.player) \ + or (self.advanced_tactics and state.has(ItemNames.INFESTOR, self.player)) + + def zerg_basic_anti_air(self, state: CollectionState) -> bool: + return self.zerg_competent_anti_air(state) or self.kerrigan_unit_available in kerrigan_unit_available or \ + state.has_any({ItemNames.SWARM_QUEEN, ItemNames.SCOURGE}, self.player) or (self.advanced_tactics and state.has(ItemNames.SPORE_CRAWLER, self.player)) + + def morph_brood_lord(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.MUTALISK, ItemNames.CORRUPTOR}, self.player) \ + and state.has(ItemNames.MUTALISK_CORRUPTOR_BROOD_LORD_ASPECT, self.player) + + def morph_viper(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.MUTALISK, ItemNames.CORRUPTOR}, self.player) \ + and state.has(ItemNames.MUTALISK_CORRUPTOR_VIPER_ASPECT, self.player) + + def morph_impaler_or_lurker(self, state: CollectionState) -> bool: + return state.has(ItemNames.HYDRALISK, self.player) and state.has_any({ItemNames.HYDRALISK_IMPALER_ASPECT, ItemNames.HYDRALISK_LURKER_ASPECT}, self.player) + + def zerg_competent_comp(self, state: CollectionState) -> bool: + advanced = self.advanced_tactics + core_unit = state.has_any({ItemNames.ROACH, ItemNames.ABERRATION, ItemNames.ZERGLING}, self.player) + support_unit = state.has_any({ItemNames.SWARM_QUEEN, ItemNames.HYDRALISK}, self.player) \ + or self.morph_brood_lord(state) \ + or advanced and (state.has_any({ItemNames.INFESTOR, ItemNames.DEFILER}, self.player) or self.morph_viper(state)) + if core_unit and support_unit: + return True + vespene_unit = state.has_any({ItemNames.ULTRALISK, ItemNames.ABERRATION}, self.player) \ + or advanced and self.morph_viper(state) + return vespene_unit and state.has_any({ItemNames.ZERGLING, ItemNames.SWARM_QUEEN}, self.player) + + def spread_creep(self, state: CollectionState) -> bool: + return self.advanced_tactics or state.has(ItemNames.SWARM_QUEEN, self.player) + + def zerg_competent_defense(self, state: CollectionState) -> bool: + return ( + self.zerg_common_unit(state) + and ( + ( + state.has(ItemNames.SWARM_HOST, self.player) + or self.morph_brood_lord(state) + or self.morph_impaler_or_lurker(state) + ) or ( + self.advanced_tactics + and (self.morph_viper(state) + or state.has(ItemNames.SPINE_CRAWLER, self.player)) + ) + ) + ) + + def basic_kerrigan(self, state: CollectionState) -> bool: + # One active ability that can be used to defeat enemies directly on Standard + if not self.advanced_tactics and \ + not state.has_any({ItemNames.KERRIGAN_KINETIC_BLAST, ItemNames.KERRIGAN_LEAPING_STRIKE, + ItemNames.KERRIGAN_CRUSHING_GRIP, ItemNames.KERRIGAN_PSIONIC_SHIFT, + ItemNames.KERRIGAN_SPAWN_BANELINGS}, self.player): + return False + # Two non-ultimate abilities + count = 0 + for item in (ItemNames.KERRIGAN_KINETIC_BLAST, ItemNames.KERRIGAN_LEAPING_STRIKE, ItemNames.KERRIGAN_HEROIC_FORTITUDE, + ItemNames.KERRIGAN_CHAIN_REACTION, ItemNames.KERRIGAN_CRUSHING_GRIP, ItemNames.KERRIGAN_PSIONIC_SHIFT, + ItemNames.KERRIGAN_SPAWN_BANELINGS, ItemNames.KERRIGAN_INFEST_BROODLINGS, ItemNames.KERRIGAN_FURY): + if state.has(item, self.player): + count += 1 + if count >= 2: + return True + return False + + def two_kerrigan_actives(self, state: CollectionState) -> bool: + count = 0 + for i in range(7): + if state.has_any(kerrigan_actives[i], self.player): + count += 1 + return count >= 2 + + def zerg_pass_vents(self, state: CollectionState) -> bool: + return self.story_tech_granted \ + or state.has_any({ItemNames.ZERGLING, ItemNames.HYDRALISK, ItemNames.ROACH}, self.player) \ + or (self.advanced_tactics and state.has(ItemNames.INFESTOR, self.player)) + + def supreme_requirement(self, state: CollectionState) -> bool: + return self.story_tech_granted \ + or not self.kerrigan_unit_available \ + or ( + state.has_all({ItemNames.KERRIGAN_LEAPING_STRIKE, ItemNames.KERRIGAN_MEND}, self.player) + and self.kerrigan_levels(state, 35) + ) + + def kerrigan_levels(self, state: CollectionState, target: int) -> bool: + if self.story_levels_granted or not self.kerrigan_unit_available: + return True # Levels are granted + if self.kerrigan_levels_per_mission_completed > 0 \ + and self.kerrigan_levels_per_mission_completed_cap > 0 \ + and not self.is_item_placement(state): + # Levels can be granted from mission completion. + # Item pool filtering isn't aware of missions beaten. Assume that missions beaten will fulfill this rule. + return True + # Levels from missions beaten + levels = self.kerrigan_levels_per_mission_completed * state.count_group("Missions", self.player) + if self.kerrigan_levels_per_mission_completed_cap != -1: + levels = min(levels, self.kerrigan_levels_per_mission_completed_cap) + # Levels from items + for kerrigan_level_item in kerrigan_levels: + level_amount = get_full_item_list()[kerrigan_level_item].number + item_count = state.count(kerrigan_level_item, self.player) + levels += item_count * level_amount + # Total level cap + if self.kerrigan_total_level_cap != -1: + levels = min(levels, self.kerrigan_total_level_cap) + + return levels >= target + + + def the_reckoning_requirement(self, state: CollectionState) -> bool: + if self.take_over_ai_allies: + return self.terran_competent_comp(state) \ + and self.zerg_competent_comp(state) \ + and (self.zerg_competent_anti_air(state) + or self.terran_competent_anti_air(state)) + else: + return self.zerg_competent_comp(state) \ + and self.zerg_competent_anti_air(state) + + # LotV + + def protoss_common_unit(self, state: CollectionState) -> bool: + return state.has_any(self.basic_protoss_units, self.player) + + def protoss_basic_anti_air(self, state: CollectionState) -> bool: + return self.protoss_competent_anti_air(state) \ + or state.has_any({ItemNames.PHOENIX, ItemNames.MIRAGE, ItemNames.CORSAIR, ItemNames.CARRIER, ItemNames.SCOUT, + ItemNames.DARK_ARCHON, ItemNames.WRATHWALKER, ItemNames.MOTHERSHIP}, self.player) \ + or state.has_all({ItemNames.WARP_PRISM, ItemNames.WARP_PRISM_PHASE_BLASTER}, self.player) \ + or self.advanced_tactics and state.has_any( + {ItemNames.HIGH_TEMPLAR, ItemNames.SIGNIFIER, ItemNames.ASCENDANT, ItemNames.DARK_TEMPLAR, + ItemNames.SENTRY, ItemNames.ENERGIZER}, self.player) + + def protoss_anti_armor_anti_air(self, state: CollectionState) -> bool: + return self.protoss_competent_anti_air(state) \ + or state.has_any({ItemNames.SCOUT, ItemNames.WRATHWALKER}, self.player) \ + or (state.has_any({ItemNames.IMMORTAL, ItemNames.ANNIHILATOR}, self.player) + and state.has(ItemNames.IMMORTAL_ANNIHILATOR_ADVANCED_TARGETING_MECHANICS, self.player)) + + def protoss_anti_light_anti_air(self, state: CollectionState) -> bool: + return self.protoss_competent_anti_air(state) \ + or state.has_any({ItemNames.PHOENIX, ItemNames.MIRAGE, ItemNames.CORSAIR, ItemNames.CARRIER}, self.player) + + def protoss_competent_anti_air(self, state: CollectionState) -> bool: + return state.has_any( + {ItemNames.STALKER, ItemNames.SLAYER, ItemNames.INSTIGATOR, ItemNames.DRAGOON, ItemNames.ADEPT, + ItemNames.VOID_RAY, ItemNames.DESTROYER, ItemNames.TEMPEST}, self.player) \ + or (state.has_any({ItemNames.PHOENIX, ItemNames.MIRAGE, ItemNames.CORSAIR, ItemNames.CARRIER}, self.player) + and state.has_any({ItemNames.SCOUT, ItemNames.WRATHWALKER}, self.player)) \ + or (self.advanced_tactics + and state.has_any({ItemNames.IMMORTAL, ItemNames.ANNIHILATOR}, self.player) + and state.has(ItemNames.IMMORTAL_ANNIHILATOR_ADVANCED_TARGETING_MECHANICS, self.player)) + + def protoss_has_blink(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.STALKER, ItemNames.INSTIGATOR, ItemNames.SLAYER}, self.player) \ + or ( + state.has(ItemNames.DARK_TEMPLAR_AVENGER_BLOOD_HUNTER_BLINK, self.player) + and state.has_any({ItemNames.DARK_TEMPLAR, ItemNames.BLOOD_HUNTER, ItemNames.AVENGER}, self.player) + ) + + def protoss_can_attack_behind_chasm(self, state: CollectionState) -> bool: + return state.has_any( + {ItemNames.SCOUT, ItemNames.TEMPEST, + ItemNames.CARRIER, ItemNames.VOID_RAY, ItemNames.DESTROYER, ItemNames.MOTHERSHIP}, self.player) \ + or self.protoss_has_blink(state) \ + or (state.has(ItemNames.WARP_PRISM, self.player) + and (self.protoss_common_unit(state) or state.has(ItemNames.WARP_PRISM_PHASE_BLASTER, self.player))) \ + or (self.advanced_tactics + and state.has_any({ItemNames.ORACLE, ItemNames.ARBITER}, self.player)) + + def protoss_fleet(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.CARRIER, ItemNames.TEMPEST, ItemNames.VOID_RAY, ItemNames.DESTROYER}, self.player) + + def templars_return_requirement(self, state: CollectionState) -> bool: + return self.story_tech_granted \ + or ( + state.has_any({ItemNames.IMMORTAL, ItemNames.ANNIHILATOR}, self.player) + and state.has_any({ItemNames.COLOSSUS, ItemNames.VANGUARD, ItemNames.REAVER, ItemNames.DARK_TEMPLAR}, self.player) + and state.has_any({ItemNames.SENTRY, ItemNames.HIGH_TEMPLAR}, self.player) + ) + + def brothers_in_arms_requirement(self, state: CollectionState) -> bool: + return ( + self.protoss_common_unit(state) + and self.protoss_anti_armor_anti_air(state) + and self.protoss_hybrid_counter(state) + ) or ( + self.take_over_ai_allies + and ( + self.terran_common_unit(state) + or self.protoss_common_unit(state) + ) + and ( + self.terran_competent_anti_air(state) + or self.protoss_anti_armor_anti_air(state) + ) + and ( + self.protoss_hybrid_counter(state) + or state.has_any({ItemNames.BATTLECRUISER, ItemNames.LIBERATOR, ItemNames.SIEGE_TANK}, self.player) + or state.has_all({ItemNames.SPECTRE, ItemNames.SPECTRE_PSIONIC_LASH}, self.player) + or (state.has(ItemNames.IMMORTAL, self.player) + and state.has_any({ItemNames.MARINE, ItemNames.MARAUDER}, self.player) + and self.terran_bio_heal(state)) + ) + ) + + def protoss_hybrid_counter(self, state: CollectionState) -> bool: + """ + Ground Hybrids + """ + return state.has_any( + {ItemNames.ANNIHILATOR, ItemNames.ASCENDANT, ItemNames.TEMPEST, ItemNames.CARRIER, ItemNames.VOID_RAY, + ItemNames.WRATHWALKER, ItemNames.VANGUARD}, self.player) \ + or (state.has(ItemNames.IMMORTAL, self.player) or self.advanced_tactics) and state.has_any( + {ItemNames.STALKER, ItemNames.DRAGOON, ItemNames.ADEPT, ItemNames.INSTIGATOR, ItemNames.SLAYER}, self.player) + + def the_infinite_cycle_requirement(self, state: CollectionState) -> bool: + return self.story_tech_granted \ + or not self.kerrigan_unit_available \ + or ( + self.two_kerrigan_actives(state) + and self.basic_kerrigan(state) + and self.kerrigan_levels(state, 70) + ) + + def protoss_basic_splash(self, state: CollectionState) -> bool: + return state.has_any( + {ItemNames.ZEALOT, ItemNames.COLOSSUS, ItemNames.VANGUARD, ItemNames.HIGH_TEMPLAR, ItemNames.SIGNIFIER, + ItemNames.DARK_TEMPLAR, ItemNames.REAVER, ItemNames.ASCENDANT}, self.player) + + def protoss_static_defense(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.PHOTON_CANNON, ItemNames.KHAYDARIN_MONOLITH}, self.player) + + def last_stand_requirement(self, state: CollectionState) -> bool: + return self.protoss_common_unit(state) \ + and self.protoss_competent_anti_air(state) \ + and self.protoss_static_defense(state) \ + and ( + self.advanced_tactics + or self.protoss_basic_splash(state) + ) + + def harbinger_of_oblivion_requirement(self, state: CollectionState) -> bool: + return self.protoss_anti_armor_anti_air(state) and ( + self.take_over_ai_allies + or ( + self.protoss_common_unit(state) + and self.protoss_hybrid_counter(state) + ) + ) + + def protoss_competent_comp(self, state: CollectionState) -> bool: + return self.protoss_common_unit(state) \ + and self.protoss_competent_anti_air(state) \ + and self.protoss_hybrid_counter(state) \ + and self.protoss_basic_splash(state) + + def protoss_stalker_upgrade(self, state: CollectionState) -> bool: + return ( + state.has_any( + { + ItemNames.STALKER_INSTIGATOR_SLAYER_DISINTEGRATING_PARTICLES, + ItemNames.STALKER_INSTIGATOR_SLAYER_PARTICLE_REFLECTION + }, self.player) + and self.lock_any_item(state, {ItemNames.STALKER, ItemNames.INSTIGATOR, ItemNames.SLAYER}) + ) + + def steps_of_the_rite_requirement(self, state: CollectionState) -> bool: + return self.protoss_competent_comp(state) \ + or ( + self.protoss_common_unit(state) + and self.protoss_competent_anti_air(state) + and self.protoss_static_defense(state) + ) + + def protoss_heal(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.CARRIER, ItemNames.SENTRY, ItemNames.SHIELD_BATTERY, ItemNames.RECONSTRUCTION_BEAM}, self.player) + + def templars_charge_requirement(self, state: CollectionState) -> bool: + return self.protoss_heal(state) \ + and self.protoss_anti_armor_anti_air(state) \ + and ( + self.protoss_fleet(state) + or (self.advanced_tactics + and self.protoss_competent_comp(state) + ) + ) + + def the_host_requirement(self, state: CollectionState) -> bool: + return (self.protoss_fleet(state) + and self.protoss_static_defense(state) + ) or ( + self.protoss_competent_comp(state) + and state.has(ItemNames.SOA_TIME_STOP, self.player) + ) + + def salvation_requirement(self, state: CollectionState) -> bool: + return [ + self.protoss_competent_comp(state), + self.protoss_fleet(state), + self.protoss_static_defense(state) + ].count(True) >= 2 + + def into_the_void_requirement(self, state: CollectionState) -> bool: + return self.protoss_competent_comp(state) \ + or ( + self.take_over_ai_allies + and ( + state.has(ItemNames.BATTLECRUISER, self.player) + or ( + state.has(ItemNames.ULTRALISK, self.player) + and self.protoss_competent_anti_air(state) + ) + ) + ) + + def essence_of_eternity_requirement(self, state: CollectionState) -> bool: + defense_score = self.terran_defense_rating(state, False, True) + if self.take_over_ai_allies and self.protoss_static_defense(state): + defense_score += 2 + return defense_score >= 10 \ + and ( + self.terran_competent_anti_air(state) + or self.take_over_ai_allies + and self.protoss_competent_anti_air(state) + ) \ + and ( + state.has(ItemNames.BATTLECRUISER, self.player) + or (state.has(ItemNames.BANSHEE, self.player) and state.has_any({ItemNames.VIKING, ItemNames.VALKYRIE}, + self.player)) + or self.take_over_ai_allies and self.protoss_fleet(state) + ) \ + and state.has_any({ItemNames.SIEGE_TANK, ItemNames.LIBERATOR}, self.player) + + def amons_fall_requirement(self, state: CollectionState) -> bool: + if self.take_over_ai_allies: + return ( + ( + state.has_any({ItemNames.BATTLECRUISER, ItemNames.CARRIER}, self.player) + ) + or (state.has(ItemNames.ULTRALISK, self.player) + and self.protoss_competent_anti_air(state) + and ( + state.has_any({ItemNames.LIBERATOR, ItemNames.BANSHEE, ItemNames.VALKYRIE, ItemNames.VIKING}, self.player) + or state.has_all({ItemNames.WRAITH, ItemNames.WRAITH_ADVANCED_LASER_TECHNOLOGY}, self.player) + or self.protoss_fleet(state) + ) + and (self.terran_sustainable_mech_heal(state) + or (self.spear_of_adun_autonomously_cast_presence == SpearOfAdunAutonomouslyCastAbilityPresence.option_everywhere + and state.has(ItemNames.RECONSTRUCTION_BEAM, self.player)) + ) + ) + ) \ + and self.terran_competent_anti_air(state) \ + and self.protoss_competent_comp(state) \ + and self.zerg_competent_comp(state) + else: + return state.has(ItemNames.MUTALISK, self.player) and self.zerg_competent_comp(state) + + def nova_any_weapon(self, state: CollectionState) -> bool: + return state.has_any( + {ItemNames.NOVA_C20A_CANISTER_RIFLE, ItemNames.NOVA_HELLFIRE_SHOTGUN, ItemNames.NOVA_PLASMA_RIFLE, + ItemNames.NOVA_MONOMOLECULAR_BLADE, ItemNames.NOVA_BLAZEFIRE_GUNBLADE}, self.player) + + def nova_ranged_weapon(self, state: CollectionState) -> bool: + return state.has_any( + {ItemNames.NOVA_C20A_CANISTER_RIFLE, ItemNames.NOVA_HELLFIRE_SHOTGUN, ItemNames.NOVA_PLASMA_RIFLE}, + self.player) + + def nova_splash(self, state: CollectionState) -> bool: + return state.has_any({ + ItemNames.NOVA_HELLFIRE_SHOTGUN, ItemNames.NOVA_BLAZEFIRE_GUNBLADE, ItemNames.NOVA_PULSE_GRENADES + }, self.player) \ + or self.advanced_tactics and state.has_any( + {ItemNames.NOVA_PLASMA_RIFLE, ItemNames.NOVA_MONOMOLECULAR_BLADE}, self.player) + + def nova_dash(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.NOVA_MONOMOLECULAR_BLADE, ItemNames.NOVA_BLINK}, self.player) + + def nova_full_stealth(self, state: CollectionState) -> bool: + return state.count(ItemNames.NOVA_PROGRESSIVE_STEALTH_SUIT_MODULE, self.player) >= 2 + + def nova_heal(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.NOVA_ARMORED_SUIT_MODULE, ItemNames.NOVA_STIM_INFUSION}, self.player) + + def nova_escape_assist(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.NOVA_BLINK, ItemNames.NOVA_HOLO_DECOY, ItemNames.NOVA_IONIC_FORCE_FIELD}, self.player) + + def the_escape_stuff_granted(self) -> bool: + """ + The NCO first mission requires having too much stuff first before actually able to do anything + :return: + """ + return self.story_tech_granted \ + or (self.mission_order == MissionOrder.option_vanilla and self.enabled_campaigns == {SC2Campaign.NCO}) + + def the_escape_first_stage_requirement(self, state: CollectionState) -> bool: + return self.the_escape_stuff_granted() \ + or (self.nova_ranged_weapon(state) and (self.nova_full_stealth(state) or self.nova_heal(state))) + + def the_escape_requirement(self, state: CollectionState) -> bool: + return self.the_escape_first_stage_requirement(state) \ + and (self.the_escape_stuff_granted() or self.nova_splash(state)) + + def terran_cliffjumper(self, state: CollectionState) -> bool: + return state.has(ItemNames.REAPER, self.player) \ + or state.has_all({ItemNames.GOLIATH, ItemNames.GOLIATH_JUMP_JETS}, self.player) \ + or state.has_all({ItemNames.SIEGE_TANK, ItemNames.SIEGE_TANK_JUMP_JETS}, self.player) + + def terran_able_to_snipe_defiler(self, state: CollectionState) -> bool: + return state.has_all({ItemNames.NOVA_JUMP_SUIT_MODULE, ItemNames.NOVA_C20A_CANISTER_RIFLE}, self.player) \ + or state.has_all({ItemNames.SIEGE_TANK, ItemNames.SIEGE_TANK_MAELSTROM_ROUNDS, ItemNames.SIEGE_TANK_JUMP_JETS}, self.player) + + def sudden_strike_requirement(self, state: CollectionState) -> bool: + return self.sudden_strike_can_reach_objectives(state) \ + and self.terran_able_to_snipe_defiler(state) \ + and state.has_any({ItemNames.SIEGE_TANK, ItemNames.VULTURE}, self.player) \ + and self.nova_splash(state) \ + and (self.terran_defense_rating(state, True, False) >= 2 + or state.has(ItemNames.NOVA_JUMP_SUIT_MODULE, self.player)) + + def sudden_strike_can_reach_objectives(self, state: CollectionState) -> bool: + return self.terran_cliffjumper(state) \ + or state.has_any({ItemNames.BANSHEE, ItemNames.VIKING}, self.player) \ + or ( + self.advanced_tactics + and state.has(ItemNames.MEDIVAC, self.player) + and state.has_any({ItemNames.MARINE, ItemNames.MARAUDER, ItemNames.VULTURE, ItemNames.HELLION, + ItemNames.GOLIATH}, self.player) + ) + + def enemy_intelligence_garrisonable_unit(self, state: CollectionState) -> bool: + """ + Has unit usable as a Garrison in Enemy Intelligence + :param state: + :return: + """ + return state.has_any( + {ItemNames.MARINE, ItemNames.REAPER, ItemNames.MARAUDER, ItemNames.GHOST, ItemNames.SPECTRE, + ItemNames.HELLION, ItemNames.GOLIATH, ItemNames.WARHOUND, ItemNames.DIAMONDBACK, ItemNames.VIKING}, + self.player) + + def enemy_intelligence_cliff_garrison(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.REAPER, ItemNames.VIKING, ItemNames.MEDIVAC, ItemNames.HERCULES}, self.player) \ + or state.has_all({ItemNames.GOLIATH, ItemNames.GOLIATH_JUMP_JETS}, self.player) \ + or self.advanced_tactics and state.has_any({ItemNames.HELS_ANGELS, ItemNames.BRYNHILDS}, self.player) + + def enemy_intelligence_first_stage_requirement(self, state: CollectionState) -> bool: + return self.enemy_intelligence_garrisonable_unit(state) \ + and (self.terran_competent_comp(state) + or ( + self.terran_common_unit(state) + and self.terran_competent_anti_air(state) + and state.has(ItemNames.NOVA_NUKE, self.player) + ) + ) \ + and self.terran_defense_rating(state, True, True) >= 5 + + def enemy_intelligence_second_stage_requirement(self, state: CollectionState) -> bool: + return self.enemy_intelligence_first_stage_requirement(state) \ + and self.enemy_intelligence_cliff_garrison(state) \ + and ( + self.story_tech_granted + or ( + self.nova_any_weapon(state) + and ( + self.nova_full_stealth(state) + or (self.nova_heal(state) + and self.nova_splash(state) + and self.nova_ranged_weapon(state)) + ) + ) + ) + + def enemy_intelligence_third_stage_requirement(self, state: CollectionState) -> bool: + return self.enemy_intelligence_second_stage_requirement(state) \ + and ( + self.story_tech_granted + or ( + state.has(ItemNames.NOVA_PROGRESSIVE_STEALTH_SUIT_MODULE, self.player) + and self.nova_dash(state) + ) + ) + + def trouble_in_paradise_requirement(self, state: CollectionState) -> bool: + return self.nova_any_weapon(state) \ + and self.nova_splash(state) \ + and self.terran_beats_protoss_deathball(state) \ + and self.terran_defense_rating(state, True, True) >= 7 + + def night_terrors_requirement(self, state: CollectionState) -> bool: + return self.terran_common_unit(state) \ + and self.terran_competent_anti_air(state) \ + and ( + # These can handle the waves of infested, even volatile ones + state.has(ItemNames.SIEGE_TANK, self.player) + or state.has_all({ItemNames.VIKING, ItemNames.VIKING_SHREDDER_ROUNDS}, self.player) + or ( + ( + # Regular infesteds + state.has(ItemNames.FIREBAT, self.player) + or state.has_all({ItemNames.HELLION, ItemNames.HELLION_HELLBAT_ASPECT}, self.player) + or ( + self.advanced_tactics + and state.has_any({ItemNames.PERDITION_TURRET, ItemNames.PLANETARY_FORTRESS}, self.player) + ) + ) + and self.terran_bio_heal(state) + and ( + # Volatile infesteds + state.has(ItemNames.LIBERATOR, self.player) + or ( + self.advanced_tactics + and state.has_any({ItemNames.HERC, ItemNames.VULTURE}, self.player) + ) + ) + ) + ) + + def flashpoint_far_requirement(self, state: CollectionState) -> bool: + return self.terran_competent_comp(state) \ + and self.terran_mobile_detector(state) \ + and self.terran_defense_rating(state, True, False) >= 6 + + def enemy_shadow_tripwires_tool(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.NOVA_FLASHBANG_GRENADES, ItemNames.NOVA_BLINK, ItemNames.NOVA_DOMINATION}, + self.player) + + def enemy_shadow_door_unlocks_tool(self, state: CollectionState) -> bool: + return state.has_any({ItemNames.NOVA_DOMINATION, ItemNames.NOVA_BLINK, ItemNames.NOVA_JUMP_SUIT_MODULE}, + self.player) + + def enemy_shadow_domination(self, state: CollectionState) -> bool: + return self.story_tech_granted \ + or (self.nova_ranged_weapon(state) + and (self.nova_full_stealth(state) + or state.has(ItemNames.NOVA_JUMP_SUIT_MODULE, self.player) + or (self.nova_heal(state) and self.nova_splash(state)) + ) + ) + + def enemy_shadow_first_stage(self, state: CollectionState) -> bool: + return self.enemy_shadow_domination(state) \ + and (self.story_tech_granted + or ((self.nova_full_stealth(state) and self.enemy_shadow_tripwires_tool(state)) + or (self.nova_heal(state) and self.nova_splash(state)) + ) + ) + + def enemy_shadow_second_stage(self, state: CollectionState) -> bool: + return self.enemy_shadow_first_stage(state) \ + and (self.story_tech_granted + or self.nova_splash(state) + or self.nova_heal(state) + or self.nova_escape_assist(state) + ) + + def enemy_shadow_door_controls(self, state: CollectionState) -> bool: + return self.enemy_shadow_second_stage(state) \ + and (self.story_tech_granted or self.enemy_shadow_door_unlocks_tool(state)) + + def enemy_shadow_victory(self, state: CollectionState) -> bool: + return self.enemy_shadow_door_controls(state) \ + and (self.story_tech_granted or self.nova_heal(state)) + + def dark_skies_requirement(self, state: CollectionState) -> bool: + return self.terran_common_unit(state) \ + and self.terran_beats_protoss_deathball(state) \ + and self.terran_defense_rating(state, False, True) >= 8 + + def end_game_requirement(self, state: CollectionState) -> bool: + return self.terran_competent_comp(state) \ + and self.terran_mobile_detector(state) \ + and ( + state.has_any({ItemNames.BATTLECRUISER, ItemNames.LIBERATOR, ItemNames.BANSHEE}, self.player) + or state.has_all({ItemNames.WRAITH, ItemNames.WRAITH_ADVANCED_LASER_TECHNOLOGY}, self.player) + ) \ + and (state.has_any({ItemNames.BATTLECRUISER, ItemNames.VIKING, ItemNames.LIBERATOR}, self.player) + or (self.advanced_tactics + and state.has_all({ItemNames.RAVEN, ItemNames.RAVEN_HUNTER_SEEKER_WEAPON}, self.player) + ) + ) + + def __init__(self, world: World): + self.world: World = world + self.player = None if world is None else world.player + self.logic_level = get_option_value(world, 'required_tactics') + self.advanced_tactics = self.logic_level != RequiredTactics.option_standard + self.take_over_ai_allies = get_option_value(world, "take_over_ai_allies") == TakeOverAIAllies.option_true + self.kerrigan_unit_available = get_option_value(world, 'kerrigan_presence') in kerrigan_unit_available \ + and SC2Campaign.HOTS in get_enabled_campaigns(world) + self.kerrigan_levels_per_mission_completed = get_option_value(world, "kerrigan_levels_per_mission_completed") + self.kerrigan_levels_per_mission_completed_cap = get_option_value(world, "kerrigan_levels_per_mission_completed_cap") + self.kerrigan_total_level_cap = get_option_value(world, "kerrigan_total_level_cap") + self.story_tech_granted = get_option_value(world, "grant_story_tech") == GrantStoryTech.option_true + self.story_levels_granted = get_option_value(world, "grant_story_levels") != GrantStoryLevels.option_disabled + self.basic_terran_units = get_basic_units(world, SC2Race.TERRAN) + self.basic_zerg_units = get_basic_units(world, SC2Race.ZERG) + self.basic_protoss_units = get_basic_units(world, SC2Race.PROTOSS) + self.spear_of_adun_autonomously_cast_presence = get_option_value(world, "spear_of_adun_autonomously_cast_ability_presence") + self.enabled_campaigns = get_enabled_campaigns(world) + self.mission_order = get_option_value(world, "mission_order") diff --git a/worlds/sc2/Starcraft2.kv b/worlds/sc2/Starcraft2.kv new file mode 100644 index 000000000000..6b112c2f00a6 --- /dev/null +++ b/worlds/sc2/Starcraft2.kv @@ -0,0 +1,28 @@ + + scroll_type: ["content", "bars"] + bar_width: dp(12) + effect_cls: "ScrollEffect" + + + cols: 1 + size_hint_y: None + height: self.minimum_height + 15 + padding: [5,0,dp(12),0] + +: + cols: 1 + +: + rows: 1 + +: + cols: 1 + spacing: [0,5] + +: + text_size: self.size + markup: True + halign: 'center' + valign: 'middle' + padding: [5,0,5,0] + outline_width: 1 diff --git a/worlds/sc2/__init__.py b/worlds/sc2/__init__.py new file mode 100644 index 000000000000..fffa618d2694 --- /dev/null +++ b/worlds/sc2/__init__.py @@ -0,0 +1,482 @@ +import typing +from dataclasses import fields + +from typing import List, Set, Iterable, Sequence, Dict, Callable, Union +from math import floor, ceil +from BaseClasses import Item, MultiWorld, Location, Tutorial, ItemClassification +from worlds.AutoWorld import WebWorld, World +from . import ItemNames +from .Items import StarcraftItem, filler_items, get_item_table, get_full_item_list, \ + get_basic_units, ItemData, upgrade_included_names, progressive_if_nco, kerrigan_actives, kerrigan_passives, \ + kerrigan_only_passives, progressive_if_ext, not_balanced_starting_units, spear_of_adun_calldowns, \ + spear_of_adun_castable_passives, nova_equipment +from .ItemGroups import item_name_groups +from .Locations import get_locations, LocationType, get_location_types, get_plando_locations +from .Regions import create_regions +from .Options import get_option_value, LocationInclusion, KerriganLevelItemDistribution, \ + KerriganPresence, KerriganPrimalStatus, RequiredTactics, kerrigan_unit_available, StarterUnit, SpearOfAdunPresence, \ + get_enabled_campaigns, SpearOfAdunAutonomouslyCastAbilityPresence, Starcraft2Options +from .PoolFilter import filter_items, get_item_upgrades, UPGRADABLE_ITEMS, missions_in_mission_table, get_used_races +from .MissionTables import MissionInfo, SC2Campaign, lookup_name_to_mission, SC2Mission, \ + SC2Race + + +class Starcraft2WebWorld(WebWorld): + setup = Tutorial( + "Multiworld Setup Guide", + "A guide to setting up the Starcraft 2 randomizer connected to an Archipelago Multiworld", + "English", + "setup_en.md", + "setup/en", + ["TheCondor", "Phaneros"] + ) + + tutorials = [setup] + + +class SC2World(World): + """ + StarCraft II is a science fiction real-time strategy video game developed and published by Blizzard Entertainment. + Play as one of three factions across four campaigns in a battle for supremacy of the Koprulu Sector. + """ + + game = "Starcraft 2" + web = Starcraft2WebWorld() + data_version = 6 + + item_name_to_id = {name: data.code for name, data in get_full_item_list().items()} + location_name_to_id = {location.name: location.code for location in get_locations(None)} + options_dataclass = Starcraft2Options + options: Starcraft2Options + + item_name_groups = item_name_groups + locked_locations: typing.List[str] + location_cache: typing.List[Location] + mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]] = {} + final_mission_id: int + victory_item: str + required_client_version = 0, 4, 5 + + def __init__(self, multiworld: MultiWorld, player: int): + super(SC2World, self).__init__(multiworld, player) + self.location_cache = [] + self.locked_locations = [] + + def create_item(self, name: str) -> Item: + data = get_full_item_list()[name] + return StarcraftItem(name, data.classification, data.code, self.player) + + def create_regions(self): + self.mission_req_table, self.final_mission_id, self.victory_item = create_regions( + self, get_locations(self), self.location_cache + ) + + def create_items(self): + setup_events(self.player, self.locked_locations, self.location_cache) + + excluded_items = get_excluded_items(self) + + starter_items = assign_starter_items(self, excluded_items, self.locked_locations, self.location_cache) + + fill_resource_locations(self, self.locked_locations, self.location_cache) + + pool = get_item_pool(self, self.mission_req_table, starter_items, excluded_items, self.location_cache) + + fill_item_pool_with_dummy_items(self, self.locked_locations, self.location_cache, pool) + + self.multiworld.itempool += pool + + def set_rules(self): + self.multiworld.completion_condition[self.player] = lambda state: state.has(self.victory_item, self.player) + + def get_filler_item_name(self) -> str: + return self.random.choice(filler_items) + + def fill_slot_data(self): + slot_data = {} + for option_name in [field.name for field in fields(Starcraft2Options)]: + option = get_option_value(self, option_name) + if type(option) in {str, int}: + slot_data[option_name] = int(option) + slot_req_table = {} + + # Serialize data + for campaign in self.mission_req_table: + slot_req_table[campaign.id] = {} + for mission in self.mission_req_table[campaign]: + slot_req_table[campaign.id][mission] = self.mission_req_table[campaign][mission]._asdict() + # Replace mission objects with mission IDs + slot_req_table[campaign.id][mission]["mission"] = slot_req_table[campaign.id][mission]["mission"].id + + for index in range(len(slot_req_table[campaign.id][mission]["required_world"])): + # TODO this is a band-aid, sometimes the mission_req_table already contains dicts + # as far as I can tell it's related to having multiple vanilla mission orders + if not isinstance(slot_req_table[campaign.id][mission]["required_world"][index], dict): + slot_req_table[campaign.id][mission]["required_world"][index] = slot_req_table[campaign.id][mission]["required_world"][index]._asdict() + + enabled_campaigns = get_enabled_campaigns(self) + slot_data["plando_locations"] = get_plando_locations(self) + slot_data["nova_covert_ops_only"] = (enabled_campaigns == {SC2Campaign.NCO}) + slot_data["mission_req"] = slot_req_table + slot_data["final_mission"] = self.final_mission_id + slot_data["version"] = 3 + + if SC2Campaign.HOTS not in enabled_campaigns: + slot_data["kerrigan_presence"] = KerriganPresence.option_not_present + return slot_data + + +def setup_events(player: int, locked_locations: typing.List[str], location_cache: typing.List[Location]): + for location in location_cache: + if location.address is None: + item = Item(location.name, ItemClassification.progression, None, player) + + locked_locations.append(location.name) + + location.place_locked_item(item) + + +def get_excluded_items(world: World) -> Set[str]: + excluded_items: Set[str] = set(get_option_value(world, 'excluded_items')) + for item in world.multiworld.precollected_items[world.player]: + excluded_items.add(item.name) + locked_items: Set[str] = set(get_option_value(world, 'locked_items')) + # Starter items are also excluded items + starter_items: Set[str] = set(get_option_value(world, 'start_inventory')) + item_table = get_full_item_list() + soa_presence = get_option_value(world, "spear_of_adun_presence") + soa_autocast_presence = get_option_value(world, "spear_of_adun_autonomously_cast_ability_presence") + enabled_campaigns = get_enabled_campaigns(world) + + # Ensure no item is both guaranteed and excluded + invalid_items = excluded_items.intersection(locked_items) + invalid_count = len(invalid_items) + # Don't count starter items that can appear multiple times + invalid_count -= len([item for item in starter_items.intersection(locked_items) if item_table[item].quantity != 1]) + if invalid_count > 0: + raise Exception(f"{invalid_count} item{'s are' if invalid_count > 1 else ' is'} both locked and excluded from generation. Please adjust your excluded items and locked items.") + + def smart_exclude(item_choices: Set[str], choices_to_keep: int): + expected_choices = len(item_choices) + if expected_choices == 0: + return + item_choices = set(item_choices) + starter_choices = item_choices.intersection(starter_items) + excluded_choices = item_choices.intersection(excluded_items) + item_choices.difference_update(excluded_choices) + item_choices.difference_update(locked_items) + candidates = sorted(item_choices) + exclude_amount = min(expected_choices - choices_to_keep - len(excluded_choices) + len(starter_choices), len(candidates)) + if exclude_amount > 0: + excluded_items.update(world.random.sample(candidates, exclude_amount)) + + # Nova gear exclusion if NCO not in campaigns + if SC2Campaign.NCO not in enabled_campaigns: + excluded_items = excluded_items.union(nova_equipment) + + kerrigan_presence = get_option_value(world, "kerrigan_presence") + # Exclude Primal Form item if option is not set or Kerrigan is unavailable + if get_option_value(world, "kerrigan_primal_status") != KerriganPrimalStatus.option_item or \ + (kerrigan_presence in {KerriganPresence.option_not_present, KerriganPresence.option_not_present_and_no_passives}): + excluded_items.add(ItemNames.KERRIGAN_PRIMAL_FORM) + + # no Kerrigan & remove all passives => remove all abilities + if kerrigan_presence == KerriganPresence.option_not_present_and_no_passives: + for tier in range(7): + smart_exclude(kerrigan_actives[tier].union(kerrigan_passives[tier]), 0) + else: + # no Kerrigan, but keep non-Kerrigan passives + if kerrigan_presence == KerriganPresence.option_not_present: + smart_exclude(kerrigan_only_passives, 0) + for tier in range(7): + smart_exclude(kerrigan_actives[tier], 0) + + # SOA exclusion, other cases are handled by generic race logic + if (soa_presence == SpearOfAdunPresence.option_lotv_protoss and SC2Campaign.LOTV not in enabled_campaigns) \ + or soa_presence == SpearOfAdunPresence.option_not_present: + excluded_items.update(spear_of_adun_calldowns) + if (soa_autocast_presence == SpearOfAdunAutonomouslyCastAbilityPresence.option_lotv_protoss \ + and SC2Campaign.LOTV not in enabled_campaigns) \ + or soa_autocast_presence == SpearOfAdunAutonomouslyCastAbilityPresence.option_not_present: + excluded_items.update(spear_of_adun_castable_passives) + + return excluded_items + + +def assign_starter_items(world: World, excluded_items: Set[str], locked_locations: List[str], location_cache: typing.List[Location]) -> List[Item]: + starter_items: List[Item] = [] + non_local_items = get_option_value(world, "non_local_items") + starter_unit = get_option_value(world, "starter_unit") + enabled_campaigns = get_enabled_campaigns(world) + first_mission = get_first_mission(world.mission_req_table) + # Ensuring that first mission is completable + if starter_unit == StarterUnit.option_off: + starter_mission_locations = [location.name for location in location_cache + if location.parent_region.name == first_mission + and location.access_rule == Location.access_rule] + if not starter_mission_locations: + # Force early unit if first mission is impossible without one + starter_unit = StarterUnit.option_any_starter_unit + + if starter_unit != StarterUnit.option_off: + first_race = lookup_name_to_mission[first_mission].race + + if first_race == SC2Race.ANY: + # If the first mission is a logic-less no-build + mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]] = world.mission_req_table + races = get_used_races(mission_req_table, world) + races.remove(SC2Race.ANY) + if lookup_name_to_mission[first_mission].race in races: + # The campaign's race is in (At least one mission that's not logic-less no-build exists) + first_race = lookup_name_to_mission[first_mission].campaign.race + elif len(races) > 0: + # The campaign only has logic-less no-build missions. Find any other valid race + first_race = world.random.choice(list(races)) + + if first_race != SC2Race.ANY: + # The race of the early unit has been chosen + basic_units = get_basic_units(world, first_race) + if starter_unit == StarterUnit.option_balanced: + basic_units = basic_units.difference(not_balanced_starting_units) + if first_mission == SC2Mission.DARK_WHISPERS.mission_name: + # Special case - you don't have a logicless location but need an AA + basic_units = basic_units.difference( + {ItemNames.ZEALOT, ItemNames.CENTURION, ItemNames.SENTINEL, ItemNames.BLOOD_HUNTER, + ItemNames.AVENGER, ItemNames.IMMORTAL, ItemNames.ANNIHILATOR, ItemNames.VANGUARD}) + if first_mission == SC2Mission.SUDDEN_STRIKE.mission_name: + # Special case - cliffjumpers + basic_units = {ItemNames.REAPER, ItemNames.GOLIATH, ItemNames.SIEGE_TANK, ItemNames.VIKING, ItemNames.BANSHEE} + local_basic_unit = sorted(item for item in basic_units if item not in non_local_items and item not in excluded_items) + if not local_basic_unit: + # Drop non_local_items constraint + local_basic_unit = sorted(item for item in basic_units if item not in excluded_items) + if not local_basic_unit: + raise Exception("Early Unit: At least one basic unit must be included") + + unit: Item = add_starter_item(world, excluded_items, local_basic_unit) + starter_items.append(unit) + + # NCO-only specific rules + if first_mission == SC2Mission.SUDDEN_STRIKE.mission_name: + support_item: Union[str, None] = None + if unit.name == ItemNames.REAPER: + support_item = ItemNames.REAPER_SPIDER_MINES + elif unit.name == ItemNames.GOLIATH: + support_item = ItemNames.GOLIATH_JUMP_JETS + elif unit.name == ItemNames.SIEGE_TANK: + support_item = ItemNames.SIEGE_TANK_JUMP_JETS + elif unit.name == ItemNames.VIKING: + support_item = ItemNames.VIKING_SMART_SERVOS + if support_item is not None: + starter_items.append(add_starter_item(world, excluded_items, [support_item])) + starter_items.append(add_starter_item(world, excluded_items, [ItemNames.NOVA_JUMP_SUIT_MODULE])) + starter_items.append( + add_starter_item(world, excluded_items, + [ + ItemNames.NOVA_HELLFIRE_SHOTGUN, + ItemNames.NOVA_PLASMA_RIFLE, + ItemNames.NOVA_PULSE_GRENADES + ])) + if enabled_campaigns == {SC2Campaign.NCO}: + starter_items.append(add_starter_item(world, excluded_items, [ItemNames.LIBERATOR_RAID_ARTILLERY])) + + starter_abilities = get_option_value(world, 'start_primary_abilities') + assert isinstance(starter_abilities, int) + if starter_abilities: + ability_count = starter_abilities + ability_tiers = [0, 1, 3] + world.random.shuffle(ability_tiers) + if ability_count > 3: + ability_tiers.append(6) + for tier in ability_tiers: + abilities = kerrigan_actives[tier].union(kerrigan_passives[tier]).difference(excluded_items, non_local_items) + if not abilities: + abilities = kerrigan_actives[tier].union(kerrigan_passives[tier]).difference(excluded_items) + if abilities: + ability_count -= 1 + starter_items.append(add_starter_item(world, excluded_items, list(abilities))) + if ability_count == 0: + break + + return starter_items + + +def get_first_mission(mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]]) -> str: + # The first world should also be the starting world + campaigns = mission_req_table.keys() + lowest_id = min([campaign.id for campaign in campaigns]) + first_campaign = [campaign for campaign in campaigns if campaign.id == lowest_id][0] + first_mission = list(mission_req_table[first_campaign])[0] + return first_mission + + +def add_starter_item(world: World, excluded_items: Set[str], item_list: Sequence[str]) -> Item: + + item_name = world.random.choice(sorted(item_list)) + + excluded_items.add(item_name) + + item = create_item_with_correct_settings(world.player, item_name) + + world.multiworld.push_precollected(item) + + return item + + +def get_item_pool(world: World, mission_req_table: Dict[SC2Campaign, Dict[str, MissionInfo]], + starter_items: List[Item], excluded_items: Set[str], location_cache: List[Location]) -> List[Item]: + pool: List[Item] = [] + + # For the future: goal items like Artifact Shards go here + locked_items = [] + + # YAML items + yaml_locked_items = get_option_value(world, 'locked_items') + assert not isinstance(yaml_locked_items, int) + + # Adjust generic upgrade availability based on options + include_upgrades = get_option_value(world, 'generic_upgrade_missions') == 0 + upgrade_items = get_option_value(world, 'generic_upgrade_items') + assert isinstance(upgrade_items, int) + + # Include items from outside main campaigns + item_sets = {'wol', 'hots', 'lotv'} + if get_option_value(world, 'nco_items') \ + or SC2Campaign.NCO in get_enabled_campaigns(world): + item_sets.add('nco') + if get_option_value(world, 'bw_items'): + item_sets.add('bw') + if get_option_value(world, 'ext_items'): + item_sets.add('ext') + + def allowed_quantity(name: str, data: ItemData) -> int: + if name in excluded_items \ + or data.type == "Upgrade" and (not include_upgrades or name not in upgrade_included_names[upgrade_items]) \ + or not data.origin.intersection(item_sets): + return 0 + elif name in progressive_if_nco and 'nco' not in item_sets: + return 1 + elif name in progressive_if_ext and 'ext' not in item_sets: + return 1 + else: + return data.quantity + + for name, data in get_item_table().items(): + for _ in range(allowed_quantity(name, data)): + item = create_item_with_correct_settings(world.player, name) + if name in yaml_locked_items: + locked_items.append(item) + else: + pool.append(item) + + existing_items = starter_items + [item for item in world.multiworld.precollected_items[world.player] if item not in starter_items] + existing_names = [item.name for item in existing_items] + + # Check the parent item integrity, exclude items + pool[:] = [item for item in pool if pool_contains_parent(item, pool + locked_items + existing_items)] + + # Removing upgrades for excluded items + for item_name in excluded_items: + if item_name in existing_names: + continue + invalid_upgrades = get_item_upgrades(pool, item_name) + for invalid_upgrade in invalid_upgrades: + pool.remove(invalid_upgrade) + + fill_pool_with_kerrigan_levels(world, pool) + filtered_pool = filter_items(world, mission_req_table, location_cache, pool, existing_items, locked_items) + return filtered_pool + + +def fill_item_pool_with_dummy_items(self: SC2World, locked_locations: List[str], + location_cache: List[Location], pool: List[Item]): + for _ in range(len(location_cache) - len(locked_locations) - len(pool)): + item = create_item_with_correct_settings(self.player, self.get_filler_item_name()) + pool.append(item) + + +def create_item_with_correct_settings(player: int, name: str) -> Item: + data = get_full_item_list()[name] + + item = Item(name, data.classification, data.code, player) + + return item + + +def pool_contains_parent(item: Item, pool: Iterable[Item]): + item_data = get_full_item_list().get(item.name) + if item_data.parent_item is None: + # The item has not associated parent, the item is valid + return True + parent_item = item_data.parent_item + # Check if the pool contains the parent item + return parent_item in [pool_item.name for pool_item in pool] + + +def fill_resource_locations(world: World, locked_locations: List[str], location_cache: List[Location]): + """ + Filters the locations in the world using a trash or Nothing item + :param multiworld: + :param player: + :param locked_locations: + :param location_cache: + :return: + """ + open_locations = [location for location in location_cache if location.item is None] + plando_locations = get_plando_locations(world) + resource_location_types = get_location_types(world, LocationInclusion.option_resources) + location_data = {sc2_location.name: sc2_location for sc2_location in get_locations(world)} + for location in open_locations: + # Go through the locations that aren't locked yet (early unit, etc) + if location.name not in plando_locations: + # The location is not plando'd + sc2_location = location_data[location.name] + if sc2_location.type in resource_location_types: + item_name = world.random.choice(filler_items) + item = create_item_with_correct_settings(world.player, item_name) + location.place_locked_item(item) + locked_locations.append(location.name) + + +def place_exclusion_item(item_name, location, locked_locations, player): + item = create_item_with_correct_settings(player, item_name) + location.place_locked_item(item) + locked_locations.append(location.name) + + +def fill_pool_with_kerrigan_levels(world: World, item_pool: List[Item]): + total_levels = get_option_value(world, "kerrigan_level_item_sum") + if get_option_value(world, "kerrigan_presence") not in kerrigan_unit_available \ + or total_levels == 0 \ + or SC2Campaign.HOTS not in get_enabled_campaigns(world): + return + + def add_kerrigan_level_items(level_amount: int, item_amount: int): + name = f"{level_amount} Kerrigan Level" + if level_amount > 1: + name += "s" + for _ in range(item_amount): + item_pool.append(create_item_with_correct_settings(world.player, name)) + + sizes = [70, 35, 14, 10, 7, 5, 2, 1] + option = get_option_value(world, "kerrigan_level_item_distribution") + + assert isinstance(option, int) + assert isinstance(total_levels, int) + + if option in (KerriganLevelItemDistribution.option_vanilla, KerriganLevelItemDistribution.option_smooth): + distribution = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + if option == KerriganLevelItemDistribution.option_vanilla: + distribution = [32, 0, 0, 1, 3, 0, 0, 0, 1, 1] + else: # Smooth + distribution = [0, 0, 0, 1, 1, 2, 2, 2, 1, 1] + for tier in range(len(distribution)): + add_kerrigan_level_items(tier + 1, distribution[tier]) + else: + size = sizes[option - 2] + round_func: Callable[[float], int] = round + if total_levels > 70: + round_func = floor + else: + round_func = ceil + add_kerrigan_level_items(size, round_func(float(total_levels) / size)) diff --git a/worlds/sc2/docs/contributors.md b/worlds/sc2/docs/contributors.md new file mode 100644 index 000000000000..5b62466d7e45 --- /dev/null +++ b/worlds/sc2/docs/contributors.md @@ -0,0 +1,42 @@ +# Contributors +Contibutors are listed with preferred or Discord names first, with github usernames prepended with an `@` + +## Update 2024.0 +### Code Changes +* Ziktofel (@Ziktofel) +* Salzkorn (@Salzkorn) +* EnvyDragon (@EnvyDragon) +* Phanerus (@MatthewMarinets) +* Madi Sylveon (@MadiMadsen) +* Magnemania (@Magnemania) +* Subsourian (@Subsourian) +* Hopop (@hopop201) +* Alice Voltaire (@AliceVoltaire) +* Genderdruid (@ArchonofFail) +* CrazedCollie (@FoxOfWar) + +### Additional Beta testing and bug reports +* Varcklen (@Varcklen) +* BicolourSnake (@Bicoloursnake) +* @NobleXenon +* Severencir (@Severencir) +* neocerber (@neocerber) +* Mati (@Matiya-star) +* Ixzine +* sweetox +* 8thDaughterOfFrost +* The M8 +* Berserker (@Berserker66) +* KaitoKid +* Sheen +* ProfBytes +* IncoherentOrange +* eudaimonistic +* Figment + +## Older versions +Not all contributors to older versions of Archipelago Starcraft 2 are known. + +TheCondor (@TheCondor07) is the original maintainer of the project. Other known contributors include: +* soldieroforder +* Berserker (@Berserker66) diff --git a/worlds/sc2/docs/en_Starcraft 2.md b/worlds/sc2/docs/en_Starcraft 2.md new file mode 100644 index 000000000000..43a7da89f24f --- /dev/null +++ b/worlds/sc2/docs/en_Starcraft 2.md @@ -0,0 +1,64 @@ +# Starcraft 2 Wings of Liberty + +## What does randomization do to this game? + +The following unlocks are randomized as items: +1. Your ability to build any non-worker unit. +2. Unit specific upgrades including some combinations not available in the vanilla campaigns, such as both strain choices simultaneously for Zerg and every Spear of Adun upgrade simultaneously for Protoss! +3. Your ability to get the generic unit upgrades, such as attack and armour upgrades. +4. Other miscellaneous upgrades such as laboratory upgrades and mercenaries for Terran, Kerrigan levels and upgrades for Zerg, and Spear of Adun upgrades for Protoss. +5. Small boosts to your starting mineral, vespene gas, and supply totals on each mission. + +You find items by making progress in these categories: +* Completing missions +* Completing bonus objectives (like by gathering lab research material in Wings of Liberty) +* Reaching milestones in the mission, such as completing part of a main objective +* Completing challenges based on achievements in the base game, such as clearing all Zerg on Devil's Playground + +Except for mission completion, these categories can be disabled in the game's settings. For instance, you can disable getting items for reaching required milestones. + +When you receive items, they will immediately become available, even during a mission, and you will be +notified via a text box in the top-right corner of the game screen. Item unlocks are also logged in the Archipelago client. + +Missions are launched through the Starcraft 2 Archipelago client, through the Starcraft 2 Launcher tab. The between mission segments on the Hyperion, the Leviathan, and the Spear of Adun are not included. Additionally, metaprogression currencies such as credits and Solarite are not used. + +## What is the goal of this game when randomized? + +The goal is to beat the final mission in the mission order. The yaml configuration file controls the mission order and how missions are shuffled. + +## What non-randomized changes are there from vanilla Starcraft 2? + +1. Some missions have more vespene geysers available to allow a wider variety of units. +2. Many new units and upgrades have been added as items, coming from co-op, melee, later campaigns, later expansions, brood war, and original ideas. +3. Higher-tech production structures, including Factories, Starports, Robotics Facilities, and Stargates, no longer have tech requirements. +4. Zerg missions have been adjusted to give the player a starting Lair where they would only have Hatcheries. +5. Upgrades with a downside have had the downside removed, such as automated refineries costing more or tech reactors taking longer to build. +6. Unit collision within the vents in Enemy Within has been adjusted to allow larger units to travel through them without getting stuck in odd places. +7. Several vanilla bugs have been fixed. + +## Which of my items can be in another player's world? + +By default, any of StarCraft 2's items (specified above) can be in another player's world. See the +[Advanced YAML Guide](https://archipelago.gg/tutorial/Archipelago/advanced_settings/en) +for more information on how to change this. + +## Unique Local Commands + +The following commands are only available when using the Starcraft 2 Client to play with Archipelago. You can list them any time in the client with `/help`. + +* `/download_data` Download the most recent release of the necessary files for playing SC2 with Archipelago. Will overwrite existing files +* `/difficulty [difficulty]` Overrides the difficulty set for the world. + * Options: casual, normal, hard, brutal +* `/game_speed [game_speed]` Overrides the game speed for the world + * Options: default, slower, slow, normal, fast, faster +* `/color [faction] [color]` Changes your color for one of your playable factions. + * Faction options: raynor, kerrigan, primal, protoss, nova + * Color options: white, red, blue, teal, purple, yellow, orange, green, lightpink, violet, lightgrey, darkgreen, brown, lightgreen, darkgrey, pink, rainbow, random, default +* `/option [option_name] [option_value]` Sets an option normally controlled by your yaml after generation. + * Run without arguments to list all options. + * Options pertain to automatic cutscene skipping, Kerrigan presence, Spear of Adun presence, starting resource amounts, controlling AI allies, etc. +* `/disable_mission_check` Disables the check to see if a mission is available to play. Meant for co-op runs where one player can play the next mission in a chain the other player is doing. +* `/play [mission_id]` Starts a Starcraft 2 mission based off of the mission_id provided +* `/available` Get what missions are currently available to play +* `/unfinished` Get what missions are currently available to play and have not had all locations checked +* `/set_path [path]` Manually set the SC2 install directory (if the automatic detection fails) diff --git a/worlds/sc2wol/docs/setup_en.md b/worlds/sc2/docs/setup_en.md similarity index 50% rename from worlds/sc2wol/docs/setup_en.md rename to worlds/sc2/docs/setup_en.md index 9bfeb3d235bc..10881e149c43 100644 --- a/worlds/sc2wol/docs/setup_en.md +++ b/worlds/sc2/docs/setup_en.md @@ -7,12 +7,10 @@ to obtain a config file for StarCraft 2. - [StarCraft 2](https://starcraft2.com/en-us/) - [The most recent Archipelago release](https://github.com/ArchipelagoMW/Archipelago/releases) -- [StarCraft 2 AP Maps and Data](https://github.com/Ziktofel/Archipelago-SC2-data/releases) ## How do I install this randomizer? -1. Install StarCraft 2 and Archipelago using the first two links above. (The StarCraft 2 client for Archipelago is - included by default.) +1. Install StarCraft 2 and Archipelago using the links above. The StarCraft 2 Archipelago client is downloaded by the Archipelago installer. - Linux users should also follow the instructions found at the bottom of this page (["Running in Linux"](#running-in-linux)). 2. Run ArchipelagoStarcraft2Client.exe. @@ -21,25 +19,66 @@ to obtain a config file for StarCraft 2. ## Where do I get a config file (aka "YAML") for this game? -The [Player Settings](https://archipelago.gg/games/Starcraft%202%20Wings%20of%20Liberty/player-settings) page on this -website allows you to choose your personal settings for the randomizer and download them into a config file. Remember -the name you type in the `Player Name` box; that's the "slot name" the client will ask you for when you attempt to -connect! +Yaml files are configuration files that tell Archipelago how you'd like your game to be randomized, even if you're only using default options. +When you're setting up a multiworld, every world needs its own yaml file. -### And why do I need a config file? +There are three basic ways to get a yaml: +* You can go to the [Player Options](https://archipelago.gg/games/Starcraft%202/player-options) page, set your options in the GUI, and export the yaml. +* You can generate a template, either by downloading it from the [Player Options](https://archipelago.gg/games/Starcraft%202/player-options) page or by generating it from the Launcher (ArchipelagoLauncher.exe). The template includes descriptions of each option, you just have to edit it in your text editor of choice. +* You can ask someone else to share their yaml to use it for yourself or adjust it as you wish. -Config files tell Archipelago how you'd like your game to be randomized, even if you're only using default settings. -When you're setting up a multiworld, every world needs its own config file. -Check out [Creating a YAML](https://archipelago.gg/tutorial/Archipelago/setup/en#creating-a-yaml) for more information. +Remember the name you enter in the options page or in the yaml file, you'll need it to connect later! + +Note that the basic Player Options page doesn't allow you to change all advanced options, such as excluding particular units or upgrades. Go through the [Weighted Options](https://archipelago.gg/weighted-options) page for that. + +Check out [Creating a YAML](https://archipelago.gg/tutorial/Archipelago/setup/en#creating-a-yaml) for more game-agnostic information. + +### Common yaml questions +#### How do I know I set my yaml up correctly? + +The simplest way to check is to test it out. Save your yaml to the Players/ folder within your Archipelago installation and run ArchipelagoGenerate.exe. You should see a new .zip file within the output/ folder of your Archipelago installation if things worked correctly. It's advisable to run ArchipelagoGenerate through a terminal so that you can see the printout, which will include any errors and the precise output file name if it's successful. If you don't like terminals, you can also check the log file in the logs/ folder. + +#### What does Progression Balancing do? + +For Starcraft 2, not much. It's an Archipelago-wide option meant to shift required items earlier in the playthrough, but Starcraft 2 tends to be much more open in what items you can use. As such, this adjustment isn't very noticeable. It can also increase generation times, so we generally recommend turning it off. + +#### How do I specify items in a list, like in excluded items? + +You can look up the syntax for yaml collections in the [YAML specification](https://yaml.org/spec/1.2.2/#21-collections). For lists, every item goes on its own line, started with a hyphen: + +```yaml +excluded_items: + - Battlecruiser + - Drop-Pods (Kerrigan Tier 7) +``` + +An empty list is just a matching pair of square brackets: `[]`. That's the default value in the template, which should let you know to use this syntax. + +#### How do I specify items for the starting inventory? + +The starting inventory is a YAML mapping rather than a list, which associates an item with the amount you start with. The syntax looks like the item name, followed by a colon, then a whitespace character, and then the value: + +```yaml +start_inventory: + Micro-Filtering: 1 + Additional Starting Vespene: 5 +``` + +An empty mapping is just a matching pair of curly braces: `{}`. That's the default value in the template, which should let you know to use this syntax. + +#### How do I know the exact names of items? + +You can look up a complete list if item names in the [Icon Repository](https://matthewmarinets.github.io/ap_sc2_icons/). ## How do I join a MultiWorld game? 1. Run ArchipelagoStarcraft2Client.exe. - macOS users should instead follow the instructions found at ["Running in macOS"](#running-in-macos) for this step only. 2. Type `/connect [server ip]`. -3. Type your slot name and the server's password when prompted. -4. Once connected, switch to the 'StarCraft 2 Launcher' tab in the client. There, you can see every mission. By default, - only 'Liberation Day' will be available at the beginning. Just click on a mission to start it! + - If you're running through the website, the server IP should be displayed near the top of the room page. +3. Type your slot name from your YAML when prompted. +4. If the server has a password, enter that when prompted. +5. Once connected, switch to the 'StarCraft 2 Launcher' tab in the client. There, you can see all the missions in your world. Unreachable missions will have greyed-out text. Just click on an available mission to start it! ## The game isn't launching when I try to start a mission. diff --git a/worlds/sc2wol/requirements.txt b/worlds/sc2/requirements.txt similarity index 100% rename from worlds/sc2wol/requirements.txt rename to worlds/sc2/requirements.txt diff --git a/worlds/sc2/test/__init__.py b/worlds/sc2/test/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/worlds/sc2/test/test_Regions.py b/worlds/sc2/test/test_Regions.py new file mode 100644 index 000000000000..c268b65da9a8 --- /dev/null +++ b/worlds/sc2/test/test_Regions.py @@ -0,0 +1,41 @@ +import unittest +from .test_base import Sc2TestBase +from .. import Regions +from .. import Options, MissionTables + +class TestGridsizes(unittest.TestCase): + def test_grid_sizes_meet_specs(self): + self.assertTupleEqual((1, 2, 0), Regions.get_grid_dimensions(2)) + self.assertTupleEqual((1, 3, 0), Regions.get_grid_dimensions(3)) + self.assertTupleEqual((2, 2, 0), Regions.get_grid_dimensions(4)) + self.assertTupleEqual((2, 3, 1), Regions.get_grid_dimensions(5)) + self.assertTupleEqual((2, 4, 1), Regions.get_grid_dimensions(7)) + self.assertTupleEqual((2, 4, 0), Regions.get_grid_dimensions(8)) + self.assertTupleEqual((3, 3, 0), Regions.get_grid_dimensions(9)) + self.assertTupleEqual((2, 5, 0), Regions.get_grid_dimensions(10)) + self.assertTupleEqual((3, 4, 1), Regions.get_grid_dimensions(11)) + self.assertTupleEqual((3, 4, 0), Regions.get_grid_dimensions(12)) + self.assertTupleEqual((3, 5, 0), Regions.get_grid_dimensions(15)) + self.assertTupleEqual((4, 4, 0), Regions.get_grid_dimensions(16)) + self.assertTupleEqual((4, 6, 0), Regions.get_grid_dimensions(24)) + self.assertTupleEqual((5, 5, 0), Regions.get_grid_dimensions(25)) + self.assertTupleEqual((5, 6, 1), Regions.get_grid_dimensions(29)) + self.assertTupleEqual((5, 7, 2), Regions.get_grid_dimensions(33)) + + +class TestGridGeneration(Sc2TestBase): + options = { + "mission_order": Options.MissionOrder.option_grid, + "excluded_missions": [MissionTables.SC2Mission.ZERO_HOUR.mission_name,], + "enable_hots_missions": False, + "enable_prophecy_missions": True, + "enable_lotv_prologue_missions": False, + "enable_lotv_missions": False, + "enable_epilogue_missions": False, + "enable_nco_missions": False + } + + def test_size_matches_exclusions(self): + self.assertNotIn(MissionTables.SC2Mission.ZERO_HOUR.mission_name, self.multiworld.regions) + # WoL has 29 missions. -1 for Zero Hour being excluded, +1 for the automatically-added menu location + self.assertEqual(len(self.multiworld.regions), 29) diff --git a/worlds/sc2/test/test_base.py b/worlds/sc2/test/test_base.py new file mode 100644 index 000000000000..28529e37edd5 --- /dev/null +++ b/worlds/sc2/test/test_base.py @@ -0,0 +1,11 @@ +from typing import * + +from test.TestBase import WorldTestBase +from .. import SC2World +from .. import Client + +class Sc2TestBase(WorldTestBase): + game = Client.SC2Context.game + world: SC2World + player: ClassVar[int] = 1 + skip_long_tests: bool = True diff --git a/worlds/sc2/test/test_options.py b/worlds/sc2/test/test_options.py new file mode 100644 index 000000000000..30d21f39697e --- /dev/null +++ b/worlds/sc2/test/test_options.py @@ -0,0 +1,7 @@ +import unittest +from .test_base import Sc2TestBase +from .. import Options, MissionTables + +class TestOptions(unittest.TestCase): + def test_campaign_size_option_max_matches_number_of_missions(self): + self.assertEqual(Options.MaximumCampaignSize.range_end, len(MissionTables.SC2Mission)) diff --git a/worlds/sc2wol/Client.py b/worlds/sc2wol/Client.py deleted file mode 100644 index 83b7b62d2977..000000000000 --- a/worlds/sc2wol/Client.py +++ /dev/null @@ -1,1222 +0,0 @@ -from __future__ import annotations - -import asyncio -import copy -import ctypes -import logging -import multiprocessing -import os.path -import re -import sys -import tempfile -import typing -import queue -import zipfile -import io -import random -import concurrent.futures -from pathlib import Path - -# CommonClient import first to trigger ModuleUpdater -from CommonClient import CommonContext, server_loop, ClientCommandProcessor, gui_enabled, get_base_parser -from Utils import init_logging, is_windows - -if __name__ == "__main__": - init_logging("SC2Client", exception_logger="Client") - -logger = logging.getLogger("Client") -sc2_logger = logging.getLogger("Starcraft2") - -import nest_asyncio -from worlds._sc2common import bot -from worlds._sc2common.bot.data import Race -from worlds._sc2common.bot.main import run_game -from worlds._sc2common.bot.player import Bot -from worlds.sc2wol import SC2WoLWorld -from worlds.sc2wol.Items import lookup_id_to_name, get_full_item_list, ItemData, type_flaggroups, upgrade_numbers -from worlds.sc2wol.Locations import SC2WOL_LOC_ID_OFFSET -from worlds.sc2wol.MissionTables import lookup_id_to_mission -from worlds.sc2wol.Regions import MissionInfo - -import colorama -from NetUtils import ClientStatus, NetworkItem, RawJSONtoTextParser, JSONtoTextParser, JSONMessagePart -from MultiServer import mark_raw - -pool = concurrent.futures.ThreadPoolExecutor(1) -loop = asyncio.get_event_loop_policy().new_event_loop() -nest_asyncio.apply(loop) -max_bonus: int = 13 -victory_modulo: int = 100 - -# GitHub repo where the Map/mod data is hosted for /download_data command -DATA_REPO_OWNER = "Ziktofel" -DATA_REPO_NAME = "Archipelago-SC2-data" -DATA_API_VERSION = "API2" - - -# Data version file path. -# This file is used to tell if the downloaded data are outdated -# Associated with /download_data command -def get_metadata_file(): - return os.environ["SC2PATH"] + os.sep + "ArchipelagoSC2Metadata.txt" - - -class StarcraftClientProcessor(ClientCommandProcessor): - ctx: SC2Context - - def _cmd_difficulty(self, difficulty: str = "") -> bool: - """Overrides the current difficulty set for the world. Takes the argument casual, normal, hard, or brutal""" - options = difficulty.split() - num_options = len(options) - - if num_options > 0: - difficulty_choice = options[0].lower() - if difficulty_choice == "casual": - self.ctx.difficulty_override = 0 - elif difficulty_choice == "normal": - self.ctx.difficulty_override = 1 - elif difficulty_choice == "hard": - self.ctx.difficulty_override = 2 - elif difficulty_choice == "brutal": - self.ctx.difficulty_override = 3 - else: - self.output("Unable to parse difficulty '" + options[0] + "'") - return False - - self.output("Difficulty set to " + options[0]) - return True - - else: - if self.ctx.difficulty == -1: - self.output("Please connect to a seed before checking difficulty.") - else: - current_difficulty = self.ctx.difficulty - if self.ctx.difficulty_override >= 0: - current_difficulty = self.ctx.difficulty_override - self.output("Current difficulty: " + ["Casual", "Normal", "Hard", "Brutal"][current_difficulty]) - self.output("To change the difficulty, add the name of the difficulty after the command.") - return False - - - def _cmd_game_speed(self, game_speed: str = "") -> bool: - """Overrides the current game speed for the world. - Takes the arguments default, slower, slow, normal, fast, faster""" - options = game_speed.split() - num_options = len(options) - - if num_options > 0: - speed_choice = options[0].lower() - if speed_choice == "default": - self.ctx.game_speed_override = 0 - elif speed_choice == "slower": - self.ctx.game_speed_override = 1 - elif speed_choice == "slow": - self.ctx.game_speed_override = 2 - elif speed_choice == "normal": - self.ctx.game_speed_override = 3 - elif speed_choice == "fast": - self.ctx.game_speed_override = 4 - elif speed_choice == "faster": - self.ctx.game_speed_override = 5 - else: - self.output("Unable to parse game speed '" + options[0] + "'") - return False - - self.output("Game speed set to " + options[0]) - return True - - else: - if self.ctx.game_speed == -1: - self.output("Please connect to a seed before checking game speed.") - else: - current_speed = self.ctx.game_speed - if self.ctx.game_speed_override >= 0: - current_speed = self.ctx.game_speed_override - self.output("Current game speed: " - + ["Default", "Slower", "Slow", "Normal", "Fast", "Faster"][current_speed]) - self.output("To change the game speed, add the name of the speed after the command," - " or Default to select based on difficulty.") - return False - - def _cmd_color(self, color: str = "") -> bool: - player_colors = [ - "White", "Red", "Blue", "Teal", - "Purple", "Yellow", "Orange", "Green", - "LightPink", "Violet", "LightGrey", "DarkGreen", - "Brown", "LightGreen", "DarkGrey", "Pink", - "Rainbow", "Random", "Default" - ] - match_colors = [player_color.lower() for player_color in player_colors] - if color: - if color.lower() not in match_colors: - self.output(color + " is not a valid color. Available colors: " + ', '.join(player_colors)) - return False - if color.lower() == "random": - color = random.choice(player_colors[:16]) - self.ctx.player_color = match_colors.index(color.lower()) - self.output("Color set to " + player_colors[self.ctx.player_color]) - else: - self.output("Current player color: " + player_colors[self.ctx.player_color]) - self.output("To change your colors, add the name of the color after the command.") - self.output("Available colors: " + ', '.join(player_colors)) - - def _cmd_disable_mission_check(self) -> bool: - """Disables the check to see if a mission is available to play. Meant for co-op runs where one player can play - the next mission in a chain the other player is doing.""" - self.ctx.missions_unlocked = True - sc2_logger.info("Mission check has been disabled") - return True - - def _cmd_play(self, mission_id: str = "") -> bool: - """Start a Starcraft 2 mission""" - - options = mission_id.split() - num_options = len(options) - - if num_options > 0: - mission_number = int(options[0]) - - self.ctx.play_mission(mission_number) - - else: - sc2_logger.info( - "Mission ID needs to be specified. Use /unfinished or /available to view ids for available missions.") - return False - - return True - - def _cmd_available(self) -> bool: - """Get what missions are currently available to play""" - - request_available_missions(self.ctx) - return True - - def _cmd_unfinished(self) -> bool: - """Get what missions are currently available to play and have not had all locations checked""" - - request_unfinished_missions(self.ctx) - return True - - @mark_raw - def _cmd_set_path(self, path: str = '') -> bool: - """Manually set the SC2 install directory (if the automatic detection fails).""" - if path: - os.environ["SC2PATH"] = path - is_mod_installed_correctly() - return True - else: - sc2_logger.warning("When using set_path, you must type the path to your SC2 install directory.") - return False - - def _cmd_download_data(self) -> bool: - """Download the most recent release of the necessary files for playing SC2 with - Archipelago. Will overwrite existing files.""" - pool.submit(self._download_data) - return True - - @staticmethod - def _download_data() -> bool: - if "SC2PATH" not in os.environ: - check_game_install_path() - - if os.path.exists(get_metadata_file()): - with open(get_metadata_file(), "r") as f: - metadata = f.read() - else: - metadata = None - - tempzip, metadata = download_latest_release_zip(DATA_REPO_OWNER, DATA_REPO_NAME, DATA_API_VERSION, - metadata=metadata, force_download=True) - - if tempzip != '': - try: - zipfile.ZipFile(tempzip).extractall(path=os.environ["SC2PATH"]) - sc2_logger.info(f"Download complete. Package installed.") - with open(get_metadata_file(), "w") as f: - f.write(metadata) - finally: - os.remove(tempzip) - else: - sc2_logger.warning("Download aborted/failed. Read the log for more information.") - return False - return True - - -class SC2JSONtoTextParser(JSONtoTextParser): - def __init__(self, ctx): - self.handlers = { - "ItemSend": self._handle_color, - "ItemCheat": self._handle_color, - "Hint": self._handle_color, - } - super().__init__(ctx) - - def _handle_color(self, node: JSONMessagePart): - codes = node["color"].split(";") - buffer = "".join(self.color_code(code) for code in codes if code in self.color_codes) - return buffer + self._handle_text(node) + '
' - - def color_code(self, code: str): - return '' - - -class SC2Context(CommonContext): - command_processor = StarcraftClientProcessor - game = "Starcraft 2 Wings of Liberty" - items_handling = 0b111 - difficulty = -1 - game_speed = -1 - all_in_choice = 0 - mission_order = 0 - player_color = 2 - mission_req_table: typing.Dict[str, MissionInfo] = {} - final_mission: int = 29 - announcements = queue.Queue() - sc2_run_task: typing.Optional[asyncio.Task] = None - missions_unlocked: bool = False # allow launching missions ignoring requirements - generic_upgrade_missions = 0 - generic_upgrade_research = 0 - generic_upgrade_items = 0 - current_tooltip = None - last_loc_list = None - difficulty_override = -1 - game_speed_override = -1 - mission_id_to_location_ids: typing.Dict[int, typing.List[int]] = {} - last_bot: typing.Optional[ArchipelagoBot] = None - - def __init__(self, *args, **kwargs): - super(SC2Context, self).__init__(*args, **kwargs) - self.raw_text_parser = SC2JSONtoTextParser(self) - - async def server_auth(self, password_requested: bool = False): - if password_requested and not self.password: - await super(SC2Context, self).server_auth(password_requested) - await self.get_username() - await self.send_connect() - if self.ui: - self.ui.first_check = True - - def on_package(self, cmd: str, args: dict): - if cmd in {"Connected"}: - self.difficulty = args["slot_data"]["game_difficulty"] - if "game_speed" in args["slot_data"]: - self.game_speed = args["slot_data"]["game_speed"] - else: - self.game_speed = 0 - self.all_in_choice = args["slot_data"]["all_in_map"] - slot_req_table = args["slot_data"]["mission_req"] - # Maintaining backwards compatibility with older slot data - self.mission_req_table = { - mission: MissionInfo( - **{field: value for field, value in mission_info.items() if field in MissionInfo._fields} - ) - for mission, mission_info in slot_req_table.items() - } - self.mission_order = args["slot_data"].get("mission_order", 0) - self.final_mission = args["slot_data"].get("final_mission", 29) - self.player_color = args["slot_data"].get("player_color", 2) - self.generic_upgrade_missions = args["slot_data"].get("generic_upgrade_missions", 0) - self.generic_upgrade_items = args["slot_data"].get("generic_upgrade_items", 0) - self.generic_upgrade_research = args["slot_data"].get("generic_upgrade_research", 0) - - self.build_location_to_mission_mapping() - - # Looks for the required maps and mods for SC2. Runs check_game_install_path. - maps_present = is_mod_installed_correctly() - if os.path.exists(get_metadata_file()): - with open(get_metadata_file(), "r") as f: - current_ver = f.read() - sc2_logger.debug(f"Current version: {current_ver}") - if is_mod_update_available(DATA_REPO_OWNER, DATA_REPO_NAME, DATA_API_VERSION, current_ver): - sc2_logger.info("NOTICE: Update for required files found. Run /download_data to install.") - elif maps_present: - sc2_logger.warning("NOTICE: Your map files may be outdated (version number not found). " - "Run /download_data to update them.") - - - def on_print_json(self, args: dict): - # goes to this world - if "receiving" in args and self.slot_concerns_self(args["receiving"]): - relevant = True - # found in this world - elif "item" in args and self.slot_concerns_self(args["item"].player): - relevant = True - # not related - else: - relevant = False - - if relevant: - self.announcements.put(self.raw_text_parser(copy.deepcopy(args["data"]))) - - super(SC2Context, self).on_print_json(args) - - def run_gui(self): - from kvui import GameManager, HoverBehavior, ServerToolTip - from kivy.app import App - from kivy.clock import Clock - from kivy.uix.tabbedpanel import TabbedPanelItem - from kivy.uix.gridlayout import GridLayout - from kivy.lang import Builder - from kivy.uix.label import Label - from kivy.uix.button import Button - from kivy.uix.floatlayout import FloatLayout - from kivy.properties import StringProperty - - class HoverableButton(HoverBehavior, Button): - pass - - class MissionButton(HoverableButton): - tooltip_text = StringProperty("Test") - ctx: SC2Context - - def __init__(self, *args, **kwargs): - super(HoverableButton, self).__init__(*args, **kwargs) - self.layout = FloatLayout() - self.popuplabel = ServerToolTip(text=self.text) - self.layout.add_widget(self.popuplabel) - - def on_enter(self): - self.popuplabel.text = self.tooltip_text - - if self.ctx.current_tooltip: - App.get_running_app().root.remove_widget(self.ctx.current_tooltip) - - if self.tooltip_text == "": - self.ctx.current_tooltip = None - else: - App.get_running_app().root.add_widget(self.layout) - self.ctx.current_tooltip = self.layout - - def on_leave(self): - self.ctx.ui.clear_tooltip() - - @property - def ctx(self) -> CommonContext: - return App.get_running_app().ctx - - class MissionLayout(GridLayout): - pass - - class MissionCategory(GridLayout): - pass - - class SC2Manager(GameManager): - logging_pairs = [ - ("Client", "Archipelago"), - ("Starcraft2", "Starcraft2"), - ] - base_title = "Archipelago Starcraft 2 Client" - - mission_panel = None - last_checked_locations = {} - mission_id_to_button = {} - launching: typing.Union[bool, int] = False # if int -> mission ID - refresh_from_launching = True - first_check = True - ctx: SC2Context - - def __init__(self, ctx): - super().__init__(ctx) - - def clear_tooltip(self): - if self.ctx.current_tooltip: - App.get_running_app().root.remove_widget(self.ctx.current_tooltip) - - self.ctx.current_tooltip = None - - def build(self): - container = super().build() - - panel = TabbedPanelItem(text="Starcraft 2 Launcher") - self.mission_panel = panel.content = MissionLayout() - - self.tabs.add_widget(panel) - - Clock.schedule_interval(self.build_mission_table, 0.5) - - return container - - def build_mission_table(self, dt): - if (not self.launching and (not self.last_checked_locations == self.ctx.checked_locations or - not self.refresh_from_launching)) or self.first_check: - self.refresh_from_launching = True - - self.mission_panel.clear_widgets() - if self.ctx.mission_req_table: - self.last_checked_locations = self.ctx.checked_locations.copy() - self.first_check = False - - self.mission_id_to_button = {} - categories = {} - available_missions, unfinished_missions = calc_unfinished_missions(self.ctx) - - # separate missions into categories - for mission in self.ctx.mission_req_table: - if not self.ctx.mission_req_table[mission].category in categories: - categories[self.ctx.mission_req_table[mission].category] = [] - - categories[self.ctx.mission_req_table[mission].category].append(mission) - - for category in categories: - category_panel = MissionCategory() - if category.startswith('_'): - category_display_name = '' - else: - category_display_name = category - category_panel.add_widget( - Label(text=category_display_name, size_hint_y=None, height=50, outline_width=1)) - - for mission in categories[category]: - text: str = mission - tooltip: str = "" - mission_id: int = self.ctx.mission_req_table[mission].id - # Map has uncollected locations - if mission in unfinished_missions: - text = f"[color=6495ED]{text}[/color]" - elif mission in available_missions: - text = f"[color=FFFFFF]{text}[/color]" - # Map requirements not met - else: - text = f"[color=a9a9a9]{text}[/color]" - tooltip = f"Requires: " - if self.ctx.mission_req_table[mission].required_world: - tooltip += ", ".join(list(self.ctx.mission_req_table)[req_mission - 1] for - req_mission in - self.ctx.mission_req_table[mission].required_world) - - if self.ctx.mission_req_table[mission].number: - tooltip += " and " - if self.ctx.mission_req_table[mission].number: - tooltip += f"{self.ctx.mission_req_table[mission].number} missions completed" - remaining_location_names: typing.List[str] = [ - self.ctx.location_names[loc] for loc in self.ctx.locations_for_mission(mission) - if loc in self.ctx.missing_locations] - - if mission_id == self.ctx.final_mission: - if mission in available_missions: - text = f"[color=FFBC95]{mission}[/color]" - else: - text = f"[color=D0C0BE]{mission}[/color]" - if tooltip: - tooltip += "\n" - tooltip += "Final Mission" - - if remaining_location_names: - if tooltip: - tooltip += "\n" - tooltip += f"Uncollected locations:\n" - tooltip += "\n".join(remaining_location_names) - - mission_button = MissionButton(text=text, size_hint_y=None, height=50) - mission_button.tooltip_text = tooltip - mission_button.bind(on_press=self.mission_callback) - self.mission_id_to_button[mission_id] = mission_button - category_panel.add_widget(mission_button) - - category_panel.add_widget(Label(text="")) - self.mission_panel.add_widget(category_panel) - - elif self.launching: - self.refresh_from_launching = False - - self.mission_panel.clear_widgets() - self.mission_panel.add_widget(Label(text="Launching Mission: " + - lookup_id_to_mission[self.launching])) - if self.ctx.ui: - self.ctx.ui.clear_tooltip() - - def mission_callback(self, button): - if not self.launching: - mission_id: int = next(k for k, v in self.mission_id_to_button.items() if v == button) - if self.ctx.play_mission(mission_id): - self.launching = mission_id - Clock.schedule_once(self.finish_launching, 10) - - def finish_launching(self, dt): - self.launching = False - - self.ui = SC2Manager(self) - self.ui_task = asyncio.create_task(self.ui.async_run(), name="UI") - import pkgutil - data = pkgutil.get_data(SC2WoLWorld.__module__, "Starcraft2.kv").decode() - Builder.load_string(data) - - async def shutdown(self): - await super(SC2Context, self).shutdown() - if self.last_bot: - self.last_bot.want_close = True - if self.sc2_run_task: - self.sc2_run_task.cancel() - - def play_mission(self, mission_id: int) -> bool: - if self.missions_unlocked or \ - is_mission_available(self, mission_id): - if self.sc2_run_task: - if not self.sc2_run_task.done(): - sc2_logger.warning("Starcraft 2 Client is still running!") - self.sc2_run_task.cancel() # doesn't actually close the game, just stops the python task - if self.slot is None: - sc2_logger.warning("Launching Mission without Archipelago authentication, " - "checks will not be registered to server.") - self.sc2_run_task = asyncio.create_task(starcraft_launch(self, mission_id), - name="Starcraft 2 Launch") - return True - else: - sc2_logger.info( - f"{lookup_id_to_mission[mission_id]} is not currently unlocked. " - f"Use /unfinished or /available to see what is available.") - return False - - def build_location_to_mission_mapping(self): - mission_id_to_location_ids: typing.Dict[int, typing.Set[int]] = { - mission_info.id: set() for mission_info in self.mission_req_table.values() - } - - for loc in self.server_locations: - mission_id, objective = divmod(loc - SC2WOL_LOC_ID_OFFSET, victory_modulo) - mission_id_to_location_ids[mission_id].add(objective) - self.mission_id_to_location_ids = {mission_id: sorted(objectives) for mission_id, objectives in - mission_id_to_location_ids.items()} - - def locations_for_mission(self, mission: str): - mission_id: int = self.mission_req_table[mission].id - objectives = self.mission_id_to_location_ids[self.mission_req_table[mission].id] - for objective in objectives: - yield SC2WOL_LOC_ID_OFFSET + mission_id * 100 + objective - - -async def main(): - multiprocessing.freeze_support() - parser = get_base_parser() - parser.add_argument('--name', default=None, help="Slot Name to connect as.") - args = parser.parse_args() - - ctx = SC2Context(args.connect, args.password) - ctx.auth = args.name - if ctx.server_task is None: - ctx.server_task = asyncio.create_task(server_loop(ctx), name="ServerLoop") - - if gui_enabled: - ctx.run_gui() - ctx.run_cli() - - await ctx.exit_event.wait() - - await ctx.shutdown() - - -maps_table = [ - "ap_liberation_day", "ap_the_outlaws", "ap_zero_hour", - "ap_evacuation", "ap_outbreak", "ap_safe_haven", "ap_havens_fall", - "ap_smash_and_grab", "ap_the_dig", "ap_the_moebius_factor", "ap_supernova", "ap_maw_of_the_void", - "ap_devils_playground", "ap_welcome_to_the_jungle", "ap_breakout", "ap_ghost_of_a_chance", - "ap_the_great_train_robbery", "ap_cutthroat", "ap_engine_of_destruction", "ap_media_blitz", "ap_piercing_the_shroud", - "ap_whispers_of_doom", "ap_a_sinister_turn", "ap_echoes_of_the_future", "ap_in_utter_darkness", - "ap_gates_of_hell", "ap_belly_of_the_beast", "ap_shatter_the_sky", "ap_all_in" -] - -wol_default_categories = [ - "Mar Sara", "Mar Sara", "Mar Sara", "Colonist", "Colonist", "Colonist", "Colonist", - "Artifact", "Artifact", "Artifact", "Artifact", "Artifact", "Covert", "Covert", "Covert", "Covert", - "Rebellion", "Rebellion", "Rebellion", "Rebellion", "Rebellion", "Prophecy", "Prophecy", "Prophecy", "Prophecy", - "Char", "Char", "Char", "Char" -] -wol_default_category_names = [ - "Mar Sara", "Colonist", "Artifact", "Covert", "Rebellion", "Prophecy", "Char" -] - - -def calculate_items(ctx: SC2Context) -> typing.List[int]: - items = ctx.items_received - network_item: NetworkItem - accumulators: typing.List[int] = [0 for _ in type_flaggroups] - - for network_item in items: - name: str = lookup_id_to_name[network_item.item] - item_data: ItemData = get_full_item_list()[name] - - # exists exactly once - if item_data.quantity == 1: - accumulators[type_flaggroups[item_data.type]] |= 1 << item_data.number - - # exists multiple times - elif item_data.type == "Upgrade" or item_data.type == "Progressive Upgrade": - flaggroup = type_flaggroups[item_data.type] - - # Generic upgrades apply only to Weapon / Armor upgrades - if item_data.type != "Upgrade" or ctx.generic_upgrade_items == 0: - accumulators[flaggroup] += 1 << item_data.number - else: - for bundled_number in upgrade_numbers[item_data.number]: - accumulators[flaggroup] += 1 << bundled_number - - # sum - else: - accumulators[type_flaggroups[item_data.type]] += item_data.number - - # Upgrades from completed missions - if ctx.generic_upgrade_missions > 0: - upgrade_flaggroup = type_flaggroups["Upgrade"] - num_missions = ctx.generic_upgrade_missions * len(ctx.mission_req_table) - amounts = [ - num_missions // 100, - 2 * num_missions // 100, - 3 * num_missions // 100 - ] - upgrade_count = 0 - completed = len([id for id in ctx.mission_id_to_location_ids if SC2WOL_LOC_ID_OFFSET + victory_modulo * id in ctx.checked_locations]) - for amount in amounts: - if completed >= amount: - upgrade_count += 1 - # Equivalent to "Progressive Weapon/Armor Upgrade" item - for bundled_number in upgrade_numbers[5]: - accumulators[upgrade_flaggroup] += upgrade_count << bundled_number - - return accumulators - - -def calc_difficulty(difficulty): - if difficulty == 0: - return 'C' - elif difficulty == 1: - return 'N' - elif difficulty == 2: - return 'H' - elif difficulty == 3: - return 'B' - - return 'X' - - -async def starcraft_launch(ctx: SC2Context, mission_id: int): - sc2_logger.info(f"Launching {lookup_id_to_mission[mission_id]}. If game does not launch check log file for errors.") - - with DllDirectory(None): - run_game(bot.maps.get(maps_table[mission_id - 1]), [Bot(Race.Terran, ArchipelagoBot(ctx, mission_id), - name="Archipelago", fullscreen=True)], realtime=True) - - -class ArchipelagoBot(bot.bot_ai.BotAI): - game_running: bool = False - mission_completed: bool = False - boni: typing.List[bool] - setup_done: bool - ctx: SC2Context - mission_id: int - want_close: bool = False - can_read_game = False - last_received_update: int = 0 - - def __init__(self, ctx: SC2Context, mission_id): - self.setup_done = False - self.ctx = ctx - self.ctx.last_bot = self - self.mission_id = mission_id - self.boni = [False for _ in range(max_bonus)] - - super(ArchipelagoBot, self).__init__() - - async def on_step(self, iteration: int): - if self.want_close: - self.want_close = False - await self._client.leave() - return - game_state = 0 - if not self.setup_done: - self.setup_done = True - start_items = calculate_items(self.ctx) - if self.ctx.difficulty_override >= 0: - difficulty = calc_difficulty(self.ctx.difficulty_override) - else: - difficulty = calc_difficulty(self.ctx.difficulty) - if self.ctx.game_speed_override >= 0: - game_speed = self.ctx.game_speed_override - else: - game_speed = self.ctx.game_speed - await self.chat_send("?SetOptions {} {} {} {}".format( - difficulty, - self.ctx.generic_upgrade_research, - self.ctx.all_in_choice, - game_speed - )) - await self.chat_send("?GiveResources {} {} {}".format( - start_items[8], - start_items[9], - start_items[10] - )) - await self.chat_send("?GiveTerranTech {} {} {} {} {} {} {} {} {} {}".format( - start_items[0], start_items[1], start_items[2], start_items[3], start_items[4], - start_items[5], start_items[6], start_items[12], start_items[13], start_items[14])) - await self.chat_send("?GiveProtossTech {}".format(start_items[7])) - await self.chat_send("?SetColor rr " + str(self.ctx.player_color)) # TODO: Add faction color options - await self.chat_send("?LoadFinished") - self.last_received_update = len(self.ctx.items_received) - - else: - if not self.ctx.announcements.empty(): - message = self.ctx.announcements.get(timeout=1) - await self.chat_send("?SendMessage " + message) - self.ctx.announcements.task_done() - - # Archipelago reads the health - for unit in self.all_own_units(): - if unit.health_max == 38281: - game_state = int(38281 - unit.health) - self.can_read_game = True - - if iteration == 160 and not game_state & 1: - await self.chat_send("?SendMessage Warning: Archipelago unable to connect or has lost connection to " + - "Starcraft 2 (This is likely a map issue)") - - if self.last_received_update < len(self.ctx.items_received): - current_items = calculate_items(self.ctx) - await self.chat_send("?GiveTerranTech {} {} {} {} {} {} {} {} {} {}".format( - current_items[0], current_items[1], current_items[2], current_items[3], current_items[4], - current_items[5], current_items[6], current_items[12], current_items[13], current_items[14])) - await self.chat_send("?GiveProtossTech {}".format(current_items[7])) - self.last_received_update = len(self.ctx.items_received) - - if game_state & 1: - if not self.game_running: - print("Archipelago Connected") - self.game_running = True - - if self.can_read_game: - if game_state & (1 << 1) and not self.mission_completed: - if self.mission_id != self.ctx.final_mission: - print("Mission Completed") - await self.ctx.send_msgs( - [{"cmd": 'LocationChecks', - "locations": [SC2WOL_LOC_ID_OFFSET + victory_modulo * self.mission_id]}]) - self.mission_completed = True - else: - print("Game Complete") - await self.ctx.send_msgs([{"cmd": 'StatusUpdate', "status": ClientStatus.CLIENT_GOAL}]) - self.mission_completed = True - - for x, completed in enumerate(self.boni): - if not completed and game_state & (1 << (x + 2)): - await self.ctx.send_msgs( - [{"cmd": 'LocationChecks', - "locations": [SC2WOL_LOC_ID_OFFSET + victory_modulo * self.mission_id + x + 1]}]) - self.boni[x] = True - - else: - await self.chat_send("?SendMessage LostConnection - Lost connection to game.") - - -def request_unfinished_missions(ctx: SC2Context): - if ctx.mission_req_table: - message = "Unfinished Missions: " - unlocks = initialize_blank_mission_dict(ctx.mission_req_table) - unfinished_locations = initialize_blank_mission_dict(ctx.mission_req_table) - - _, unfinished_missions = calc_unfinished_missions(ctx, unlocks=unlocks) - - # Removing All-In from location pool - final_mission = lookup_id_to_mission[ctx.final_mission] - if final_mission in unfinished_missions.keys(): - message = f"Final Mission Available: {final_mission}[{ctx.final_mission}]\n" + message - if unfinished_missions[final_mission] == -1: - unfinished_missions.pop(final_mission) - - message += ", ".join(f"{mark_up_mission_name(ctx, mission, unlocks)}[{ctx.mission_req_table[mission].id}] " + - mark_up_objectives( - f"[{len(unfinished_missions[mission])}/" - f"{sum(1 for _ in ctx.locations_for_mission(mission))}]", - ctx, unfinished_locations, mission) - for mission in unfinished_missions) - - if ctx.ui: - ctx.ui.log_panels['All'].on_message_markup(message) - ctx.ui.log_panels['Starcraft2'].on_message_markup(message) - else: - sc2_logger.info(message) - else: - sc2_logger.warning("No mission table found, you are likely not connected to a server.") - - -def calc_unfinished_missions(ctx: SC2Context, unlocks=None): - unfinished_missions = [] - locations_completed = [] - - if not unlocks: - unlocks = initialize_blank_mission_dict(ctx.mission_req_table) - - available_missions = calc_available_missions(ctx, unlocks) - - for name in available_missions: - objectives = set(ctx.locations_for_mission(name)) - if objectives: - objectives_completed = ctx.checked_locations & objectives - if len(objectives_completed) < len(objectives): - unfinished_missions.append(name) - locations_completed.append(objectives_completed) - - else: # infer that this is the final mission as it has no objectives - unfinished_missions.append(name) - locations_completed.append(-1) - - return available_missions, dict(zip(unfinished_missions, locations_completed)) - - -def is_mission_available(ctx: SC2Context, mission_id_to_check): - unfinished_missions = calc_available_missions(ctx) - - return any(mission_id_to_check == ctx.mission_req_table[mission].id for mission in unfinished_missions) - - -def mark_up_mission_name(ctx: SC2Context, mission, unlock_table): - """Checks if the mission is required for game completion and adds '*' to the name to mark that.""" - - if ctx.mission_req_table[mission].completion_critical: - if ctx.ui: - message = "[color=AF99EF]" + mission + "[/color]" - else: - message = "*" + mission + "*" - else: - message = mission - - if ctx.ui: - unlocks = unlock_table[mission] - - if len(unlocks) > 0: - pre_message = f"[ref={list(ctx.mission_req_table).index(mission)}|Unlocks: " - pre_message += ", ".join(f"{unlock}({ctx.mission_req_table[unlock].id})" for unlock in unlocks) - pre_message += f"]" - message = pre_message + message + "[/ref]" - - return message - - -def mark_up_objectives(message, ctx, unfinished_locations, mission): - formatted_message = message - - if ctx.ui: - locations = unfinished_locations[mission] - - pre_message = f"[ref={list(ctx.mission_req_table).index(mission) + 30}|" - pre_message += "
".join(location for location in locations) - pre_message += f"]" - formatted_message = pre_message + message + "[/ref]" - - return formatted_message - - -def request_available_missions(ctx: SC2Context): - if ctx.mission_req_table: - message = "Available Missions: " - - # Initialize mission unlock table - unlocks = initialize_blank_mission_dict(ctx.mission_req_table) - - missions = calc_available_missions(ctx, unlocks) - message += \ - ", ".join(f"{mark_up_mission_name(ctx, mission, unlocks)}" - f"[{ctx.mission_req_table[mission].id}]" - for mission in missions) - - if ctx.ui: - ctx.ui.log_panels['All'].on_message_markup(message) - ctx.ui.log_panels['Starcraft2'].on_message_markup(message) - else: - sc2_logger.info(message) - else: - sc2_logger.warning("No mission table found, you are likely not connected to a server.") - - -def calc_available_missions(ctx: SC2Context, unlocks=None): - available_missions = [] - missions_complete = 0 - - # Get number of missions completed - for loc in ctx.checked_locations: - if loc % victory_modulo == 0: - missions_complete += 1 - - for name in ctx.mission_req_table: - # Go through the required missions for each mission and fill up unlock table used later for hover-over tooltips - if unlocks: - for unlock in ctx.mission_req_table[name].required_world: - unlocks[list(ctx.mission_req_table)[unlock - 1]].append(name) - - if mission_reqs_completed(ctx, name, missions_complete): - available_missions.append(name) - - return available_missions - - -def mission_reqs_completed(ctx: SC2Context, mission_name: str, missions_complete: int): - """Returns a bool signifying if the mission has all requirements complete and can be done - - Arguments: - ctx -- instance of SC2Context - locations_to_check -- the mission string name to check - missions_complete -- an int of how many missions have been completed - mission_path -- a list of missions that have already been checked -""" - if len(ctx.mission_req_table[mission_name].required_world) >= 1: - # A check for when the requirements are being or'd - or_success = False - - # Loop through required missions - for req_mission in ctx.mission_req_table[mission_name].required_world: - req_success = True - - # Check if required mission has been completed - if not (ctx.mission_req_table[list(ctx.mission_req_table)[req_mission - 1]].id * - victory_modulo + SC2WOL_LOC_ID_OFFSET) in ctx.checked_locations: - if not ctx.mission_req_table[mission_name].or_requirements: - return False - else: - req_success = False - - # Grid-specific logic (to avoid long path checks and infinite recursion) - if ctx.mission_order in (3, 4): - if req_success: - return True - else: - if req_mission is ctx.mission_req_table[mission_name].required_world[-1]: - return False - else: - continue - - # Recursively check required mission to see if it's requirements are met, in case !collect has been done - # Skipping recursive check on Grid settings to speed up checks and avoid infinite recursion - if not mission_reqs_completed(ctx, list(ctx.mission_req_table)[req_mission - 1], missions_complete): - if not ctx.mission_req_table[mission_name].or_requirements: - return False - else: - req_success = False - - # If requirement check succeeded mark or as satisfied - if ctx.mission_req_table[mission_name].or_requirements and req_success: - or_success = True - - if ctx.mission_req_table[mission_name].or_requirements: - # Return false if or requirements not met - if not or_success: - return False - - # Check number of missions - if missions_complete >= ctx.mission_req_table[mission_name].number: - return True - else: - return False - else: - return True - - -def initialize_blank_mission_dict(location_table): - unlocks = {} - - for mission in list(location_table): - unlocks[mission] = [] - - return unlocks - - -def check_game_install_path() -> bool: - # First thing: go to the default location for ExecuteInfo. - # An exception for Windows is included because it's very difficult to find ~\Documents if the user moved it. - if is_windows: - # The next five lines of utterly inscrutable code are brought to you by copy-paste from Stack Overflow. - # https://stackoverflow.com/questions/6227590/finding-the-users-my-documents-path/30924555# - import ctypes.wintypes - CSIDL_PERSONAL = 5 # My Documents - SHGFP_TYPE_CURRENT = 0 # Get current, not default value - - buf = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH) - ctypes.windll.shell32.SHGetFolderPathW(None, CSIDL_PERSONAL, None, SHGFP_TYPE_CURRENT, buf) - documentspath = buf.value - einfo = str(documentspath / Path("StarCraft II\\ExecuteInfo.txt")) - else: - einfo = str(bot.paths.get_home() / Path(bot.paths.USERPATH[bot.paths.PF])) - - # Check if the file exists. - if os.path.isfile(einfo): - - # Open the file and read it, picking out the latest executable's path. - with open(einfo) as f: - content = f.read() - if content: - try: - base = re.search(r" = (.*)Versions", content).group(1) - except AttributeError: - sc2_logger.warning(f"Found {einfo}, but it was empty. Run SC2 through the Blizzard launcher, then " - f"try again.") - return False - if os.path.exists(base): - executable = bot.paths.latest_executeble(Path(base).expanduser() / "Versions") - - # Finally, check the path for an actual executable. - # If we find one, great. Set up the SC2PATH. - if os.path.isfile(executable): - sc2_logger.info(f"Found an SC2 install at {base}!") - sc2_logger.debug(f"Latest executable at {executable}.") - os.environ["SC2PATH"] = base - sc2_logger.debug(f"SC2PATH set to {base}.") - return True - else: - sc2_logger.warning(f"We may have found an SC2 install at {base}, but couldn't find {executable}.") - else: - sc2_logger.warning(f"{einfo} pointed to {base}, but we could not find an SC2 install there.") - else: - sc2_logger.warning(f"Couldn't find {einfo}. Run SC2 through the Blizzard launcher, then try again. " - f"If that fails, please run /set_path with your SC2 install directory.") - return False - - -def is_mod_installed_correctly() -> bool: - """Searches for all required files.""" - if "SC2PATH" not in os.environ: - check_game_install_path() - - mapdir = os.environ['SC2PATH'] / Path('Maps/ArchipelagoCampaign') - mods = ["ArchipelagoCore", "ArchipelagoPlayer", "ArchipelagoPlayerWoL", "ArchipelagoTriggers"] - modfiles = [os.environ["SC2PATH"] / Path("Mods/" + mod + ".SC2Mod") for mod in mods] - wol_required_maps = ["WoL" + os.sep + map_name + ".SC2Map" for map_name in maps_table] - needs_files = False - - # Check for maps. - missing_maps = [] - for mapfile in wol_required_maps: - if not os.path.isfile(mapdir / mapfile): - missing_maps.append(mapfile) - if len(missing_maps) >= 19: - sc2_logger.warning(f"All map files missing from {mapdir}.") - needs_files = True - elif len(missing_maps) > 0: - for map in missing_maps: - sc2_logger.debug(f"Missing {map} from {mapdir}.") - sc2_logger.warning(f"Missing {len(missing_maps)} map files.") - needs_files = True - else: # Must be no maps missing - sc2_logger.info(f"All maps found in {mapdir}.") - - # Check for mods. - for modfile in modfiles: - if os.path.isfile(modfile) or os.path.isdir(modfile): - sc2_logger.info(f"Archipelago mod found at {modfile}.") - else: - sc2_logger.warning(f"Archipelago mod could not be found at {modfile}.") - needs_files = True - - # Final verdict. - if needs_files: - sc2_logger.warning(f"Required files are missing. Run /download_data to acquire them.") - return False - else: - sc2_logger.debug(f"All map/mod files are properly installed.") - return True - - -class DllDirectory: - # Credit to Black Sliver for this code. - # More info: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setdlldirectoryw - _old: typing.Optional[str] = None - _new: typing.Optional[str] = None - - def __init__(self, new: typing.Optional[str]): - self._new = new - - def __enter__(self): - old = self.get() - if self.set(self._new): - self._old = old - - def __exit__(self, *args): - if self._old is not None: - self.set(self._old) - - @staticmethod - def get() -> typing.Optional[str]: - if sys.platform == "win32": - n = ctypes.windll.kernel32.GetDllDirectoryW(0, None) - buf = ctypes.create_unicode_buffer(n) - ctypes.windll.kernel32.GetDllDirectoryW(n, buf) - return buf.value - # NOTE: other OS may support os.environ["LD_LIBRARY_PATH"], but this fix is windows-specific - return None - - @staticmethod - def set(s: typing.Optional[str]) -> bool: - if sys.platform == "win32": - return ctypes.windll.kernel32.SetDllDirectoryW(s) != 0 - # NOTE: other OS may support os.environ["LD_LIBRARY_PATH"], but this fix is windows-specific - return False - - -def download_latest_release_zip(owner: str, repo: str, api_version: str, metadata: str = None, force_download=False) -> (str, str): - """Downloads the latest release of a GitHub repo to the current directory as a .zip file.""" - import requests - - headers = {"Accept": 'application/vnd.github.v3+json'} - url = f"https://api.github.com/repos/{owner}/{repo}/releases/tags/{api_version}" - - r1 = requests.get(url, headers=headers) - if r1.status_code == 200: - latest_metadata = r1.json() - cleanup_downloaded_metadata(latest_metadata) - latest_metadata = str(latest_metadata) - # sc2_logger.info(f"Latest version: {latest_metadata}.") - else: - sc2_logger.warning(f"Status code: {r1.status_code}") - sc2_logger.warning(f"Failed to reach GitHub. Could not find download link.") - sc2_logger.warning(f"text: {r1.text}") - return "", metadata - - if (force_download is False) and (metadata == latest_metadata): - sc2_logger.info("Latest version already installed.") - return "", metadata - - sc2_logger.info(f"Attempting to download latest version of API version {api_version} of {repo}.") - download_url = r1.json()["assets"][0]["browser_download_url"] - - r2 = requests.get(download_url, headers=headers) - if r2.status_code == 200 and zipfile.is_zipfile(io.BytesIO(r2.content)): - tempdir = tempfile.gettempdir() - file = tempdir + os.sep + f"{repo}.zip" - with open(file, "wb") as fh: - fh.write(r2.content) - sc2_logger.info(f"Successfully downloaded {repo}.zip.") - return file, latest_metadata - else: - sc2_logger.warning(f"Status code: {r2.status_code}") - sc2_logger.warning("Download failed.") - sc2_logger.warning(f"text: {r2.text}") - return "", metadata - - -def cleanup_downloaded_metadata(medatada_json): - for asset in medatada_json['assets']: - del asset['download_count'] - - -def is_mod_update_available(owner: str, repo: str, api_version: str, metadata: str) -> bool: - import requests - - headers = {"Accept": 'application/vnd.github.v3+json'} - url = f"https://api.github.com/repos/{owner}/{repo}/releases/tags/{api_version}" - - r1 = requests.get(url, headers=headers) - if r1.status_code == 200: - latest_metadata = r1.json() - cleanup_downloaded_metadata(latest_metadata) - latest_metadata = str(latest_metadata) - if metadata != latest_metadata: - return True - else: - return False - - else: - sc2_logger.warning(f"Failed to reach GitHub while checking for updates.") - sc2_logger.warning(f"Status code: {r1.status_code}") - sc2_logger.warning(f"text: {r1.text}") - return False - - -def launch(): - colorama.init() - asyncio.run(main()) - colorama.deinit() diff --git a/worlds/sc2wol/Items.py b/worlds/sc2wol/Items.py deleted file mode 100644 index 971a75375fe4..000000000000 --- a/worlds/sc2wol/Items.py +++ /dev/null @@ -1,421 +0,0 @@ -from BaseClasses import Item, ItemClassification, MultiWorld -import typing - -from .Options import get_option_value -from .MissionTables import vanilla_mission_req_table - - -class ItemData(typing.NamedTuple): - code: typing.Optional[int] - type: typing.Optional[str] - number: typing.Optional[int] - classification: ItemClassification = ItemClassification.useful - quantity: int = 1 - parent_item: str = None - origin: typing.Set[str] = {"wol"} - - -class StarcraftWoLItem(Item): - game: str = "Starcraft 2 Wings of Liberty" - - -def get_full_item_list(): - return item_table - - -SC2WOL_ITEM_ID_OFFSET = 1000 - -item_table = { - "Marine": ItemData(0 + SC2WOL_ITEM_ID_OFFSET, "Unit", 0, classification=ItemClassification.progression), - "Medic": ItemData(1 + SC2WOL_ITEM_ID_OFFSET, "Unit", 1, classification=ItemClassification.progression), - "Firebat": ItemData(2 + SC2WOL_ITEM_ID_OFFSET, "Unit", 2, classification=ItemClassification.progression), - "Marauder": ItemData(3 + SC2WOL_ITEM_ID_OFFSET, "Unit", 3, classification=ItemClassification.progression), - "Reaper": ItemData(4 + SC2WOL_ITEM_ID_OFFSET, "Unit", 4, classification=ItemClassification.progression), - "Hellion": ItemData(5 + SC2WOL_ITEM_ID_OFFSET, "Unit", 5, classification=ItemClassification.progression), - "Vulture": ItemData(6 + SC2WOL_ITEM_ID_OFFSET, "Unit", 6, classification=ItemClassification.progression), - "Goliath": ItemData(7 + SC2WOL_ITEM_ID_OFFSET, "Unit", 7, classification=ItemClassification.progression), - "Diamondback": ItemData(8 + SC2WOL_ITEM_ID_OFFSET, "Unit", 8, classification=ItemClassification.progression), - "Siege Tank": ItemData(9 + SC2WOL_ITEM_ID_OFFSET, "Unit", 9, classification=ItemClassification.progression), - "Medivac": ItemData(10 + SC2WOL_ITEM_ID_OFFSET, "Unit", 10, classification=ItemClassification.progression), - "Wraith": ItemData(11 + SC2WOL_ITEM_ID_OFFSET, "Unit", 11, classification=ItemClassification.progression), - "Viking": ItemData(12 + SC2WOL_ITEM_ID_OFFSET, "Unit", 12, classification=ItemClassification.progression), - "Banshee": ItemData(13 + SC2WOL_ITEM_ID_OFFSET, "Unit", 13, classification=ItemClassification.progression), - "Battlecruiser": ItemData(14 + SC2WOL_ITEM_ID_OFFSET, "Unit", 14, classification=ItemClassification.progression), - "Ghost": ItemData(15 + SC2WOL_ITEM_ID_OFFSET, "Unit", 15, classification=ItemClassification.progression), - "Spectre": ItemData(16 + SC2WOL_ITEM_ID_OFFSET, "Unit", 16, classification=ItemClassification.progression), - "Thor": ItemData(17 + SC2WOL_ITEM_ID_OFFSET, "Unit", 17, classification=ItemClassification.progression), - # EE units - "Liberator": ItemData(18 + SC2WOL_ITEM_ID_OFFSET, "Unit", 18, classification=ItemClassification.progression, origin={"nco", "ext"}), - "Valkyrie": ItemData(19 + SC2WOL_ITEM_ID_OFFSET, "Unit", 19, classification=ItemClassification.progression, origin={"bw"}), - "Widow Mine": ItemData(20 + SC2WOL_ITEM_ID_OFFSET, "Unit", 20, classification=ItemClassification.progression, origin={"ext"}), - "Cyclone": ItemData(21 + SC2WOL_ITEM_ID_OFFSET, "Unit", 21, classification=ItemClassification.progression, origin={"ext"}), - - # Some other items are moved to Upgrade group because of the way how the bot message is parsed - "Progressive Infantry Weapon": ItemData(100 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 0, quantity=3), - "Progressive Infantry Armor": ItemData(102 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 2, quantity=3), - "Progressive Vehicle Weapon": ItemData(103 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 4, quantity=3), - "Progressive Vehicle Armor": ItemData(104 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 6, quantity=3), - "Progressive Ship Weapon": ItemData(105 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 8, quantity=3), - "Progressive Ship Armor": ItemData(106 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 10, quantity=3), - # Upgrade bundle 'number' values are used as indices to get affected 'number's - "Progressive Weapon Upgrade": ItemData(107 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 0, quantity=3), - "Progressive Armor Upgrade": ItemData(108 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 1, quantity=3), - "Progressive Infantry Upgrade": ItemData(109 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 2, quantity=3), - "Progressive Vehicle Upgrade": ItemData(110 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 3, quantity=3), - "Progressive Ship Upgrade": ItemData(111 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 4, quantity=3), - "Progressive Weapon/Armor Upgrade": ItemData(112 + SC2WOL_ITEM_ID_OFFSET, "Upgrade", 5, quantity=3), - - "Projectile Accelerator (Bunker)": ItemData(200 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 0, parent_item="Bunker"), - "Neosteel Bunker (Bunker)": ItemData(201 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 1, parent_item="Bunker"), - "Titanium Housing (Missile Turret)": ItemData(202 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 2, classification=ItemClassification.filler, parent_item="Missile Turret"), - "Hellstorm Batteries (Missile Turret)": ItemData(203 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 3, parent_item="Missile Turret"), - "Advanced Construction (SCV)": ItemData(204 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 4), - "Dual-Fusion Welders (SCV)": ItemData(205 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 5), - "Fire-Suppression System (Building)": ItemData(206 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 6), - "Orbital Command (Building)": ItemData(207 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 7), - "Progressive Stimpack (Marine)": ItemData(208 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 0, parent_item="Marine", quantity=2), - "Combat Shield (Marine)": ItemData(209 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 9, classification=ItemClassification.progression, parent_item="Marine"), - "Advanced Medic Facilities (Medic)": ItemData(210 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 10, classification=ItemClassification.filler, parent_item="Medic"), - "Stabilizer Medpacks (Medic)": ItemData(211 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 11, classification=ItemClassification.progression, parent_item="Medic"), - "Incinerator Gauntlets (Firebat)": ItemData(212 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 12, classification=ItemClassification.filler, parent_item="Firebat"), - "Juggernaut Plating (Firebat)": ItemData(213 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 13, parent_item="Firebat"), - "Concussive Shells (Marauder)": ItemData(214 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 14, parent_item="Marauder"), - "Kinetic Foam (Marauder)": ItemData(215 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 15, parent_item="Marauder"), - "U-238 Rounds (Reaper)": ItemData(216 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 16, parent_item="Reaper"), - "G-4 Clusterbomb (Reaper)": ItemData(217 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 17, classification=ItemClassification.progression, parent_item="Reaper"), - # Items from EE - "Mag-Field Accelerators (Cyclone)": ItemData(218 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 18, parent_item="Cyclone", origin={"ext"}), - "Mag-Field Launchers (Cyclone)": ItemData(219 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 19, parent_item="Cyclone", origin={"ext"}), - # Items from new mod - "Laser Targeting System (Marine)": ItemData(220 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 8, classification=ItemClassification.filler, parent_item="Marine", origin={"nco"}), # Freed slot from Stimpack - "Magrail Munitions (Marine)": ItemData(221 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 20, parent_item="Marine", origin={"nco"}), - "Optimized Logistics (Marine)": ItemData(222 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 21, classification=ItemClassification.filler, parent_item="Marine", origin={"nco"}), - "Restoration (Medic)": ItemData(223 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 22, classification=ItemClassification.filler, parent_item="Medic", origin={"bw"}), - "Optical Flare (Medic)": ItemData(224 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 23, classification=ItemClassification.filler, parent_item="Medic", origin={"bw"}), - "Optimized Logistics (Medic)": ItemData(225 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 24, classification=ItemClassification.filler, parent_item="Medic", origin={"bw"}), - "Progressive Stimpack (Firebat)": ItemData(226 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 6, parent_item="Firebat", quantity=2, origin={"bw"}), - "Optimized Logistics (Firebat)": ItemData(227 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 25, parent_item="Firebat", origin={"bw"}), - "Progressive Stimpack (Marauder)": ItemData(228 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 8, parent_item="Marauder", quantity=2, origin={"nco"}), - "Laser Targeting System (Marauder)": ItemData(229 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 26, classification=ItemClassification.filler, parent_item="Marauder", origin={"nco"}), - "Magrail Munitions (Marauder)": ItemData(230 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 27, classification=ItemClassification.filler, parent_item="Marauder", origin={"nco"}), - "Internal Tech Module (Marauder)": ItemData(231 + SC2WOL_ITEM_ID_OFFSET, "Armory 1", 28, classification=ItemClassification.filler, parent_item="Marauder", origin={"nco"}), - - # Items from new mod - "Progressive Stimpack (Reaper)": ItemData(250 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 10, parent_item="Reaper", quantity=2, origin={"nco"}), - "Laser Targeting System (Reaper)": ItemData(251 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 0, classification=ItemClassification.filler, parent_item="Reaper", origin={"nco"}), - "Advanced Cloaking Field (Reaper)": ItemData(252 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 1, parent_item="Reaper", origin={"nco"}), - "Spider Mines (Reaper)": ItemData(253 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 2, classification=ItemClassification.filler, parent_item="Reaper", origin={"nco"}), - "Combat Drugs (Reaper)": ItemData(254 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 3, classification=ItemClassification.filler, parent_item="Reaper", origin={"ext"}), - "Hellbat Aspect (Hellion)": ItemData(255 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 4, parent_item="Hellion", origin={"nco"}), - "Smart Servos (Hellion)": ItemData(256 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 5, parent_item="Hellion", origin={"nco"}), - "Optimized Logistics (Hellion)": ItemData(257 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 6, classification=ItemClassification.filler, parent_item="Hellion", origin={"nco"}), - "Jump Jets (Hellion)": ItemData(258 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 7, classification=ItemClassification.filler, parent_item="Hellion", origin={"nco"}), - "Progressive Stimpack (Hellion)": ItemData(259 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 12, parent_item="Hellion", quantity=2, origin={"nco"}), - "Ion Thrusters (Vulture)": ItemData(260 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 8, classification=ItemClassification.filler, parent_item="Vulture", origin={"bw"}), - "Auto Launchers (Vulture)": ItemData(261 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 9, parent_item="Vulture", origin={"bw"}), - "High Explosive Munition (Spider Mine)": ItemData(262 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 10, origin={"bw"}), - "Jump Jets (Goliath)": ItemData(263 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 11, classification=ItemClassification.filler, parent_item="Goliath", origin={"nco"}), - "Optimized Logistics (Goliath)": ItemData(264 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 12, classification=ItemClassification.filler, parent_item="Goliath", origin={"nco"}), - "Hyperfluxor (Diamondback)": ItemData(265 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 13, parent_item="Diamondback", origin={"ext"}), - "Burst Capacitors (Diamondback)": ItemData(266 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 14, classification=ItemClassification.filler, parent_item="Diamondback", origin={"ext"}), - "Optimized Logistics (Diamondback)": ItemData(267 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 15, parent_item="Diamondback", origin={"ext"}), - "Jump Jets (Siege Tank)": ItemData(268 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 16, parent_item="Siege Tank", origin={"nco"}), - "Spider Mines (Siege Tank)": ItemData(269 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 17, classification=ItemClassification.filler, parent_item="Siege Tank", origin={"nco"}), - "Smart Servos (Siege Tank)": ItemData(270 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 18, classification=ItemClassification.filler, parent_item="Siege Tank", origin={"nco"}), - "Graduating Range (Siege Tank)": ItemData(271 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 19, classification=ItemClassification.progression, parent_item="Siege Tank", origin={"ext"}), - "Laser Targeting System (Siege Tank)": ItemData(272 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 20, parent_item="Siege Tank", origin={"nco"}), - "Advanced Siege Tech (Siege Tank)": ItemData(273 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 21, parent_item="Siege Tank", origin={"ext"}), - "Internal Tech Module (Siege Tank)": ItemData(274 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 22, classification=ItemClassification.filler, parent_item="Siege Tank", origin={"nco"}), - "Optimized Logistics (Predator)": ItemData(275 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 23, classification=ItemClassification.filler, parent_item="Predator", origin={"ext"}), - "Expanded Hull (Medivac)": ItemData(276 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 24, classification=ItemClassification.filler, parent_item="Medivac", origin={"ext"}), - "Afterburners (Medivac)": ItemData(277 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 25, classification=ItemClassification.filler, parent_item="Medivac", origin={"ext"}), - "Advanced Laser Technology (Wraith)": ItemData(278 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 26, classification=ItemClassification.progression, parent_item="Wraith", origin={"ext"}), - "Smart Servos (Viking)": ItemData(279 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 27, parent_item="Viking", origin={"ext"}), - "Magrail Munitions (Viking)": ItemData(280 + SC2WOL_ITEM_ID_OFFSET, "Armory 3", 28, parent_item="Viking", origin={"ext"}), - - "Twin-Linked Flamethrower (Hellion)": ItemData(300 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 0, classification=ItemClassification.filler, parent_item="Hellion"), - "Thermite Filaments (Hellion)": ItemData(301 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 1, parent_item="Hellion"), - "Cerberus Mine (Spider Mine)": ItemData(302 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 2, classification=ItemClassification.filler), - "Replenishable Magazine (Vulture)": ItemData(303 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 3, classification=ItemClassification.filler, parent_item="Vulture"), - "Multi-Lock Weapons System (Goliath)": ItemData(304 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 4, parent_item="Goliath"), - "Ares-Class Targeting System (Goliath)": ItemData(305 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 5, parent_item="Goliath"), - "Tri-Lithium Power Cell (Diamondback)": ItemData(306 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 6, classification=ItemClassification.filler, parent_item="Diamondback"), - "Shaped Hull (Diamondback)": ItemData(307 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 7, classification=ItemClassification.filler, parent_item="Diamondback"), - "Maelstrom Rounds (Siege Tank)": ItemData(308 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 8, classification=ItemClassification.progression, parent_item="Siege Tank"), - "Shaped Blast (Siege Tank)": ItemData(309 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 9, parent_item="Siege Tank"), - "Rapid Deployment Tube (Medivac)": ItemData(310 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 10, classification=ItemClassification.filler, parent_item="Medivac"), - "Advanced Healing AI (Medivac)": ItemData(311 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 11, classification=ItemClassification.filler, parent_item="Medivac"), - "Tomahawk Power Cells (Wraith)": ItemData(312 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 12, classification=ItemClassification.filler, parent_item="Wraith"), - "Displacement Field (Wraith)": ItemData(313 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 13, classification=ItemClassification.filler, parent_item="Wraith"), - "Ripwave Missiles (Viking)": ItemData(314 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 14, parent_item="Viking"), - "Phobos-Class Weapons System (Viking)": ItemData(315 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 15, parent_item="Viking"), - "Progressive Cross-Spectrum Dampeners (Banshee)": ItemData(316 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 2, classification=ItemClassification.filler, parent_item="Banshee", quantity=2), - "Shockwave Missile Battery (Banshee)": ItemData(317 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 17, parent_item="Banshee"), - "Missile Pods (Battlecruiser)": ItemData(318 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 18, classification=ItemClassification.filler, parent_item="Battlecruiser"), - "Defensive Matrix (Battlecruiser)": ItemData(319 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 19, classification=ItemClassification.filler, parent_item="Battlecruiser"), - "Ocular Implants (Ghost)": ItemData(320 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 20, parent_item="Ghost"), - "Crius Suit (Ghost)": ItemData(321 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 21, parent_item="Ghost"), - "Psionic Lash (Spectre)": ItemData(322 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 22, classification=ItemClassification.progression, parent_item="Spectre"), - "Nyx-Class Cloaking Module (Spectre)": ItemData(323 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 23, parent_item="Spectre"), - "330mm Barrage Cannon (Thor)": ItemData(324 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 24, classification=ItemClassification.filler, parent_item="Thor"), - "Immortality Protocol (Thor)": ItemData(325 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 25, classification=ItemClassification.filler, parent_item="Thor"), - # Items from EE - "Advanced Ballistics (Liberator)": ItemData(326 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 26, parent_item="Liberator", origin={"ext"}), - "Raid Artillery (Liberator)": ItemData(327 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 27, classification=ItemClassification.progression, parent_item="Liberator", origin={"nco"}), - "Drilling Claws (Widow Mine)": ItemData(328 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 28, classification=ItemClassification.filler, parent_item="Widow Mine", origin={"ext"}), - "Concealment (Widow Mine)": ItemData(329 + SC2WOL_ITEM_ID_OFFSET, "Armory 2", 29, classification=ItemClassification.progression, parent_item="Widow Mine", origin={"ext"}), - - #Items from new mod - "Hyperflight Rotors (Banshee)": ItemData(350 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 0, classification=ItemClassification.filler, parent_item="Banshee", origin={"ext"}), - "Laser Targeting System (Banshee)": ItemData(351 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 1, classification=ItemClassification.filler, parent_item="Banshee", origin={"nco"}), - "Internal Tech Module (Banshee)": ItemData(352 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 2, classification=ItemClassification.filler, parent_item="Banshee", origin={"nco"}), - "Tactical Jump (Battlecruiser)": ItemData(353 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 3, parent_item="Battlecruiser", origin={"nco", "ext"}), - "Cloak (Battlecruiser)": ItemData(354 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 4, parent_item="Battlecruiser", origin={"nco"}), - "ATX Laser Battery (Battlecruiser)": ItemData(355 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 5, classification=ItemClassification.progression, parent_item="Battlecruiser", origin={"nco"}), - "Optimized Logistics (Battlecruiser)": ItemData(356 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 6, classification=ItemClassification.filler, parent_item="Battlecruiser", origin={"ext"}), - "Internal Tech Module (Battlecruiser)": ItemData(357 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 7, classification=ItemClassification.filler, parent_item="Battlecruiser", origin={"nco"}), - "EMP Rounds (Ghost)": ItemData(358 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 8, parent_item="Ghost", origin={"ext"}), - "Lockdown (Ghost)": ItemData(359 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 9, parent_item="Ghost", origin={"bw"}), - "Impaler Rounds (Spectre)": ItemData(360 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 10, parent_item="Spectre", origin={"ext"}), - "Progressive High Impact Payload (Thor)": ItemData(361 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 14, parent_item="Thor", quantity=2, origin={"ext"}), # L2 is Smart Servos - "Bio Mechanical Repair Drone (Raven)": ItemData(363 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 13, parent_item="Raven", origin={"nco"}), - "Spider Mines (Raven)": ItemData(364 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 14, parent_item="Raven", origin={"nco"}), - "Railgun Turret (Raven)": ItemData(365 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 15, parent_item="Raven", origin={"nco"}), - "Hunter-Seeker Weapon (Raven)": ItemData(366 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 16, parent_item="Raven", origin={"nco"}), - "Interference Matrix (Raven)": ItemData(367 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 17, parent_item="Raven", origin={"ext"}), - "Anti-Armor Missile (Raven)": ItemData(368 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 18, classification=ItemClassification.filler, parent_item="Raven", origin={"ext"}), - "Internal Tech Module (Raven)": ItemData(369 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 19, classification=ItemClassification.filler, parent_item="Raven", origin={"nco"}), - "EMP Shockwave (Science Vessel)": ItemData(370 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 20, parent_item="Science Vessel", origin={"bw"}), - "Defensive Matrix (Science Vessel)": ItemData(371 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 21, parent_item="Science Vessel", origin={"bw"}), - "Targeting Optics (Cyclone)": ItemData(372 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 22, parent_item="Cyclone", origin={"ext"}), - "Rapid Fire Launchers (Cyclone)": ItemData(373 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 23, parent_item="Cyclone", origin={"ext"}), - "Cloak (Liberator)": ItemData(374 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 24, classification=ItemClassification.filler, parent_item="Liberator", origin={"nco"}), - "Laser Targeting System (Liberator)": ItemData(375 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 25, classification=ItemClassification.filler, parent_item="Liberator", origin={"ext"}), - "Optimized Logistics (Liberator)": ItemData(376 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 26, classification=ItemClassification.filler, parent_item="Liberator", origin={"nco"}), - "Black Market Launchers (Widow Mine)": ItemData(377 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 27, classification=ItemClassification.filler, parent_item="Widow Mine", origin={"ext"}), - "Executioner Missiles (Widow Mine)": ItemData(378 + SC2WOL_ITEM_ID_OFFSET, "Armory 4", 28, parent_item="Widow Mine", origin={"ext"}), - - # Just lazy to create a new group for one unit - "Enhanced Cluster Launchers (Valkyrie)": ItemData(379 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 17, parent_item="Valkyrie", origin={"ext"}), - "Shaped Hull (Valkyrie)": ItemData(380 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 20, classification=ItemClassification.filler, parent_item="Valkyrie", origin={"ext"}), - "Burst Lasers (Valkyrie)": ItemData(381 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 21, parent_item="Valkyrie", origin={"ext"}), - "Afterburners (Valkyrie)": ItemData(382 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 22, classification=ItemClassification.filler, parent_item="Valkyrie", origin={"ext"}), - - "Bunker": ItemData(400 + SC2WOL_ITEM_ID_OFFSET, "Building", 0, classification=ItemClassification.progression), - "Missile Turret": ItemData(401 + SC2WOL_ITEM_ID_OFFSET, "Building", 1, classification=ItemClassification.progression), - "Sensor Tower": ItemData(402 + SC2WOL_ITEM_ID_OFFSET, "Building", 2), - - "War Pigs": ItemData(500 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 0, classification=ItemClassification.progression), - "Devil Dogs": ItemData(501 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 1, classification=ItemClassification.filler), - "Hammer Securities": ItemData(502 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 2), - "Spartan Company": ItemData(503 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 3, classification=ItemClassification.progression), - "Siege Breakers": ItemData(504 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 4), - "Hel's Angel": ItemData(505 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 5, classification=ItemClassification.progression), - "Dusk Wings": ItemData(506 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 6), - "Jackson's Revenge": ItemData(507 + SC2WOL_ITEM_ID_OFFSET, "Mercenary", 7), - - "Ultra-Capacitors": ItemData(600 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 0), - "Vanadium Plating": ItemData(601 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 1), - "Orbital Depots": ItemData(602 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 2), - "Micro-Filtering": ItemData(603 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 3), - "Automated Refinery": ItemData(604 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 4), - "Command Center Reactor": ItemData(605 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 5), - "Raven": ItemData(606 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 6), - "Science Vessel": ItemData(607 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 7, classification=ItemClassification.progression), - "Tech Reactor": ItemData(608 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 8), - "Orbital Strike": ItemData(609 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 9), - "Shrike Turret (Bunker)": ItemData(610 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 10, parent_item="Bunker"), - "Fortified Bunker (Bunker)": ItemData(611 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 11, parent_item="Bunker"), - "Planetary Fortress": ItemData(612 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 12, classification=ItemClassification.progression), - "Perdition Turret": ItemData(613 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 13, classification=ItemClassification.progression), - "Predator": ItemData(614 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 14, classification=ItemClassification.filler), - "Hercules": ItemData(615 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 15, classification=ItemClassification.progression), - "Cellular Reactor": ItemData(616 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 16), - "Progressive Regenerative Bio-Steel": ItemData(617 + SC2WOL_ITEM_ID_OFFSET, "Progressive Upgrade", 4, quantity=2), - "Hive Mind Emulator": ItemData(618 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 18, ItemClassification.progression), - "Psi Disrupter": ItemData(619 + SC2WOL_ITEM_ID_OFFSET, "Laboratory", 19, classification=ItemClassification.progression), - - "Zealot": ItemData(700 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 0, classification=ItemClassification.progression), - "Stalker": ItemData(701 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 1, classification=ItemClassification.progression), - "High Templar": ItemData(702 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 2, classification=ItemClassification.progression), - "Dark Templar": ItemData(703 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 3, classification=ItemClassification.progression), - "Immortal": ItemData(704 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 4, classification=ItemClassification.progression), - "Colossus": ItemData(705 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 5), - "Phoenix": ItemData(706 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 6, classification=ItemClassification.filler), - "Void Ray": ItemData(707 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 7, classification=ItemClassification.progression), - "Carrier": ItemData(708 + SC2WOL_ITEM_ID_OFFSET, "Protoss", 8, classification=ItemClassification.progression), - - # Filler items to fill remaining spots - "+15 Starting Minerals": ItemData(800 + SC2WOL_ITEM_ID_OFFSET, "Minerals", 15, quantity=0, classification=ItemClassification.filler), - "+15 Starting Vespene": ItemData(801 + SC2WOL_ITEM_ID_OFFSET, "Vespene", 15, quantity=0, classification=ItemClassification.filler), - # This Filler item isn't placed by the generator yet unless plando'd - "+2 Starting Supply": ItemData(802 + SC2WOL_ITEM_ID_OFFSET, "Supply", 2, quantity=0, classification=ItemClassification.filler), - # This item is used to "remove" location from the game. Never placed unless plando'd - "Nothing": ItemData(803 + SC2WOL_ITEM_ID_OFFSET, "Nothing Group", 2, quantity=0, classification=ItemClassification.trap), - - # "Keystone Piece": ItemData(850 + SC2WOL_ITEM_ID_OFFSET, "Goal", 0, quantity=0, classification=ItemClassification.progression_skip_balancing) -} - -def get_item_table(multiworld: MultiWorld, player: int): - return item_table - -basic_units = { - 'Marine', - 'Marauder', - 'Goliath', - 'Hellion', - 'Vulture' -} - -advanced_basic_units = basic_units.union({ - 'Reaper', - 'Diamondback', - 'Viking' -}) - - -def get_basic_units(multiworld: MultiWorld, player: int) -> typing.Set[str]: - if get_option_value(multiworld, player, 'required_tactics') > 0: - return advanced_basic_units - else: - return basic_units - - -item_name_groups = {} -for item, data in get_full_item_list().items(): - item_name_groups.setdefault(data.type, []).append(item) - if data.type in ("Armory 1", "Armory 2") and '(' in item: - short_name = item[:item.find(' (')] - item_name_groups[short_name] = [item] -item_name_groups["Missions"] = ["Beat " + mission_name for mission_name in vanilla_mission_req_table] - - -# Items that can be placed before resources if not already in -# General upgrades and Mercs -second_pass_placeable_items: typing.Tuple[str, ...] = ( - # Buildings without upgrades - "Sensor Tower", - "Hive Mind Emulator", - "Psi Disrupter", - "Perdition Turret", - # General upgrades without any dependencies - "Advanced Construction (SCV)", - "Dual-Fusion Welders (SCV)", - "Fire-Suppression System (Building)", - "Orbital Command (Building)", - "Ultra-Capacitors", - "Vanadium Plating", - "Orbital Depots", - "Micro-Filtering", - "Automated Refinery", - "Command Center Reactor", - "Tech Reactor", - "Planetary Fortress", - "Cellular Reactor", - "Progressive Regenerative Bio-Steel", # Place only L1 - # Mercenaries - "War Pigs", - "Devil Dogs", - "Hammer Securities", - "Spartan Company", - "Siege Breakers", - "Hel's Angel", - "Dusk Wings", - "Jackson's Revenge" -) - - -filler_items: typing.Tuple[str, ...] = ( - '+15 Starting Minerals', - '+15 Starting Vespene' -) - -# Defense rating table -# Commented defense ratings are handled in LogicMixin -defense_ratings = { - "Siege Tank": 5, - # "Maelstrom Rounds": 2, - "Planetary Fortress": 3, - # Bunker w/ Marine/Marauder: 3, - "Perdition Turret": 2, - "Missile Turret": 2, - "Vulture": 2, - "Liberator": 2, - "Widow Mine": 2 - # "Concealment (Widow Mine)": 1 -} -zerg_defense_ratings = { - "Perdition Turret": 2, - # Bunker w/ Firebat: 2, - "Hive Mind Emulator": 3, - "Psi Disruptor": 3 -} - -spider_mine_sources = { - "Vulture", - "Spider Mines (Reaper)", - "Spider Mines (Siege Tank)", - "Spider Mines (Raven)" -} - -progressive_if_nco = { - "Progressive Stimpack (Marine)", - "Progressive Stimpack (Firebat)", - "Progressive Cross-Spectrum Dampeners (Banshee)", - "Progressive Regenerative Bio-Steel" -} - -# 'number' values of upgrades for upgrade bundle items -upgrade_numbers = [ - {0, 4, 8}, # Weapon - {2, 6, 10}, # Armor - {0, 2}, # Infantry - {4, 6}, # Vehicle - {8, 10}, # Starship - {0, 2, 4, 6, 8, 10} # All -] -# Names of upgrades to be included for different options -upgrade_included_names = [ - { # Individual Items - "Progressive Infantry Weapon", - "Progressive Infantry Armor", - "Progressive Vehicle Weapon", - "Progressive Vehicle Armor", - "Progressive Ship Weapon", - "Progressive Ship Armor" - }, - { # Bundle Weapon And Armor - "Progressive Weapon Upgrade", - "Progressive Armor Upgrade" - }, - { # Bundle Unit Class - "Progressive Infantry Upgrade", - "Progressive Vehicle Upgrade", - "Progressive Starship Upgrade" - }, - { # Bundle All - "Progressive Weapon/Armor Upgrade" - } -] - -lookup_id_to_name: typing.Dict[int, str] = {data.code: item_name for item_name, data in get_full_item_list().items() if - data.code} -# Map type to expected int -type_flaggroups: typing.Dict[str, int] = { - "Unit": 0, - "Upgrade": 1, # Weapon / Armor upgrades - "Armory 1": 2, # Unit upgrades - "Armory 2": 3, # Unit upgrades - "Building": 4, - "Mercenary": 5, - "Laboratory": 6, - "Protoss": 7, - "Minerals": 8, - "Vespene": 9, - "Supply": 10, - "Goal": 11, - "Armory 3": 12, # Unit upgrades - "Armory 4": 13, # Unit upgrades - "Progressive Upgrade": 14, # Unit upgrades that exist multiple times (Stimpack / Super Stimpack) - "Nothing Group": 15 -} diff --git a/worlds/sc2wol/Locations.py b/worlds/sc2wol/Locations.py deleted file mode 100644 index fba7051337df..000000000000 --- a/worlds/sc2wol/Locations.py +++ /dev/null @@ -1,516 +0,0 @@ -from enum import IntEnum -from typing import List, Tuple, Optional, Callable, NamedTuple -from BaseClasses import MultiWorld -from .Options import get_option_value - -from BaseClasses import Location - -SC2WOL_LOC_ID_OFFSET = 1000 - - -class SC2WoLLocation(Location): - game: str = "Starcraft2WoL" - - -class LocationType(IntEnum): - VICTORY = 0 # Winning a mission - MISSION_PROGRESS = 1 # All tasks done for progressing the mission normally towards victory. All cleaning of expansion bases falls here - BONUS = 2 # Bonus objective, getting a campaign or mission bonus in vanilla (credits, research, bonus units or resources) - CHALLENGE = 3 # Challenging objectives, often harder than just completing a mission - OPTIONAL_BOSS = 4 # Any boss that's not required to win the mission. All Brutalisks, Loki, etc. - -class LocationData(NamedTuple): - region: str - name: str - code: Optional[int] - type: LocationType - rule: Callable = lambda state: True - - -def get_locations(multiworld: Optional[MultiWorld], player: Optional[int]) -> Tuple[LocationData, ...]: - # Note: rules which are ended with or True are rules identified as needed later when restricted units is an option - logic_level = get_option_value(multiworld, player, 'required_tactics') - location_table: List[LocationData] = [ - LocationData("Liberation Day", "Liberation Day: Victory", SC2WOL_LOC_ID_OFFSET + 100, LocationType.VICTORY), - LocationData("Liberation Day", "Liberation Day: First Statue", SC2WOL_LOC_ID_OFFSET + 101, LocationType.BONUS), - LocationData("Liberation Day", "Liberation Day: Second Statue", SC2WOL_LOC_ID_OFFSET + 102, LocationType.BONUS), - LocationData("Liberation Day", "Liberation Day: Third Statue", SC2WOL_LOC_ID_OFFSET + 103, LocationType.BONUS), - LocationData("Liberation Day", "Liberation Day: Fourth Statue", SC2WOL_LOC_ID_OFFSET + 104, LocationType.BONUS), - LocationData("Liberation Day", "Liberation Day: Fifth Statue", SC2WOL_LOC_ID_OFFSET + 105, LocationType.BONUS), - LocationData("Liberation Day", "Liberation Day: Sixth Statue", SC2WOL_LOC_ID_OFFSET + 106, LocationType.BONUS), - LocationData("Liberation Day", "Liberation Day: Special Delivery", SC2WOL_LOC_ID_OFFSET + 107, LocationType.MISSION_PROGRESS), - LocationData("The Outlaws", "The Outlaws: Victory", SC2WOL_LOC_ID_OFFSET + 200, LocationType.VICTORY, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("The Outlaws", "The Outlaws: Rebel Base", SC2WOL_LOC_ID_OFFSET + 201, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("The Outlaws", "The Outlaws: North Resource Pickups", SC2WOL_LOC_ID_OFFSET + 202, LocationType.BONUS), - LocationData("The Outlaws", "The Outlaws: Bunker", SC2WOL_LOC_ID_OFFSET + 203, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Zero Hour", "Zero Hour: Victory", SC2WOL_LOC_ID_OFFSET + 300, LocationType.VICTORY, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) >= 2 and - (logic_level > 0 or state._sc2wol_has_anti_air(multiworld, player))), - LocationData("Zero Hour", "Zero Hour: First Group Rescued", SC2WOL_LOC_ID_OFFSET + 301, LocationType.BONUS), - LocationData("Zero Hour", "Zero Hour: Second Group Rescued", SC2WOL_LOC_ID_OFFSET + 302, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Zero Hour", "Zero Hour: Third Group Rescued", SC2WOL_LOC_ID_OFFSET + 303, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) >= 2), - LocationData("Zero Hour", "Zero Hour: First Hatchery", SC2WOL_LOC_ID_OFFSET + 304, LocationType.CHALLENGE, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Zero Hour", "Zero Hour: Second Hatchery", SC2WOL_LOC_ID_OFFSET + 305, LocationType.CHALLENGE, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Zero Hour", "Zero Hour: Third Hatchery", SC2WOL_LOC_ID_OFFSET + 306, LocationType.CHALLENGE, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Zero Hour", "Zero Hour: Fourth Hatchery", SC2WOL_LOC_ID_OFFSET + 307, LocationType.CHALLENGE, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Evacuation", "Evacuation: Victory", SC2WOL_LOC_ID_OFFSET + 400, LocationType.VICTORY, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - (logic_level > 0 and state._sc2wol_has_anti_air(multiworld, player) - or state._sc2wol_has_competent_anti_air(multiworld, player))), - LocationData("Evacuation", "Evacuation: North Chrysalis", SC2WOL_LOC_ID_OFFSET + 401, LocationType.BONUS), - LocationData("Evacuation", "Evacuation: West Chrysalis", SC2WOL_LOC_ID_OFFSET + 402, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Evacuation", "Evacuation: East Chrysalis", SC2WOL_LOC_ID_OFFSET + 403, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Evacuation", "Evacuation: Reach Hanson", SC2WOL_LOC_ID_OFFSET + 404, LocationType.MISSION_PROGRESS), - LocationData("Evacuation", "Evacuation: Secret Resource Stash", SC2WOL_LOC_ID_OFFSET + 405, LocationType.BONUS), - LocationData("Evacuation", "Evacuation: Flawless", SC2WOL_LOC_ID_OFFSET + 406, LocationType.CHALLENGE, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True, False) >= 2 and - (logic_level > 0 and state._sc2wol_has_anti_air(multiworld, player) - or state._sc2wol_has_competent_anti_air(multiworld, player))), - LocationData("Outbreak", "Outbreak: Victory", SC2WOL_LOC_ID_OFFSET + 500, LocationType.VICTORY, - lambda state: state._sc2wol_defense_rating(multiworld, player, True, False) >= 4 and - (state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Outbreak", "Outbreak: Left Infestor", SC2WOL_LOC_ID_OFFSET + 501, LocationType.BONUS, - lambda state: state._sc2wol_defense_rating(multiworld, player, True, False) >= 2 and - (state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Outbreak", "Outbreak: Right Infestor", SC2WOL_LOC_ID_OFFSET + 502, LocationType.BONUS, - lambda state: state._sc2wol_defense_rating(multiworld, player, True, False) >= 2 and - (state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Outbreak", "Outbreak: North Infested Command Center", SC2WOL_LOC_ID_OFFSET + 503, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_defense_rating(multiworld, player, True, False) >= 2 and - (state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Outbreak", "Outbreak: South Infested Command Center", SC2WOL_LOC_ID_OFFSET + 504, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_defense_rating(multiworld, player, True, False) >= 2 and - (state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Outbreak", "Outbreak: Northwest Bar", SC2WOL_LOC_ID_OFFSET + 505, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_defense_rating(multiworld, player, True, False) >= 2 and - (state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Outbreak", "Outbreak: North Bar", SC2WOL_LOC_ID_OFFSET + 506, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_defense_rating(multiworld, player, True, False) >= 2 and - (state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Outbreak", "Outbreak: South Bar", SC2WOL_LOC_ID_OFFSET + 507, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_defense_rating(multiworld, player, True, False) >= 2 and - (state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Safe Haven", "Safe Haven: Victory", SC2WOL_LOC_ID_OFFSET + 600, LocationType.VICTORY, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player)), - LocationData("Safe Haven", "Safe Haven: North Nexus", SC2WOL_LOC_ID_OFFSET + 601, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player)), - LocationData("Safe Haven", "Safe Haven: East Nexus", SC2WOL_LOC_ID_OFFSET + 602, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player)), - LocationData("Safe Haven", "Safe Haven: South Nexus", SC2WOL_LOC_ID_OFFSET + 603, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player)), - LocationData("Safe Haven", "Safe Haven: First Terror Fleet", SC2WOL_LOC_ID_OFFSET + 604, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player)), - LocationData("Safe Haven", "Safe Haven: Second Terror Fleet", SC2WOL_LOC_ID_OFFSET + 605, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player)), - LocationData("Safe Haven", "Safe Haven: Third Terror Fleet", SC2WOL_LOC_ID_OFFSET + 606, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player)), - LocationData("Haven's Fall", "Haven's Fall: Victory", SC2WOL_LOC_ID_OFFSET + 700, LocationType.VICTORY, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) >= 3), - LocationData("Haven's Fall", "Haven's Fall: North Hive", SC2WOL_LOC_ID_OFFSET + 701, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) >= 3), - LocationData("Haven's Fall", "Haven's Fall: East Hive", SC2WOL_LOC_ID_OFFSET + 702, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) >= 3), - LocationData("Haven's Fall", "Haven's Fall: South Hive", SC2WOL_LOC_ID_OFFSET + 703, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) >= 3), - LocationData("Haven's Fall", "Haven's Fall: Northeast Colony Base", SC2WOL_LOC_ID_OFFSET + 704, LocationType.CHALLENGE, - lambda state: state._sc2wol_can_respond_to_colony_infestations), - LocationData("Haven's Fall", "Haven's Fall: East Colony Base", SC2WOL_LOC_ID_OFFSET + 705, LocationType.CHALLENGE, - lambda state: state._sc2wol_can_respond_to_colony_infestations), - LocationData("Haven's Fall", "Haven's Fall: Middle Colony Base", SC2WOL_LOC_ID_OFFSET + 706, LocationType.CHALLENGE, - lambda state: state._sc2wol_can_respond_to_colony_infestations), - LocationData("Haven's Fall", "Haven's Fall: Southeast Colony Base", SC2WOL_LOC_ID_OFFSET + 707, LocationType.CHALLENGE, - lambda state: state._sc2wol_can_respond_to_colony_infestations), - LocationData("Haven's Fall", "Haven's Fall: Southwest Colony Base", SC2WOL_LOC_ID_OFFSET + 708, LocationType.CHALLENGE, - lambda state: state._sc2wol_can_respond_to_colony_infestations), - LocationData("Smash and Grab", "Smash and Grab: Victory", SC2WOL_LOC_ID_OFFSET + 800, LocationType.VICTORY, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - (logic_level > 0 and state._sc2wol_has_anti_air(multiworld, player) - or state._sc2wol_has_competent_anti_air(multiworld, player))), - LocationData("Smash and Grab", "Smash and Grab: First Relic", SC2WOL_LOC_ID_OFFSET + 801, LocationType.BONUS), - LocationData("Smash and Grab", "Smash and Grab: Second Relic", SC2WOL_LOC_ID_OFFSET + 802, LocationType.BONUS), - LocationData("Smash and Grab", "Smash and Grab: Third Relic", SC2WOL_LOC_ID_OFFSET + 803, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - (logic_level > 0 and state._sc2wol_has_anti_air(multiworld, player) - or state._sc2wol_has_competent_anti_air(multiworld, player))), - LocationData("Smash and Grab", "Smash and Grab: Fourth Relic", SC2WOL_LOC_ID_OFFSET + 804, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - (logic_level > 0 and state._sc2wol_has_anti_air(multiworld, player) - or state._sc2wol_has_competent_anti_air(multiworld, player))), - LocationData("Smash and Grab", "Smash and Grab: First Forcefield Area Busted", SC2WOL_LOC_ID_OFFSET + 805, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - (logic_level > 0 and state._sc2wol_has_anti_air(multiworld, player) - or state._sc2wol_has_competent_anti_air(multiworld, player))), - LocationData("Smash and Grab", "Smash and Grab: Second Forcefield Area Busted", SC2WOL_LOC_ID_OFFSET + 806, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - (logic_level > 0 and state._sc2wol_has_anti_air(multiworld, player) - or state._sc2wol_has_competent_anti_air(multiworld, player))), - LocationData("The Dig", "The Dig: Victory", SC2WOL_LOC_ID_OFFSET + 900, LocationType.VICTORY, - lambda state: state._sc2wol_has_anti_air(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, False) >= 7), - LocationData("The Dig", "The Dig: Left Relic", SC2WOL_LOC_ID_OFFSET + 901, LocationType.BONUS, - lambda state: state._sc2wol_defense_rating(multiworld, player, False) >= 5), - LocationData("The Dig", "The Dig: Right Ground Relic", SC2WOL_LOC_ID_OFFSET + 902, LocationType.BONUS, - lambda state: state._sc2wol_defense_rating(multiworld, player, False) >= 5), - LocationData("The Dig", "The Dig: Right Cliff Relic", SC2WOL_LOC_ID_OFFSET + 903, LocationType.BONUS, - lambda state: state._sc2wol_defense_rating(multiworld, player, False) >= 5), - LocationData("The Dig", "The Dig: Moebius Base", SC2WOL_LOC_ID_OFFSET + 904, LocationType.MISSION_PROGRESS), - LocationData("The Moebius Factor", "The Moebius Factor: Victory", SC2WOL_LOC_ID_OFFSET + 1000, LocationType.VICTORY, - lambda state: state._sc2wol_has_anti_air(multiworld, player) and - (state._sc2wol_has_air(multiworld, player) - or state.has_any({'Medivac', 'Hercules'}, player) - and state._sc2wol_has_common_unit(multiworld, player))), - LocationData("The Moebius Factor", "The Moebius Factor: 1st Data Core", SC2WOL_LOC_ID_OFFSET + 1001, LocationType.MISSION_PROGRESS), - LocationData("The Moebius Factor", "The Moebius Factor: 2nd Data Core", SC2WOL_LOC_ID_OFFSET + 1002, LocationType.MISSION_PROGRESS, - lambda state: (state._sc2wol_has_air(multiworld, player) - or state.has_any({'Medivac', 'Hercules'}, player) - and state._sc2wol_has_common_unit(multiworld, player))), - LocationData("The Moebius Factor", "The Moebius Factor: South Rescue", SC2WOL_LOC_ID_OFFSET + 1003, LocationType.BONUS, - lambda state: state._sc2wol_able_to_rescue(multiworld, player)), - LocationData("The Moebius Factor", "The Moebius Factor: Wall Rescue", SC2WOL_LOC_ID_OFFSET + 1004, LocationType.BONUS, - lambda state: state._sc2wol_able_to_rescue(multiworld, player)), - LocationData("The Moebius Factor", "The Moebius Factor: Mid Rescue", SC2WOL_LOC_ID_OFFSET + 1005, LocationType.BONUS, - lambda state: state._sc2wol_able_to_rescue(multiworld, player)), - LocationData("The Moebius Factor", "The Moebius Factor: Nydus Roof Rescue", SC2WOL_LOC_ID_OFFSET + 1006, LocationType.BONUS, - lambda state: state._sc2wol_able_to_rescue(multiworld, player)), - LocationData("The Moebius Factor", "The Moebius Factor: Alive Inside Rescue", SC2WOL_LOC_ID_OFFSET + 1007, LocationType.BONUS, - lambda state: state._sc2wol_able_to_rescue(multiworld, player)), - LocationData("The Moebius Factor", "The Moebius Factor: Brutalisk", SC2WOL_LOC_ID_OFFSET + 1008, LocationType.OPTIONAL_BOSS, - lambda state: state._sc2wol_has_anti_air(multiworld, player) and - (state._sc2wol_has_air(multiworld, player) - or state.has_any({'Medivac', 'Hercules'}, player) - and state._sc2wol_has_common_unit(multiworld, player))), - LocationData("The Moebius Factor", "The Moebius Factor: 3rd Data Core", SC2WOL_LOC_ID_OFFSET + 1009, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_anti_air(multiworld, player) and - (state._sc2wol_has_air(multiworld, player) - or state.has_any({'Medivac', 'Hercules'}, player) - and state._sc2wol_has_common_unit(multiworld, player))), - LocationData("Supernova", "Supernova: Victory", SC2WOL_LOC_ID_OFFSET + 1100, LocationType.VICTORY, - lambda state: state._sc2wol_beats_protoss_deathball(multiworld, player)), - LocationData("Supernova", "Supernova: West Relic", SC2WOL_LOC_ID_OFFSET + 1101, LocationType.BONUS), - LocationData("Supernova", "Supernova: North Relic", SC2WOL_LOC_ID_OFFSET + 1102, LocationType.BONUS), - LocationData("Supernova", "Supernova: South Relic", SC2WOL_LOC_ID_OFFSET + 1103, LocationType.BONUS, - lambda state: state._sc2wol_beats_protoss_deathball(multiworld, player)), - LocationData("Supernova", "Supernova: East Relic", SC2WOL_LOC_ID_OFFSET + 1104, LocationType.BONUS, - lambda state: state._sc2wol_beats_protoss_deathball(multiworld, player)), - LocationData("Supernova", "Supernova: Landing Zone Cleared", SC2WOL_LOC_ID_OFFSET + 1105, LocationType.MISSION_PROGRESS), - LocationData("Supernova", "Supernova: Middle Base", SC2WOL_LOC_ID_OFFSET + 1106, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_beats_protoss_deathball(multiworld, player)), - LocationData("Supernova", "Supernova: Southeast Base", SC2WOL_LOC_ID_OFFSET + 1107, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_beats_protoss_deathball(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: Victory", SC2WOL_LOC_ID_OFFSET + 1200, LocationType.VICTORY, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: Landing Zone Cleared", SC2WOL_LOC_ID_OFFSET + 1201, LocationType.MISSION_PROGRESS), - LocationData("Maw of the Void", "Maw of the Void: Expansion Prisoners", SC2WOL_LOC_ID_OFFSET + 1202, LocationType.BONUS, - lambda state: logic_level > 0 or state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: South Close Prisoners", SC2WOL_LOC_ID_OFFSET + 1203, LocationType.BONUS, - lambda state: logic_level > 0 or state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: South Far Prisoners", SC2WOL_LOC_ID_OFFSET + 1204, LocationType.BONUS, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: North Prisoners", SC2WOL_LOC_ID_OFFSET + 1205, LocationType.BONUS, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: Mothership", SC2WOL_LOC_ID_OFFSET + 1206, LocationType.OPTIONAL_BOSS, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: Expansion Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1207, LocationType.MISSION_PROGRESS, - lambda state: logic_level > 0 or state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: Middle Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1208, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: Southeast Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1209, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: Stargate Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1210, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: Northwest Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1211, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: West Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1212, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Maw of the Void", "Maw of the Void: Southwest Rip Field Generator", SC2WOL_LOC_ID_OFFSET + 1213, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_survives_rip_field(multiworld, player)), - LocationData("Devil's Playground", "Devil's Playground: Victory", SC2WOL_LOC_ID_OFFSET + 1300, LocationType.VICTORY, - lambda state: logic_level > 0 or - state._sc2wol_has_anti_air(multiworld, player) and ( - state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Devil's Playground", "Devil's Playground: Tosh's Miners", SC2WOL_LOC_ID_OFFSET + 1301, LocationType.BONUS), - LocationData("Devil's Playground", "Devil's Playground: Brutalisk", SC2WOL_LOC_ID_OFFSET + 1302, LocationType.OPTIONAL_BOSS, - lambda state: logic_level > 0 or state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player)), - LocationData("Devil's Playground", "Devil's Playground: North Reapers", SC2WOL_LOC_ID_OFFSET + 1303, LocationType.BONUS), - LocationData("Devil's Playground", "Devil's Playground: Middle Reapers", SC2WOL_LOC_ID_OFFSET + 1304, LocationType.BONUS, - lambda state: logic_level > 0 or state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player)), - LocationData("Devil's Playground", "Devil's Playground: Southwest Reapers", SC2WOL_LOC_ID_OFFSET + 1305, LocationType.BONUS, - lambda state: logic_level > 0 or state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player)), - LocationData("Devil's Playground", "Devil's Playground: Southeast Reapers", SC2WOL_LOC_ID_OFFSET + 1306, LocationType.BONUS, - lambda state: logic_level > 0 or - state._sc2wol_has_anti_air(multiworld, player) and ( - state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Devil's Playground", "Devil's Playground: East Reapers", SC2WOL_LOC_ID_OFFSET + 1307, LocationType.BONUS, - lambda state: state._sc2wol_has_anti_air(multiworld, player) and - (logic_level > 0 or - state._sc2wol_has_common_unit(multiworld, player) or state.has("Reaper", player))), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: Victory", SC2WOL_LOC_ID_OFFSET + 1400, LocationType.VICTORY, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: Close Relic", SC2WOL_LOC_ID_OFFSET + 1401, LocationType.BONUS), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: West Relic", SC2WOL_LOC_ID_OFFSET + 1402, LocationType.BONUS, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: North-East Relic", SC2WOL_LOC_ID_OFFSET + 1403, LocationType.BONUS, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: Middle Base", SC2WOL_LOC_ID_OFFSET + 1404, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: Main Base", SC2WOL_LOC_ID_OFFSET + 1405, LocationType.CHALLENGE, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player) - and state._sc2wol_beats_protoss_deathball(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: No Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1406, LocationType.CHALLENGE, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player) - and state._sc2wol_has_competent_ground_to_air(multiworld, player) - and state._sc2wol_beats_protoss_deathball(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 1 Terrazine Node Sealed", SC2WOL_LOC_ID_OFFSET + 1407, LocationType.CHALLENGE, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player) - and state._sc2wol_has_competent_ground_to_air(multiworld, player) - and state._sc2wol_beats_protoss_deathball(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 2 Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1408, LocationType.CHALLENGE, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player) - and state._sc2wol_beats_protoss_deathball(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 3 Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1409, LocationType.CHALLENGE, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player) - and state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 4 Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1410, LocationType.CHALLENGE, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player)), - LocationData("Welcome to the Jungle", "Welcome to the Jungle: Up to 5 Terrazine Nodes Sealed", SC2WOL_LOC_ID_OFFSET + 1411, LocationType.CHALLENGE, - lambda state: state._sc2wol_welcome_to_the_jungle_requirement(multiworld, player)), - LocationData("Breakout", "Breakout: Victory", SC2WOL_LOC_ID_OFFSET + 1500, LocationType.VICTORY), - LocationData("Breakout", "Breakout: Diamondback Prison", SC2WOL_LOC_ID_OFFSET + 1501, LocationType.BONUS), - LocationData("Breakout", "Breakout: Siege Tank Prison", SC2WOL_LOC_ID_OFFSET + 1502, LocationType.BONUS), - LocationData("Breakout", "Breakout: First Checkpoint", SC2WOL_LOC_ID_OFFSET + 1503, LocationType.MISSION_PROGRESS), - LocationData("Breakout", "Breakout: Second Checkpoint", SC2WOL_LOC_ID_OFFSET + 1504, LocationType.MISSION_PROGRESS), - LocationData("Ghost of a Chance", "Ghost of a Chance: Victory", SC2WOL_LOC_ID_OFFSET + 1600, LocationType.VICTORY), - LocationData("Ghost of a Chance", "Ghost of a Chance: Terrazine Tank", SC2WOL_LOC_ID_OFFSET + 1601, LocationType.MISSION_PROGRESS), - LocationData("Ghost of a Chance", "Ghost of a Chance: Jorium Stockpile", SC2WOL_LOC_ID_OFFSET + 1602, LocationType.MISSION_PROGRESS), - LocationData("Ghost of a Chance", "Ghost of a Chance: First Island Spectres", SC2WOL_LOC_ID_OFFSET + 1603, LocationType.BONUS), - LocationData("Ghost of a Chance", "Ghost of a Chance: Second Island Spectres", SC2WOL_LOC_ID_OFFSET + 1604, LocationType.BONUS), - LocationData("Ghost of a Chance", "Ghost of a Chance: Third Island Spectres", SC2WOL_LOC_ID_OFFSET + 1605, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: Victory", SC2WOL_LOC_ID_OFFSET + 1700, LocationType.VICTORY, - lambda state: state._sc2wol_has_train_killers(multiworld, player) and - state._sc2wol_has_anti_air(multiworld, player)), - LocationData("The Great Train Robbery", "The Great Train Robbery: North Defiler", SC2WOL_LOC_ID_OFFSET + 1701, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: Mid Defiler", SC2WOL_LOC_ID_OFFSET + 1702, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: South Defiler", SC2WOL_LOC_ID_OFFSET + 1703, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: Close Diamondback", SC2WOL_LOC_ID_OFFSET + 1704, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: Northwest Diamondback", SC2WOL_LOC_ID_OFFSET + 1705, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: North Diamondback", SC2WOL_LOC_ID_OFFSET + 1706, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: Northeast Diamondback", SC2WOL_LOC_ID_OFFSET + 1707, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: Southwest Diamondback", SC2WOL_LOC_ID_OFFSET + 1708, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: Southeast Diamondback", SC2WOL_LOC_ID_OFFSET + 1709, LocationType.BONUS), - LocationData("The Great Train Robbery", "The Great Train Robbery: Kill Team", SC2WOL_LOC_ID_OFFSET + 1710, LocationType.CHALLENGE, - lambda state: (logic_level > 0 or state._sc2wol_has_common_unit(multiworld, player)) and - state._sc2wol_has_train_killers(multiworld, player) and - state._sc2wol_has_anti_air(multiworld, player)), - LocationData("Cutthroat", "Cutthroat: Victory", SC2WOL_LOC_ID_OFFSET + 1800, LocationType.VICTORY, - lambda state: state._sc2wol_has_common_unit(multiworld, player) and - (logic_level > 0 or state._sc2wol_has_anti_air)), - LocationData("Cutthroat", "Cutthroat: Mira Han", SC2WOL_LOC_ID_OFFSET + 1801, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Cutthroat", "Cutthroat: North Relic", SC2WOL_LOC_ID_OFFSET + 1802, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Cutthroat", "Cutthroat: Mid Relic", SC2WOL_LOC_ID_OFFSET + 1803, LocationType.BONUS), - LocationData("Cutthroat", "Cutthroat: Southwest Relic", SC2WOL_LOC_ID_OFFSET + 1804, LocationType.BONUS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Cutthroat", "Cutthroat: North Command Center", SC2WOL_LOC_ID_OFFSET + 1805, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Cutthroat", "Cutthroat: South Command Center", SC2WOL_LOC_ID_OFFSET + 1806, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Cutthroat", "Cutthroat: West Command Center", SC2WOL_LOC_ID_OFFSET + 1807, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_common_unit(multiworld, player)), - LocationData("Engine of Destruction", "Engine of Destruction: Victory", SC2WOL_LOC_ID_OFFSET + 1900, LocationType.VICTORY, - lambda state: state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_has_common_unit(multiworld, player) or state.has('Wraith', player)), - LocationData("Engine of Destruction", "Engine of Destruction: Odin", SC2WOL_LOC_ID_OFFSET + 1901, LocationType.MISSION_PROGRESS), - LocationData("Engine of Destruction", "Engine of Destruction: Loki", SC2WOL_LOC_ID_OFFSET + 1902, LocationType.OPTIONAL_BOSS, - lambda state: state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_has_common_unit(multiworld, player) or state.has('Wraith', player)), - LocationData("Engine of Destruction", "Engine of Destruction: Lab Devourer", SC2WOL_LOC_ID_OFFSET + 1903, LocationType.BONUS), - LocationData("Engine of Destruction", "Engine of Destruction: North Devourer", SC2WOL_LOC_ID_OFFSET + 1904, LocationType.BONUS, - lambda state: state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_has_common_unit(multiworld, player) or state.has('Wraith', player)), - LocationData("Engine of Destruction", "Engine of Destruction: Southeast Devourer", SC2WOL_LOC_ID_OFFSET + 1905, LocationType.BONUS, - lambda state: state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_has_common_unit(multiworld, player) or state.has('Wraith', player)), - LocationData("Engine of Destruction", "Engine of Destruction: West Base", SC2WOL_LOC_ID_OFFSET + 1906, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_has_common_unit(multiworld, player) or state.has('Wraith', player)), - LocationData("Engine of Destruction", "Engine of Destruction: Northwest Base", SC2WOL_LOC_ID_OFFSET + 1907, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_has_common_unit(multiworld, player) or state.has('Wraith', player)), - LocationData("Engine of Destruction", "Engine of Destruction: Northeast Base", SC2WOL_LOC_ID_OFFSET + 1908, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_has_common_unit(multiworld, player) or state.has('Wraith', player)), - LocationData("Engine of Destruction", "Engine of Destruction: Southeast Base", SC2WOL_LOC_ID_OFFSET + 1909, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_anti_air(multiworld, player) and - state._sc2wol_has_common_unit(multiworld, player) or state.has('Wraith', player)), - LocationData("Media Blitz", "Media Blitz: Victory", SC2WOL_LOC_ID_OFFSET + 2000, LocationType.VICTORY, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Media Blitz", "Media Blitz: Tower 1", SC2WOL_LOC_ID_OFFSET + 2001, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Media Blitz", "Media Blitz: Tower 2", SC2WOL_LOC_ID_OFFSET + 2002, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Media Blitz", "Media Blitz: Tower 3", SC2WOL_LOC_ID_OFFSET + 2003, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Media Blitz", "Media Blitz: Science Facility", SC2WOL_LOC_ID_OFFSET + 2004, LocationType.BONUS), - LocationData("Media Blitz", "Media Blitz: All Barracks", SC2WOL_LOC_ID_OFFSET + 2005, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Media Blitz", "Media Blitz: All Factories", SC2WOL_LOC_ID_OFFSET + 2006, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Media Blitz", "Media Blitz: All Starports", SC2WOL_LOC_ID_OFFSET + 2007, LocationType.MISSION_PROGRESS, - lambda state: logic_level > 0 or state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Media Blitz", "Media Blitz: Odin Not Trashed", SC2WOL_LOC_ID_OFFSET + 2008, LocationType.CHALLENGE, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Piercing the Shroud", "Piercing the Shroud: Victory", SC2WOL_LOC_ID_OFFSET + 2100, LocationType.VICTORY, - lambda state: state._sc2wol_has_mm_upgrade(multiworld, player)), - LocationData("Piercing the Shroud", "Piercing the Shroud: Holding Cell Relic", SC2WOL_LOC_ID_OFFSET + 2101, LocationType.BONUS), - LocationData("Piercing the Shroud", "Piercing the Shroud: Brutalisk Relic", SC2WOL_LOC_ID_OFFSET + 2102, LocationType.BONUS, - lambda state: state._sc2wol_has_mm_upgrade(multiworld, player)), - LocationData("Piercing the Shroud", "Piercing the Shroud: First Escape Relic", SC2WOL_LOC_ID_OFFSET + 2103,LocationType.BONUS, - lambda state: state._sc2wol_has_mm_upgrade(multiworld, player)), - LocationData("Piercing the Shroud", "Piercing the Shroud: Second Escape Relic", SC2WOL_LOC_ID_OFFSET + 2104, LocationType.BONUS, - lambda state: state._sc2wol_has_mm_upgrade(multiworld, player)), - LocationData("Piercing the Shroud", "Piercing the Shroud: Brutalisk", SC2WOL_LOC_ID_OFFSET + 2105, LocationType.OPTIONAL_BOSS, - lambda state: state._sc2wol_has_mm_upgrade(multiworld, player)), - LocationData("Piercing the Shroud", "Piercing the Shroud: Fusion Reactor", SC2WOL_LOC_ID_OFFSET + 2106, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_mm_upgrade(multiworld, player)), - LocationData("Whispers of Doom", "Whispers of Doom: Victory", SC2WOL_LOC_ID_OFFSET + 2200, LocationType.VICTORY), - LocationData("Whispers of Doom", "Whispers of Doom: First Hatchery", SC2WOL_LOC_ID_OFFSET + 2201, LocationType.BONUS), - LocationData("Whispers of Doom", "Whispers of Doom: Second Hatchery", SC2WOL_LOC_ID_OFFSET + 2202, LocationType.BONUS), - LocationData("Whispers of Doom", "Whispers of Doom: Third Hatchery", SC2WOL_LOC_ID_OFFSET + 2203, LocationType.BONUS), - LocationData("Whispers of Doom", "Whispers of Doom: First Prophecy Fragment", SC2WOL_LOC_ID_OFFSET + 2204, LocationType.MISSION_PROGRESS), - LocationData("Whispers of Doom", "Whispers of Doom: Second Prophecy Fragment", SC2WOL_LOC_ID_OFFSET + 2205, LocationType.MISSION_PROGRESS), - LocationData("Whispers of Doom", "Whispers of Doom: Third Prophecy Fragment", SC2WOL_LOC_ID_OFFSET + 2206, LocationType.MISSION_PROGRESS), - LocationData("A Sinister Turn", "A Sinister Turn: Victory", SC2WOL_LOC_ID_OFFSET + 2300, LocationType.VICTORY, - lambda state: state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("A Sinister Turn", "A Sinister Turn: Robotics Facility", SC2WOL_LOC_ID_OFFSET + 2301, LocationType.BONUS, - lambda state: logic_level > 0 or state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("A Sinister Turn", "A Sinister Turn: Dark Shrine", SC2WOL_LOC_ID_OFFSET + 2302, LocationType.BONUS, - lambda state: logic_level > 0 or state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("A Sinister Turn", "A Sinister Turn: Templar Archives", SC2WOL_LOC_ID_OFFSET + 2303, LocationType.BONUS, - lambda state: state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("A Sinister Turn", "A Sinister Turn: Northeast Base", SC2WOL_LOC_ID_OFFSET + 2304, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("A Sinister Turn", "A Sinister Turn: Southwest Base", SC2WOL_LOC_ID_OFFSET + 2305, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("A Sinister Turn", "A Sinister Turn: Maar", SC2WOL_LOC_ID_OFFSET + 2306, LocationType.MISSION_PROGRESS, - lambda state: logic_level > 0 or state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("A Sinister Turn", "A Sinister Turn: Northwest Preserver", SC2WOL_LOC_ID_OFFSET + 2307, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("A Sinister Turn", "A Sinister Turn: Southwest Preserver", SC2WOL_LOC_ID_OFFSET + 2308, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("A Sinister Turn", "A Sinister Turn: East Preserver", SC2WOL_LOC_ID_OFFSET + 2309, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("Echoes of the Future", "Echoes of the Future: Victory", SC2WOL_LOC_ID_OFFSET + 2400, LocationType.VICTORY, - lambda state: logic_level > 0 or state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("Echoes of the Future", "Echoes of the Future: Close Obelisk", SC2WOL_LOC_ID_OFFSET + 2401, LocationType.BONUS), - LocationData("Echoes of the Future", "Echoes of the Future: West Obelisk", SC2WOL_LOC_ID_OFFSET + 2402, LocationType.BONUS, - lambda state: logic_level > 0 or state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("Echoes of the Future", "Echoes of the Future: Base", SC2WOL_LOC_ID_OFFSET + 2403, LocationType.MISSION_PROGRESS), - LocationData("Echoes of the Future", "Echoes of the Future: Southwest Tendril", SC2WOL_LOC_ID_OFFSET + 2404, LocationType.MISSION_PROGRESS), - LocationData("Echoes of the Future", "Echoes of the Future: Southeast Tendril", SC2WOL_LOC_ID_OFFSET + 2405, LocationType.MISSION_PROGRESS, - lambda state: logic_level > 0 or state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("Echoes of the Future", "Echoes of the Future: Northeast Tendril", SC2WOL_LOC_ID_OFFSET + 2406, LocationType.MISSION_PROGRESS, - lambda state: logic_level > 0 or state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("Echoes of the Future", "Echoes of the Future: Northwest Tendril", SC2WOL_LOC_ID_OFFSET + 2407, LocationType.MISSION_PROGRESS, - lambda state: logic_level > 0 or state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("In Utter Darkness", "In Utter Darkness: Defeat", SC2WOL_LOC_ID_OFFSET + 2500, LocationType.VICTORY), - LocationData("In Utter Darkness", "In Utter Darkness: Protoss Archive", SC2WOL_LOC_ID_OFFSET + 2501, LocationType.BONUS, - lambda state: state._sc2wol_has_protoss_medium_units(multiworld, player)), - LocationData("In Utter Darkness", "In Utter Darkness: Kills", SC2WOL_LOC_ID_OFFSET + 2502, LocationType.CHALLENGE, - lambda state: state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("In Utter Darkness", "In Utter Darkness: Urun", SC2WOL_LOC_ID_OFFSET + 2503, LocationType.MISSION_PROGRESS), - LocationData("In Utter Darkness", "In Utter Darkness: Mohandar", SC2WOL_LOC_ID_OFFSET + 2504, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("In Utter Darkness", "In Utter Darkness: Selendis", SC2WOL_LOC_ID_OFFSET + 2505, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("In Utter Darkness", "In Utter Darkness: Artanis", SC2WOL_LOC_ID_OFFSET + 2506, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_protoss_common_units(multiworld, player)), - LocationData("Gates of Hell", "Gates of Hell: Victory", SC2WOL_LOC_ID_OFFSET + 2600, LocationType.VICTORY, - lambda state: state._sc2wol_has_competent_comp(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) > 6), - LocationData("Gates of Hell", "Gates of Hell: Large Army", SC2WOL_LOC_ID_OFFSET + 2601, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) > 6), - LocationData("Gates of Hell", "Gates of Hell: 2 Drop Pods", SC2WOL_LOC_ID_OFFSET + 2602, LocationType.BONUS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) > 6), - LocationData("Gates of Hell", "Gates of Hell: 4 Drop Pods", SC2WOL_LOC_ID_OFFSET + 2603, LocationType.BONUS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) > 6), - LocationData("Gates of Hell", "Gates of Hell: 6 Drop Pods", SC2WOL_LOC_ID_OFFSET + 2604, LocationType.BONUS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) > 6), - LocationData("Gates of Hell", "Gates of Hell: 8 Drop Pods", SC2WOL_LOC_ID_OFFSET + 2605, LocationType.BONUS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player) and - state._sc2wol_defense_rating(multiworld, player, True) > 6), - LocationData("Belly of the Beast", "Belly of the Beast: Victory", SC2WOL_LOC_ID_OFFSET + 2700, LocationType.VICTORY), - LocationData("Belly of the Beast", "Belly of the Beast: First Charge", SC2WOL_LOC_ID_OFFSET + 2701, LocationType.MISSION_PROGRESS), - LocationData("Belly of the Beast", "Belly of the Beast: Second Charge", SC2WOL_LOC_ID_OFFSET + 2702, LocationType.MISSION_PROGRESS), - LocationData("Belly of the Beast", "Belly of the Beast: Third Charge", SC2WOL_LOC_ID_OFFSET + 2703, LocationType.MISSION_PROGRESS), - LocationData("Belly of the Beast", "Belly of the Beast: First Group Rescued", SC2WOL_LOC_ID_OFFSET + 2704, LocationType.BONUS), - LocationData("Belly of the Beast", "Belly of the Beast: Second Group Rescued", SC2WOL_LOC_ID_OFFSET + 2705, LocationType.BONUS), - LocationData("Belly of the Beast", "Belly of the Beast: Third Group Rescued", SC2WOL_LOC_ID_OFFSET + 2706, LocationType.BONUS), - LocationData("Shatter the Sky", "Shatter the Sky: Victory", SC2WOL_LOC_ID_OFFSET + 2800, LocationType.VICTORY, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Shatter the Sky", "Shatter the Sky: Close Coolant Tower", SC2WOL_LOC_ID_OFFSET + 2801, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Shatter the Sky", "Shatter the Sky: Northwest Coolant Tower", SC2WOL_LOC_ID_OFFSET + 2802, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Shatter the Sky", "Shatter the Sky: Southeast Coolant Tower", SC2WOL_LOC_ID_OFFSET + 2803, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Shatter the Sky", "Shatter the Sky: Southwest Coolant Tower", SC2WOL_LOC_ID_OFFSET + 2804, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Shatter the Sky", "Shatter the Sky: Leviathan", SC2WOL_LOC_ID_OFFSET + 2805, LocationType.OPTIONAL_BOSS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Shatter the Sky", "Shatter the Sky: East Hatchery", SC2WOL_LOC_ID_OFFSET + 2806, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Shatter the Sky", "Shatter the Sky: North Hatchery", SC2WOL_LOC_ID_OFFSET + 2807, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("Shatter the Sky", "Shatter the Sky: Mid Hatchery", SC2WOL_LOC_ID_OFFSET + 2808, LocationType.MISSION_PROGRESS, - lambda state: state._sc2wol_has_competent_comp(multiworld, player)), - LocationData("All-In", "All-In: Victory", None, LocationType.VICTORY, - lambda state: state._sc2wol_final_mission_requirements(multiworld, player)) - ] - - beat_events = [] - - for i, location_data in enumerate(location_table): - # Removing all item-based logic on No Logic - if logic_level == 2: - location_data = location_data._replace(rule=Location.access_rule) - location_table[i] = location_data - # Generating Beat event locations - if location_data.name.endswith((": Victory", ": Defeat")): - beat_events.append( - location_data._replace(name="Beat " + location_data.name.rsplit(": ", 1)[0], code=None) - ) - return tuple(location_table + beat_events) diff --git a/worlds/sc2wol/LogicMixin.py b/worlds/sc2wol/LogicMixin.py deleted file mode 100644 index 112302beb207..000000000000 --- a/worlds/sc2wol/LogicMixin.py +++ /dev/null @@ -1,148 +0,0 @@ -from BaseClasses import MultiWorld -from worlds.AutoWorld import LogicMixin -from .Options import get_option_value -from .Items import get_basic_units, defense_ratings, zerg_defense_ratings - - -class SC2WoLLogic(LogicMixin): - def _sc2wol_has_common_unit(self, multiworld: MultiWorld, player: int) -> bool: - return self.has_any(get_basic_units(multiworld, player), player) - - def _sc2wol_has_air(self, multiworld: MultiWorld, player: int) -> bool: - return self.has_any({'Viking', 'Wraith', 'Banshee', 'Battlecruiser'}, player) or get_option_value(multiworld, player, 'required_tactics') > 0 \ - and self.has_any({'Hercules', 'Medivac'}, player) and self._sc2wol_has_common_unit(multiworld, player) - - def _sc2wol_has_air_anti_air(self, multiworld: MultiWorld, player: int) -> bool: - return self.has('Viking', player) \ - or self.has_all({'Wraith', 'Advanced Laser Technology (Wraith)'}, player) \ - or self.has_all({'Battlecruiser', 'ATX Laser Battery (Battlecruiser)'}, player) \ - or get_option_value(multiworld, player, 'required_tactics') > 0 and self.has_any({'Wraith', 'Valkyrie', 'Battlecruiser'}, player) - - def _sc2wol_has_competent_ground_to_air(self, multiworld: MultiWorld, player: int) -> bool: - return self.has('Goliath', player) \ - or self.has('Marine', player) and self.has_any({'Medic', 'Medivac'}, player) \ - or get_option_value(multiworld, player, 'required_tactics') > 0 and self.has('Cyclone', player) - - def _sc2wol_has_competent_anti_air(self, multiworld: MultiWorld, player: int) -> bool: - return self._sc2wol_has_competent_ground_to_air(multiworld, player) \ - or self._sc2wol_has_air_anti_air(multiworld, player) - - def _sc2wol_welcome_to_the_jungle_requirement(self, multiworld: MultiWorld, player: int) -> bool: - return ( - self._sc2wol_has_common_unit(multiworld, player) - and self._sc2wol_has_competent_ground_to_air(multiworld, player) - ) or ( - get_option_value(multiworld, player, 'required_tactics') > 0 - and self.has_any({'Marine', 'Vulture'}, player) - and self._sc2wol_has_air_anti_air(multiworld, player) - ) - - def _sc2wol_has_anti_air(self, multiworld: MultiWorld, player: int) -> bool: - return self.has_any({'Missile Turret', 'Thor', 'War Pigs', 'Spartan Company', "Hel's Angel", 'Battlecruiser', 'Marine', 'Wraith', 'Valkyrie', 'Cyclone'}, player) \ - or self._sc2wol_has_competent_anti_air(multiworld, player) \ - or get_option_value(multiworld, player, 'required_tactics') > 0 and self.has_any({'Ghost', 'Spectre', 'Widow Mine', 'Liberator'}, player) - - def _sc2wol_defense_rating(self, multiworld: MultiWorld, player: int, zerg_enemy: bool, air_enemy: bool = True) -> bool: - defense_score = sum((defense_ratings[item] for item in defense_ratings if self.has(item, player))) - if self.has_any({'Marine', 'Marauder'}, player) and self.has('Bunker', player): - defense_score += 3 - if self.has_all({'Siege Tank', 'Maelstrom Rounds (Siege Tank)'}, player): - defense_score += 2 - if self.has_all({'Siege Tank', 'Graduating Range (Siege Tank)'}, player): - defense_score += 1 - if self.has_all({'Widow Mine', 'Concealment (Widow Mine)'}, player): - defense_score += 1 - if zerg_enemy: - defense_score += sum((zerg_defense_ratings[item] for item in zerg_defense_ratings if self.has(item, player))) - if self.has('Firebat', player) and self.has('Bunker', player): - defense_score += 2 - if not air_enemy and self.has('Missile Turret', player): - defense_score -= defense_ratings['Missile Turret'] - # Advanced Tactics bumps defense rating requirements down by 2 - if get_option_value(multiworld, player, 'required_tactics') > 0: - defense_score += 2 - return defense_score - - def _sc2wol_has_competent_comp(self, multiworld: MultiWorld, player: int) -> bool: - return \ - ( - ( - self.has_any({'Marine', 'Marauder'}, player) and self.has_any({'Medivac', 'Medic'}, player) - or self.has_any({'Thor', 'Banshee', 'Siege Tank'}, player) - or self.has_all({'Liberator', 'Raid Artillery (Liberator)'}, player) - ) and self._sc2wol_has_competent_anti_air(multiworld, player) - ) \ - or \ - ( - self.has('Battlecruiser', player) and self._sc2wol_has_common_unit(multiworld, player) - ) - - def _sc2wol_has_train_killers(self, multiworld: MultiWorld, player: int) -> bool: - return ( - self.has_any({'Siege Tank', 'Diamondback', 'Marauder', 'Cyclone'}, player) - or get_option_value(multiworld, player, 'required_tactics') > 0 - and ( - self.has_all({'Reaper', "G-4 Clusterbomb"}, player) - or self.has_all({'Spectre', 'Psionic Lash'}, player) - or self.has_any({'Vulture', 'Liberator'}, player) - ) - ) - - def _sc2wol_able_to_rescue(self, multiworld: MultiWorld, player: int) -> bool: - return self.has_any({'Medivac', 'Hercules', 'Raven', 'Viking'}, player) or get_option_value(multiworld, player, 'required_tactics') > 0 - - def _sc2wol_has_protoss_common_units(self, multiworld: MultiWorld, player: int) -> bool: - return self.has_any({'Zealot', 'Immortal', 'Stalker', 'Dark Templar'}, player) \ - or get_option_value(multiworld, player, 'required_tactics') > 0 and self.has('High Templar', player) - - def _sc2wol_has_protoss_medium_units(self, multiworld: MultiWorld, player: int) -> bool: - return self._sc2wol_has_protoss_common_units(multiworld, player) and \ - self.has_any({'Stalker', 'Void Ray', 'Carrier'}, player) \ - or get_option_value(multiworld, player, 'required_tactics') > 0 and self.has('Dark Templar', player) - - def _sc2wol_beats_protoss_deathball(self, multiworld: MultiWorld, player: int) -> bool: - return (self.has_any({'Banshee', 'Battlecruiser'}, player) or - self.has_all({'Liberator', 'Raid Artillery (Liberator)'}, player)) \ - and self._sc2wol_has_competent_anti_air(multiworld, player) or \ - self._sc2wol_has_competent_comp(multiworld, player) and self._sc2wol_has_air_anti_air(multiworld, player) - - def _sc2wol_has_mm_upgrade(self, multiworld: MultiWorld, player: int) -> bool: - return self.has_any({"Combat Shield (Marine)", "Stabilizer Medpacks (Medic)"}, player) - - def _sc2wol_survives_rip_field(self, multiworld: MultiWorld, player: int) -> bool: - return self.has("Battlecruiser", player) or \ - self._sc2wol_has_air(multiworld, player) and \ - self._sc2wol_has_competent_anti_air(multiworld, player) and \ - self.has("Science Vessel", player) - - def _sc2wol_has_nukes(self, multiworld: MultiWorld, player: int) -> bool: - return get_option_value(multiworld, player, 'required_tactics') > 0 and self.has_any({'Ghost', 'Spectre'}, player) - - def _sc2wol_can_respond_to_colony_infestations(self, multiworld: MultiWorld, player: int) -> bool: - return self._sc2wol_has_common_unit(multiworld, player) \ - and self._sc2wol_has_competent_anti_air(multiworld, player) \ - and \ - ( - self._sc2wol_has_air_anti_air(multiworld, player) or - self.has_any({'Battlecruiser', 'Valkyrie'}), player - ) \ - and \ - self._sc2wol_defense_rating(multiworld, player, True) >= 3 - - def _sc2wol_final_mission_requirements(self, multiworld: MultiWorld, player: int): - beats_kerrigan = self.has_any({'Marine', 'Banshee', 'Ghost'}, player) or get_option_value(multiworld, player, 'required_tactics') > 0 - if get_option_value(multiworld, player, 'all_in_map') == 0: - # Ground - defense_rating = self._sc2wol_defense_rating(multiworld, player, True, False) - if self.has_any({'Battlecruiser', 'Banshee'}, player): - defense_rating += 3 - return defense_rating >= 12 and beats_kerrigan - else: - # Air - defense_rating = self._sc2wol_defense_rating(multiworld, player, True, True) - return defense_rating >= 8 and beats_kerrigan \ - and self.has_any({'Viking', 'Battlecruiser', 'Valkyrie'}, player) \ - and self.has_any({'Hive Mind Emulator', 'Psi Disruptor', 'Missile Turret'}, player) - - def _sc2wol_cleared_missions(self, multiworld: MultiWorld, player: int, mission_count: int) -> bool: - return self.has_group("Missions", player, mission_count) diff --git a/worlds/sc2wol/MissionTables.py b/worlds/sc2wol/MissionTables.py deleted file mode 100644 index 298cd7a978a6..000000000000 --- a/worlds/sc2wol/MissionTables.py +++ /dev/null @@ -1,230 +0,0 @@ -from typing import NamedTuple, Dict, List -from enum import IntEnum - -no_build_regions_list = ["Liberation Day", "Breakout", "Ghost of a Chance", "Piercing the Shroud", "Whispers of Doom", - "Belly of the Beast"] -easy_regions_list = ["The Outlaws", "Zero Hour", "Evacuation", "Outbreak", "Smash and Grab", "Devil's Playground"] -medium_regions_list = ["Safe Haven", "Haven's Fall", "The Dig", "The Moebius Factor", "Supernova", - "Welcome to the Jungle", "The Great Train Robbery", "Cutthroat", "Media Blitz", - "A Sinister Turn", "Echoes of the Future"] -hard_regions_list = ["Maw of the Void", "Engine of Destruction", "In Utter Darkness", "Gates of Hell", - "Shatter the Sky"] - - -class MissionPools(IntEnum): - STARTER = 0 - EASY = 1 - MEDIUM = 2 - HARD = 3 - FINAL = 4 - - -class MissionInfo(NamedTuple): - id: int - required_world: List[int] - category: str - number: int = 0 # number of worlds need beaten - completion_critical: bool = False # missions needed to beat game - or_requirements: bool = False # true if the requirements should be or-ed instead of and-ed - - -class FillMission(NamedTuple): - type: int - connect_to: List[int] # -1 connects to Menu - category: str - number: int = 0 # number of worlds need beaten - completion_critical: bool = False # missions needed to beat game - or_requirements: bool = False # true if the requirements should be or-ed instead of and-ed - removal_priority: int = 0 # how many missions missing from the pool required to remove this mission - - -vanilla_shuffle_order = [ - FillMission(MissionPools.STARTER, [-1], "Mar Sara", completion_critical=True), - FillMission(MissionPools.EASY, [0], "Mar Sara", completion_critical=True), - FillMission(MissionPools.EASY, [1], "Mar Sara", completion_critical=True), - FillMission(MissionPools.EASY, [2], "Colonist"), - FillMission(MissionPools.MEDIUM, [3], "Colonist"), - FillMission(MissionPools.HARD, [4], "Colonist", number=7), - FillMission(MissionPools.HARD, [4], "Colonist", number=7, removal_priority=1), - FillMission(MissionPools.EASY, [2], "Artifact", completion_critical=True), - FillMission(MissionPools.MEDIUM, [7], "Artifact", number=8, completion_critical=True), - FillMission(MissionPools.HARD, [8], "Artifact", number=11, completion_critical=True), - FillMission(MissionPools.HARD, [9], "Artifact", number=14, completion_critical=True, removal_priority=11), - FillMission(MissionPools.HARD, [10], "Artifact", completion_critical=True, removal_priority=10), - FillMission(MissionPools.MEDIUM, [2], "Covert", number=4), - FillMission(MissionPools.MEDIUM, [12], "Covert"), - FillMission(MissionPools.HARD, [13], "Covert", number=8, removal_priority=3), - FillMission(MissionPools.HARD, [13], "Covert", number=8, removal_priority=2), - FillMission(MissionPools.MEDIUM, [2], "Rebellion", number=6), - FillMission(MissionPools.HARD, [16], "Rebellion"), - FillMission(MissionPools.HARD, [17], "Rebellion"), - FillMission(MissionPools.HARD, [18], "Rebellion", removal_priority=12), - FillMission(MissionPools.HARD, [19], "Rebellion", removal_priority=5), - FillMission(MissionPools.MEDIUM, [8], "Prophecy", removal_priority=9), - FillMission(MissionPools.HARD, [21], "Prophecy", removal_priority=8), - FillMission(MissionPools.HARD, [22], "Prophecy", removal_priority=7), - FillMission(MissionPools.HARD, [23], "Prophecy", removal_priority=6), - FillMission(MissionPools.HARD, [11], "Char", completion_critical=True), - FillMission(MissionPools.HARD, [25], "Char", completion_critical=True, removal_priority=4), - FillMission(MissionPools.HARD, [25], "Char", completion_critical=True), - FillMission(MissionPools.FINAL, [26, 27], "Char", completion_critical=True, or_requirements=True) -] - -mini_campaign_order = [ - FillMission(MissionPools.STARTER, [-1], "Mar Sara", completion_critical=True), - FillMission(MissionPools.EASY, [0], "Colonist"), - FillMission(MissionPools.MEDIUM, [1], "Colonist"), - FillMission(MissionPools.EASY, [0], "Artifact", completion_critical=True), - FillMission(MissionPools.MEDIUM, [3], "Artifact", number=4, completion_critical=True), - FillMission(MissionPools.HARD, [4], "Artifact", number=8, completion_critical=True), - FillMission(MissionPools.MEDIUM, [0], "Covert", number=2), - FillMission(MissionPools.HARD, [6], "Covert"), - FillMission(MissionPools.MEDIUM, [0], "Rebellion", number=3), - FillMission(MissionPools.HARD, [8], "Rebellion"), - FillMission(MissionPools.MEDIUM, [4], "Prophecy"), - FillMission(MissionPools.HARD, [10], "Prophecy"), - FillMission(MissionPools.HARD, [5], "Char", completion_critical=True), - FillMission(MissionPools.HARD, [5], "Char", completion_critical=True), - FillMission(MissionPools.FINAL, [12, 13], "Char", completion_critical=True, or_requirements=True) -] - -gauntlet_order = [ - FillMission(MissionPools.STARTER, [-1], "I", completion_critical=True), - FillMission(MissionPools.EASY, [0], "II", completion_critical=True), - FillMission(MissionPools.EASY, [1], "III", completion_critical=True), - FillMission(MissionPools.MEDIUM, [2], "IV", completion_critical=True), - FillMission(MissionPools.MEDIUM, [3], "V", completion_critical=True), - FillMission(MissionPools.HARD, [4], "VI", completion_critical=True), - FillMission(MissionPools.FINAL, [5], "Final", completion_critical=True) -] - -mini_gauntlet_order = [ - FillMission(MissionPools.STARTER, [-1], "I", completion_critical=True), - FillMission(MissionPools.EASY, [0], "II", completion_critical=True), - FillMission(MissionPools.MEDIUM, [1], "III", completion_critical=True), - FillMission(MissionPools.FINAL, [2], "Final", completion_critical=True) -] - -grid_order = [ - FillMission(MissionPools.STARTER, [-1], "_1"), - FillMission(MissionPools.EASY, [0], "_1"), - FillMission(MissionPools.MEDIUM, [1, 6, 3], "_1", or_requirements=True), - FillMission(MissionPools.HARD, [2, 7], "_1", or_requirements=True), - FillMission(MissionPools.EASY, [0], "_2"), - FillMission(MissionPools.MEDIUM, [1, 4], "_2", or_requirements=True), - FillMission(MissionPools.HARD, [2, 5, 10, 7], "_2", or_requirements=True), - FillMission(MissionPools.HARD, [3, 6, 11], "_2", or_requirements=True), - FillMission(MissionPools.MEDIUM, [4, 9, 12], "_3", or_requirements=True), - FillMission(MissionPools.HARD, [5, 8, 10, 13], "_3", or_requirements=True), - FillMission(MissionPools.HARD, [6, 9, 11, 14], "_3", or_requirements=True), - FillMission(MissionPools.HARD, [7, 10], "_3", or_requirements=True), - FillMission(MissionPools.HARD, [8, 13], "_4", or_requirements=True), - FillMission(MissionPools.HARD, [9, 12, 14], "_4", or_requirements=True), - FillMission(MissionPools.HARD, [10, 13], "_4", or_requirements=True), - FillMission(MissionPools.FINAL, [11, 14], "_4", or_requirements=True) -] - -mini_grid_order = [ - FillMission(MissionPools.STARTER, [-1], "_1"), - FillMission(MissionPools.EASY, [0], "_1"), - FillMission(MissionPools.MEDIUM, [1, 5], "_1", or_requirements=True), - FillMission(MissionPools.EASY, [0], "_2"), - FillMission(MissionPools.MEDIUM, [1, 3], "_2", or_requirements=True), - FillMission(MissionPools.HARD, [2, 4], "_2", or_requirements=True), - FillMission(MissionPools.MEDIUM, [3, 7], "_3", or_requirements=True), - FillMission(MissionPools.HARD, [4, 6], "_3", or_requirements=True), - FillMission(MissionPools.FINAL, [5, 7], "_3", or_requirements=True) -] - -tiny_grid_order = [ - FillMission(MissionPools.STARTER, [-1], "_1"), - FillMission(MissionPools.MEDIUM, [0], "_1"), - FillMission(MissionPools.EASY, [0], "_2"), - FillMission(MissionPools.FINAL, [1, 2], "_2", or_requirements=True), -] - -blitz_order = [ - FillMission(MissionPools.STARTER, [-1], "I"), - FillMission(MissionPools.EASY, [-1], "I"), - FillMission(MissionPools.MEDIUM, [0, 1], "II", number=1, or_requirements=True), - FillMission(MissionPools.MEDIUM, [0, 1], "II", number=1, or_requirements=True), - FillMission(MissionPools.MEDIUM, [0, 1], "III", number=2, or_requirements=True), - FillMission(MissionPools.MEDIUM, [0, 1], "III", number=2, or_requirements=True), - FillMission(MissionPools.HARD, [0, 1], "IV", number=3, or_requirements=True), - FillMission(MissionPools.HARD, [0, 1], "IV", number=3, or_requirements=True), - FillMission(MissionPools.HARD, [0, 1], "V", number=4, or_requirements=True), - FillMission(MissionPools.HARD, [0, 1], "V", number=4, or_requirements=True), - FillMission(MissionPools.HARD, [0, 1], "Final", number=5, or_requirements=True), - FillMission(MissionPools.FINAL, [0, 1], "Final", number=5, or_requirements=True) -] - -mission_orders = [ - vanilla_shuffle_order, - vanilla_shuffle_order, - mini_campaign_order, - grid_order, - mini_grid_order, - blitz_order, - gauntlet_order, - mini_gauntlet_order, - tiny_grid_order -] - - -vanilla_mission_req_table = { - "Liberation Day": MissionInfo(1, [], "Mar Sara", completion_critical=True), - "The Outlaws": MissionInfo(2, [1], "Mar Sara", completion_critical=True), - "Zero Hour": MissionInfo(3, [2], "Mar Sara", completion_critical=True), - "Evacuation": MissionInfo(4, [3], "Colonist"), - "Outbreak": MissionInfo(5, [4], "Colonist"), - "Safe Haven": MissionInfo(6, [5], "Colonist", number=7), - "Haven's Fall": MissionInfo(7, [5], "Colonist", number=7), - "Smash and Grab": MissionInfo(8, [3], "Artifact", completion_critical=True), - "The Dig": MissionInfo(9, [8], "Artifact", number=8, completion_critical=True), - "The Moebius Factor": MissionInfo(10, [9], "Artifact", number=11, completion_critical=True), - "Supernova": MissionInfo(11, [10], "Artifact", number=14, completion_critical=True), - "Maw of the Void": MissionInfo(12, [11], "Artifact", completion_critical=True), - "Devil's Playground": MissionInfo(13, [3], "Covert", number=4), - "Welcome to the Jungle": MissionInfo(14, [13], "Covert"), - "Breakout": MissionInfo(15, [14], "Covert", number=8), - "Ghost of a Chance": MissionInfo(16, [14], "Covert", number=8), - "The Great Train Robbery": MissionInfo(17, [3], "Rebellion", number=6), - "Cutthroat": MissionInfo(18, [17], "Rebellion"), - "Engine of Destruction": MissionInfo(19, [18], "Rebellion"), - "Media Blitz": MissionInfo(20, [19], "Rebellion"), - "Piercing the Shroud": MissionInfo(21, [20], "Rebellion"), - "Whispers of Doom": MissionInfo(22, [9], "Prophecy"), - "A Sinister Turn": MissionInfo(23, [22], "Prophecy"), - "Echoes of the Future": MissionInfo(24, [23], "Prophecy"), - "In Utter Darkness": MissionInfo(25, [24], "Prophecy"), - "Gates of Hell": MissionInfo(26, [12], "Char", completion_critical=True), - "Belly of the Beast": MissionInfo(27, [26], "Char", completion_critical=True), - "Shatter the Sky": MissionInfo(28, [26], "Char", completion_critical=True), - "All-In": MissionInfo(29, [27, 28], "Char", completion_critical=True, or_requirements=True) -} - -lookup_id_to_mission: Dict[int, str] = { - data.id: mission_name for mission_name, data in vanilla_mission_req_table.items() if data.id} - -starting_mission_locations = { - "Liberation Day": "Liberation Day: Victory", - "Breakout": "Breakout: Victory", - "Ghost of a Chance": "Ghost of a Chance: Victory", - "Piercing the Shroud": "Piercing the Shroud: Victory", - "Whispers of Doom": "Whispers of Doom: Victory", - "Belly of the Beast": "Belly of the Beast: Victory", - "Zero Hour": "Zero Hour: First Group Rescued", - "Evacuation": "Evacuation: Reach Hanson", - "Devil's Playground": "Devil's Playground: Tosh's Miners", - "Smash and Grab": "Smash and Grab: First Relic", - "The Great Train Robbery": "The Great Train Robbery: North Defiler" -} - - -alt_final_mission_locations = { - "Maw of the Void": "Maw of the Void: Victory", - "Engine of Destruction": "Engine of Destruction: Victory", - "Supernova": "Supernova: Victory", - "Gates of Hell": "Gates of Hell: Victory", - "Shatter the Sky": "Shatter the Sky: Victory" -} \ No newline at end of file diff --git a/worlds/sc2wol/Options.py b/worlds/sc2wol/Options.py deleted file mode 100644 index e4b6a740669a..000000000000 --- a/worlds/sc2wol/Options.py +++ /dev/null @@ -1,362 +0,0 @@ -from typing import Dict, FrozenSet, Union -from BaseClasses import MultiWorld -from Options import Choice, Option, Toggle, DefaultOnToggle, ItemSet, OptionSet, Range -from .MissionTables import vanilla_mission_req_table - -ORDER_VANILLA = 0 -ORDER_VANILLA_SHUFFLED = 1 - -class GameDifficulty(Choice): - """ - The difficulty of the campaign, affects enemy AI, starting units, and game speed. - - For those unfamiliar with the Archipelago randomizer, the recommended settings are one difficulty level - lower than the vanilla game - """ - display_name = "Game Difficulty" - option_casual = 0 - option_normal = 1 - option_hard = 2 - option_brutal = 3 - default = 1 - -class GameSpeed(Choice): - """Optional setting to override difficulty-based game speed.""" - display_name = "Game Speed" - option_default = 0 - option_slower = 1 - option_slow = 2 - option_normal = 3 - option_fast = 4 - option_faster = 5 - default = option_default - -class FinalMap(Choice): - """ - Determines if the final map and goal of the campaign. - All in: You need to beat All-in map - Random Hard: A random hard mission is selected as a goal. - Beat this mission in order to complete the game. - All-in map won't be in the campaign - - Vanilla mission order always ends with All in mission! - - Warning: Using All-in with a short mission order (7 or fewer missions) is not recommended, - as there might not be enough locations to place all the required items, - any excess required items will be placed into the player's starting inventory! - - This option is short-lived. It may be changed in the future - """ - display_name = "Final Map" - option_all_in = 0 - option_random_hard = 1 - -class AllInMap(Choice): - """Determines what version of All-In (final map) that will be generated for the campaign.""" - display_name = "All In Map" - option_ground = 0 - option_air = 1 - - -class MissionOrder(Choice): - """ - Determines the order the missions are played in. The last three mission orders end in a random mission. - Vanilla (29): Keeps the standard mission order and branching from the WoL Campaign. - Vanilla Shuffled (29): Keeps same branching paths from the WoL Campaign but randomizes the order of missions within. - Mini Campaign (15): Shorter version of the campaign with randomized missions and optional branches. - Grid (16): A 4x4 grid of random missions. Start at the top-left and forge a path towards bottom-right mission to win. - Mini Grid (9): A 3x3 version of Grid. Complete the bottom-right mission to win. - Blitz (12): 12 random missions that open up very quickly. Complete the bottom-right mission to win. - Gauntlet (7): Linear series of 7 random missions to complete the campaign. - Mini Gauntlet (4): Linear series of 4 random missions to complete the campaign. - Tiny Grid (4): A 2x2 version of Grid. Complete the bottom-right mission to win. - """ - display_name = "Mission Order" - option_vanilla = 0 - option_vanilla_shuffled = 1 - option_mini_campaign = 2 - option_grid = 3 - option_mini_grid = 4 - option_blitz = 5 - option_gauntlet = 6 - option_mini_gauntlet = 7 - option_tiny_grid = 8 - - -class PlayerColor(Choice): - """Determines in-game team color.""" - display_name = "Player Color" - option_white = 0 - option_red = 1 - option_blue = 2 - option_teal = 3 - option_purple = 4 - option_yellow = 5 - option_orange = 6 - option_green = 7 - option_light_pink = 8 - option_violet = 9 - option_light_grey = 10 - option_dark_green = 11 - option_brown = 12 - option_light_green = 13 - option_dark_grey = 14 - option_pink = 15 - option_rainbow = 16 - option_default = 17 - default = option_default - - -class ShuffleProtoss(DefaultOnToggle): - """Determines if the 3 protoss missions are included in the shuffle if Vanilla mission order is not enabled. - If turned off, the 3 protoss missions will not appear and Protoss units are removed from the pool.""" - display_name = "Shuffle Protoss Missions" - - -class ShuffleNoBuild(DefaultOnToggle): - """Determines if the 5 no-build missions are included in the shuffle if Vanilla mission order is not enabled. - If turned off, the 5 no-build missions will not appear.""" - display_name = "Shuffle No-Build Missions" - - -class EarlyUnit(DefaultOnToggle): - """ - Guarantees that the first mission will contain a unit. - - Each mission available to be the first mission has a pre-defined location where the unit should spawn. - This location gets overriden over any exclusion. It's guaranteed to be reachable with an empty inventory. - """ - display_name = "Early Unit" - - -class RequiredTactics(Choice): - """Determines the maximum tactical difficulty of the seed (separate from mission difficulty). Higher settings - increase randomness. - - Standard: All missions can be completed with good micro and macro. - Advanced: Completing missions may require relying on starting units and micro-heavy units. - No Logic: Units and upgrades may be placed anywhere. LIKELY TO RENDER THE RUN IMPOSSIBLE ON HARDER DIFFICULTIES!""" - display_name = "Required Tactics" - option_standard = 0 - option_advanced = 1 - option_no_logic = 2 - - -class UnitsAlwaysHaveUpgrades(DefaultOnToggle): - """ - If turned on, all upgrades will be present for each unit and structure in the seed. - This usually results in fewer units. - - See also: Max Number of Upgrades - """ - display_name = "Units Always Have Upgrades" - - -class GenericUpgradeMissions(Range): - """Determines the percentage of missions in the mission order that must be completed before - level 1 of all weapon and armor upgrades is unlocked. Level 2 upgrades require double the amount of missions, - and level 3 requires triple the amount. The required amounts are always rounded down. - If set to 0, upgrades are instead added to the item pool and must be found to be used.""" - display_name = "Generic Upgrade Missions" - range_start = 0 - range_end = 100 - default = 0 - - -class GenericUpgradeResearch(Choice): - """Determines how weapon and armor upgrades affect missions once unlocked. - - Vanilla: Upgrades must be researched as normal. - Auto In No-Build: In No-Build missions, upgrades are automatically researched. - In all other missions, upgrades must be researched as normal. - Auto In Build: In No-Build missions, upgrades are unavailable as normal. - In all other missions, upgrades are automatically researched. - Always Auto: Upgrades are automatically researched in all missions.""" - display_name = "Generic Upgrade Research" - option_vanilla = 0 - option_auto_in_no_build = 1 - option_auto_in_build = 2 - option_always_auto = 3 - - -class GenericUpgradeItems(Choice): - """Determines how weapon and armor upgrades are split into items. All options produce 3 levels of each item. - Does nothing if upgrades are unlocked by completed mission counts. - - Individual Items: All weapon and armor upgrades are each an item, - resulting in 18 total upgrade items. - Bundle Weapon And Armor: All types of weapon upgrades are one item, - and all types of armor upgrades are one item, - resulting in 6 total items. - Bundle Unit Class: Weapon and armor upgrades are merged, - but Infantry, Vehicle, and Starship upgrades are bundled separately, - resulting in 9 total items. - Bundle All: All weapon and armor upgrades are one item, - resulting in 3 total items.""" - display_name = "Generic Upgrade Items" - option_individual_items = 0 - option_bundle_weapon_and_armor = 1 - option_bundle_unit_class = 2 - option_bundle_all = 3 - - -class NovaCovertOpsItems(Toggle): - """If turned on, the equipment upgrades from Nova Covert Ops may be present in the world.""" - display_name = "Nova Covert Ops Items" - default = Toggle.option_true - - -class BroodWarItems(Toggle): - """If turned on, returning items from StarCraft: Brood War may appear in the world.""" - display_name = "Brood War Items" - default = Toggle.option_true - - -class ExtendedItems(Toggle): - """If turned on, original items that did not appear in Campaign mode may appear in the world.""" - display_name = "Extended Items" - default = Toggle.option_true - - -class MaxNumberOfUpgrades(Range): - """ - Set a maximum to the number of upgrades a unit/structure can have. -1 is used to define unlimited. - Note that most unit have 4 or 6 upgrades. - - If used with Units Always Have Upgrades, each unit has this given amount of upgrades (if there enough upgrades exist) - - See also: Units Always Have Upgrades - """ - display_name = "Maximum number of upgrades per unit/structure" - range_start = -1 - # Do not know the maximum, but it is less than 123! - range_end = 123 - default = -1 - - -class LockedItems(ItemSet): - """Guarantees that these items will be unlockable""" - display_name = "Locked Items" - - -class ExcludedItems(ItemSet): - """Guarantees that these items will not be unlockable""" - display_name = "Excluded Items" - - -class ExcludedMissions(OptionSet): - """Guarantees that these missions will not appear in the campaign - Doesn't apply to vanilla mission order. - It may be impossible to build a valid campaign if too many missions are excluded.""" - display_name = "Excluded Missions" - valid_keys = {mission_name for mission_name in vanilla_mission_req_table.keys() if mission_name != 'All-In'} - - -class LocationInclusion(Choice): - option_enabled = 0 - option_trash = 1 - option_nothing = 2 - - -class MissionProgressLocations(LocationInclusion): - """ - Enables or disables item rewards for progressing (not finishing) a mission. - Progressing a mission is usually a task of completing or progressing into a main objective. - Clearing an expansion base also counts here. - - Enabled: All locations fitting into this do their normal rewards - Trash: Forces a trash item in - Nothing: No rewards for this type of tasks, effectively disabling such locations - - Note: Individual locations subject to plando are always enabled, so the plando can be placed properly. - See also: Excluded Locations, Item Plando (https://archipelago.gg/tutorial/Archipelago/plando/en#item-plando) - """ - display_name = "Mission Progress Locations" - - -class BonusLocations(LocationInclusion): - """ - Enables or disables item rewards for completing bonus tasks. - Bonus tasks are those giving you a campaign-wide or mission-wide bonus in vanilla game: - Research, credits, bonus units or resources, etc. - - Enabled: All locations fitting into this do their normal rewards - Trash: Forces a trash item in - Nothing: No rewards for this type of tasks, effectively disabling such locations - - Note: Individual locations subject to plando are always enabled, so the plando can be placed properly. - See also: Excluded Locations, Item Plando (https://archipelago.gg/tutorial/Archipelago/plando/en#item-plando) - """ - display_name = "Bonus Locations" - - -class ChallengeLocations(LocationInclusion): - """ - Enables or disables item rewards for completing challenge tasks. - Challenges are tasks that have usually higher requirements to be completed - than to complete the mission they're in successfully. - You might be required to visit the same mission later when getting stronger in order to finish these tasks. - - Enabled: All locations fitting into this do their normal rewards - Trash: Forces a trash item in - Nothing: No rewards for this type of tasks, effectively disabling such locations - - Note: Individual locations subject to plando are always enabled, so the plando can be placed properly. - See also: Excluded Locations, Item Plando (https://archipelago.gg/tutorial/Archipelago/plando/en#item-plando) - """ - display_name = "Challenge Locations" - - -class OptionalBossLocations(LocationInclusion): - """ - Enables or disables item rewards for defeating optional bosses. - An optional boss is any boss that's not required to kill in order to finish the mission successfully. - All Brutalisks, Loki, etc. belongs here. - - Enabled: All locations fitting into this do their normal rewards - Trash: Forces a trash item in - Nothing: No rewards for this type of tasks, effectively disabling such locations - - Note: Individual locations subject to plando are always enabled, so the plando can be placed properly. - See also: Excluded Locations, Item Plando (https://archipelago.gg/tutorial/Archipelago/plando/en#item-plando) - """ - display_name = "Optional Boss Locations" - - -# noinspection PyTypeChecker -sc2wol_options: Dict[str, Option] = { - "game_difficulty": GameDifficulty, - "game_speed": GameSpeed, - "all_in_map": AllInMap, - "final_map": FinalMap, - "mission_order": MissionOrder, - "player_color": PlayerColor, - "shuffle_protoss": ShuffleProtoss, - "shuffle_no_build": ShuffleNoBuild, - "early_unit": EarlyUnit, - "required_tactics": RequiredTactics, - "units_always_have_upgrades": UnitsAlwaysHaveUpgrades, - "max_number_of_upgrades": MaxNumberOfUpgrades, - "generic_upgrade_missions": GenericUpgradeMissions, - "generic_upgrade_research": GenericUpgradeResearch, - "generic_upgrade_items": GenericUpgradeItems, - "locked_items": LockedItems, - "excluded_items": ExcludedItems, - "excluded_missions": ExcludedMissions, - "nco_items": NovaCovertOpsItems, - "bw_items": BroodWarItems, - "ext_items": ExtendedItems, - "mission_progress_locations": MissionProgressLocations, - "bonus_locations": BonusLocations, - "challenge_locations": ChallengeLocations, - "optional_boss_locations": OptionalBossLocations -} - - -def get_option_value(multiworld: MultiWorld, player: int, name: str) -> Union[int, FrozenSet]: - if multiworld is None: - return sc2wol_options[name].default - - player_option = getattr(multiworld, name)[player] - - return player_option.value diff --git a/worlds/sc2wol/PoolFilter.py b/worlds/sc2wol/PoolFilter.py deleted file mode 100644 index 23422a3d1ea5..000000000000 --- a/worlds/sc2wol/PoolFilter.py +++ /dev/null @@ -1,367 +0,0 @@ -from typing import Callable, Dict, List, Set -from BaseClasses import MultiWorld, ItemClassification, Item, Location -from .Items import get_full_item_list, spider_mine_sources, second_pass_placeable_items, filler_items, \ - progressive_if_nco -from .MissionTables import no_build_regions_list, easy_regions_list, medium_regions_list, hard_regions_list,\ - mission_orders, MissionInfo, alt_final_mission_locations, MissionPools -from .Options import get_option_value, MissionOrder, FinalMap, MissionProgressLocations, LocationInclusion -from .LogicMixin import SC2WoLLogic - -# Items with associated upgrades -UPGRADABLE_ITEMS = [ - "Marine", "Medic", "Firebat", "Marauder", "Reaper", "Ghost", "Spectre", - "Hellion", "Vulture", "Goliath", "Diamondback", "Siege Tank", "Thor", "Predator", "Widow Mine", "Cyclone", - "Medivac", "Wraith", "Viking", "Banshee", "Battlecruiser", "Raven", "Science Vessel", "Liberator", "Valkyrie", - "Bunker", "Missile Turret" -] - -BARRACKS_UNITS = {"Marine", "Medic", "Firebat", "Marauder", "Reaper", "Ghost", "Spectre"} -FACTORY_UNITS = {"Hellion", "Vulture", "Goliath", "Diamondback", "Siege Tank", "Thor", "Predator", "Widow Mine", "Cyclone"} -STARPORT_UNITS = {"Medivac", "Wraith", "Viking", "Banshee", "Battlecruiser", "Hercules", "Science Vessel", "Raven", "Liberator", "Valkyrie"} - -PROTOSS_REGIONS = {"A Sinister Turn", "Echoes of the Future", "In Utter Darkness"} - - -def filter_missions(multiworld: MultiWorld, player: int) -> Dict[int, List[str]]: - """ - Returns a semi-randomly pruned tuple of no-build, easy, medium, and hard mission sets - """ - - mission_order_type = get_option_value(multiworld, player, "mission_order") - shuffle_no_build = get_option_value(multiworld, player, "shuffle_no_build") - shuffle_protoss = get_option_value(multiworld, player, "shuffle_protoss") - excluded_missions = get_option_value(multiworld, player, "excluded_missions") - final_map = get_option_value(multiworld, player, "final_map") - mission_pools = { - MissionPools.STARTER: no_build_regions_list[:], - MissionPools.EASY: easy_regions_list[:], - MissionPools.MEDIUM: medium_regions_list[:], - MissionPools.HARD: hard_regions_list[:], - MissionPools.FINAL: [] - } - if mission_order_type == MissionOrder.option_vanilla: - # Vanilla uses the entire mission pool - mission_pools[MissionPools.FINAL] = ['All-In'] - return mission_pools - # Omitting No-Build missions if not shuffling no-build - if not shuffle_no_build: - excluded_missions = excluded_missions.union(no_build_regions_list) - # Omitting Protoss missions if not shuffling protoss - if not shuffle_protoss: - excluded_missions = excluded_missions.union(PROTOSS_REGIONS) - # Replacing All-In with alternate ending depending on option - if final_map == FinalMap.option_random_hard: - final_mission = multiworld.random.choice([mission for mission in alt_final_mission_locations.keys() if mission not in excluded_missions]) - excluded_missions.add(final_mission) - else: - final_mission = 'All-In' - # Excluding missions - for difficulty, mission_pool in mission_pools.items(): - mission_pools[difficulty] = [mission for mission in mission_pool if mission not in excluded_missions] - mission_pools[MissionPools.FINAL].append(final_mission) - # Mission pool changes on Build-Only - if not get_option_value(multiworld, player, 'shuffle_no_build'): - def move_mission(mission_name, current_pool, new_pool): - if mission_name in mission_pools[current_pool]: - mission_pools[current_pool].remove(mission_name) - mission_pools[new_pool].append(mission_name) - # Replacing No Build missions with Easy missions - move_mission("Zero Hour", MissionPools.EASY, MissionPools.STARTER) - move_mission("Evacuation", MissionPools.EASY, MissionPools.STARTER) - move_mission("Devil's Playground", MissionPools.EASY, MissionPools.STARTER) - # Pushing Outbreak to Normal, as it cannot be placed as the second mission on Build-Only - move_mission("Outbreak", MissionPools.EASY, MissionPools.MEDIUM) - # Pushing extra Normal missions to Easy - move_mission("The Great Train Robbery", MissionPools.MEDIUM, MissionPools.EASY) - move_mission("Echoes of the Future", MissionPools.MEDIUM, MissionPools.EASY) - move_mission("Cutthroat", MissionPools.MEDIUM, MissionPools.EASY) - # Additional changes on Advanced Tactics - if get_option_value(multiworld, player, "required_tactics") > 0: - move_mission("The Great Train Robbery", MissionPools.EASY, MissionPools.STARTER) - move_mission("Smash and Grab", MissionPools.EASY, MissionPools.STARTER) - move_mission("Moebius Factor", MissionPools.MEDIUM, MissionPools.EASY) - move_mission("Welcome to the Jungle", MissionPools.MEDIUM, MissionPools.EASY) - move_mission("Engine of Destruction", MissionPools.HARD, MissionPools.MEDIUM) - - return mission_pools - - -def get_item_upgrades(inventory: List[Item], parent_item: Item or str): - item_name = parent_item.name if isinstance(parent_item, Item) else parent_item - return [ - inv_item for inv_item in inventory - if get_full_item_list()[inv_item.name].parent_item == item_name - ] - - -def get_item_quantity(item: Item, multiworld: MultiWorld, player: int): - if (not get_option_value(multiworld, player, "nco_items")) \ - and item.name in progressive_if_nco: - return 1 - return get_full_item_list()[item.name].quantity - - -def copy_item(item: Item): - return Item(item.name, item.classification, item.code, item.player) - - -class ValidInventory: - - def has(self, item: str, player: int): - return item in self.logical_inventory - - def has_any(self, items: Set[str], player: int): - return any(item in self.logical_inventory for item in items) - - def has_all(self, items: Set[str], player: int): - return all(item in self.logical_inventory for item in items) - - def has_units_per_structure(self) -> bool: - return len(BARRACKS_UNITS.intersection(self.logical_inventory)) > self.min_units_per_structure and \ - len(FACTORY_UNITS.intersection(self.logical_inventory)) > self.min_units_per_structure and \ - len(STARPORT_UNITS.intersection(self.logical_inventory)) > self.min_units_per_structure - - def generate_reduced_inventory(self, inventory_size: int, mission_requirements: List[Callable]) -> List[Item]: - """Attempts to generate a reduced inventory that can fulfill the mission requirements.""" - inventory = list(self.item_pool) - locked_items = list(self.locked_items) - self.logical_inventory = { - item.name for item in inventory + locked_items + self.existing_items - if item.classification in (ItemClassification.progression, ItemClassification.progression_skip_balancing) - } - requirements = mission_requirements - cascade_keys = self.cascade_removal_map.keys() - units_always_have_upgrades = get_option_value(self.multiworld, self.player, "units_always_have_upgrades") - - def attempt_removal(item: Item) -> bool: - # If item can be removed and has associated items, remove them as well - inventory.remove(item) - # Only run logic checks when removing logic items - if item.name in self.logical_inventory: - self.logical_inventory.remove(item.name) - if not all(requirement(self) for requirement in requirements): - # If item cannot be removed, lock or revert - self.logical_inventory.add(item.name) - for _ in range(get_item_quantity(item, self.multiworld, self.player)): - locked_items.append(copy_item(item)) - return False - return True - - # Limit the maximum number of upgrades - maxUpgrad = get_option_value(self.multiworld, self.player, - "max_number_of_upgrades") - if maxUpgrad != -1: - unit_avail_upgrades = {} - # Needed to take into account locked/existing items - unit_nb_upgrades = {} - for item in inventory: - cItem = get_full_item_list()[item.name] - if cItem.type in UPGRADABLE_ITEMS and item.name not in unit_avail_upgrades: - unit_avail_upgrades[item.name] = [] - unit_nb_upgrades[item.name] = 0 - elif cItem.parent_item is not None: - if cItem.parent_item not in unit_avail_upgrades: - unit_avail_upgrades[cItem.parent_item] = [item] - unit_nb_upgrades[cItem.parent_item] = 1 - else: - unit_avail_upgrades[cItem.parent_item].append(item) - unit_nb_upgrades[cItem.parent_item] += 1 - # For those two categories, we count them but dont include them in removal - for item in locked_items + self.existing_items: - cItem = get_full_item_list()[item.name] - if cItem.type in UPGRADABLE_ITEMS and item.name not in unit_avail_upgrades: - unit_avail_upgrades[item.name] = [] - unit_nb_upgrades[item.name] = 0 - elif cItem.parent_item is not None: - if cItem.parent_item not in unit_avail_upgrades: - unit_nb_upgrades[cItem.parent_item] = 1 - else: - unit_nb_upgrades[cItem.parent_item] += 1 - # Making sure that the upgrades being removed is random - # Currently, only for combat shield vs Stabilizer Medpacks... - shuffled_unit_upgrade_list = list(unit_avail_upgrades.keys()) - self.multiworld.random.shuffle(shuffled_unit_upgrade_list) - for unit in shuffled_unit_upgrade_list: - while (unit_nb_upgrades[unit] > maxUpgrad) \ - and (len(unit_avail_upgrades[unit]) > 0): - itemCandidate = self.multiworld.random.choice(unit_avail_upgrades[unit]) - _ = attempt_removal(itemCandidate) - # Whatever it succeed to remove the iventory or it fails and thus - # lock it, the upgrade is no longer available for removal - unit_avail_upgrades[unit].remove(itemCandidate) - unit_nb_upgrades[unit] -= 1 - - # Locking associated items for items that have already been placed when units_always_have_upgrades is on - if units_always_have_upgrades: - existing_items = set(self.existing_items[:] + locked_items) - while existing_items: - existing_item = existing_items.pop() - items_to_lock = self.cascade_removal_map.get(existing_item, [existing_item]) - if get_full_item_list()[existing_item.name].type != "Upgrade": - # Don't process general upgrades, they may have been pre-locked per-level - for item in items_to_lock: - if item in inventory: - item_quantity = inventory.count(item) - # Unit upgrades, lock all levels - for _ in range(item_quantity): - inventory.remove(item) - if item not in locked_items: - # Lock all the associated items if not already locked - for _ in range(item_quantity): - locked_items.append(copy_item(item)) - if item in existing_items: - existing_items.remove(item) - - if self.min_units_per_structure > 0 and self.has_units_per_structure(): - requirements.append(lambda state: state.has_units_per_structure()) - - # Determining if the full-size inventory can complete campaign - if not all(requirement(self) for requirement in requirements): - raise Exception("Too many items excluded - campaign is impossible to complete.") - - while len(inventory) + len(locked_items) > inventory_size: - if len(inventory) == 0: - # There are more items than locations and all of them are already locked due to YAML or logic. - # Random items from locked ones will go to starting items - self.multiworld.random.shuffle(locked_items) - while len(locked_items) > inventory_size: - item: Item = locked_items.pop() - self.multiworld.push_precollected(item) - break - # Select random item from removable items - item = self.multiworld.random.choice(inventory) - # Cascade removals to associated items - if item in cascade_keys: - items_to_remove = self.cascade_removal_map[item] - transient_items = [] - cascade_failure = False - while len(items_to_remove) > 0: - item_to_remove = items_to_remove.pop() - transient_items.append(item_to_remove) - if item_to_remove not in inventory: - if units_always_have_upgrades and item_to_remove in locked_items: - cascade_failure = True - break - else: - continue - success = attempt_removal(item_to_remove) - if not success and units_always_have_upgrades: - cascade_failure = True - transient_items += items_to_remove - break - # Lock all associated items if any of them cannot be removed on Units Always Have Upgrades - if cascade_failure: - for transient_item in transient_items: - if transient_item in inventory: - for _ in range(inventory.count(transient_item)): - inventory.remove(transient_item) - if transient_item not in locked_items: - for _ in range(get_item_quantity(transient_item, self.multiworld, self.player)): - locked_items.append(copy_item(transient_item)) - if transient_item.classification in (ItemClassification.progression, ItemClassification.progression_skip_balancing): - self.logical_inventory.add(transient_item.name) - else: - attempt_removal(item) - - if not spider_mine_sources & self.logical_inventory: - inventory = [item for item in inventory if not item.name.endswith("(Spider Mine)")] - if not BARRACKS_UNITS & self.logical_inventory: - inventory = [item for item in inventory if - not (item.name.startswith("Progressive Infantry") or item.name == "Orbital Strike")] - if not FACTORY_UNITS & self.logical_inventory: - inventory = [item for item in inventory if not item.name.startswith("Progressive Vehicle")] - if not STARPORT_UNITS & self.logical_inventory: - inventory = [item for item in inventory if not item.name.startswith("Progressive Ship")] - - # Cull finished, adding locked items back into inventory - inventory += locked_items - - # Replacing empty space with generically useful items - replacement_items = [item for item in self.item_pool - if (item not in inventory - and item not in self.locked_items - and item.name in second_pass_placeable_items)] - self.multiworld.random.shuffle(replacement_items) - while len(inventory) < inventory_size and len(replacement_items) > 0: - item = replacement_items.pop() - inventory.append(item) - - return inventory - - def _read_logic(self): - self._sc2wol_has_common_unit = lambda world, player: SC2WoLLogic._sc2wol_has_common_unit(self, world, player) - self._sc2wol_has_air = lambda world, player: SC2WoLLogic._sc2wol_has_air(self, world, player) - self._sc2wol_has_air_anti_air = lambda world, player: SC2WoLLogic._sc2wol_has_air_anti_air(self, world, player) - self._sc2wol_has_competent_anti_air = lambda world, player: SC2WoLLogic._sc2wol_has_competent_anti_air(self, world, player) - self._sc2wol_has_competent_ground_to_air = lambda world, player: SC2WoLLogic._sc2wol_has_competent_ground_to_air(self, world, player) - self._sc2wol_has_anti_air = lambda world, player: SC2WoLLogic._sc2wol_has_anti_air(self, world, player) - self._sc2wol_defense_rating = lambda world, player, zerg_enemy, air_enemy=False: SC2WoLLogic._sc2wol_defense_rating(self, world, player, zerg_enemy, air_enemy) - self._sc2wol_has_competent_comp = lambda world, player: SC2WoLLogic._sc2wol_has_competent_comp(self, world, player) - self._sc2wol_has_train_killers = lambda world, player: SC2WoLLogic._sc2wol_has_train_killers(self, world, player) - self._sc2wol_able_to_rescue = lambda world, player: SC2WoLLogic._sc2wol_able_to_rescue(self, world, player) - self._sc2wol_beats_protoss_deathball = lambda world, player: SC2WoLLogic._sc2wol_beats_protoss_deathball(self, world, player) - self._sc2wol_survives_rip_field = lambda world, player: SC2WoLLogic._sc2wol_survives_rip_field(self, world, player) - self._sc2wol_has_protoss_common_units = lambda world, player: SC2WoLLogic._sc2wol_has_protoss_common_units(self, world, player) - self._sc2wol_has_protoss_medium_units = lambda world, player: SC2WoLLogic._sc2wol_has_protoss_medium_units(self, world, player) - self._sc2wol_has_mm_upgrade = lambda world, player: SC2WoLLogic._sc2wol_has_mm_upgrade(self, world, player) - self._sc2wol_welcome_to_the_jungle_requirement = lambda world, player: SC2WoLLogic._sc2wol_welcome_to_the_jungle_requirement(self, world, player) - self._sc2wol_can_respond_to_colony_infestations = lambda world, player: SC2WoLLogic._sc2wol_can_respond_to_colony_infestations(self, world, player) - self._sc2wol_final_mission_requirements = lambda world, player: SC2WoLLogic._sc2wol_final_mission_requirements(self, world, player) - - def __init__(self, multiworld: MultiWorld, player: int, - item_pool: List[Item], existing_items: List[Item], locked_items: List[Item], - has_protoss: bool): - self.multiworld = multiworld - self.player = player - self.logical_inventory = set() - self.locked_items = locked_items[:] - self.existing_items = existing_items - self._read_logic() - # Initial filter of item pool - self.item_pool = [] - item_quantities: dict[str, int] = dict() - # Inventory restrictiveness based on number of missions with checks - mission_order_type = get_option_value(self.multiworld, self.player, "mission_order") - mission_count = len(mission_orders[mission_order_type]) - 1 - self.min_units_per_structure = int(mission_count / 7) - min_upgrades = 1 if mission_count < 10 else 2 - for item in item_pool: - item_info = get_full_item_list()[item.name] - if item_info.type == "Upgrade": - # Locking upgrades based on mission duration - if item.name not in item_quantities: - item_quantities[item.name] = 0 - item_quantities[item.name] += 1 - if item_quantities[item.name] < min_upgrades: - self.locked_items.append(item) - else: - self.item_pool.append(item) - elif item_info.type == "Goal": - locked_items.append(item) - elif item_info.type != "Protoss" or has_protoss: - self.item_pool.append(item) - self.cascade_removal_map: Dict[Item, List[Item]] = dict() - for item in self.item_pool + locked_items + existing_items: - if item.name in UPGRADABLE_ITEMS: - upgrades = get_item_upgrades(self.item_pool, item) - associated_items = [*upgrades, item] - self.cascade_removal_map[item] = associated_items - if get_option_value(multiworld, player, "units_always_have_upgrades"): - for upgrade in upgrades: - self.cascade_removal_map[upgrade] = associated_items - - -def filter_items(multiworld: MultiWorld, player: int, mission_req_table: Dict[str, MissionInfo], location_cache: List[Location], - item_pool: List[Item], existing_items: List[Item], locked_items: List[Item]) -> List[Item]: - """ - Returns a semi-randomly pruned set of items based on number of available locations. - The returned inventory must be capable of logically accessing every location in the world. - """ - open_locations = [location for location in location_cache if location.item is None] - inventory_size = len(open_locations) - has_protoss = bool(PROTOSS_REGIONS.intersection(mission_req_table.keys())) - mission_requirements = [location.access_rule for location in location_cache] - valid_inventory = ValidInventory(multiworld, player, item_pool, existing_items, locked_items, has_protoss) - - valid_items = valid_inventory.generate_reduced_inventory(inventory_size, mission_requirements) - return valid_items diff --git a/worlds/sc2wol/Regions.py b/worlds/sc2wol/Regions.py deleted file mode 100644 index f588ce7e982e..000000000000 --- a/worlds/sc2wol/Regions.py +++ /dev/null @@ -1,313 +0,0 @@ -from typing import List, Set, Dict, Tuple, Optional, Callable -from BaseClasses import MultiWorld, Region, Entrance, Location -from .Locations import LocationData -from .Options import get_option_value, MissionOrder -from .MissionTables import MissionInfo, mission_orders, vanilla_mission_req_table, alt_final_mission_locations, \ - MissionPools, vanilla_shuffle_order -from .PoolFilter import filter_missions - -PROPHECY_CHAIN_MISSION_COUNT = 4 - -VANILLA_SHUFFLED_FIRST_PROPHECY_MISSION = 21 - -def create_regions(multiworld: MultiWorld, player: int, locations: Tuple[LocationData, ...], location_cache: List[Location])\ - -> Tuple[Dict[str, MissionInfo], int, str]: - locations_per_region = get_locations_per_region(locations) - - mission_order_type = get_option_value(multiworld, player, "mission_order") - mission_order = mission_orders[mission_order_type] - - mission_pools = filter_missions(multiworld, player) - - regions = [create_region(multiworld, player, locations_per_region, location_cache, "Menu")] - - names: Dict[str, int] = {} - - if mission_order_type == MissionOrder.option_vanilla: - - # Generating all regions and locations - for region_name in vanilla_mission_req_table.keys(): - regions.append(create_region(multiworld, player, locations_per_region, location_cache, region_name)) - multiworld.regions += regions - - connect(multiworld, player, names, 'Menu', 'Liberation Day'), - connect(multiworld, player, names, 'Liberation Day', 'The Outlaws', - lambda state: state.has("Beat Liberation Day", player)), - connect(multiworld, player, names, 'The Outlaws', 'Zero Hour', - lambda state: state.has("Beat The Outlaws", player)), - connect(multiworld, player, names, 'Zero Hour', 'Evacuation', - lambda state: state.has("Beat Zero Hour", player)), - connect(multiworld, player, names, 'Evacuation', 'Outbreak', - lambda state: state.has("Beat Evacuation", player)), - connect(multiworld, player, names, "Outbreak", "Safe Haven", - lambda state: state._sc2wol_cleared_missions(multiworld, player, 7) and - state.has("Beat Outbreak", player)), - connect(multiworld, player, names, "Outbreak", "Haven's Fall", - lambda state: state._sc2wol_cleared_missions(multiworld, player, 7) and - state.has("Beat Outbreak", player)), - connect(multiworld, player, names, 'Zero Hour', 'Smash and Grab', - lambda state: state.has("Beat Zero Hour", player)), - connect(multiworld, player, names, 'Smash and Grab', 'The Dig', - lambda state: state._sc2wol_cleared_missions(multiworld, player, 8) and - state.has("Beat Smash and Grab", player)), - connect(multiworld, player, names, 'The Dig', 'The Moebius Factor', - lambda state: state._sc2wol_cleared_missions(multiworld, player, 11) and - state.has("Beat The Dig", player)), - connect(multiworld, player, names, 'The Moebius Factor', 'Supernova', - lambda state: state._sc2wol_cleared_missions(multiworld, player, 14) and - state.has("Beat The Moebius Factor", player)), - connect(multiworld, player, names, 'Supernova', 'Maw of the Void', - lambda state: state.has("Beat Supernova", player)), - connect(multiworld, player, names, 'Zero Hour', "Devil's Playground", - lambda state: state._sc2wol_cleared_missions(multiworld, player, 4) and - state.has("Beat Zero Hour", player)), - connect(multiworld, player, names, "Devil's Playground", 'Welcome to the Jungle', - lambda state: state.has("Beat Devil's Playground", player)), - connect(multiworld, player, names, "Welcome to the Jungle", 'Breakout', - lambda state: state._sc2wol_cleared_missions(multiworld, player, 8) and - state.has("Beat Welcome to the Jungle", player)), - connect(multiworld, player, names, "Welcome to the Jungle", 'Ghost of a Chance', - lambda state: state._sc2wol_cleared_missions(multiworld, player, 8) and - state.has("Beat Welcome to the Jungle", player)), - connect(multiworld, player, names, "Zero Hour", 'The Great Train Robbery', - lambda state: state._sc2wol_cleared_missions(multiworld, player, 6) and - state.has("Beat Zero Hour", player)), - connect(multiworld, player, names, 'The Great Train Robbery', 'Cutthroat', - lambda state: state.has("Beat The Great Train Robbery", player)), - connect(multiworld, player, names, 'Cutthroat', 'Engine of Destruction', - lambda state: state.has("Beat Cutthroat", player)), - connect(multiworld, player, names, 'Engine of Destruction', 'Media Blitz', - lambda state: state.has("Beat Engine of Destruction", player)), - connect(multiworld, player, names, 'Media Blitz', 'Piercing the Shroud', - lambda state: state.has("Beat Media Blitz", player)), - connect(multiworld, player, names, 'The Dig', 'Whispers of Doom', - lambda state: state.has("Beat The Dig", player)), - connect(multiworld, player, names, 'Whispers of Doom', 'A Sinister Turn', - lambda state: state.has("Beat Whispers of Doom", player)), - connect(multiworld, player, names, 'A Sinister Turn', 'Echoes of the Future', - lambda state: state.has("Beat A Sinister Turn", player)), - connect(multiworld, player, names, 'Echoes of the Future', 'In Utter Darkness', - lambda state: state.has("Beat Echoes of the Future", player)), - connect(multiworld, player, names, 'Maw of the Void', 'Gates of Hell', - lambda state: state.has("Beat Maw of the Void", player)), - connect(multiworld, player, names, 'Gates of Hell', 'Belly of the Beast', - lambda state: state.has("Beat Gates of Hell", player)), - connect(multiworld, player, names, 'Gates of Hell', 'Shatter the Sky', - lambda state: state.has("Beat Gates of Hell", player)), - connect(multiworld, player, names, 'Gates of Hell', 'All-In', - lambda state: state.has('Beat Gates of Hell', player) and ( - state.has('Beat Shatter the Sky', player) or state.has('Beat Belly of the Beast', player))) - - return vanilla_mission_req_table, 29, 'All-In: Victory' - - else: - missions = [] - - remove_prophecy = mission_order_type == 1 and not get_option_value(multiworld, player, "shuffle_protoss") - - final_mission = mission_pools[MissionPools.FINAL][0] - - # Determining if missions must be removed - mission_pool_size = sum(len(mission_pool) for mission_pool in mission_pools.values()) - removals = len(mission_order) - mission_pool_size - # Removing entire Prophecy chain on vanilla shuffled when not shuffling protoss - if remove_prophecy: - removals -= PROPHECY_CHAIN_MISSION_COUNT - - # Initial fill out of mission list and marking all-in mission - for mission in mission_order: - # Removing extra missions if mission pool is too small - # Also handle lower removal priority than Prophecy - if 0 < mission.removal_priority <= removals or mission.category == 'Prophecy' and remove_prophecy \ - or (remove_prophecy and mission_order_type == MissionOrder.option_vanilla_shuffled - and mission.removal_priority > vanilla_shuffle_order[ - VANILLA_SHUFFLED_FIRST_PROPHECY_MISSION].removal_priority - and 0 < mission.removal_priority <= removals + PROPHECY_CHAIN_MISSION_COUNT): - missions.append(None) - elif mission.type == MissionPools.FINAL: - missions.append(final_mission) - else: - missions.append(mission.type) - - no_build_slots = [] - easy_slots = [] - medium_slots = [] - hard_slots = [] - - # Search through missions to find slots needed to fill - for i in range(len(missions)): - if missions[i] is None: - continue - if missions[i] == MissionPools.STARTER: - no_build_slots.append(i) - elif missions[i] == MissionPools.EASY: - easy_slots.append(i) - elif missions[i] == MissionPools.MEDIUM: - medium_slots.append(i) - elif missions[i] == MissionPools.HARD: - hard_slots.append(i) - - # Add no_build missions to the pool and fill in no_build slots - missions_to_add = mission_pools[MissionPools.STARTER] - if len(no_build_slots) > len(missions_to_add): - raise Exception("There are no valid No-Build missions. Please exclude fewer missions.") - for slot in no_build_slots: - filler = multiworld.random.randint(0, len(missions_to_add) - 1) - - missions[slot] = missions_to_add.pop(filler) - - # Add easy missions into pool and fill in easy slots - missions_to_add = missions_to_add + mission_pools[MissionPools.EASY] - if len(easy_slots) > len(missions_to_add): - raise Exception("There are not enough Easy missions to fill the campaign. Please exclude fewer missions.") - for slot in easy_slots: - filler = multiworld.random.randint(0, len(missions_to_add) - 1) - - missions[slot] = missions_to_add.pop(filler) - - # Add medium missions into pool and fill in medium slots - missions_to_add = missions_to_add + mission_pools[MissionPools.MEDIUM] - if len(medium_slots) > len(missions_to_add): - raise Exception("There are not enough Easy and Medium missions to fill the campaign. Please exclude fewer missions.") - for slot in medium_slots: - filler = multiworld.random.randint(0, len(missions_to_add) - 1) - - missions[slot] = missions_to_add.pop(filler) - - # Add hard missions into pool and fill in hard slots - missions_to_add = missions_to_add + mission_pools[MissionPools.HARD] - if len(hard_slots) > len(missions_to_add): - raise Exception("There are not enough missions to fill the campaign. Please exclude fewer missions.") - for slot in hard_slots: - filler = multiworld.random.randint(0, len(missions_to_add) - 1) - - missions[slot] = missions_to_add.pop(filler) - - # Generating regions and locations from selected missions - for region_name in missions: - regions.append(create_region(multiworld, player, locations_per_region, location_cache, region_name)) - multiworld.regions += regions - - # Mapping original mission slots to shifted mission slots when missions are removed - slot_map = [] - slot_offset = 0 - for position, mission in enumerate(missions): - slot_map.append(position - slot_offset + 1) - if mission is None: - slot_offset += 1 - - # Loop through missions to create requirements table and connect regions - # TODO: Handle 'and' connections - mission_req_table = {} - - def build_connection_rule(mission_names: List[str], missions_req: int) -> Callable: - if len(mission_names) > 1: - return lambda state: state.has_all({f"Beat {name}" for name in mission_names}, player) and \ - state._sc2wol_cleared_missions(multiworld, player, missions_req) - else: - return lambda state: state.has(f"Beat {mission_names[0]}", player) and \ - state._sc2wol_cleared_missions(multiworld, player, missions_req) - - for i, mission in enumerate(missions): - if mission is None: - continue - connections = [] - all_connections = [] - for connection in mission_order[i].connect_to: - if connection == -1: - continue - while missions[connection] is None: - connection -= 1 - all_connections.append(missions[connection]) - for connection in mission_order[i].connect_to: - required_mission = missions[connection] - if connection == -1: - connect(multiworld, player, names, "Menu", mission) - else: - if required_mission is None and not mission_order[i].completion_critical: # Drop non-critical null slots - continue - while required_mission is None: # Substituting null slot with prior slot - connection -= 1 - required_mission = missions[connection] - required_missions = [required_mission] if mission_order[i].or_requirements else all_connections - connect(multiworld, player, names, required_mission, mission, - build_connection_rule(required_missions, mission_order[i].number)) - connections.append(slot_map[connection]) - - mission_req_table.update({mission: MissionInfo( - vanilla_mission_req_table[mission].id, connections, mission_order[i].category, - number=mission_order[i].number, - completion_critical=mission_order[i].completion_critical, - or_requirements=mission_order[i].or_requirements)}) - - final_mission_id = vanilla_mission_req_table[final_mission].id - - # Changing the completion condition for alternate final missions into an event - if final_mission != 'All-In': - final_location = alt_final_mission_locations[final_mission] - # Final location should be near the end of the cache - for i in range(len(location_cache) - 1, -1, -1): - if location_cache[i].name == final_location: - location_cache[i].locked = True - location_cache[i].event = True - location_cache[i].address = None - break - else: - final_location = 'All-In: Victory' - - return mission_req_table, final_mission_id, final_location - -def create_location(player: int, location_data: LocationData, region: Region, - location_cache: List[Location]) -> Location: - location = Location(player, location_data.name, location_data.code, region) - location.access_rule = location_data.rule - - if id is None: - location.event = True - location.locked = True - - location_cache.append(location) - - return location - - -def create_region(multiworld: MultiWorld, player: int, locations_per_region: Dict[str, List[LocationData]], - location_cache: List[Location], name: str) -> Region: - region = Region(name, player, multiworld) - - if name in locations_per_region: - for location_data in locations_per_region[name]: - location = create_location(player, location_data, region, location_cache) - region.locations.append(location) - - return region - - -def connect(world: MultiWorld, player: int, used_names: Dict[str, int], source: str, target: str, - rule: Optional[Callable] = None): - sourceRegion = world.get_region(source, player) - targetRegion = world.get_region(target, player) - - if target not in used_names: - used_names[target] = 1 - name = target - else: - used_names[target] += 1 - name = target + (' ' * used_names[target]) - - connection = Entrance(player, name, sourceRegion) - - if rule: - connection.access_rule = rule - - sourceRegion.exits.append(connection) - connection.connect(targetRegion) - - -def get_locations_per_region(locations: Tuple[LocationData, ...]) -> Dict[str, List[LocationData]]: - per_region: Dict[str, List[LocationData]] = {} - - for location in locations: - per_region.setdefault(location.region, []).append(location) - - return per_region diff --git a/worlds/sc2wol/Starcraft2.kv b/worlds/sc2wol/Starcraft2.kv deleted file mode 100644 index f0785b89e428..000000000000 --- a/worlds/sc2wol/Starcraft2.kv +++ /dev/null @@ -1,16 +0,0 @@ -: - rows: 1 - -: - cols: 1 - padding: [10,5,10,5] - spacing: [0,5] - -: - text_size: self.size - markup: True - halign: 'center' - valign: 'middle' - padding: [5,0,5,0] - markup: True - outline_width: 1 diff --git a/worlds/sc2wol/__init__.py b/worlds/sc2wol/__init__.py deleted file mode 100644 index 5c487f8fee09..000000000000 --- a/worlds/sc2wol/__init__.py +++ /dev/null @@ -1,324 +0,0 @@ -import typing - -from typing import List, Set, Tuple, Dict -from BaseClasses import Item, MultiWorld, Location, Tutorial, ItemClassification -from worlds.AutoWorld import WebWorld, World -from .Items import StarcraftWoLItem, filler_items, item_name_groups, get_item_table, get_full_item_list, \ - get_basic_units, ItemData, upgrade_included_names, progressive_if_nco -from .Locations import get_locations, LocationType -from .Regions import create_regions -from .Options import sc2wol_options, get_option_value, LocationInclusion -from .LogicMixin import SC2WoLLogic -from .PoolFilter import filter_missions, filter_items, get_item_upgrades -from .MissionTables import starting_mission_locations, MissionInfo - - -class Starcraft2WoLWebWorld(WebWorld): - setup = Tutorial( - "Multiworld Setup Guide", - "A guide to setting up the Starcraft 2 randomizer connected to an Archipelago Multiworld", - "English", - "setup_en.md", - "setup/en", - ["TheCondor"] - ) - - tutorials = [setup] - - -class SC2WoLWorld(World): - """ - StarCraft II: Wings of Liberty is a science fiction real-time strategy video game developed and published by Blizzard Entertainment. - Command Raynor's Raiders in collecting pieces of the Keystone in order to stop the zerg threat posed by the Queen of Blades. - """ - - game = "Starcraft 2 Wings of Liberty" - web = Starcraft2WoLWebWorld() - data_version = 5 - - item_name_to_id = {name: data.code for name, data in get_full_item_list().items()} - location_name_to_id = {location.name: location.code for location in get_locations(None, None)} - option_definitions = sc2wol_options - - item_name_groups = item_name_groups - locked_locations: typing.List[str] - location_cache: typing.List[Location] - mission_req_table = {} - final_mission_id: int - victory_item: str - required_client_version = 0, 4, 3 - - def __init__(self, multiworld: MultiWorld, player: int): - super(SC2WoLWorld, self).__init__(multiworld, player) - self.location_cache = [] - self.locked_locations = [] - - def create_item(self, name: str) -> Item: - data = get_full_item_list()[name] - return StarcraftWoLItem(name, data.classification, data.code, self.player) - - def create_regions(self): - self.mission_req_table, self.final_mission_id, self.victory_item = create_regions( - self.multiworld, self.player, get_locations(self.multiworld, self.player), self.location_cache - ) - - def create_items(self): - setup_events(self.player, self.locked_locations, self.location_cache) - - excluded_items = get_excluded_items(self.multiworld, self.player) - - starter_items = assign_starter_items(self.multiworld, self.player, excluded_items, self.locked_locations) - - filter_locations(self.multiworld, self.player, self.locked_locations, self.location_cache) - - pool = get_item_pool(self.multiworld, self.player, self.mission_req_table, starter_items, excluded_items, self.location_cache) - - fill_item_pool_with_dummy_items(self, self.multiworld, self.player, self.locked_locations, self.location_cache, pool) - - self.multiworld.itempool += pool - - def set_rules(self): - self.multiworld.completion_condition[self.player] = lambda state: state.has(self.victory_item, self.player) - - def get_filler_item_name(self) -> str: - return self.multiworld.random.choice(filler_items) - - def fill_slot_data(self): - slot_data = {} - for option_name in sc2wol_options: - option = getattr(self.multiworld, option_name)[self.player] - if type(option.value) in {str, int}: - slot_data[option_name] = int(option.value) - slot_req_table = {} - for mission in self.mission_req_table: - slot_req_table[mission] = self.mission_req_table[mission]._asdict() - - slot_data["mission_req"] = slot_req_table - slot_data["final_mission"] = self.final_mission_id - return slot_data - - -def setup_events(player: int, locked_locations: typing.List[str], location_cache: typing.List[Location]): - for location in location_cache: - if location.address is None: - item = Item(location.name, ItemClassification.progression, None, player) - - locked_locations.append(location.name) - - location.place_locked_item(item) - - -def get_excluded_items(multiworld: MultiWorld, player: int) -> Set[str]: - excluded_items: Set[str] = set() - - for item in multiworld.precollected_items[player]: - excluded_items.add(item.name) - - excluded_items_option = getattr(multiworld, 'excluded_items', []) - - excluded_items.update(excluded_items_option[player].value) - - return excluded_items - - -def assign_starter_items(multiworld: MultiWorld, player: int, excluded_items: Set[str], locked_locations: List[str]) -> List[Item]: - non_local_items = multiworld.non_local_items[player].value - if get_option_value(multiworld, player, "early_unit"): - local_basic_unit = sorted(item for item in get_basic_units(multiworld, player) if item not in non_local_items and item not in excluded_items) - if not local_basic_unit: - raise Exception("At least one basic unit must be local") - - # The first world should also be the starting world - first_mission = list(multiworld.worlds[player].mission_req_table)[0] - if first_mission in starting_mission_locations: - first_location = starting_mission_locations[first_mission] - elif first_mission == "In Utter Darkness": - first_location = first_mission + ": Defeat" - else: - first_location = first_mission + ": Victory" - - return [assign_starter_item(multiworld, player, excluded_items, locked_locations, first_location, local_basic_unit)] - else: - return [] - - -def assign_starter_item(multiworld: MultiWorld, player: int, excluded_items: Set[str], locked_locations: List[str], - location: str, item_list: Tuple[str, ...]) -> Item: - - item_name = multiworld.random.choice(item_list) - - excluded_items.add(item_name) - - item = create_item_with_correct_settings(player, item_name) - - multiworld.get_location(location, player).place_locked_item(item) - - locked_locations.append(location) - - return item - - -def get_item_pool(multiworld: MultiWorld, player: int, mission_req_table: Dict[str, MissionInfo], - starter_items: List[Item], excluded_items: Set[str], location_cache: List[Location]) -> List[Item]: - pool: List[Item] = [] - - # For the future: goal items like Artifact Shards go here - locked_items = [] - - # YAML items - yaml_locked_items = get_option_value(multiworld, player, 'locked_items') - - # Adjust generic upgrade availability based on options - include_upgrades = get_option_value(multiworld, player, 'generic_upgrade_missions') == 0 - upgrade_items = get_option_value(multiworld, player, 'generic_upgrade_items') - - # Include items from outside Wings of Liberty - item_sets = {'wol'} - if get_option_value(multiworld, player, 'nco_items'): - item_sets.add('nco') - if get_option_value(multiworld, player, 'bw_items'): - item_sets.add('bw') - if get_option_value(multiworld, player, 'ext_items'): - item_sets.add('ext') - - def allowed_quantity(name: str, data: ItemData) -> int: - if name in excluded_items \ - or data.type == "Upgrade" and (not include_upgrades or name not in upgrade_included_names[upgrade_items]) \ - or not data.origin.intersection(item_sets): - return 0 - elif name in progressive_if_nco and 'nco' not in item_sets: - return 1 - else: - return data.quantity - - for name, data in get_item_table(multiworld, player).items(): - for i in range(allowed_quantity(name, data)): - item = create_item_with_correct_settings(player, name) - if name in yaml_locked_items: - locked_items.append(item) - else: - pool.append(item) - - existing_items = starter_items + [item for item in multiworld.precollected_items[player]] - existing_names = [item.name for item in existing_items] - - # Check the parent item integrity, exclude items - pool[:] = [item for item in pool if pool_contains_parent(item, pool + locked_items + existing_items)] - - # Removing upgrades for excluded items - for item_name in excluded_items: - if item_name in existing_names: - continue - invalid_upgrades = get_item_upgrades(pool, item_name) - for invalid_upgrade in invalid_upgrades: - pool.remove(invalid_upgrade) - - filtered_pool = filter_items(multiworld, player, mission_req_table, location_cache, pool, existing_items, locked_items) - return filtered_pool - - -def fill_item_pool_with_dummy_items(self: SC2WoLWorld, multiworld: MultiWorld, player: int, locked_locations: List[str], - location_cache: List[Location], pool: List[Item]): - for _ in range(len(location_cache) - len(locked_locations) - len(pool)): - item = create_item_with_correct_settings(player, self.get_filler_item_name()) - pool.append(item) - - -def create_item_with_correct_settings(player: int, name: str) -> Item: - data = get_full_item_list()[name] - - item = Item(name, data.classification, data.code, player) - - return item - - -def pool_contains_parent(item: Item, pool: [Item]): - item_data = get_full_item_list().get(item.name) - if item_data.parent_item is None: - # The item has not associated parent, the item is valid - return True - parent_item = item_data.parent_item - # Check if the pool contains the parent item - return parent_item in [pool_item.name for pool_item in pool] - - -def filter_locations(multiworld: MultiWorld, player, locked_locations: List[str], location_cache: List[Location]): - """ - Filters the locations in the world using a trash or Nothing item - :param multiworld: - :param player: - :param locked_locations: - :param location_cache: - :return: - """ - open_locations = [location for location in location_cache if location.item is None] - plando_locations = get_plando_locations(multiworld, player) - mission_progress_locations = get_option_value(multiworld, player, "mission_progress_locations") - bonus_locations = get_option_value(multiworld, player, "bonus_locations") - challenge_locations = get_option_value(multiworld, player, "challenge_locations") - optional_boss_locations = get_option_value(multiworld, player, "optional_boss_locations") - location_data = get_locations(multiworld, player) - for location in open_locations: - # Go through the locations that aren't locked yet (early unit, etc) - if location.name not in plando_locations: - # The location is not plando'd - sc2_location = [sc2_location for sc2_location in location_data if sc2_location.name == location.name][0] - location_type = sc2_location.type - - if location_type == LocationType.MISSION_PROGRESS \ - and mission_progress_locations != LocationInclusion.option_enabled: - item_name = get_exclusion_item(multiworld, mission_progress_locations) - place_exclusion_item(item_name, location, locked_locations, player) - - if location_type == LocationType.BONUS \ - and bonus_locations != LocationInclusion.option_enabled: - item_name = get_exclusion_item(multiworld, bonus_locations) - place_exclusion_item(item_name, location, locked_locations, player) - - if location_type == LocationType.CHALLENGE \ - and challenge_locations != LocationInclusion.option_enabled: - item_name = get_exclusion_item(multiworld, challenge_locations) - place_exclusion_item(item_name, location, locked_locations, player) - - if location_type == LocationType.OPTIONAL_BOSS \ - and optional_boss_locations != LocationInclusion.option_enabled: - item_name = get_exclusion_item(multiworld, optional_boss_locations) - place_exclusion_item(item_name, location, locked_locations, player) - - -def place_exclusion_item(item_name, location, locked_locations, player): - item = create_item_with_correct_settings(player, item_name) - location.place_locked_item(item) - locked_locations.append(location.name) - - -def get_exclusion_item(multiworld: MultiWorld, option) -> str: - """ - Gets the exclusion item according to settings (trash/nothing) - :param multiworld: - :param option: - :return: Item used for location exclusion - """ - if option == LocationInclusion.option_nothing: - return "Nothing" - elif option == LocationInclusion.option_trash: - index = multiworld.random.randint(0, len(filler_items) - 1) - return filler_items[index] - raise Exception(f"Unsupported option type: {option}") - - -def get_plando_locations(multiworld: MultiWorld, player) -> List[str]: - """ - - :param multiworld: - :param player: - :return: A list of locations affected by a plando in a world - """ - plando_locations = [] - for plando_setting in multiworld.plando_items[player]: - plando_locations += plando_setting.get("locations", []) - plando_setting_location = plando_setting.get("location", None) - if plando_setting_location is not None: - plando_locations.append(plando_setting_location) - - return plando_locations diff --git a/worlds/sc2wol/docs/en_Starcraft 2 Wings of Liberty.md b/worlds/sc2wol/docs/en_Starcraft 2 Wings of Liberty.md deleted file mode 100644 index 18bda6478457..000000000000 --- a/worlds/sc2wol/docs/en_Starcraft 2 Wings of Liberty.md +++ /dev/null @@ -1,54 +0,0 @@ -# Starcraft 2 Wings of Liberty - -## What does randomization do to this game? - -The following unlocks are randomized as items: -1. Your ability to build any non-worker unit (including Marines!). -2. Your ability to upgrade infantry weapons, infantry armor, vehicle weapons, etc. -3. All armory upgrades -4. All laboratory upgrades -5. All mercenaries -6. Small boosts to your starting mineral and vespene gas totals on each mission - -You find items by making progress in bonus objectives (like by rescuing allies in 'Zero Hour') and by completing -missions. When you receive items, they will immediately become available, even during a mission, and you will be -notified via a text box in the top-right corner of the game screen. (The text client for StarCraft 2 also records all -items in all worlds.) - -Missions are launched only through the text client. The Hyperion is never visited. Additionally, credits are not used. - -## What is the goal of this game when randomized? - -The goal is to beat the final mission: 'All In'. The config file determines which variant you must complete. - -## What non-randomized changes are there from vanilla Starcraft 2? - -1. Some missions have more vespene geysers available to allow a wider variety of units. -2. Starports no longer require Factories in order to be built. -3. In 'A Sinister Turn' and 'Echoes of the Future', you can research Protoss air weapon/armor upgrades. - -## Which of my items can be in another player's world? - -By default, any of StarCraft 2's items (specified above) can be in another player's world. See the -[Advanced YAML Guide](https://archipelago.gg/tutorial/Archipelago/advanced_settings/en) -for more information on how to change this. - -## Unique Local Commands - -The following commands are only available when using the Starcraft 2 Client to play with Archipelago. - -- `/difficulty [difficulty]` Overrides the difficulty set for the world. - - Options: casual, normal, hard, brutal -- `/game_speed [game_speed]` Overrides the game speed for the world - - Options: default, slower, slow, normal, fast, faster -- `/color [color]` Changes your color (Currently has no effect) - - Options: white, red, blue, teal, purple, yellow, orange, green, lightpink, violet, lightgrey, darkgreen, brown, - lightgreen, darkgrey, pink, rainbow, random, default -- `/disable_mission_check` Disables the check to see if a mission is available to play. Meant for co-op runs where one - player can play the next mission in a chain the other player is doing. -- `/play [mission_id]` Starts a Starcraft 2 mission based off of the mission_id provided -- `/available` Get what missions are currently available to play -- `/unfinished` Get what missions are currently available to play and have not had all locations checked -- `/set_path [path]` Menually set the SC2 install directory (if the automatic detection fails) -- `/download_data` Download the most recent release of the necassry files for playing SC2 with Archipelago. Will - overwrite existing files