1
Fork 0
mirror of https://github.com/Steffo99/lihzahrd.git synced 2024-10-16 06:27:29 +00:00

Update for 1.4.2.3

This commit is contained in:
MartinRohrbach 2021-06-04 11:11:55 +02:00 committed by Stefano Pigozzi
parent d5e8730eb5
commit ae2a40275b
5 changed files with 68 additions and 6 deletions

View file

@ -729,6 +729,11 @@ class EntityType(enum.IntEnum):
QueenSlimeMinionPurple = 660
EmpressButterfly = 661
PirateGhost = 662
Princess = 663
TorchGod = 664
ChaosBallTim = 665
VileSpitEaterOfWorlds = 666
GoldenSlime = 667
def __repr__(self):
return f"{self.__class__.__name__}.{self.name}"

View file

@ -5098,5 +5098,52 @@ class ItemType(enum.IntEnum):
CARTON_OF_MILK = 5041
COFFEE = 5042
# 1.4.1, updated from https://github.com/TerraMap/windows/blob/master/Data/tiles.xml
TORCH_GODS_FAVOR = 5043
MUSIC_BOX_JOURNEYS_END_2 = 5044
PLAGUEBRINGERS_SKULL = 5045
PLAGUEBRINGERS_CLOAK = 5046
PLAGUEBRINGERS_TREADS = 5047
WANDERING_JINGASA = 5048
WANDERING_YUKATA = 5049
WANDERING_GETA = 5050
TIMELESS_TRAVELERS_HOOD = 5051
TIMELESS_TRAVELERS_CLOAK = 5052
TIMELESS_TRAVELERS_FOOTWEAR = 5053
FLORET_PROTECTOR_HELMET = 5054
FLORET_PROTECTOR_SHIRT = 5055
FLORET_PROTECTOR_PANTS = 5056
CAPRICORN_HELMET = 5057
CAPRICORN_CHESTPLATE = 5058
CAPRICORN_HOOVES = 5059
CAPRICORN_TAIL = 5060
VIDEO_VISAGE = 5061
LAZER_BLAZER = 5062
PINSTRIPE_PANTS = 5063
LAVAPROOF_TACKLE_BAG = 5064
RESONANCE_SCEPTER = 5065
BEE_HIVE = 5066
ANTLION_EGGS = 5067
FLINX_FOR_COAT = 5068
FLINX_STAFF = 5069
FLINX_FUR = 5070
ROYAL_TIARA = 5071
ROYAL_BLOUSE = 5072
ROYAL_DRESS = 5073
SPINAL_TAP = 5074
RAINBOW_CURSOR = 5075
ROYAL_SCEPTER = 5076
GLASS_SLIPPER = 5077
PRINCE_UNIFORM = 5078
PRINCE_PANTS = 5079
PRINCE_CAPE = 5080
POTTED_CRYSTAL_FERN = 5081
POTTED_CRYSTAL_SPIRAL = 5082
POTTED_CRYSTAL_TEARDROP = 5083
POTTED_CRYSTAL_TREE = 5084
PRINCESS_64 = 5085
PAINTING_OF_A_LASS = 5086
DARK_SIDE_OF_THE_HOLLOW = 5087
def __repr__(self):
return f"{self.__class__.__name__}.{self.name}"

View file

@ -42,5 +42,8 @@ class AnglerQuestFish(enum.IntEnum):
SLIMEFISH = 37
TROPICAL_BARRACUDA = 38
# none of the other tools know what fish this is ... *shrug*
UNKNOWN1 = 39
def __repr__(self):
return f"{self.__class__.__name__}.{self.name}"

View file

@ -52,6 +52,7 @@ class Version:
227: "1.4.0.3",
228: "1.4.0.4",
230: "1.4.0.5",
238: "1.4.2.3"
}
def __init__(self, data: typing.Union[int, str]):
@ -71,7 +72,7 @@ class Version:
try:
return self._version_ids[self.id]
except KeyError:
return "Unknown"
return "Unknown (%i)" % self.id
def __repr__(self):
return f"Version({self.id})"

View file

@ -34,6 +34,7 @@ class World:
difficulty: Difficulty,
is_drunk_world: bool,
is_for_the_worthy: bool,
is_tenth_anniversary: bool,
created_on,
styles: Styles,
backgrounds: Backgrounds,
@ -120,6 +121,10 @@ class World:
"""If the world was created with the
for the worthy (https://terraria.gamepedia.com/Secret_world_seeds#For_the_worthy) seed."""
self.is_tenth_anniversary: bool = is_tenth_anniversary
"""If the world was created with the
celebrationmk10 (https://terraria.fandom.com/wiki/Secret_world_seeds#Celebrationmk10) seed."""
self.created_on = created_on
"""The date and time this world was created in."""
@ -376,9 +381,9 @@ class World:
version = Version(f.int4())
relogic = f.string(7)
savefile_type = f.uint1()
supported_versions = (Version("1.4.0.4"), Version("1.4.0.5"))
supported_versions = (Version("1.4.2.3"), Version("1.4.2.3"))
if version not in supported_versions or relogic != "relogic" or savefile_type != 2:
raise NotImplementedError("This parser can only read Terraria 1.4.0.4 or 1.4.0.5 save files.")
raise NotImplementedError("This parser can only read Terraria 1.4.2.3 save files.")
revision = f.uint4()
is_favorite = f.uint8() != 0
@ -403,6 +408,7 @@ class World:
difficulty = Difficulty(f.int4())
is_drunk_world = f.bool()
is_for_the_worthy = f.bool()
is_tenth_anniversary = f.bool()
created_on = f.datetime()
world_styles = Styles(moon=MoonStyle(f.uint1()),
@ -458,7 +464,7 @@ class World:
shadow_orbs = ShadowOrbs(smashed_at_least_once=f.bool(),
spawn_meteorite=f.bool(),
evil_boss_counter=f.int4())
evil_boss_counter=f.uint1()) # was int4()
altars_smashed = f.int4()
@ -499,7 +505,7 @@ class World:
clouds = Clouds(bg_cloud=f.int4(), cloud_number=f.int2(), wind_speed=f.single())
angler_today_quest_completed_by_count = f.uint1()
angler_today_quest_completed_by_count = f.int4() # was uint1()
angler_today_quest_completed_by = []
for _ in range(angler_today_quest_completed_by_count):
angler_today_quest_completed_by.append(f.string())
@ -893,7 +899,7 @@ class World:
world = cls(version=version, savefile_type=savefile_type, revision=revision, is_favorite=is_favorite,
name=name, generator=generator, uuid_=uuid_, id_=id_, bounds=bounds, size=world_size,
difficulty=difficulty, is_drunk_world=is_drunk_world, is_for_the_worthy=is_for_the_worthy,
created_on=created_on, styles=world_styles, backgrounds=backgrounds,
is_tenth_anniversary=is_tenth_anniversary, created_on=created_on, styles=world_styles, backgrounds=backgrounds,
spawn_point=spawn_point, underground_level=underground_level, cavern_level=cavern_level,
time=time, events=events, dungeon_point=dungeon_point, world_evil=world_evil,
saved_npcs=saved_npcs, altars_smashed=altars_smashed, is_hardmode=is_hardmode,