Example #1
0
 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
Example #2
0
 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
Example #3
0
 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
Example #4
0
 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
Example #5
0
 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]