Files
Grinch-AP/worlds/civ_6/test/TestStartingHints.py
Carter Hesterman 5f73c245fc New Game Implementation: Civilization VI (#3736)
* Init

* remove submodule

* Init

* Update docs

* Fix tests

* Update to use apcivvi

* Update Readme and codeowners

* Minor changes

* Remove .value from options (except starting hint)

* Minor updates

* remove unnecessary property

* Cleanup Rules and Region

* Fix output file generation

* Implement feedback

* Remove 'AP' tag and fix issue with format strings and using same quotes

* Update worlds/civ_6/__init__.py

Co-authored-by: Scipio Wright <scipiowright@gmail.com>

* Minor docs changes

* minor updates

* Small rework of create items

* Minor updates

* Remove unused variable

* Move client to Launcher Components with rest of similar clients

* Revert "Move client to Launcher Components with rest of similar clients"

This reverts commit f9fd5df9fdf19eaf4f1de54e21e3c33a74f02364.

* modify component

* Fix generation issues

* Fix tests

* Minor change

* Add improvement and test case

* Minor options changes

* .

* Preliminary Review

* Fix failing test due to slot data serialization

* Format json

* Remove exclude missable boosts

* Update options (update goody hut text, make research multiplier a range)

* Update docs punctuation and slot data init

* Move priority/excluded locations into options

* Implement docs PR feedback

* PR Feedback for options

* PR feedback misc

* Update location classification and fix client type

* Fix typings

* Update research cost multiplier

* Remove unnecessary location priority code

* Remove extrenous use of items()

* WIP PR Feedback

* WIP PR Feedback

* Add victory event

* Add option set for death link effect

* PR improvements

* Update post fill hint to support items with multiple classifications

* remove unnecessary len

* Move location exclusion logic

* Update test to use set instead of accidental dict

* Update docs around progressive eras and boost locations

* Update docs for options to be more readable

* Fix issue with filler items and prehints

* Update filler_data to be static

* Update links in docs

* Minor updates and PR feedback

* Update boosts data

* Update era required items

* Update existing techs

* Update existing techs

* move boost data class

* Update reward data

* Update prereq data

* Update new items and progressive districts

* Remove unused code

* Make filler item name func more efficient

* Update death link text

* Move Civ6 to the end of readme

* Fix bug with hidden locations and location.name

* Partial PR Feedback Implementation

* Format changes

* Minor review feedback

* Modify access rules to use list created in generate_early

* Modify boost rules to precalculate requirements

* Remove option checks from access rules

* Fix issue with pre initialized dicts

* Add inno setup for civ6 client

* Update inno_setup.iss

---------

Co-authored-by: Scipio Wright <scipiowright@gmail.com>
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Co-authored-by: Exempt-Medic <ExemptMedic@Gmail.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2025-03-10 14:53:26 +01:00

126 lines
4.6 KiB
Python

from BaseClasses import ItemClassification
from Fill import distribute_items_restrictive
from ..Enum import CivVICheckType
from . import CivVITestBase
class TestStartingHints(CivVITestBase):
run_default_tests = False # type: ignore
auto_construct = False
options = {
"progressive_eras": "true",
"death_link": "true",
"death_link_effect": "unit_killed",
"progressive_districts": "true",
"pre_hint_items": set({"Progression", "Useful", "Filler"}),
}
def test_all_tech_civic_items_are_hinted_default(self) -> None:
self.world_setup()
distribute_items_restrictive(self.multiworld)
self.world.post_fill()
start_location_hints = self.world.options.start_location_hints.value
for location_name, location_data in self.world.location_table.items():
if location_data.location_type == CivVICheckType.CIVIC or location_data.location_type == CivVICheckType.TECH:
self.assertIn(location_name, start_location_hints)
else:
self.assertNotIn(location_name, start_location_hints)
class TestOnlyProgressionItemsHinted(CivVITestBase):
run_default_tests = False # type: ignore
auto_construct = False
options = {
"progressive_eras": "true",
"death_link": "true",
"death_link_effect": "unit_killed",
"progressive_districts": "true",
"pre_hint_items": set({"Progression"}),
}
def test_only_progression_items_are_hinted(self) -> None:
self.world_setup()
distribute_items_restrictive(self.multiworld)
self.world.post_fill()
start_location_hints = self.world.options.start_location_hints.value
self.assertTrue(len(start_location_hints) > 0)
for hint in start_location_hints:
location_data = self.world.get_location(hint)
if location_data.item:
self.assertTrue(location_data.item.classification == ItemClassification.progression)
else:
self.assertTrue(False, "Location has no item")
class TestNoJunkItemsHinted(CivVITestBase):
run_default_tests = False # type: ignore
auto_construct = False
options = {
"progressive_eras": "true",
"death_link": "true",
"death_link_effect": "unit_killed",
"progressive_districts": "true",
"pre_hint_items": set({"Progression", "Useful"}),
"boostsanity": "true",
"shuffle_goody_hut_rewards": "true",
}
def test_no_junk_items_are_hinted(self) -> None:
self.world_setup()
distribute_items_restrictive(self.multiworld)
item = self.multiworld.get_location("TECH_AP_ANCIENT_01", self.player).item
self.assertIsNotNone(item)
if item:
item.classification = ItemClassification.filler
self.world.post_fill()
start_location_hints = self.world.options.start_location_hints.value
self.assertTrue(len(start_location_hints) > 0)
self.assertNotIn("TECH_AP_ANCIENT_01", start_location_hints)
class TestOnlyJunkItemsHinted(CivVITestBase):
run_default_tests = False # type: ignore
auto_construct = False
options = {
"progressive_eras": "true",
"death_link": "true",
"death_link_effect": "unit_killed",
"progressive_districts": "true",
"pre_hint_items": set({"Filler"}),
}
def test_only_junk_items_are_hinted(self) -> None:
self.world_setup()
distribute_items_restrictive(self.multiworld)
item = self.multiworld.get_location("TECH_AP_ANCIENT_01", self.player).item
self.assertIsNotNone(item)
if item:
item.classification = ItemClassification.filler
self.world.post_fill()
start_location_hints = self.world.options.start_location_hints.value
self.assertEqual(len(start_location_hints), 1)
self.assertIn("TECH_AP_ANCIENT_01", start_location_hints)
class TestNoItemsHinted(CivVITestBase):
run_default_tests = False # type: ignore
auto_construct = False
options = {
"progressive_eras": "true",
"death_link": "true",
"death_link_effect": "unit_killed",
"progressive_districts": "true",
"pre_hint_items": set({}),
}
def test_no_items_are_hinted(self) -> None:
self.world_setup()
distribute_items_restrictive(self.multiworld)
self.world.post_fill()
start_location_hints = self.world.options.start_location_hints.value
self.assertEqual(len(start_location_hints), 0)