Giter Site home page Giter Site logo

fieryhenry / tbcml Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 47.94 MB

A python library designed to make modding The Battle Cats easier, more automated, and more powerful

License: MIT License

Python 93.87% Smali 1.78% JavaScript 0.74% Java 0.80% HTML 2.81%
battle-cats hacking modding

tbcml's Introduction

Hi there I'm fieryhenry

I do hacking and modding stuff with the mobile game The Battle Cats

ko-fi

Here's a list of a few of my projects:

tbcml's People

Contributors

dependabot[bot] avatar enderelijas avatar fieryhenry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tbcml's Issues

iOS ipa support?

current tbcml cannot modify ios battlecats (.ipa file), do you have plan to support ios?

Both Android and iOS bc app structure are similar.
all things in assets folder in apk are also in the ipa file.
So we can change logo, datapacks, html…

It could be hard to implement all features like mailboxhack or libc modifications (antiban)

Failed to pack APK

Here's the log.

Failed to pack APK: I: Using Apktool 2.7.0
brut.directory.DirectoryException: java.nio.file.NoSuchFileException: C:\Users\gatli\AppData\Roaming\tbcml\APKs\12.5.0en\extracted

Failed to sign APK: Enter Passphrase for keystore: jarsigner: unable to open jar file: C:\Users\gatli\AppData\Roaming\tbcml\APKs\12.5.0en\jp.co.ponos.battlecatsen-modded.apk

Is there something I either did wrong or is this a bug?

ValueError: bad transparency mask

Calling the format_deploy_icon() method as shown below, throws a ValueError: bad transparency mask.

Code causing error

enemy = Enemies.from_game_data(self.game_data).get_enemy(8)
enemy_model = enemy.get_anim().model
enemy_icon = enemy.get_enemy_icon()
        
cat_model = CatModel.create_empty(self.id, CatFormType.FIRST)
cat_model.model = enemy_model.copy()
cat_model.model.flip_x()
cat_model.model.set_unit_form(cat_model.form.value)
cat_model.set_cat_id(self.id)

form = CatForm(self.id, CatFormType.FIRST, anim=cat_model)
form.import_enemy(enemy)

form.stats.cost = 0
form.deploy_icon = enemy_icon
form.format_deploy_icon()

Method error chain

# cats.py line 835
def format_deploy_icon(self):
        deploy_icon = self.get_deploy_icon()
        if deploy_icon.width == 128 and deploy_icon.height == 128:
            return
        base_image = core.BCImage.from_size(128, 128)
        base_image.paste(deploy_icon, 9, 21)
        self.deploy_icon = base_image
# bc_image.py line 130
def paste(self, image: "BCImage", x: int, y: int):
        self.image.paste(image.image, (x, y), image.image)

Trouble on Android

Tried putting in this script:
from tbcml.core import (
CountryCode,
GameVersion,
Apk,
GamePacks,
Mod,
ModEdit,
CatFormType,
Cat,
CatForm,
)

cc = CountryCode.EN

gv = GameVersion.from_string("12.3.0")

apk = Apk(gv, cc)
apk.download()
apk.extract()

apk.download_server_files()
apk.copy_server_files()

game_packs = GamePacks.from_apk(apk)

mod_id = Mod.create_mod_id()

mod = Mod(
name="Test Mod",
author="Test Author",
description="Test Description",
mod_id=mod_id,
mod_version="1.0.0",
password="test",
)

cat_id = 0
cat_form_type = CatFormType.FIRST

form = CatForm(cat_id, cat_form_type, name="Test Cat")

cat = Cat(cat_id)

cat.set_form(cat_form_type, form)

mod_edit = ModEdit(["cats", cat_id], cat.to_dict())

mod.add_mod_edit(mod_edit)

apk.load_mods([mod], game_packs)

print(apk.get_final_apk_path())

and ended with this in Termux:
Traceback (most recent call last):
File "/storage/emulated/0/download/bcml/script.py", line 1, in
from tbcml.core import (
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/tbcml/init.py", line 1, in
from tbcml import core
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/tbcml/core/init.py", line 111, in
from .io.bc_csv import CSV, Delimeter, to_str
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/tbcml/core/io/init.py", line 1, in
from tbcml.core.io import (
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/tbcml/core/io/bc_image.py", line 4, in
from PyQt5.QtGui import QImage, QIcon, QPixmap
ModuleNotFoundError: No module named 'PyQt5'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.