Item flag printer: Fix beamos item flags not being printed
@@ -285,12 +285,10 @@ def print_all_used_item_pickup_flags(self):
actors += dzx.entries_by_type_and_layer("TGDR", layer)
for actor in actors:
- if not hasattr(actor, "item_pickup_flag"):
- # Some hacky code to try to look for unknown params that are item pickup flags:
- #if stage_id == 3: # DRC
- # for i in range(1, 20):
- # param_name = "unknown_param_%d" % i
- # if hasattr(actor, param_name):
+ for attr_name in actor.param_fields:
+ #if attr_name.startswith("unknown_param_"):
+ # # Some hacky code to try to look for unknown params that are item pickup flags.
+ # if stage_id == 3:
# class_name = DataTables.actor_name_to_class_name[actor.name]
# param_fields = DataTables.actor_parameters[class_name]
# params_bitfield_name, mask = param_fields[param_name]
@@ -299,10 +297,11 @@ def print_all_used_item_pickup_flags(self):
# continue
# if getattr(actor, param_name) == 5:
# print("!!!! %s %s %s" % (actor.name, param_name, arc_path))
+ #
+ # continue
- continue
-
- item_flag = actor.item_pickup_flag & 0x7F
+ if "item_pickup_flag" in attr_name:
+ item_flag = getattr(actor, attr_name) & 0x7F
if item_flag == 0x7F:
continue
@@ -310,11 +309,16 @@ def print_all_used_item_pickup_flags(self):
if class_name in ["d_a_item", "d_a_race_item", "d_a_tag_kb_item"]:
item_name = self.item_names[actor.item_id]
- elif class_name in ["d_a_tsubo", "d_a_switem", "d_a_obj_barrel2", "d_a_obj_movebox", "d_a_obj_bemos", "d_a_obj_homen", "d_a_stone", "d_a_stone2"]:
+ elif class_name in ["d_a_tsubo", "d_a_switem", "d_a_obj_barrel2", "d_a_obj_movebox", "d_a_obj_homen", "d_a_stone", "d_a_stone2"]:
if actor.item_id < 0x20:
item_name = self.item_names[actor.item_id]
else:
item_name = "Random drop type 0x%02X" % (actor.item_id - 0x20)
+ elif class_name == "d_a_obj_bemos":
+ if actor.beamos_item_id < 0x20:
+ item_name = self.item_names[actor.beamos_item_id]
+ else:
+ item_name = "Random drop type 0x%02X" % (actor.item_id - 0x20)
elif class_name == "d_a_deku_item":
item_name = self.item_names[0x34]
else:
