Remove .value from options (except starting hint)

This commit is contained in:
Carter Hesterman
2024-08-06 14:22:06 -06:00
parent 5cbbe9a0b1
commit 0980a5d33e
3 changed files with 17 additions and 17 deletions

View File

@@ -65,7 +65,7 @@ def get_formatted_player_name(world, player) -> str:
def get_advisor_type(world: 'CivVIWorld', location: Location) -> str:
if world.options.advisor_show_progression_items.value and location.item.classification == ItemClassification.progression:
if world.options.advisor_show_progression_items and location.item.classification == ItemClassification.progression:
return "ADVISOR_PROGRESSIVE"
else:
return "ADVISOR_GENERIC"
@@ -87,13 +87,13 @@ def generate_new_items(world: 'CivVIWorld') -> str:
hidden_techs = []
hidden_civics = []
if world.options.boostsanity.value:
if world.options.boostsanity:
boost_techs = [location for location in locations if location.location_type == CivVICheckType.BOOST and location.name.split("_")[1] == "TECH"]
boost_civics = [location for location in locations if location.location_type == CivVICheckType.BOOST and location.name.split("_")[1] == "CIVIC"]
techs += boost_techs
civics += boost_civics
if world.options.hide_item_names.value:
if world.options.hide_item_names:
hidden_techs = [tech.name for tech in techs]
hidden_civics = [civic.name for civic in civics]
@@ -166,7 +166,7 @@ def generate_setup_file(world) -> str:
end
"""
if world.options.boostsanity.value:
if world.options.boostsanity:
setup += f"""
-- Init Boosts
if Game.GetProperty("BoostsAsChecks") == nil then
@@ -182,7 +182,7 @@ def generate_goody_hut_sql(world) -> str:
Generates the SQL for the goody huts or an empty string if they are disabled since the mod expects the file to be there
"""
if world.options.shuffle_goody_hut_rewards.value:
if world.options.shuffle_goody_hut_rewards:
return f"""
UPDATE GoodyHutSubTypes SET Description = NULL WHERE GoodyHut NOT IN ('METEOR_GOODIES', 'GOODYHUT_SAILOR_WONDROUS', 'DUMMY_GOODY_BUILDIER') AND Weight > 0;
@@ -218,7 +218,7 @@ def generate_update_boosts_sql(world) -> str:
Generates the SQL for existing boosts in boostsanity or an empty string if they are disabled since the mod expects the file to be there
"""
if world.options.boostsanity.value:
if world.options.boostsanity:
return f"""
UPDATE Boosts
SET TechnologyType = 'BOOST_' || TechnologyType

View File

@@ -106,8 +106,8 @@ def create_regions(world: 'CivVIWorld', options: CivVIOptions, player: int):
has_progressive_items = options.progression_style.current_key != "none"
has_progressive_eras = options.progression_style.current_key == "eras_and_districts"
has_goody_huts = options.shuffle_goody_hut_rewards.value
has_boosts = options.boostsanity.value
has_goody_huts = options.shuffle_goody_hut_rewards
has_boosts = options.boostsanity
regions: List[Region] = []
for era in EraType:
@@ -172,7 +172,7 @@ def create_regions(world: 'CivVIWorld', options: CivVIOptions, player: int):
world.multiworld.completion_condition[player] = lambda state: state.can_reach(
EraType.ERA_FUTURE.value, "Region", player)
if world.options.boostsanity.value and not world.options.exclude_missable_boosts.value:
if world.options.boostsanity and not world.options.exclude_missable_boosts:
_update_boost_locations_to_include_missable(world)

View File

@@ -80,13 +80,13 @@ class CivVIWorld(World):
create_regions(self, self.options, self.player)
def set_rules(self) -> None:
if self.options.boostsanity.value:
if self.options.boostsanity:
create_boost_rules(self)
def create_item(self, name: str) -> Item:
item: CivVIItemData = self.item_table[name]
classification = item.classification
if self.options.boostsanity.value:
if self.options.boostsanity:
if item.civ_name in BOOSTSANITY_PROGRESSION_ITEMS:
classification = ItemClassification.progression
@@ -126,10 +126,10 @@ class CivVIWorld(World):
num_filler_items = 0
# Goody items, create 10 by default if options are enabled
if self.options.shuffle_goody_hut_rewards.value:
if self.options.shuffle_goody_hut_rewards:
num_filler_items += 10
if self.options.boostsanity.value:
if self.options.boostsanity:
boost_data = get_boosts_data()
num_filler_items += len(boost_data)
@@ -170,10 +170,10 @@ class CivVIWorld(World):
def fill_slot_data(self):
return {
"progression_style": self.options.progression_style.current_key,
"death_link": self.options.death_link.value,
"research_cost_multiplier": self.options.research_cost_multiplier.value,
"death_link_effect": self.options.death_link_effect.value,
"death_link_effect_percent": self.options.death_link_effect_percent.value,
"death_link": self.options.death_link,
"research_cost_multiplier": self.options.research_cost_multiplier,
"death_link_effect": self.options.death_link_effect,
"death_link_effect_percent": self.options.death_link_effect_percent,
}