def settings_yml_rep(self, include_colors=False): out = {EbEventFlagTableEntry.name: EbEventFlagTableEntry.to_yml_rep(self.flag), SpritePaletteIdTableEntry.name: SpritePaletteIdTableEntry.to_yml_rep(self.sprite_palette_id), FlashEffectTableEntry.name: FlashEffectTableEntry.to_yml_rep(self.flash_effect)} if include_colors: out["Colors"] = str(self) if self.flag != 0: out["Event Palette"] = self.flag_palette.settings_yml_rep(include_colors=True) return out
def yml_rep(self): out = super(Door, self).yml_rep() out["Type"] = DoorType.tostring(DoorType.DOOR) out["Text Pointer"] = self.text_pointer.yml_rep() out["Event Flag"] = EbEventFlagTableEntry.to_yml_rep(self.flag) out["Destination X"] = self.destination_x out["Destination Y"] = self.destination_y try: out["Direction"] = DestinationDirection.tostring(self.destination_direction) except InvalidArgumentError: raise InvalidUserDataError("Door had invalid destination direction of %#x" % self.destination_direction) out["Style"] = self.destination_style return out
def yml_rep(self): out = super(SwitchDoor, self).yml_rep() out["Type"] = DoorType.tostring(DoorType.SWITCH) out["Event Flag"] = EbEventFlagTableEntry.to_yml_rep(self.flag) out["Text Pointer"] = self.text_pointer.yml_rep() return out
def to_yml_rep(cls, value): return [{EbEventFlagTableEntry.name: EbEventFlagTableEntry.to_yml_rep(flag), "Tile Changes": [MapEventSubTableEntry.to_yml_rep(tile_change) for tile_change in tile_changes]} for flag, tile_changes in value]