bcsfe-wrapper-python 0.1.20__py3-none-any.whl → 0.1.22__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 +48 -13
- {bcsfe_wrapper_python-0.1.20.dist-info → bcsfe_wrapper_python-0.1.22.dist-info}/METADATA +1 -1
- {bcsfe_wrapper_python-0.1.20.dist-info → bcsfe_wrapper_python-0.1.22.dist-info}/RECORD +5 -5
- {bcsfe_wrapper_python-0.1.20.dist-info → bcsfe_wrapper_python-0.1.22.dist-info}/WHEEL +0 -0
- {bcsfe_wrapper_python-0.1.20.dist-info → bcsfe_wrapper_python-0.1.22.dist-info}/top_level.txt +0 -0
bcsfe_wrapper/wrapper.py
CHANGED
|
@@ -64,7 +64,13 @@ class BCSFEWrapper:
|
|
|
64
64
|
codes = handler.get_codes()
|
|
65
65
|
return codes if codes else (None, None)
|
|
66
66
|
|
|
67
|
-
def
|
|
67
|
+
def _check_save(self):
|
|
68
|
+
if self.save_file is None:
|
|
69
|
+
raise RuntimeError("セーブデータが読み込まれていません。先に from_server() などでデータをロードしてください。")
|
|
70
|
+
|
|
71
|
+
def _set_val(self, attr: str, amount: int):
|
|
72
|
+
self._check_save()
|
|
73
|
+
setattr(self.save_file, attr, amount)
|
|
68
74
|
def edit_catfood(self, amount: int): self._set_val("catfood", amount)
|
|
69
75
|
def edit_xp(self, amount: int): self._set_val("xp", amount)
|
|
70
76
|
def edit_normal_tickets(self, amount: int): self._set_val("normal_tickets", amount)
|
|
@@ -75,47 +81,63 @@ class BCSFEWrapper:
|
|
|
75
81
|
def edit_leadership(self, amount: int): self._set_val("leadership", amount)
|
|
76
82
|
|
|
77
83
|
def edit_battle_items(self, amount: int):
|
|
84
|
+
self._check_save()
|
|
78
85
|
for item in self.save_file.battle_items.items: item.amount = amount
|
|
79
86
|
def edit_catseyes(self, amount: int):
|
|
87
|
+
self._check_save()
|
|
80
88
|
for i in range(len(self.save_file.catseyes)): self.save_file.catseyes[i] = amount
|
|
81
89
|
def edit_catfruit(self, amount: int):
|
|
90
|
+
self._check_save()
|
|
82
91
|
for i in range(len(self.save_file.catfruit)): self.save_file.catfruit[i] = amount
|
|
83
92
|
|
|
84
93
|
def unlock_cats(self, cat_ids: List[int]):
|
|
94
|
+
self._check_save()
|
|
85
95
|
for cid in cat_ids:
|
|
86
|
-
|
|
96
|
+
internal_id = cid - 1
|
|
97
|
+
cat = self.save_file.cats.get_cat_by_id(internal_id)
|
|
87
98
|
if cat: cat.unlock(self.save_file)
|
|
88
99
|
def unlock_all_cats(self):
|
|
100
|
+
self._check_save()
|
|
89
101
|
for cat in self.save_file.cats.cats: cat.unlock(self.save_file)
|
|
90
102
|
|
|
91
|
-
# 新機能: 指定キャラ削除(未解放に戻す)
|
|
92
103
|
def remove_cats(self, cat_ids: List[int]):
|
|
104
|
+
self._check_save()
|
|
93
105
|
for cid in cat_ids:
|
|
94
|
-
|
|
106
|
+
internal_id = cid - 1
|
|
107
|
+
cat = self.save_file.cats.get_cat_by_id(internal_id)
|
|
95
108
|
if cat: cat.set_unlocked(False)
|
|
96
109
|
|
|
97
110
|
def upgrade_cats(self, cat_ids: List[int], base: int = 19, plus: int = 0):
|
|
111
|
+
self._check_save()
|
|
98
112
|
for cid in cat_ids:
|
|
99
|
-
|
|
113
|
+
internal_id = cid - 1
|
|
114
|
+
cat = self.save_file.cats.get_cat_by_id(internal_id)
|
|
100
115
|
if cat: cat.upgrade.base, cat.upgrade.plus = base, plus
|
|
101
116
|
def upgrade_all_cats(self, base: Optional[int] = None, plus: Optional[int] = None):
|
|
117
|
+
self._check_save()
|
|
102
118
|
for cat in self.save_file.cats.cats:
|
|
103
119
|
if not cat.is_unlocked(self.save_file): continue
|
|
104
120
|
power_up = core.PowerUpHelper(cat, self.save_file)
|
|
105
121
|
cat.upgrade.base = (base if base is not None else power_up.get_max_possible_base()) - 1
|
|
106
122
|
cat.upgrade.plus = plus if plus is not None else power_up.get_max_possible_plus()
|
|
107
123
|
def set_cat_form(self, cat_ids: List[int], form: int = 2):
|
|
124
|
+
self._check_save()
|
|
108
125
|
for cid in cat_ids:
|
|
109
|
-
|
|
126
|
+
internal_id = cid - 1
|
|
127
|
+
cat = self.save_file.cats.get_cat_by_id(internal_id)
|
|
110
128
|
if cat: cat.set_form(form)
|
|
111
129
|
def true_form_all_cats(self):
|
|
130
|
+
self._check_save()
|
|
112
131
|
cats = self.save_file.cats.get_unlocked_cats()
|
|
113
132
|
self.save_file.cats.true_form_cats(self.save_file, cats, True, True)
|
|
114
133
|
self.save_file.cats.fourth_form_cats(self.save_file, cats, True, True)
|
|
115
134
|
|
|
116
|
-
def clear_tutorial(self):
|
|
135
|
+
def clear_tutorial(self):
|
|
136
|
+
self._check_save()
|
|
137
|
+
edits.clear_tutorial.clear_tutorial(self.save_file, False)
|
|
117
138
|
|
|
118
139
|
def _clear_chapter_group(self, chapters_obj, chapters_to_clear: List[int]):
|
|
140
|
+
self._check_save()
|
|
119
141
|
for c_id in chapters_to_clear:
|
|
120
142
|
if c_id < len(chapters_obj.chapters):
|
|
121
143
|
chapter = chapters_obj.chapters[c_id]
|
|
@@ -123,13 +145,17 @@ class BCSFEWrapper:
|
|
|
123
145
|
for stage in chapter.stages: stage.treasure = 3
|
|
124
146
|
|
|
125
147
|
def clear_empire_of_cats(self, chapters: List[int] = [0, 1, 2]):
|
|
148
|
+
self._check_save()
|
|
126
149
|
self._clear_chapter_group(self.save_file.story.chapters, chapters)
|
|
127
150
|
def clear_into_the_future(self, chapters: List[int] = [0, 1, 2]):
|
|
151
|
+
self._check_save()
|
|
128
152
|
self._clear_chapter_group(self.save_file.story.chapters, [c + 3 for c in chapters])
|
|
129
153
|
def clear_cats_of_the_cosmos(self, chapters: List[int] = [0, 1, 2]):
|
|
154
|
+
self._check_save()
|
|
130
155
|
self._clear_chapter_group(self.save_file.story.chapters, [c + 6 for c in chapters])
|
|
131
156
|
|
|
132
157
|
def _clear_legend_group(self, legend_obj, max_star: int = 1):
|
|
158
|
+
self._check_save()
|
|
133
159
|
for map_id in range(len(legend_obj.chapters)):
|
|
134
160
|
for star in range(min(max_star, legend_obj.get_total_stars(map_id))):
|
|
135
161
|
for stage_id in range(legend_obj.get_total_stages(map_id, star)):
|
|
@@ -140,22 +166,28 @@ class BCSFEWrapper:
|
|
|
140
166
|
def clear_zero_legends(self, max_star: int = 1): self._clear_legend_group(self.save_file.zero_legends, max_star)
|
|
141
167
|
|
|
142
168
|
def clear_zombie_outbreaks(self, chapters: List[int] = [0, 1, 2, 3, 4, 5, 6, 7, 8]):
|
|
169
|
+
self._check_save()
|
|
143
170
|
for chapter_id in chapters:
|
|
144
171
|
for stage_id in range(48):
|
|
145
172
|
self.save_file.outbreaks.clear_outbreak(chapter_id, stage_id, True)
|
|
146
173
|
|
|
147
|
-
def unlock_aku_realm(self):
|
|
174
|
+
def unlock_aku_realm(self):
|
|
175
|
+
self._check_save()
|
|
176
|
+
edits.aku_realm.unlock_aku_realm(self.save_file)
|
|
148
177
|
|
|
149
178
|
def unlock_all_medals(self):
|
|
179
|
+
self._check_save()
|
|
150
180
|
for i in range(len(self.save_file.medals.medals)):
|
|
151
181
|
self.save_file.medals.medals[i] = True
|
|
152
182
|
|
|
153
183
|
def claim_all_stamps(self):
|
|
184
|
+
self._check_save()
|
|
154
185
|
for stamp in self.save_file.stamps.stamps:
|
|
155
186
|
stamp.received = True
|
|
156
187
|
stamp.current_stamp = stamp.total_stamps
|
|
157
188
|
|
|
158
189
|
def legend_all_gamatoto_members(self):
|
|
190
|
+
self._check_save()
|
|
159
191
|
members_name = core.core_data.get_gamatoto_members_name(self.save_file)
|
|
160
192
|
legend_ids = [m.member_id for m in members_name.members if m.rarity == 2]
|
|
161
193
|
if not legend_ids: return
|
|
@@ -163,6 +195,7 @@ class BCSFEWrapper:
|
|
|
163
195
|
helper.id = random.choice(legend_ids)
|
|
164
196
|
|
|
165
197
|
def complete_all_treasures(self, groups: List[int] = [0, 1, 2]):
|
|
198
|
+
self._check_save()
|
|
166
199
|
for group_id in groups:
|
|
167
200
|
start, end = group_id * 3, (group_id + 1) * 3
|
|
168
201
|
for c_id in range(start, end):
|
|
@@ -171,30 +204,32 @@ class BCSFEWrapper:
|
|
|
171
204
|
for stage in chapter.stages: stage.treasure = 3
|
|
172
205
|
|
|
173
206
|
def max_all_upgrades(self):
|
|
207
|
+
self._check_save()
|
|
174
208
|
for upgrade in self.save_file.upgrades.upgrades:
|
|
175
209
|
upgrade.base = upgrade.max_base
|
|
176
210
|
upgrade.plus = upgrade.max_plus
|
|
177
211
|
|
|
178
|
-
# 新機能: 施設レベルの個別指定
|
|
179
212
|
def edit_upgrade_level(self, upgrade_id: int, base: Optional[int] = None, plus: Optional[int] = None):
|
|
180
|
-
|
|
181
|
-
0:にゃんこ砲攻撃力, 1:射程, 2:チャージ, 3:働きネコ効率, 4:お財布, 5:お城体力, 6:研究, 7:会計, 8:勉強, 9:統率力
|
|
182
|
-
"""
|
|
213
|
+
self._check_save()
|
|
183
214
|
if upgrade_id < len(self.save_file.upgrades.upgrades):
|
|
184
215
|
upgrade = self.save_file.upgrades.upgrades[upgrade_id]
|
|
185
216
|
if base is not None: upgrade.base = base
|
|
186
217
|
if plus is not None: upgrade.plus = plus
|
|
187
218
|
|
|
188
219
|
def instant_complete_activities(self):
|
|
220
|
+
self._check_save()
|
|
189
221
|
self.save_file.gamatoto.expedition.remaining_time = 0
|
|
190
222
|
self.save_file.ototo.developing_remaining_time = 0
|
|
191
223
|
|
|
192
224
|
def max_all_talents(self):
|
|
225
|
+
self._check_save()
|
|
193
226
|
for cat in self.save_file.cats.get_unlocked_cats():
|
|
194
227
|
for talent in cat.talents:
|
|
195
228
|
talent.level = talent.max_level
|
|
196
229
|
|
|
197
|
-
def unban(self):
|
|
230
|
+
def unban(self):
|
|
231
|
+
self._check_save()
|
|
232
|
+
self.save_file.show_ban_message = self.save_file.banned = False
|
|
198
233
|
def get_inquiry_code(self) -> str: return self.save_file.inquiry_code
|
|
199
234
|
def edit_inquiry_code(self, new_code: str): self.save_file.inquiry_code = new_code
|
|
200
235
|
def get_save_file(self) -> core.SaveFile: return self.save_file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
bcsfe_wrapper/__init__.py,sha256=o2LbyVJjuRV1gap8wDbsv39kEUJM1rt8Lq49u1RYYXA,268
|
|
2
|
-
bcsfe_wrapper/wrapper.py,sha256=
|
|
2
|
+
bcsfe_wrapper/wrapper.py,sha256=nffE7JI7jasWAm_-NVWnpLgjCqXi6LVlxHWX6_xhBAc,11081
|
|
3
3
|
bcsfe_wrapper/__pycache__/__init__.cpython-311.pyc,sha256=svMfcdHfIa6yhFBxIuraz6iCJ0ZuMsDRaOFR2NWWC6A,567
|
|
4
4
|
bcsfe_wrapper/__pycache__/wrapper.cpython-311.pyc,sha256=ij4a4EzzZlilVhzc-SB8LHaQKWO3truExx2aGn-coMg,21944
|
|
5
5
|
bcsfe_wrapper/bcsfe/__init__.py,sha256=vCHjSoJq5u684HLQXahhtA64MZWffNHFdhweP7RM0f4,144
|
|
@@ -310,7 +310,7 @@ bcsfe_wrapper/bcsfe/files/locales/vi/edits/treasures.properties,sha256=U9uKsF4y0
|
|
|
310
310
|
bcsfe_wrapper/bcsfe/files/locales/vi/edits/user_rank.properties,sha256=FcldhzKM0UmuhmGzI3dGzxstuKcw-t-gkbmKLZT4VKg,603
|
|
311
311
|
bcsfe_wrapper/bcsfe/files/themes/default.json,sha256=w8eqqd9ATIFwUcvOWTdJjyd1T3LGgUm3iVkJhT5wfEo,392
|
|
312
312
|
bcsfe_wrapper/bcsfe/files/themes/discord.json,sha256=W1dtEev6tap_waHOxvSqENDcMRA9jfBvjW7t-ssdGs4,370
|
|
313
|
-
bcsfe_wrapper_python-0.1.
|
|
314
|
-
bcsfe_wrapper_python-0.1.
|
|
315
|
-
bcsfe_wrapper_python-0.1.
|
|
316
|
-
bcsfe_wrapper_python-0.1.
|
|
313
|
+
bcsfe_wrapper_python-0.1.22.dist-info/METADATA,sha256=WxJ5vOUn3IxTetHnSr0_5MIkxkumbgQY2OkxSmuTK2A,4518
|
|
314
|
+
bcsfe_wrapper_python-0.1.22.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
315
|
+
bcsfe_wrapper_python-0.1.22.dist-info/top_level.txt,sha256=kqyMKpAdNg39_kGGtqsxOSLPIb-qx7R1mQj1hReUsYM,14
|
|
316
|
+
bcsfe_wrapper_python-0.1.22.dist-info/RECORD,,
|
|
File without changes
|
{bcsfe_wrapper_python-0.1.20.dist-info → bcsfe_wrapper_python-0.1.22.dist-info}/top_level.txt
RENAMED
|
File without changes
|