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

Fix more missing flags

This commit is contained in:
Steffo 2019-08-21 14:06:49 +02:00
parent 7e5bc78006
commit 04c607aa0c
4 changed files with 19 additions and 9 deletions

View file

@ -27,6 +27,7 @@ class BossesDefeated:
santa_nk1: bool,
everscream: bool,
martian_madness: bool,
lunatic_cultist: bool,
lunar_pillars: PillarsInfo,
old_ones_army: OldOnesArmyTiers):
self.eye_of_cthulhu: bool = eye_of_cthulhu
@ -55,6 +56,7 @@ class BossesDefeated:
self.santa_nk1: bool = santa_nk1
self.everscream: bool = everscream
self.martian_madness: bool = martian_madness
self.lunatic_cultist: bool = lunatic_cultist
self.lunar_pillars: PillarsInfo = lunar_pillars
self.old_ones_army: OldOnesArmyTiers = old_ones_army

View file

@ -21,7 +21,6 @@ class HardmodeTier2Ore(enum.IntEnum):
class HardmodeTier3Ore(enum.IntEnum):
NOT_DETERMINED = -1
NOT_DETERMINED_TOO = 16785407 # ???
ADAMANTITE = 111
TITANIUM = 223

View file

@ -1,7 +1,6 @@
import uuid
import math
import typing
import multiprocessing
from .fileutils import *
from .header import *
from .tiles import *
@ -11,7 +10,6 @@ from .npcs import *
from .tileentities import *
from .pressureplates import *
from .townmanager import *
from .timer import Timer
from .errors import InvalidFooterError
@ -255,7 +253,7 @@ class World:
liquid = Liquid(type_=liquid_type, volume=fr.uint1())
else:
liquid = None
if rle_compression == RLEEncoding.DOUBLE_BYTE or rle_compression == RLEEncoding.UNKNOWN_3:
if rle_compression == RLEEncoding.DOUBLE_BYTE:
multiply_by = fr.uint2() + 1
elif rle_compression == RLEEncoding.SINGLE_BYTE:
multiply_by = fr.uint1() + 1
@ -391,9 +389,18 @@ class World:
rain = Rain(is_active=f.bool(), time_left=f.int4(), max_rain=f.single())
hardmode_ore_1 = HardmodeTier1Ore(f.int4())
hardmode_ore_2 = HardmodeTier2Ore(f.int4())
hardmode_ore_3 = HardmodeTier3Ore(f.int4())
try:
hardmode_ore_1 = HardmodeTier1Ore(f.int4())
except ValueError:
hardmode_ore_1 = HardmodeTier1Ore.NOT_DETERMINED
try:
hardmode_ore_2 = HardmodeTier2Ore(f.int4())
except ValueError:
hardmode_ore_2 = HardmodeTier2Ore.NOT_DETERMINED
try:
hardmode_ore_3 = HardmodeTier3Ore(f.int4())
except ValueError:
hardmode_ore_3 = HardmodeTier3Ore.NOT_DETERMINED
altars_smashed = AltarsSmashed(count=smashed_altars_count,
ore_tier1=hardmode_ore_1,
ore_tier2=hardmode_ore_2,
@ -458,6 +465,7 @@ class World:
defeated_duke_fishron = f.bool()
defeated_martian_madness = f.bool()
defeated_lunatic_cultist = f.bool()
defeated_moon_lord = f.bool()
defeated_pumpking = f.bool()
defeated_mourning_wood = f.bool()
@ -533,7 +541,8 @@ class World:
everscream=defeated_everscream,
lunar_pillars=defeated_pillars,
old_ones_army=old_ones_army,
martian_madness=defeated_martian_madness)
martian_madness=defeated_martian_madness,
lunatic_cultist=defeated_lunatic_cultist)
unknown_world_header_data = f.read_until(pointers.world_tiles)

View file

@ -5,7 +5,7 @@ with open("README.md", "r") as f:
setuptools.setup(
name="lihzahrd",
version="1.0b3",
version="1.0b4",
author="Stefano Pigozzi",
author_email="ste.pigozzi@gmail.com",
description="A Terraria world parser in Python",