From 7a99efaf5484f479bb564e8d648bae78350218fa Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 10 Jun 2020 12:48:07 +0200 Subject: [PATCH] Fix journey powers parsing --- lihzahrd/journeypowers/journeypowers.py | 10 ---------- lihzahrd/world.py | 8 ++------ 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lihzahrd/journeypowers/journeypowers.py b/lihzahrd/journeypowers/journeypowers.py index 2b5f99c..4a8b35c 100755 --- a/lihzahrd/journeypowers/journeypowers.py +++ b/lihzahrd/journeypowers/journeypowers.py @@ -17,20 +17,15 @@ class JourneyPowers: def __init__(self, freeze_time: typing.Optional[bool] = None, - god_mode: typing.Optional[bool] = None, time_rate: typing.Optional[float] = None, freeze_rain: typing.Optional[bool] = None, freeze_wind: typing.Optional[bool] = None, - far_placement_range: typing.Optional[bool] = None, difficulty: typing.Optional[float] = None, freeze_biome_spread: typing.Optional[bool] = None): self.freeze_time: bool = freeze_time """Is time frozen?""" - self.god_mode: bool = god_mode - """Is god mode enabled?""" - self.time_rate: float = time_rate """How fast does time go, 1x to 24x. Value ranges from 0.0 to 1.0.""" @@ -40,9 +35,6 @@ class JourneyPowers: self.freeze_wind: bool = freeze_wind """Can the wind speed and direction change.""" - self.far_placement_range: bool = far_placement_range - """Can players place blocks further than normal.""" - self.difficulty: float = difficulty """Enemy difficulty scaling, 0.5x to 3x. Value ranges from 0.0 to 1.0.""" @@ -52,10 +44,8 @@ class JourneyPowers: def __repr__(self): return f"JourneyPowers(" \ f"freeze_time={self.freeze_time}," \ - f" god_mode={self.god_mode}," \ f" freeze_rain={self.freeze_rain}," \ f" freeze_wind={self.freeze_wind}," \ - f" far_placement={self.far_placement_range}," \ f" freeze_biome_spread={self.freeze_biome_spread}," \ f" time_rate={self.time_rate}," \ f" difficulty={self.difficulty}" \ diff --git a/lihzahrd/world.py b/lihzahrd/world.py index 6b289a6..3f633f9 100644 --- a/lihzahrd/world.py +++ b/lihzahrd/world.py @@ -637,7 +637,7 @@ class World: ore_4 = BlockType(f.int4()) saved_ore_tiers = SavedOreTiers(ore_1, ore_2, ore_3, ore_4, hardmode_ore_1, hardmode_ore_2, hardmode_ore_3) - pets = Pets(f.bool(), f.bool(), f.bool()) + pets = Pets(cat=f.bool(), dog=f.bool(), bunny=f.bool()) defeated_empress_of_light = f.bool() defeated_queen_slime = f.bool() @@ -871,21 +871,17 @@ class World: unknown_bestiary_data = f.read_until(pointers.journey_powers) + journey_powers = JourneyPowers() while f.bool(): - journey_powers = JourneyPowers() power_id = f.int2() if power_id == 0: journey_powers.freeze_time = f.bool() - elif power_id == 5: - journey_powers.god_mode = f.bool() elif power_id == 8: journey_powers.time_rate = f.single() elif power_id == 9: journey_powers.freeze_rain = f.bool() elif power_id == 10: journey_powers.freeze_wind = f.bool() - elif power_id == 11: - journey_powers.far_placement_range = f.bool() elif power_id == 12: journey_powers.difficulty = f.single() elif power_id == 13: