Classes and Methods
A library for data mining the game Cassette Beasts.
- class cbpickaxe.Animation(frames: List[Frame], frame_tags: List[FrameTag], image: str)
An animated sprite consisting of a set of frames with several tags indicating types of animations (ex. idle, attack, hurt),
- frames: List[Frame]
Frames that make up the animations. Can be indexed into using the frame ids stored in FrameTags.
- static from_scn(input_stream: IO[bytes]) Animation
Reads in an Animation from the given Godot scn file input stream.
- get_frame(animation_name: str, frame_offset: int) Frame
Returns the frame at the given offset within the animation with the given name.
- image: str
Relative filepath to the sprite sheet image for the animation.
- class cbpickaxe.Box(x: int, y: int, width: int, height: int)
A rectangular region of an image.
- height: int
Height of the Box.
- width: int
Width of the Box.
- x: int
Left-most position of the Box.
- y: int
Upper-most position of the Box.
- class cbpickaxe.Color(red: float, green: float, blue: float, alpha: float)
A RGBA color.
Exists primarily to be a JSON serializable alternative to godot_parser's Color class.
- alpha: float
Alpha/opacity of the color in the range of [0.0, 1.0], where 1.0 indicates fully opaque and 0.0 indicates fully transparent.
- blue: float
Blue component in the range of [0.0, 1.0].
- static from_gp(original: Color) Color
Converts the given godot_parser Color into a cbpickaxe Color.
- green: float
Green component in the range of [0.0, 1.0].
- red: float
Red component in the range of [0.0, 1.0].
- to_8bit_rgba() Tuple[int, int, int, int]
Converts the color to an RGBA tuple where each color value is in the range [0, 255].
- class cbpickaxe.ElementalType(palette: List[Color])
An elemental type.
- static from_tres(input_stream: IO[str]) ElementalType
Parses an ElementalType from the given Godot ".tres" input stream.
- class cbpickaxe.Evolution(name: str, evolved_form: str, required_tape_grade: int, min_hour: float, max_hour: float, required_location: str | None, specialization: str | None, is_secret: bool)
A remastering that a monster tape can undergo.
- max_hour: float
Maximum in-game hour for the remaster to be able to occur. (maximum of 24.0)
- min_hour: float
Minimum in-game hour for the remaster to be able to occur. (minimum of 0.0)
- name: str
Internal name of the remaster. Typically the English name of the remastered form.
- required_tape_grade: int
Grade that the monster needs to be at in order to remaster. (typically 5)
- specialization: str | None
String ID of the specialization choice to have the monster engage in this remaster.
- class cbpickaxe.FrameTag(name: str, start_frame: int, end_frame: int)
A tag descripting the frames of an animation.
- end_frame: int
Id of the last frame that makes up the animation.
- name: str
Name of the FrameTag, typically the name of the animation (ex. "idle").
- start_frame: int
Id of the first frame that makes up the animation.
- class cbpickaxe.Hoylake(default_locale: str | None = None)
A class that handles loading in data files from the decompiled game.
- get_locales() Set[str]
Returns a set of the locales (languages) that translation files have been loaded in for.
- get_monster_forms_by_tags(tags: Iterable[str], include_any: bool = True) Dict[str, Tuple[str, MonsterForm]]
Returns all of the monster forms that have any of the given tags.
- get_moves_by_tags(tags: Iterable[str]) Dict[str, Tuple[str, Move]]
Returns all of the moves that have any of the given tags.
- load_animation(path: str) Animation
Loads in the animation at the given res:// filepath.
Must have loaded at least one root before running.
If there is no animation file at that location in any of the loaded root directories, then a ValueError will be raised.
- load_elemental_type(path: str) Tuple[str, ElementalType]
Loads in the elemental type at the given res:// filepath.
Must have loaded at least one root before running.
If there is no elemental type file at that location in any of the loaded root directories, then a ValueError will be raised.
- load_item(path: str) Tuple[str, Item]
Loads in the item at the given res:// filepath.
Must have loaded at least one root before running.
If there is no item file at that location in any of the loaded root directories, then a ValueError will be raised.
- load_items(path: str) Dict[str, Tuple[str, Item]]
Loads in all of the items within the given res:// directory path.
Looks for that path in all of the loaded root directories.
Must have loaded at least one root before running.
- load_monster_form(path: str) Tuple[str, MonsterForm]
Loads in the monster form at the given res:// filepath.
Must have loaded at least one root before running.
If there is no monster form file at that location in any of the loaded root directories, then a ValueError will be raised.
- load_monster_forms(path: str) Dict[str, Tuple[str, MonsterForm]]
Loads in all of the monster forms within the given res:// directory path.
Looks for that path in all of the loaded root directories.
Must have loaded at least one root before running.
- load_move(path: str) Tuple[str, Move]
Loads in the move at the given res:// filepath.
Must have loaded at least one root before running.
If there is no move file at that location in any of the loaded root directories, then a ValueError will be raised.
- load_moves(path: str) Dict[str, Tuple[str, Move]]
Loads in all of the moves within the given res:// directory path.
Looks for that path in all of the loaded root directories.
Must have loaded at least one root before running.
- load_root(name: str, new_root: str | PathLike) None
Adds the given root directory to the list of known root directories.
Can be called multiple times in order to load multiple root directories (ex. base game, DLC, mods).
Must be run at least once before loading in any files (ex. monster forms).
- lookup_filepath(path: str) Path
Returns a real filesystem path to the file at the given res:// path.
If there is no file at that location in any of the loaded root directories, then a ValueError will be raised.
- translate(string: str, locale: str | None = None) str
Translates the given string to the specified locale. Locale defaults to English (en).
Must have loaded at least one root before running.
If the string is not found for the given locale in any of the translation tables in any of the loaded root directories, then the given string will be returned.
If no translation tables have been loaded for the given locale, then a ValueError will be raised.
- class cbpickaxe.Item(name: str, description: str, category: str, icon: str | None)
An item that the player can obtain.
- description: str
String ID of the description of the item.
- static from_tres(input_stream: IO[str]) Item
Parses an Item from the given Godot ".tres" input stream.
- name: str
String ID of the name of the item.
- class cbpickaxe.MonsterForm(name: str, swap_colors: List[Color], default_palette: List[Color], emission_palette: List[Color], battle_cry: str | None, elemental_types: List[str], exp_yield: int, require_dlc: str, pronouns: int, description: str, max_hp: int, melee_attack: int, melee_defense: int, ranged_attack: int, ranged_defense: int, speed: int, accuracy: int, evasion: int, max_ap: int, move_slots: int, evolutions: List[Evolution], bestiary_index: int, move_tags: List[str], battle_sprite_path: str, tape_upgrades: List[TapeUpgrade | str], bestiary_bios: List[str])
A monster form (species).
- accuracy: int
Base accuracy value. (typically 100)
- bestiary_bios: List[str]
List of string ids for the monster's bestiary entries. Typically a list of two string ids.
- bestiary_index: int
Bestiary index. Natural numbers for main-game monsters. -1 for DLC and mod-added monsters.
- description: str
String ID of the monster's description.
- elemental_types: List[str]
Elemental types of the monster. Typically only one, but can be empty or have multiple.
- evasion: int
Base evasion value. (typically 100)
- exp_yield: int
Value used in calculating the exp the monster yields when defeated in battle. (typically 40)
- static from_tres(input_stream: IO[str]) MonsterForm
Parses a MonsterForm from the given Godot ".tres" input stream.
- max_ap: int
Maximum amount of AP the monster can have in battle.
- max_hp: int
Base max HP stat value.
- property max_move_slots: int
The maximum number of move slots monsters of this form can have (ex. when at grade 5).
- melee_attack: int
Base melee attack stat value.
- melee_defense: int
Base melee defense stat value.
- move_slots: int
Number of move slots the monster has at base grade.
- move_tags: List[str]
List of tags that the monster can equip moves of. (Note that all monsters can also equip stickers with the "all" tag, which is not included in this list)
- name: str
String ID of the name of the monster.
- ranged_attack: int
Base ranged attack stat value.
- ranged_defense: int
Base ranged defense stat value.
- require_dlc: str
DLC that the monster requires. Empty if no DLC is required.
- speed: int
Base speed stat value.
- tape_upgrades: List[TapeUpgrade | str]
Events that occur when the monster form increases its grade.
- class cbpickaxe.Move(name: str, category_name: str, description: str, cost: int, is_passive_only: bool, power: int, accuracy: int, unavoidable: bool, target_type: TargetType, min_hits: int, max_hits: int, can_be_copied: bool, priority: int, tags: List[str], elemental_types: List[str])
A move / sticker that monsters can use in battle.
- accuracy: int
Accuracy of the move.
- cost: int
AP cost of the move.
- description: str
String ID of the description of the move.
- elemental_types: List[str]
Type(s) of the move.
- static from_tres(input_stream: IO[str]) Move
Parses a Move from the given Godot ".tres" input stream.
- is_passive_only: bool
If True, then the move only has a passive effect.
- name: str
String ID of the name of the move.
- power: int
Power of the move.
- tags: List[str]
Tags that determine which monsters can use the move.
If True, then the move is unavoidable, and thus guarenteed to hit.
- class cbpickaxe.TapeUpgrade(name: str, add_slot: bool, sticker: str)
An activity that occurs when a monster tape reaches a specific grade level.
- add_slot: bool
If True, then the monster gets one additional sticker slot during this upgrade.
- static from_sub_resource(scene: GDFile, sub_resource: GDSubResourceSection) TapeUpgrade
Parses the given sub resource into a TapeUpgrade.
- name: str
Internal name of the upgrade.
- class cbpickaxe.TranslationTable(hashes: List[int], buckets: List[int], strings: List[bytes])
Key value mapping of in-game string ids to localized strings.
This mapping does not store the strings, because the Godot ".translation" files that we load the data from do not store they keys. Thos files only store hashes of the keys, hash buckets for looking up the localized strings, and the localized strings.
- static from_translation(input_stream: IO[bytes]) Tuple[TranslationTable, str]
Creates a TranslationTable from the given binary input stream of a Godot ".translation" file.
Returns both the table and the locale. The locale defaults to English (en) if no locale is listed in the given ".translation" file.
- get(key: str, default: str | None = None) str
Looks up the translation of the given string id.
If the given string id is not found and a default value was provided, then the default value will be returned.