bcsfe-wrapper-python 0.1.6__py3-none-any.whl → 0.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
bcsfe_wrapper/wrapper.py CHANGED
@@ -25,26 +25,20 @@ class BCSFEWrapper:
25
25
  core.set_log_path(data_folder.add("log.txt"))
26
26
  core.core_data.init_data()
27
27
 
28
- # 非対話モードの設定と代替リポジトリの有効化
29
28
  core.core_data.config.set(core.ConfigKey.STRICT_UPGRADE, False)
30
29
  core.core_data.config.set(core.ConfigKey.UPDATE_TO_BETAS, False)
31
- # ユーザー入力を求めないようにするフラグ(もしあれば)
32
30
  core.print_config_err = False
33
31
 
34
32
  @classmethod
35
33
  def from_server(cls, transfer_code: str, confirmation_code: str, cc: str = "jp", gv: str = "13.1.0") -> 'BCSFEWrapper':
36
- dummy_wrapper = cls(b"", cc=cc, gv=gv) # 初期化のために空で作成
37
-
34
+ dummy_wrapper = cls(b"", cc=cc, gv=gv)
38
35
  country_code = core.CountryCode.from_code(cc)
39
36
  game_version = core.GameVersion.from_string(gv)
40
-
41
37
  server_handler, result = core.ServerHandler.from_codes(
42
38
  transfer_code, confirmation_code, country_code, game_version, print=False
43
39
  )
44
-
45
40
  if server_handler is None:
46
41
  raise RuntimeError(f"Download failed. Check your codes or internet connection.")
47
-
48
42
  return cls(server_handler.save_file.to_data().get_bytes(), cc=cc, gv=gv)
49
43
 
50
44
  def save(self, output_path: Optional[str] = None):
@@ -59,14 +53,19 @@ class BCSFEWrapper:
59
53
  return codes
60
54
  return None, None
61
55
 
62
- def edit_catfood(self, amount: int): self.save_file.catfood = amount
63
- def edit_xp(self, amount: int): self.save_file.xp = amount
64
- def edit_normal_tickets(self, amount: int): self.save_file.normal_tickets = amount
65
- def edit_rare_tickets(self, amount: int): self.save_file.rare_tickets = amount
66
- def edit_platinum_tickets(self, amount: int): self.save_file.platinum_tickets = amount
67
- def edit_legend_tickets(self, amount: int): self.save_file.legend_tickets = amount
68
- def edit_np(self, amount: int): self.save_file.np = amount
69
- def edit_leadership(self, amount: int): self.save_file.leadership = amount
56
+ # 制限を無視して設定するための内部メソッド
57
+ def _set_val(self, attr: str, amount: int):
58
+ setattr(self.save_file, attr, amount)
59
+
60
+ def edit_catfood(self, amount: int): self._set_val("catfood", amount)
61
+ def edit_xp(self, amount: int): self._set_val("xp", amount)
62
+ def edit_normal_tickets(self, amount: int): self._set_val("normal_tickets", amount)
63
+ def edit_rare_tickets(self, amount: int): self._set_val("rare_tickets", amount)
64
+ def edit_platinum_tickets(self, amount: int): self._set_val("platinum_tickets", amount)
65
+ def edit_legend_tickets(self, amount: int): self._set_val("legend_tickets", amount)
66
+ def edit_np(self, amount: int): self._set_val("np", amount)
67
+ def edit_leadership(self, amount: int): self._set_val("leadership", amount)
68
+
70
69
  def edit_battle_items(self, amount: int):
71
70
  for item in self.save_file.battle_items.items: item.amount = amount
72
71
  def edit_catseyes(self, amount: int):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcsfe-wrapper-python
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: A Python wrapper for BCSFE-Python to easily interact with Battle Cats save files.
5
5
  Home-page: https://github.com/fieryhenry/BCSFE-Python
6
6
  Author: Manus AI
@@ -1,5 +1,5 @@
1
1
  bcsfe_wrapper/__init__.py,sha256=o2LbyVJjuRV1gap8wDbsv39kEUJM1rt8Lq49u1RYYXA,268
2
- bcsfe_wrapper/wrapper.py,sha256=4qwHNifO5yzFoxWGISE78reMLHXqmpudf-9uv_rm644,5957
2
+ bcsfe_wrapper/wrapper.py,sha256=Fl2XhILwH_BhMizDvsWbNiRA-G2meycZjU0IKdIFG84,5893
3
3
  bcsfe_wrapper/bcsfe/__init__.py,sha256=vCHjSoJq5u684HLQXahhtA64MZWffNHFdhweP7RM0f4,144
4
4
  bcsfe_wrapper/bcsfe/__main__.py,sha256=Dam14Fv6L-tRRufIkIRpr69dM0b2ybU1eALJxIw_eFI,2091
5
5
  bcsfe_wrapper/bcsfe/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -198,7 +198,7 @@ bcsfe_wrapper/bcsfe/files/locales/vi/edits/treasures.properties,sha256=U9uKsF4y0
198
198
  bcsfe_wrapper/bcsfe/files/locales/vi/edits/user_rank.properties,sha256=FcldhzKM0UmuhmGzI3dGzxstuKcw-t-gkbmKLZT4VKg,603
199
199
  bcsfe_wrapper/bcsfe/files/themes/default.json,sha256=w8eqqd9ATIFwUcvOWTdJjyd1T3LGgUm3iVkJhT5wfEo,392
200
200
  bcsfe_wrapper/bcsfe/files/themes/discord.json,sha256=W1dtEev6tap_waHOxvSqENDcMRA9jfBvjW7t-ssdGs4,370
201
- bcsfe_wrapper_python-0.1.6.dist-info/METADATA,sha256=ETnG8qeArkhkECPrrlfeBIFKfkSdTujpi58_5wueVxY,4326
202
- bcsfe_wrapper_python-0.1.6.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
203
- bcsfe_wrapper_python-0.1.6.dist-info/top_level.txt,sha256=kqyMKpAdNg39_kGGtqsxOSLPIb-qx7R1mQj1hReUsYM,14
204
- bcsfe_wrapper_python-0.1.6.dist-info/RECORD,,
201
+ bcsfe_wrapper_python-0.1.7.dist-info/METADATA,sha256=a5eGItff14vKwhtrv88JRfjLGt_rHOre2d3X6jRF6n0,4326
202
+ bcsfe_wrapper_python-0.1.7.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
203
+ bcsfe_wrapper_python-0.1.7.dist-info/top_level.txt,sha256=kqyMKpAdNg39_kGGtqsxOSLPIb-qx7R1mQj1hReUsYM,14
204
+ bcsfe_wrapper_python-0.1.7.dist-info/RECORD,,