SC2: Fix Conviction logic for Grant Story Tech (#5419)
* Fix Conviction logic for Grant Story Tech - Kinetic Blast and Crushing Grip is available for the mission if story tech is granted * Review updates
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Unit tests for world generation
|
||||
"""
|
||||
from typing import *
|
||||
|
||||
from .test_base import Sc2SetupTestBase
|
||||
|
||||
from .. import mission_groups, mission_tables, options, locations, SC2Mission, SC2Campaign, SC2Race, unreleased_items, \
|
||||
|
||||
@@ -6,7 +6,9 @@ from .test_base import Sc2SetupTestBase
|
||||
from .. import get_all_missions, mission_tables, options
|
||||
from ..item import item_groups, item_tables, item_names
|
||||
from ..mission_tables import SC2Race, SC2Mission, SC2Campaign, MissionFlag
|
||||
from ..options import EnabledCampaigns, MasteryLocations
|
||||
from ..options import EnabledCampaigns, MasteryLocations, MissionOrder, EnableRaceSwapVariants, ShuffleCampaigns, \
|
||||
ShuffleNoBuild, StarterUnit, RequiredTactics, KerriganPresence, KerriganLevelItemDistribution, GrantStoryTech, \
|
||||
GrantStoryLevels
|
||||
|
||||
|
||||
class TestSupportedUseCases(Sc2SetupTestBase):
|
||||
@@ -490,3 +492,39 @@ class TestSupportedUseCases(Sc2SetupTestBase):
|
||||
|
||||
self.assertTupleEqual(terran_nonmerc_units, ())
|
||||
self.assertTupleEqual(zerg_nonmerc_units, ())
|
||||
|
||||
def test_all_kerrigan_missions_are_nobuild_and_grant_story_tech_is_on(self) -> None:
|
||||
# The actual situation the bug got caught
|
||||
world_options = {
|
||||
'mission_order': MissionOrder.option_vanilla_shuffled,
|
||||
'selected_races': [
|
||||
SC2Race.TERRAN.get_title(),
|
||||
SC2Race.ZERG.get_title(),
|
||||
SC2Race.PROTOSS.get_title(),
|
||||
],
|
||||
'enabled_campaigns': [
|
||||
SC2Campaign.WOL.campaign_name,
|
||||
SC2Campaign.PROPHECY.campaign_name,
|
||||
SC2Campaign.HOTS.campaign_name,
|
||||
SC2Campaign.PROLOGUE.campaign_name,
|
||||
SC2Campaign.LOTV.campaign_name,
|
||||
SC2Campaign.EPILOGUE.campaign_name,
|
||||
SC2Campaign.NCO.campaign_name,
|
||||
],
|
||||
'enable_race_swap': EnableRaceSwapVariants.option_shuffle_all_non_vanilla, # Causes no build Kerrigan missions to be present, only nobuilds remain
|
||||
'shuffle_campaigns': ShuffleCampaigns.option_true,
|
||||
'shuffle_no_build': ShuffleNoBuild.option_true,
|
||||
'starter_unit': StarterUnit.option_balanced,
|
||||
'required_tactics': RequiredTactics.option_standard,
|
||||
'kerrigan_presence': KerriganPresence.option_vanilla,
|
||||
'kerrigan_levels_per_mission_completed': 0,
|
||||
'kerrigan_levels_per_mission_completed_cap': -1,
|
||||
'kerrigan_level_item_sum': 87,
|
||||
'kerrigan_level_item_distribution': KerriganLevelItemDistribution.option_size_7,
|
||||
'kerrigan_total_level_cap': -1,
|
||||
'start_primary_abilities': 0,
|
||||
'grant_story_tech': GrantStoryTech.option_grant,
|
||||
'grant_story_levels': GrantStoryLevels.option_additive,
|
||||
}
|
||||
self.generate_world(world_options)
|
||||
# Just check that the world itself generates under those rules and no exception is thrown
|
||||
|
||||
Reference in New Issue
Block a user