Skip to content

Commit

Permalink
feat: assemble gunslinger colab chapters
Browse files Browse the repository at this point in the history
Also add support for <回忆> tag.
  • Loading branch information
gudzpoz committed Jul 4, 2024
1 parent d2b1db8 commit d09314b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 15 deletions.
2 changes: 1 addition & 1 deletion unpack/downloader
Submodule downloader updated 1 files
+1 −0 downloader.py
6 changes: 3 additions & 3 deletions unpack/downloader.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/downloader.py b/downloader.py
index f81ca28..e5b6536 100644
index 663194b..7879b7d 100644
--- a/downloader.py
+++ b/downloader.py
@@ -139,6 +139,20 @@ if __name__ == "__main__":
@@ -140,6 +140,20 @@ if __name__ == "__main__":
res_path = os.path.join(
out_dir, abname if config["use_abname"] else resname
)
Expand All @@ -23,7 +23,7 @@ index f81ca28..e5b6536 100644
if os.path.exists(res_path):
if os.path.getsize(res_path) == size:
logger.info(f"File {resname} already exists, thus will be skipped")
@@ -155,6 +169,8 @@ if __name__ == "__main__":
@@ -156,6 +170,8 @@ if __name__ == "__main__":
res_path = os.path.join(
out_dir, abname if config["use_abname"] else resname
)
Expand Down
43 changes: 33 additions & 10 deletions unpack/src/gfunpack/manual_chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,25 @@ def _extra_stories_sac2045():
]


def _extra_stories_gunslinger():
return [
('第九号', '', ['-38-0-1.txt']),
('万花筒', '1', ['-38-1-1.txt']),
('新叉子', '2/2战斗', ['-38-2-1.txt', '-38-2-2first.txt', '-38-2-2round.txt', '-38-2-2end.txt']),
('薄暮的星星', '2幕间', ['-38-2-3.txt']),
('多幕剧Ⅰ', '3', ['-38-3-1.txt']),
('多幕剧Ⅱ', '3/3战斗', ['-38-3-1first.txt', '-38-3-2round.txt', '-38-3-2end.txt']),
('幸福的魔法', '3幕间', ['-38-3-3.txt']),
('公社射击训练场', '', ['battleavg/-38-specialbattletips.txt']),
('不会说谎的匹诺曹Ⅰ', '4/4战斗', ['-38-4-1first.txt', '-38-4-1round.txt']),
('不会说谎的匹诺曹Ⅱ', '4结算剧情', ['-38-4-1end.txt']),
('曾经的庭院Ⅰ', '5/5战斗', ['-38-5-1first.txt', '-38-5-1round.txt']),
('曾经的庭院Ⅱ', '5结算剧情', ['-38-5-1end.txt']),
('Hai capito', '6战斗', ['-38-6-1first.txt', '-38-6-1round.txt', '-38-6-1end.txt']),
('完美和声', '7结局', ['-38-7-1.txt']),
]


_extra_chapters: list[tuple[str, str, str, list]] = [
('-42', 'C.E. 2020 茧中蝶影', '2020', _extra_stories_cocoon()),
('-50', 'C.E. 2022 焙炒爱意', '2022', []),
Expand All @@ -178,7 +197,7 @@ def _extra_stories_sac2045():
('-14,-15', '独法师', '《崩坏学园2》联动内容', []),
('-19,-20,-22', '荣耀日', '《DJMAX RESPECT》联动内容', []),
('-32', '瓦尔哈拉', '《VA-11 HALL-A》联动内容', _extra_stories_va11()),
('-38', '梦间剧', '《神枪少女》联动内容', []),
('-38', '梦间剧', '《神枪少女》联动内容', _extra_stories_gunslinger()),
('-43', '暗金潮', '《全境封锁》联动内容', []),
('-46', '小邪神前线', '《邪神与厨二病少女》联动内容', []),
('-57', '雪浪映花颜', '《佐贺偶像是传奇 卷土重来》联动内容', []),
Expand Down Expand Up @@ -309,14 +328,14 @@ def get_recorded_chapters():
_attached_events: list[tuple[str, Story]] = [
# 裂变链接:吞噬一切的花海-战斗
('-33-42-1first.txt', Story(
name="吞噬一切的花海-战斗",
description="小游戏说明",
name='吞噬一切的花海-战斗',
description='小游戏说明',
files=['battleavg/-33-44-1first.txt'],
)),
# 愚人节
('1-1-1.txt', Story(
name="演习训练-愚人节版",
description="欢迎回来,父亲大人。",
name='演习训练-愚人节版',
description='欢迎回来,父亲大人。',
files=['always-404-1-1-1.txt', 'battleavg/always-404-1-1-2.txt', 'always-404-1-1-3.txt'],
)),
# 里坎禁猎区
Expand Down Expand Up @@ -615,19 +634,23 @@ def get_block_list():
'-65-tips2.txt',
'-404-ext-1-1.txt',
# 飓风营救复刻 (-45 -> -24)
"-45-ext-04.txt",
"-45-ext-01.txt",
"-45-ext-02.txt",
"-45-ext-03.txt",
'-45-ext-04.txt',
'-45-ext-01.txt',
'-45-ext-02.txt',
'-45-ext-03.txt',

# 盲拆法则:这些是英文版
'-7-1-4-point3498.txt',
'-7-2-4-point3342.txt',
'-7-3-4-point3533.txt',
'-7-4-4-point3612.txt',

# 神枪少女联动,和 -38-ex-point91829.txt 内容一样
# 神枪少女联动,玩法说明而已
'-38-ex-point91820.txt',
'-38-ex-point91829.txt',
'-38-ex1-5-point91849.txt',
'-38-ex1-2-point91865.txt',
'-38-2-4first.txt', # 和 '-38-2-1.txt', '-38-2-2first.txt' 重复,用了修了错别字的版本

# 一币之遥,游戏提示
'-49-3-1-point94780.txt',
Expand Down
12 changes: 11 additions & 1 deletion unpack/src/gfunpack/stories.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def _generate_bg_line(self, bg: str, effects: dict[str, str]):
if bg_path is None or bg_path == '':
_warning('background not found for `%s` in %s', bg, self.filename)
bg_path = f'background/{bg}.png'
self._update_class('night', 'night' in effects)
night = 'night' if 'night' in effects else '!night'
self._resources.add(f'/images/{bg_path}')
return f':background[] :classes[{night}] /images/{bg_path}'
Expand Down Expand Up @@ -290,10 +291,19 @@ def _process_effects(self, effect_string: str):
continue
self._markdown.append(self._generate_bg_line(cg.strip(), effects))
self._markdown.append('……' * i)

# 一众的蒙版效果
if '回忆' in effects:
self._update_class('memories', True)
# 关闭所有蒙版效果
if '关闭蒙版' in effects:
self._update_class('memories', False)
self._update_class('night', False)

# 没猜错的和,这两个都是永久性黑屏,直至新的背景出现
if '黑屏1' in effects or '黑点1' in effects:
self._update_class('blank', True)
# 没猜错的和,这两个都是暂时性黑屏,一定时间后消失
# 没猜错的话,这两个都是暂时性黑屏,一定时间后消失
# 但的确不知道黑屏会不会挡住角色
if '黑屏2' in effects or '黑点2' in effects:
self._update_class('blank', False)
Expand Down

0 comments on commit d09314b

Please sign in to comment.