1
Fork 0
mirror of https://github.com/Steffo99/lihzahrd.git synced 2024-11-25 01:24:21 +00:00

Fix journey powers parsing

This commit is contained in:
Steffo 2020-06-10 12:48:07 +02:00
parent cb1cbaad7d
commit 7a99efaf54
Signed by: steffo
GPG key ID: 896A80F55F7C97F0
2 changed files with 2 additions and 16 deletions

View file

@ -17,20 +17,15 @@ class JourneyPowers:
def __init__(self, def __init__(self,
freeze_time: typing.Optional[bool] = None, freeze_time: typing.Optional[bool] = None,
god_mode: typing.Optional[bool] = None,
time_rate: typing.Optional[float] = None, time_rate: typing.Optional[float] = None,
freeze_rain: typing.Optional[bool] = None, freeze_rain: typing.Optional[bool] = None,
freeze_wind: typing.Optional[bool] = None, freeze_wind: typing.Optional[bool] = None,
far_placement_range: typing.Optional[bool] = None,
difficulty: typing.Optional[float] = None, difficulty: typing.Optional[float] = None,
freeze_biome_spread: typing.Optional[bool] = None): freeze_biome_spread: typing.Optional[bool] = None):
self.freeze_time: bool = freeze_time self.freeze_time: bool = freeze_time
"""Is time frozen?""" """Is time frozen?"""
self.god_mode: bool = god_mode
"""Is god mode enabled?"""
self.time_rate: float = time_rate self.time_rate: float = time_rate
"""How fast does time go, 1x to 24x. Value ranges from 0.0 to 1.0.""" """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 self.freeze_wind: bool = freeze_wind
"""Can the wind speed and direction change.""" """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 self.difficulty: float = difficulty
"""Enemy difficulty scaling, 0.5x to 3x. Value ranges from 0.0 to 1.0.""" """Enemy difficulty scaling, 0.5x to 3x. Value ranges from 0.0 to 1.0."""
@ -52,10 +44,8 @@ class JourneyPowers:
def __repr__(self): def __repr__(self):
return f"JourneyPowers(" \ return f"JourneyPowers(" \
f"freeze_time={self.freeze_time}," \ f"freeze_time={self.freeze_time}," \
f" god_mode={self.god_mode}," \
f" freeze_rain={self.freeze_rain}," \ f" freeze_rain={self.freeze_rain}," \
f" freeze_wind={self.freeze_wind}," \ f" freeze_wind={self.freeze_wind}," \
f" far_placement={self.far_placement_range}," \
f" freeze_biome_spread={self.freeze_biome_spread}," \ f" freeze_biome_spread={self.freeze_biome_spread}," \
f" time_rate={self.time_rate}," \ f" time_rate={self.time_rate}," \
f" difficulty={self.difficulty}" \ f" difficulty={self.difficulty}" \

View file

@ -637,7 +637,7 @@ class World:
ore_4 = BlockType(f.int4()) 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) 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_empress_of_light = f.bool()
defeated_queen_slime = f.bool() defeated_queen_slime = f.bool()
@ -871,21 +871,17 @@ class World:
unknown_bestiary_data = f.read_until(pointers.journey_powers) unknown_bestiary_data = f.read_until(pointers.journey_powers)
while f.bool():
journey_powers = JourneyPowers() journey_powers = JourneyPowers()
while f.bool():
power_id = f.int2() power_id = f.int2()
if power_id == 0: if power_id == 0:
journey_powers.freeze_time = f.bool() journey_powers.freeze_time = f.bool()
elif power_id == 5:
journey_powers.god_mode = f.bool()
elif power_id == 8: elif power_id == 8:
journey_powers.time_rate = f.single() journey_powers.time_rate = f.single()
elif power_id == 9: elif power_id == 9:
journey_powers.freeze_rain = f.bool() journey_powers.freeze_rain = f.bool()
elif power_id == 10: elif power_id == 10:
journey_powers.freeze_wind = f.bool() journey_powers.freeze_wind = f.bool()
elif power_id == 11:
journey_powers.far_placement_range = f.bool()
elif power_id == 12: elif power_id == 12:
journey_powers.difficulty = f.single() journey_powers.difficulty = f.single()
elif power_id == 13: elif power_id == 13: