更新书店美术资源;完成书店内的基本交互流程

This commit is contained in:
cakipaul 2025-02-14 19:04:21 +08:00
parent e8e5d533a0
commit 5218516d34
29 changed files with 463 additions and 110 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://yvwjasroj4yr"
path="res://.godot/imported/银元.png-6bbd7da0ef5c58c6a0d8da6a2fc0e979.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/prop/c01/银元.png"
dest_files=["res://.godot/imported/银元.png-6bbd7da0ef5c58c6a0d8da6a2fc0e979.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://buu11ukisqfa"
path="res://.godot/imported/e_老板.png-b71754ae0ab3aa1c0984709612bc682c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/scene/c01/s08_书店/e_老板.png"
dest_files=["res://.godot/imported/e_老板.png-b71754ae0ab3aa1c0984709612bc682c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bp4y3vujvsl7r"
path="res://.godot/imported/fg_前景.png-4124b6e03ace8a27f9e212ce366490eb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/scene/c01/s08_书店/fg_前景.png"
dest_files=["res://.godot/imported/fg_前景.png-4124b6e03ace8a27f9e212ce366490eb.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bho8xal4ha50l"
path="res://.godot/imported/l_打光.png-c10d283af7ba03395bd0a1e6892704fb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/scene/c01/s08_书店/l_打光.png"
dest_files=["res://.godot/imported/l_打光.png-c10d283af7ba03395bd0a1e6892704fb.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -2,6 +2,8 @@ keys,zh_CN,en,_character,_notes,_tags
c01_s05_院长房间1,百岁光阴⼀梦蝶,重回⾸往事堪嗟。今⽇春来,明朝花谢。急罚盏夜阑灯灭。,,,, c01_s05_院长房间1,百岁光阴⼀梦蝶,重回⾸往事堪嗟。今⽇春来,明朝花谢。急罚盏夜阑灯灭。,,,,
c01_s05_院长房间2,(疑惑——),,吕萍,, c01_s05_院长房间2,(疑惑——),,吕萍,,
音效_开门,开门,,音效,, 音效_开门,开门,,音效,,
c01_s07_吉祥话1,(吉祥话文本)恭喜发财!,,小孩甲,,
c01_s07_吉祥话2,(吉祥话文本)恭喜!,,小孩乙,,
c01_s01_黑雾_001,“时辰将至,锁魂障眼,自欺欺人”,,雾,note,[#shake] c01_s01_黑雾_001,“时辰将至,锁魂障眼,自欺欺人”,,雾,note,[#shake]
c01_s01_黑雾_002,“孤魂也罢,恶鬼亦然”,,雾,,[#shake] c01_s01_黑雾_002,“孤魂也罢,恶鬼亦然”,,雾,,[#shake]
c01_s01_黑雾_003,“三魂皆不可阙,将它们都带回来吧”,,雾,,[#shake] c01_s01_黑雾_003,“三魂皆不可阙,将它们都带回来吧”,,雾,,[#shake]
@ -23,8 +25,8 @@ c01_s06_谈论鬼差6,(台词设计)啊?可是...,,小蝶,,
c01_s06_谈论鬼差7,(台词设计)开始咯5...4...,,小胖孩,,[#wait=2] c01_s06_谈论鬼差7,(台词设计)开始咯5...4...,,小胖孩,,[#wait=2]
c01_s06_谈论鬼差8,啊!,,小蝶,,[#wait=0.5] c01_s06_谈论鬼差8,啊!,,小蝶,,[#wait=0.5]
c01_s06_谈论鬼差9,(台词设计)3...2...1...,,小胖孩,,[#wait=3] c01_s06_谈论鬼差9,(台词设计)3...2...1...,,小胖孩,,[#wait=3]
c01_s07_吉祥话1,(吉祥话文本)恭喜发财!,,小孩甲,, c01_s08_书店进门老板台词,把报纸放在柜台上吧,,书店老板,,
c01_s07_吉祥话2,(吉祥话文本)恭喜!,,小孩乙,, c01_s08_书店老板任务,(台词设计:安排⼯作,整理书架,有封寄给玩家的信,放在柜台上),,书店老板,,
c01_吕萍与车夫_01,“又是这个梦”,,吕萍,, c01_吕萍与车夫_01,“又是这个梦”,,吕萍,,
c01_吕萍与车夫_02,“这个星期已经第三次了”,,吕萍,, c01_吕萍与车夫_02,“这个星期已经第三次了”,,吕萍,,
c01_吕萍与车夫_03,“我到底是怎么了”,,吕萍,, c01_吕萍与车夫_03,“我到底是怎么了”,,吕萍,,

1 keys zh_CN en _character _notes _tags
2 c01_s05_院长房间1 百岁光阴⼀梦蝶,重回⾸往事堪嗟。今⽇春来,明朝花谢。急罚盏夜阑灯灭。
3 c01_s05_院长房间2 (疑惑——) 吕萍
4 音效_开门 开门 音效
5 c01_s07_吉祥话1 (吉祥话文本)恭喜发财! 小孩甲
6 c01_s07_吉祥话2 (吉祥话文本)恭喜! 小孩乙
7 c01_s01_黑雾_001 “时辰将至,锁魂障眼,自欺欺人” note [#shake]
8 c01_s01_黑雾_002 “孤魂也罢,恶鬼亦然” [#shake]
9 c01_s01_黑雾_003 “三魂皆不可阙,将它们都带回来吧” [#shake]
25 c01_s06_谈论鬼差7 (台词设计)开始咯!5...4... 小胖孩 [#wait=2]
26 c01_s06_谈论鬼差8 啊! 小蝶 [#wait=0.5]
27 c01_s06_谈论鬼差9 (台词设计)3...2...1... 小胖孩 [#wait=3]
28 c01_s07_吉祥话1 c01_s08_书店进门老板台词 (吉祥话文本)恭喜发财! 把报纸放在柜台上吧 小孩甲 书店老板
29 c01_s07_吉祥话2 c01_s08_书店老板任务 (吉祥话文本)恭喜! (台词设计:安排⼯作,整理书架,有封寄给玩家的信,放在柜台上) 小孩乙 书店老板
30 c01_吕萍与车夫_01 “又是这个梦” 吕萍
31 c01_吕萍与车夫_02 “这个星期已经第三次了” 吕萍
32 c01_吕萍与车夫_03 “我到底是怎么了” 吕萍

View File

@ -40,6 +40,14 @@
小胖孩: (台词设计)3...2...1... [#wait=3] [ID:c01_s06_谈论鬼差9] 小胖孩: (台词设计)3...2...1... [#wait=3] [ID:c01_s06_谈论鬼差9]
=> END => END
~ c01_s08_书店进门老板台词
书店老板: 把报纸放在柜台上吧 [ID:c01_s08_书店进门老板台词]
=> END
~ c01_s08_书店老板任务
书店老板: (台词设计:安排⼯作,整理书架,有封寄给玩家的信,放在柜台上) [ID:c01_s08_书店老板任务]
=> END
~ c01_s11_车夫对话1 ~ c01_s11_车夫对话1
吕萍: “又是这个梦” [ID:c01_吕萍与车夫_01] 吕萍: “又是这个梦” [ID:c01_吕萍与车夫_01]

View File

@ -52,8 +52,12 @@ ui_夜行船3,今⽇春来。明朝花谢。,,,,
ui_夜行船4,急罚盏夜阑灯灭。,,,, ui_夜行船4,急罚盏夜阑灯灭。,,,,
ui_夜行船5,夜行船,,,, ui_夜行船5,夜行船,,,,
prop_空手,空手,,,, prop_空手,空手,,,,
prop_令牌,令牌,,,,[#texture=c01/令牌物品.png][#inspect=c01/令牌.png]
prop_信碎片1,信碎片(一),,,,[#texture=c01/信碎片1.png] prop_信碎片1,信碎片(一),,,,[#texture=c01/信碎片1.png]
prop_信碎片2,信碎片(二),,,,[#texture=c01/信碎片1.png]
prop_院长的信,院长的信,,,,[#texture=c01/信碎片1.png]
prop_报纸,报纸,,,,[#texture=c01/信碎片1.png]
prop_银元,银元,,,,[#texture=c01/银元.png]
prop_令牌,令牌,,,,[#texture=c01/令牌物品.png][#inspect=c01/令牌.png]
prop_装有灵魂的令牌,装有灵魂的令牌,,,,[#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png] prop_装有灵魂的令牌,装有灵魂的令牌,,,,[#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png]
prop_火柴,火柴,,,,[#texture=c02/火柴.png] prop_火柴,火柴,,,,[#texture=c02/火柴.png]
prop_小猫玩具的脑袋,小猫玩具的脑袋,Catty's Head,,,[#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png] prop_小猫玩具的脑袋,小猫玩具的脑袋,Catty's Head,,,[#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png]
@ -62,6 +66,8 @@ prop_1012钥匙,1012钥匙,1012 Key,,,[#texture=c02/1012钥匙物品.png][#inspe
prop_老虎钳,老虎钳,,,,[#texture=c02/老虎钳物品.png][#inspect=c02/老虎钳.png] prop_老虎钳,老虎钳,,,,[#texture=c02/老虎钳物品.png][#inspect=c02/老虎钳.png]
prop_3014旋转锁钥匙,3014旋转锁钥匙,,,,[#texture=c02/3014旋转锁钥匙物品.png][#inspect=c02/3014旋转锁钥匙.png] prop_3014旋转锁钥匙,3014旋转锁钥匙,,,,[#texture=c02/3014旋转锁钥匙物品.png][#inspect=c02/3014旋转锁钥匙.png]
prop_小猫玩具完整,小猫玩具,,,,[#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png] prop_小猫玩具完整,小猫玩具,,,,[#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png]
c01_s08_书店工作,我还有工作,,,,
c01_s08_书店工钱,我还有⼯钱没拿,,,,
notes_纸条,纸条,,,, notes_纸条,纸条,,,,
notes_锁住了,锁住了,,,, notes_锁住了,锁住了,,,,
notes_打不开,打不开,,,, notes_打不开,打不开,,,,
@ -83,6 +89,8 @@ c01_s06_小朋友房间,这是其他小朋友的房间,,,,
c01_s07_钱碗,碗⾥是铜钱,,,, c01_s07_钱碗,碗⾥是铜钱,,,,
c01_s07_书店展柜,"好多书... c01_s07_书店展柜,"好多书...
要是能在这里工作就好了",,,, 要是能在这里工作就好了",,,,
c01_s08_书架游戏完成,"这些书怎么变成这样了?
好可惜...我可能需要离开了",,,,
c02_小蝉寻人启事_脸部破碎,"似乎是一张寻人启事 c02_小蝉寻人启事_脸部破碎,"似乎是一张寻人启事
脸的部分被撕掉了,看不清",,,, 脸的部分被撕掉了,看不清",,,,
c02_卫生宣传画,几张卫生宣传画,,,, c02_卫生宣传画,几张卫生宣传画,,,,

1 keys zh_CN en _character _notes _tags
52 ui_夜行船5 夜行船
53 prop_空手 空手
54 prop_令牌 prop_信碎片1 令牌 信碎片(一) [#texture=c01/令牌物品.png][#inspect=c01/令牌.png] [#texture=c01/信碎片1.png]
prop_信碎片1 信碎片(一) [#texture=c01/信碎片1.png]
55 prop_装有灵魂的令牌 prop_信碎片2 装有灵魂的令牌 信碎片(二) [#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png] [#texture=c01/信碎片1.png]
56 prop_院长的信 院长的信 [#texture=c01/信碎片1.png]
57 prop_报纸 报纸 [#texture=c01/信碎片1.png]
58 prop_银元 银元 [#texture=c01/银元.png]
59 prop_令牌 令牌 [#texture=c01/令牌物品.png][#inspect=c01/令牌.png]
60 prop_装有灵魂的令牌 装有灵魂的令牌 [#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png]
61 prop_火柴 火柴 [#texture=c02/火柴.png]
62 prop_小猫玩具的脑袋 小猫玩具的脑袋 Catty's Head [#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png]
63 prop_绳子 绳子 Rope [#texture=c02/绳子物品.png][#inspect=c02/绳子.png]
66 prop_3014旋转锁钥匙 3014旋转锁钥匙 [#texture=c02/3014旋转锁钥匙物品.png][#inspect=c02/3014旋转锁钥匙.png]
67 prop_小猫玩具完整 小猫玩具 [#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png]
68 notes_纸条 c01_s08_书店工作 纸条 我还有工作
69 c01_s08_书店工钱 我还有⼯钱没拿
70 notes_纸条 纸条
71 notes_锁住了 锁住了
72 notes_打不开 打不开
73 notes_干掉的血迹 干掉的血迹
89 c02_小蝉寻人启事_脸部破碎 c01_s08_书架游戏完成 似乎是一张寻人启事 脸的部分被撕掉了,看不清 这些书怎么变成这样了? 好可惜...我可能需要离开了
90 c02_卫生宣传画 c02_小蝉寻人启事_脸部破碎 几张卫生宣传画 似乎是一张寻人启事 脸的部分被撕掉了,看不清
91 c02_老鼠洞 c02_卫生宣传画 一个老鼠洞 在这种楼里挺常见的 几张卫生宣传画
92 c02_老鼠洞 一个老鼠洞 在这种楼里挺常见的
93 c02_十几年前的报纸 十几年前的报纸
94 c02_十几年前的报纸 c02_绳子剪刀 十几年前的报纸 绳子和剪刀
95 c02_绳子剪刀 c02_玩具缺脑袋 绳子和剪刀 这个玩具缺了个脑袋
96 c02_玩具缺脑袋 c02_又是寻人启示 这个玩具缺了个脑袋 又是那张寻人启示

View File

@ -43,8 +43,13 @@
空手 [ID:prop_空手] 空手 [ID:prop_空手]
# texture 路径从 "res://asset/art/prop/" 之后算起 # texture 路径从 "res://asset/art/prop/" 之后算起
# c01 # c01
令牌 [#texture=c01/令牌物品.png][#inspect=c01/令牌.png] [ID:prop_令牌]
信碎片(一) [#texture=c01/信碎片1.png] [ID:prop_信碎片1] 信碎片(一) [#texture=c01/信碎片1.png] [ID:prop_信碎片1]
# TODO 美术资源更换
信碎片(二) [#texture=c01/信碎片1.png] [ID:prop_信碎片2]
院长的信 [#texture=c01/信碎片1.png] [ID:prop_院长的信]
报纸 [#texture=c01/信碎片1.png] [ID:prop_报纸]
银元 [#texture=c01/银元.png] [ID:prop_银元]
令牌 [#texture=c01/令牌物品.png][#inspect=c01/令牌.png] [ID:prop_令牌]
装有灵魂的令牌 [#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png] [ID:prop_装有灵魂的令牌] 装有灵魂的令牌 [#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png] [ID:prop_装有灵魂的令牌]
# c02 # c02
火柴 [#texture=c02/火柴.png] [ID:prop_火柴] 火柴 [#texture=c02/火柴.png] [ID:prop_火柴]
@ -56,6 +61,11 @@
小猫玩具 [#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png] [ID:prop_小猫玩具完整] 小猫玩具 [#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png] [ID:prop_小猫玩具完整]
=> END => END
~ HoldingReason
我还有工作 [ID:c01_s08_书店工作]
我还有⼯钱没拿 [ID:c01_s08_书店工钱]
=> END
~ Notes ~ Notes
# 通用 # 通用
纸条 [ID:notes_纸条] 纸条 [ID:notes_纸条]
@ -80,6 +90,8 @@
# c01-s07 书店外 # c01-s07 书店外
碗⾥是铜钱 [ID:c01_s07_钱碗] 碗⾥是铜钱 [ID:c01_s07_钱碗]
好多书...\n要是能在这里工作就好了 [ID:c01_s07_书店展柜] 好多书...\n要是能在这里工作就好了 [ID:c01_s07_书店展柜]
# c01-s08 书店
这些书怎么变成这样了?\n好可惜...我可能需要离开了 [ID:c01_s08_书架游戏完成]
# c02 # c02
# c02-s01 街道 # c02-s01 街道

View File

@ -3,3 +3,4 @@ c02_张胖子_招呼吕萍5,“来来来,过来,过来”,张胖子,,[#anony
c02_吕萍问方瞎子_2,“祸福在己,当自求;兴衰有数,莫强留”,方瞎子,,[#anonymous], c02_吕萍问方瞎子_2,“祸福在己,当自求;兴衰有数,莫强留”,方瞎子,,[#anonymous],
c01_s07_吉祥话1,(吉祥话文本)恭喜发财!,小孩甲,,, c01_s07_吉祥话1,(吉祥话文本)恭喜发财!,小孩甲,,,
c01_s07_吉祥话2,(吉祥话文本)恭喜!,小孩乙,,, c01_s07_吉祥话2,(吉祥话文本)恭喜!,小孩乙,,,
c01_s12_书店外发钱,发钱了!发赏钱啦!,小孩,,,

1 keys zh_CN _character _notes _tags en
3 c02_吕萍问方瞎子_2 “祸福在己,当自求;兴衰有数,莫强留” 方瞎子 [#anonymous]
4 c01_s07_吉祥话1 (吉祥话文本)恭喜发财! 小孩甲
5 c01_s07_吉祥话2 (吉祥话文本)恭喜! 小孩乙
6 c01_s12_书店外发钱 发钱了!发赏钱啦! 小孩

View File

@ -20,4 +20,8 @@
~ c01_s07_吉祥话2 ~ c01_s07_吉祥话2
小孩乙: (吉祥话文本)恭喜! [ID:c01_s07_吉祥话2] 小孩乙: (吉祥话文本)恭喜! [ID:c01_s07_吉祥话2]
=> END => END
~ c01_s12_诡异的书店外发钱
小孩: 发钱了!发赏钱啦! [ID:c01_s12_书店外发钱]
=> END

View File

@ -82,11 +82,11 @@ func _ready() -> void:
print("Ambush has played, name=", name, " one_shot=", one_shot) print("Ambush has played, name=", name, " one_shot=", one_shot)
if one_shot: if one_shot:
return return
if on_first_enter_tree:
_entered(null)
sign_mark.interacted.connect(_interacted) sign_mark.interacted.connect(_interacted)
area.body_entered.connect(_entered) area.body_entered.connect(_entered)
area.area_entered.connect(_area_entered) area.area_entered.connect(_area_entered)
if on_first_enter_tree:
call_deferred("_do_trigger")
func _check_sign_display(): func _check_sign_display():

View File

@ -28,12 +28,10 @@ var interacted_times: int:
ground_archive.set_pair(name, "interacted_times", val) ground_archive.set_pair(name, "interacted_times", val)
static var item_config_res = preload("res://asset/dialogue/item_description.dialogue") static var item_config_res = preload("res://asset/dialogue/item_description.dialogue")
var items: PackedStringArray
func _ready() -> void: func _ready() -> void:
if Engine.is_editor_hint(): if Engine.is_editor_hint():
_reload_items()
return return
area2d.body_entered.connect(_reset) area2d.body_entered.connect(_reset)
area2d.body_exited.connect(_on_cancel) area2d.body_exited.connect(_on_cancel)
@ -54,26 +52,17 @@ func _check_sign_display():
sign_mark.enabled = false sign_mark.enabled = false
func _reload_items() -> void:
items.clear()
var id = item_config_res.titles["PropItems"]
var current_line = item_config_res.lines[id]
while current_line:
if current_line.has("translation_key"):
items.append(current_line.translation_key)
if not current_line.has("next_id") or current_line.next_id == "end":
break
current_line = item_config_res.lines[current_line.next_id]
notify_property_list_changed()
func _reset(_body = null) -> void: func _reset(_body = null) -> void:
_reset_sign_testure_to_prop()
var prop_hud = SceneManager.get_prop_hud() as PropHud
if not prop_hud.current_item_changed.is_connected(_set_sign_texture_to_prop):
prop_hud.current_item_changed.connect(_set_sign_texture_to_prop)
func _reset_sign_testure_to_prop():
var key = SceneManager.get_current_prop(false) var key = SceneManager.get_current_prop(false)
if key: if key:
_set_sign_texture_to_prop(key) _set_sign_texture_to_prop(key)
var prop_hud = SceneManager.get_prop_hud() as PropHud
if not prop_hud.current_item_changed.is_connected(_set_sign_texture_to_prop):
prop_hud.current_item_changed.connect(_set_sign_texture_to_prop)
# 根据当前 prop调整 sign 所显示的 texture # 根据当前 prop调整 sign 所显示的 texture
@ -124,9 +113,20 @@ func _on_interacted() -> void:
# print("%s interacted with %s. total times: %s" % [name, prop_key, interacted_times]) # print("%s interacted with %s. total times: %s" % [name, prop_key, interacted_times])
interact_mutex.unlock() interact_mutex.unlock()
_check_sign_display() _check_sign_display()
_reset_sign_testure_to_prop()
func _get_property_list() -> Array[Dictionary]: func _get_property_list() -> Array[Dictionary]:
var items = []
if Engine.is_editor_hint():
var id = item_config_res.titles["PropItems"]
var current_line = item_config_res.lines[id]
while current_line:
if current_line.has("translation_key"):
items.append(current_line.translation_key)
if not current_line.has("next_id") or current_line.next_id == "end":
break
current_line = item_config_res.lines[current_line.next_id]
return [ return [
{ {
"name": "prop_key", "name": "prop_key",

View File

@ -84,14 +84,7 @@ func _on_interacted() -> void:
func _show_os(res, title): func _show_os(res, title):
var lines = [] var lines = await DialogueUtil.get_lines(res, title)
var current_line = await res.get_next_dialogue_line(title)
while current_line:
lines.append(current_line)
if current_line.next_id != "end":
current_line = await res.get_next_dialogue_line(current_line.next_id)
else:
break
SceneManager.pop_os(lines) SceneManager.pop_os(lines)
SceneManager.freeze_player(1.0, action) SceneManager.freeze_player(1.0, action)

View File

@ -26,6 +26,9 @@ var target_portal := "none":
# 只在编辑器模式下检查 # 只在编辑器模式下检查
if is_node_ready() and Engine.is_editor_hint(): if is_node_ready() and Engine.is_editor_hint():
_check_sign_mark_and_texture() _check_sign_mark_and_texture()
# holding 意味着当前门禁用,不可传送,需要先完成某些条件
@export var holding := false
@export var holding_reason_key := ""
@export var default_texture: Texture2D @export var default_texture: Texture2D
@export var opened_texture: Texture2D @export var opened_texture: Texture2D
@export var default_sign_texture: Texture2D @export var default_sign_texture: Texture2D
@ -109,6 +112,13 @@ var interact_mutex = Mutex.new()
func _on_interacted() -> void: func _on_interacted() -> void:
if holding:
if holding_reason_key:
var reason = tr(holding_reason_key)
if reason:
var lines = await DialogueUtil.generate_lines(reason)
SceneManager.pop_os(lines)
return
if target_portal == "none" or not enabled: if target_portal == "none" or not enabled:
return return
interact_mutex.lock() interact_mutex.lock()

View File

@ -7,69 +7,168 @@ func _default_data() -> Dictionary:
return {} return {}
var self_game_scene = preload("res://scene/little_game/书架/书架.tscn")
var self_game_node = self_game_scene.instantiate()
var envelope_game_scene = preload("res://scene/little_game/拼凑信件.tscn")
var envelope_game_node = envelope_game_scene.instantiate()
func _ready() -> void: func _ready() -> void:
super._ready() super._ready()
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
game_node.exiting.connect(_on_game_exiting) self_game_node.exiting.connect(_on_self_game_exiting)
game_node.success.connect(_on_game_success) self_game_node.success.connect(_on_self_game_success)
envelope_game_node.exiting.connect(_on_envelope_game_exiting)
envelope_game_node.success.connect(_on_envelope_game_success)
var counter: Interactable2D
var envolope_table: Interactable2D
var ladder: Ambush2D var ladder: Ambush2D
var coin: Ambush2D
var mask: ColorRect var mask: ColorRect
var left_protal: Portal2D
var shelf_game_success = false
var envelope_game_success = false
var manager
var mice
var light: DirectionalLight2D
# 诡异的光效
const WEIRD_COLOR = Color(0.921, 0.43, 0.377)
func _on_ground_ready() -> void: func _on_ground_ready() -> void:
ladder = $"../DeployLayer/Ambush梯子" ladder = $"../DeployLayer/Ambush梯子"
envolope_table = $"../DeployLayer/Interactable信件书桌"
mask = $"../DeployLayer/Mask" mask = $"../DeployLayer/Mask"
var shelf_game_success = ArchiveManager.archive.get_global_value("shelf_game_success") left_protal = $"../DeployLayer/portal_left" as Portal2D
if shelf_game_success: counter = $"../DeployLayer/Interactable报纸柜台"
ladder.enabled = false coin = $"../DeployLayer/Ambush银元"
_game_success_setup() mice = $"../DeployLayer/自动跟随的老鼠"
manager = $"../DeployLayer/老板"
light = $"../DirectionalLight2D"
# 首先放报纸,触发动画,领取任务
if counter.interacted_times > 0:
ladder.enabled = true
envolope_table.enabled = true
$"../DeployLayer/Ambush银元".enabled = true
else: else:
$"../DeployLayer/自动跟随的老鼠".visible = false counter.interacted.connect(assign_tasks, CONNECT_ONE_SHOT)
ladder.enabled = false
envolope_table.enabled = false
envelope_game_success = ArchiveManager.archive.get_global_value("envelope_game_success")
if envelope_game_success:
envolope_table.enabled = false
else:
envolope_table.interacted.connect(_check_envelope_game)
if envolope_table.interacted_times == 1:
envolope_table.prop_key = "prop_信碎片2"
# 书架工作
shelf_game_success = ArchiveManager.archive.get_global_value("shelf_game_success")
if shelf_game_success:
light.color = WEIRD_COLOR
ladder.enabled = false
manager.visible = false
mice.visible = true
else:
mice.visible = false
_check_portal()
var game_secne = preload("res://scene/little_game/书架/书架.tscn") func _check_portal():
var game_node = game_secne.instantiate() if not shelf_game_success or not envelope_game_success:
left_protal.holding = true
left_protal.holding_reason_key = "c01_s08_书店工作"
elif not coin.played:
left_protal.holding = true
left_protal.holding_reason_key = "c01_s08_书店工钱"
else:
left_protal.holding = false
func _check_envelope_game() -> void:
if envolope_table.interacted_times == 1:
envolope_table.prop_key = "prop_信碎片2"
elif envolope_table.interacted_times >= 2:
envolope_table.prop_key = ""
play_envelope_game()
func first_enter_door() -> void:
DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s08_书店进门老板台词")
DialogueManager.dialogue_ended.connect(_on_dialogue_ended, CONNECT_ONE_SHOT)
SceneManager.freeze_player(0)
func _on_dialogue_ended(_res) -> void:
SceneManager.release_player()
func assign_tasks() -> void:
DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s08_书店老板任务")
DialogueManager.dialogue_ended.connect(_on_dialogue_ended, CONNECT_ONE_SHOT)
SceneManager.freeze_player(0)
ladder.enabled = true
envolope_table.enabled = true
func _exit_tree() -> void: func _exit_tree() -> void:
if is_instance_valid(game_node): if is_instance_valid(self_game_node):
game_node.queue_free() self_game_node.queue_free()
func play_game() -> void: func play_self_game() -> void:
if game_node.get_parent() != get_parent(): if self_game_node.get_parent() != get_parent():
get_parent().add_child(game_node) get_parent().add_child(self_game_node)
SceneManager.freeze_player(0) SceneManager.freeze_player(0)
# mask.color = Color(0, 0, 0, 0)
func _on_game_exiting() -> void: func _on_self_game_exiting() -> void:
if GlobalConfig.DEBUG: if GlobalConfig.DEBUG:
print("书架游戏 exiting") print("书架游戏 exiting")
create_tween().tween_property(mask, "color:a", 0.0, 1.0).from(1.0) create_tween().tween_property(mask, "color:a", 0.0, 1.0).from(1.0)
SceneManager.release_player() SceneManager.release_player()
func _on_game_success() -> void: func _on_self_game_success() -> void:
ArchiveManager.archive.set_global_entry("shelf_game_success", true) ArchiveManager.archive.set_global_entry("shelf_game_success", true)
shelf_game_success = true
ladder.enabled = false ladder.enabled = false
_game_success_setup() mice.visible = true
manager.visible = false
light.color = WEIRD_COLOR
# TODO 播放小蝶从书架跌倒的动画 # TODO 播放小蝶从书架跌倒的动画
SceneManager.pop_debug_dialog_info("美术", "小蝶从书架跌倒") SceneManager.pop_debug_dialog_info("美术", "小蝶从书架跌倒")
var lines = await DialogueUtil.generate_lines(tr("c01_s08_书架游戏完成"))
var callback = SceneManager.pop_os.bind(lines)
get_tree().create_timer(1.0).timeout.connect(callback)
SceneManager.release_player()
_check_portal()
func play_envelope_game() -> void:
if envelope_game_node.get_parent() != get_parent():
get_parent().add_child(envelope_game_node)
SceneManager.freeze_player(0)
func _on_envelope_game_exiting() -> void:
if GlobalConfig.DEBUG:
print("信封游戏 exiting")
create_tween().tween_property(mask, "color:a", 0.0, 1.0).from(1.0)
SceneManager.release_player() SceneManager.release_player()
func _game_success_setup() -> void: func _on_envelope_game_success() -> void:
_set_portal_target_to_wierd_street() envolope_table.enabled = false
# 书架游戏成功后,展示老鼠 create_tween().tween_property(mask, "color:a", 0.0, 1.0).from(1.0)
$"../DeployLayer/自动跟随的老鼠".visible = true ArchiveManager.archive.set_global_entry("envelope_game_success", true)
envelope_game_success = true
SceneManager.enable_prop_item("prop_院长的信")
_check_portal()
func _set_portal_target_to_wierd_street() -> void: func pay_off_wage() -> void:
# 设置传送门目标为诡异的街道 SceneManager.enable_prop_item("prop_银元")
var portal = $"../DeployLayer/portal_left" as Portal2D _check_portal()
portal.target_scene = "c01_s12"
portal.target_portal = "2"

View File

@ -1,12 +1,38 @@
[gd_scene load_steps=8 format=3 uid="uid://cwu4dhayra8pg"] [gd_scene load_steps=14 format=3 uid="uid://cwu4dhayra8pg"]
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_b3cca"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_b3cca"]
[ext_resource type="Script" path="res://scene/ground/scene/c01/s08_animation.gd" id="2_0lque"] [ext_resource type="Script" path="res://scene/ground/scene/c01/s08_animation.gd" id="2_0lque"]
[ext_resource type="Texture2D" uid="uid://coo8sw8yigii6" path="res://asset/art/scene/c01/s08_书店/bg_书店.png" id="3_322m4"] [ext_resource type="Texture2D" uid="uid://coo8sw8yigii6" path="res://asset/art/scene/c01/s08_书店/bg_书店.png" id="3_322m4"]
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="4_c4lg5"] [ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="4_c4lg5"]
[ext_resource type="Texture2D" uid="uid://buu11ukisqfa" path="res://asset/art/scene/c01/s08_书店/e_老板.png" id="4_ko03g"]
[ext_resource type="Texture2D" uid="uid://cqy0qfmko00rx" path="res://asset/art/scene/c01/s08_书店/e_梯子.png" id="5_tnrke"] [ext_resource type="Texture2D" uid="uid://cqy0qfmko00rx" path="res://asset/art/scene/c01/s08_书店/e_梯子.png" id="5_tnrke"]
[ext_resource type="PackedScene" uid="uid://nwpbl5yuh280" path="res://scene/ground/script/c01/s00_自动跟随的老鼠.tscn" id="6_05do1"] [ext_resource type="PackedScene" uid="uid://nwpbl5yuh280" path="res://scene/ground/script/c01/s00_自动跟随的老鼠.tscn" id="6_05do1"]
[ext_resource type="Texture2D" uid="uid://c3ii6vsja0645" path="res://asset/art/scene/c01/s08_书店/书店参考.png" id="6_l2q02"] [ext_resource type="Texture2D" uid="uid://c3ii6vsja0645" path="res://asset/art/scene/c01/s08_书店/书店参考.png" id="6_l2q02"]
[ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="7_fue0t"]
[ext_resource type="Texture2D" uid="uid://bho8xal4ha50l" path="res://asset/art/scene/c01/s08_书店/l_打光.png" id="9_i4dqp"]
[ext_resource type="Texture2D" uid="uid://bp4y3vujvsl7r" path="res://asset/art/scene/c01/s08_书店/fg_前景.png" id="10_4e3a1"]
[sub_resource type="Animation" id="Animation_5koky"]
resource_name = "one_shot"
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimationPlayer")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"first_enter_door"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_xqgjo"]
_data = {
"one_shot": SubResource("Animation_5koky")
}
[node name="S08" type="Node2D"] [node name="S08" type="Node2D"]
@ -15,8 +41,11 @@ scene_name = "c01_s08"
player_y = 60 player_y = 60
[node name="AnimationPlayer" parent="Ground" index="0"] [node name="AnimationPlayer" parent="Ground" index="0"]
libraries = {
"": SubResource("AnimationLibrary_xqgjo")
}
script = ExtResource("2_0lque") script = ExtResource("2_0lque")
oneshot_animation = "" oneshot_animation = "one_shot"
[node name="BGSprite2D" parent="Ground" index="2"] [node name="BGSprite2D" parent="Ground" index="2"]
texture = ExtResource("3_322m4") texture = ExtResource("3_322m4")
@ -26,21 +55,34 @@ offset = Vector2(0, -158)
position = Vector2(35, 28) position = Vector2(35, 28)
debug_note = "c01_s07 的 2 号门通往书店 debug_note = "c01_s07 的 2 号门通往书店
" "
target_scene = "c01_s07" target_scene = "c01_s12"
target_portal = "2" target_portal = "2"
holding = true
holding_reason_key = "c01_s08_书店工作"
[node name="portal_right" parent="Ground/DeployLayer" index="1"] [node name="portal_right" parent="Ground/DeployLayer" index="1"]
position = Vector2(593, 20)
target_scene = "c02_s08" target_scene = "c02_s08"
[node name="Ambush梯子" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_c4lg5")] [node name="老板" type="Sprite2D" parent="Ground/DeployLayer" index="2"]
position = Vector2(148, 9)
texture = ExtResource("4_ko03g")
[node name="Ambush梯子" parent="Ground/DeployLayer" index="3" instance=ExtResource("4_c4lg5")]
position = Vector2(431, 18) position = Vector2(431, 18)
texture = ExtResource("5_tnrke") texture = ExtResource("5_tnrke")
trigger_mode = "interact" trigger_mode = "interact"
one_shot = false one_shot = false
freeze_time = 1.0 freeze_time = 1.0
hook_method = "play_game" hook_method = "play_self_game"
[node name="Mask" type="ColorRect" parent="Ground/DeployLayer" index="3"] [node name="Interactable信件书桌" parent="Ground/DeployLayer" index="4" instance=ExtResource("7_fue0t")]
position = Vector2(227, 55)
one_shot = false
diable_prop_after_interacted = true
prop_key = "prop_信碎片1"
[node name="Mask" type="ColorRect" parent="Ground/DeployLayer" index="5"]
z_index = 10 z_index = 10
custom_minimum_size = Vector2(700, 350) custom_minimum_size = Vector2(700, 350)
anchors_preset = 15 anchors_preset = 15
@ -55,17 +97,38 @@ grow_vertical = 2
mouse_filter = 2 mouse_filter = 2
color = Color(0, 0, 0, 0) color = Color(0, 0, 0, 0)
[node name="自动跟随的老鼠" parent="Ground/DeployLayer" index="4" instance=ExtResource("6_05do1")] [node name="自动跟随的老鼠" parent="Ground/DeployLayer" index="6" instance=ExtResource("6_05do1")]
position = Vector2(-8, 88) position = Vector2(-8, 88)
action_area = Vector2(600, 32) action_area = Vector2(600, 32)
scatter_on_start = true scatter_on_start = true
[node name="Interactable报纸柜台" parent="Ground/DeployLayer" index="7" instance=ExtResource("7_fue0t")]
position = Vector2(135, 49)
diable_prop_after_interacted = true
prop_key = "prop_报纸"
[node name="Ambush银元" parent="Ground/DeployLayer" index="8" instance=ExtResource("4_c4lg5")]
position = Vector2(537, 21)
enabled = false
trigger_mode = "interact"
freeze_time = 1.0
hook_method = "pay_off_wage"
[node name="PointLight2D" type="PointLight2D" parent="Ground/AmbientLayer" index="0"]
position = Vector2(-148, 39)
color = Color(0.993775, 0.83578, 0.525594, 1)
energy = 0.4
texture = ExtResource("9_i4dqp")
offset = Vector2(317, 0)
[node name="MainPlayer" parent="Ground" index="5"] [node name="MainPlayer" parent="Ground" index="5"]
position = Vector2(41, 98) position = Vector2(41, 98)
character = "小小蝶" character = "小小蝶"
[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] [node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"]
texture = null position = Vector2(-1, 22)
texture = ExtResource("10_4e3a1")
offset = Vector2(0, 40)
[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"] [node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"]
points = PackedVector2Array(30, 150, 545, 150) points = PackedVector2Array(30, 150, 545, 150)

View File

@ -25,6 +25,6 @@ func _on_ground_ready() -> void:
func _ghost_move() -> void: func _ghost_move() -> void:
ghost.visible = true ghost.visible = true
ghost.play() # ghost.play()
var tween = create_tween() var tween = create_tween()
tween.tween_property(ghost, "global_position", Vector2(1500, 0), 20.0).as_relative() tween.tween_property(ghost, "global_position", Vector2(1500, 0), 20.0).as_relative()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=14 format=3 uid="uid://bol5hl68pbpgq"] [gd_scene load_steps=15 format=3 uid="uid://bol5hl68pbpgq"]
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_llw14"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_llw14"]
[ext_resource type="Script" path="res://scene/ground/scene/c01/s12_animation.gd" id="2_krdvw"] [ext_resource type="Script" path="res://scene/ground/scene/c01/s12_animation.gd" id="2_krdvw"]
@ -12,6 +12,7 @@
[ext_resource type="PackedScene" uid="uid://h0s5ms7r7d8g" path="res://scene/shading/ghost.tscn" id="8_gk0gq"] [ext_resource type="PackedScene" uid="uid://h0s5ms7r7d8g" path="res://scene/shading/ghost.tscn" id="8_gk0gq"]
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="9_nqlku"] [ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="9_nqlku"]
[ext_resource type="PackedScene" uid="uid://cn1ypquvs07wx" path="res://scene/ground/script/c01/s12_飘动的寻人启事.tscn" id="11_pwu7i"] [ext_resource type="PackedScene" uid="uid://cn1ypquvs07wx" path="res://scene/ground/script/c01/s12_飘动的寻人启事.tscn" id="11_pwu7i"]
[ext_resource type="PackedScene" uid="uid://0sofmhrl358m" path="res://scene/entity/npc.tscn" id="12_jutue"]
[ext_resource type="PackedScene" uid="uid://nwpbl5yuh280" path="res://scene/ground/script/c01/s00_自动跟随的老鼠.tscn" id="12_qpv8m"] [ext_resource type="PackedScene" uid="uid://nwpbl5yuh280" path="res://scene/ground/script/c01/s00_自动跟随的老鼠.tscn" id="12_qpv8m"]
[node name="S12" type="Node2D"] [node name="S12" type="Node2D"]
@ -56,7 +57,7 @@ focus_node = NodePath("../Ghost")
[node name="Ghost" parent="Ground/DeployLayer" index="5" instance=ExtResource("8_gk0gq")] [node name="Ghost" parent="Ground/DeployLayer" index="5" instance=ExtResource("8_gk0gq")]
visible = false visible = false
z_index = 10 z_index = 10
position = Vector2(-158, 23) position = Vector2(-159, 18)
autoplay = "" autoplay = ""
[node name="Ambush玩家被抓" parent="Ground/DeployLayer/Ghost" instance=ExtResource("9_nqlku")] [node name="Ambush玩家被抓" parent="Ground/DeployLayer/Ghost" instance=ExtResource("9_nqlku")]
@ -71,6 +72,10 @@ scatter_on_start = true
visible = false visible = false
position = Vector2(99, -70) position = Vector2(99, -70)
[node name="Npc发钱小孩" parent="Ground/DeployLayer" index="8" instance=ExtResource("12_jutue")]
character_name = "小孩"
dialogue_title = "c01_s12_诡异的书店外发钱"
[node name="Light" parent="Ground/AmbientLayer" index="0" instance=ExtResource("5_kywnm")] [node name="Light" parent="Ground/AmbientLayer" index="0" instance=ExtResource("5_kywnm")]
position = Vector2(999, -5) position = Vector2(999, -5)
texture = null texture = null

View File

@ -1,5 +1,8 @@
extends CanvasLayer extends CanvasLayer
signal exiting
signal success
@onready var container = %PartsContainer @onready var container = %PartsContainer
@onready var whole = %Whole @onready var whole = %Whole
@onready var content_rect = %Content @onready var content_rect = %Content
@ -11,7 +14,7 @@ var positions = []
# from part 0 to 3, rotated by 0, 90, 180, 270 degrees # from part 0 to 3, rotated by 0, 90, 180, 270 degrees
var rotations = [0, 0, 0, 0] var rotations = [0, 0, 0, 0]
var images = [] var images = []
var success = false var game_finished = false
var selected := 0: var selected := 0:
set(value): set(value):
@ -93,7 +96,7 @@ func _shuffle() -> void:
func _display_selected() -> void: func _display_selected() -> void:
if success: if game_finished:
return return
for i in range(4): for i in range(4):
if i == selected: if i == selected:
@ -110,7 +113,7 @@ func _check_answer() -> void:
if rotations[id] != 0 or id != i: if rotations[id] != 0 or id != i:
_success = false _success = false
break break
success = _success game_finished = _success
if _success: if _success:
# 从 container 中移除,添加到 whole 中 # 从 container 中移除,添加到 whole 中
var tween = create_tween() var tween = create_tween()
@ -130,11 +133,20 @@ func _check_answer() -> void:
func _post_success(): func _post_success():
var tween = create_tween() var tween = create_tween()
tween.parallel().tween_property(content_rect, "modulate:a", 1.0, 1.0) tween.tween_property(content_rect, "modulate:a", 1.0, 1.0)
func _unhandled_input(event: InputEvent) -> void: func _unhandled_input(event: InputEvent) -> void:
if success: # block all input
get_viewport().set_input_as_handled()
if event.is_action_pressed("cancel"):
if game_finished:
success.emit()
else:
exiting.emit()
get_parent().remove_child(self)
return
if game_finished:
return return
var handled = false var handled = false
if event.is_action_pressed("up"): if event.is_action_pressed("up"):
@ -163,5 +175,4 @@ func _unhandled_input(event: InputEvent) -> void:
if handled: if handled:
$SfxMove.play() $SfxMove.play()
_display_selected() _display_selected()
_check_answer() _check_answer()
get_viewport().set_input_as_handled()

View File

@ -82,9 +82,9 @@ texture_normal = SubResource("AtlasTexture_4e0jv")
[node name="1" type="TextureButton" parent="Control/Whole"] [node name="1" type="TextureButton" parent="Control/Whole"]
layout_mode = 2 layout_mode = 2
offset_left = -12.5 offset_left = -13.75
offset_top = -26.25 offset_top = -26.25
offset_right = 139.5 offset_right = 138.25
offset_bottom = 128.75 offset_bottom = 128.75
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
@ -92,10 +92,10 @@ texture_normal = SubResource("AtlasTexture_qxu7b")
[node name="2" type="TextureButton" parent="Control/Whole"] [node name="2" type="TextureButton" parent="Control/Whole"]
layout_mode = 2 layout_mode = 2
offset_left = -66.25 offset_left = -71.25
offset_top = 48.75 offset_top = 37.5
offset_right = 93.75 offset_right = 88.75
offset_bottom = 212.75 offset_bottom = 201.5
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
texture_normal = SubResource("AtlasTexture_mbck6") texture_normal = SubResource("AtlasTexture_mbck6")

View File

@ -42,5 +42,5 @@ void fragment( )
, enable_shift , enable_shift
); );
//COLOR.rgb = mix(COLOR.rgb, pixel_color.rgb, .5); //COLOR.rgb = mix(COLOR.rgb, pixel_color.rgb, .5);
COLOR.rgb = smoothstep(.1, .0, pixel_color.rgb); COLOR.rgb = smoothstep(.0, .5, pixel_color.rgb);
} }

View File

@ -1,40 +1,22 @@
[gd_scene load_steps=9 format=3 uid="uid://h0s5ms7r7d8g"] [gd_scene load_steps=6 format=3 uid="uid://h0s5ms7r7d8g"]
[ext_resource type="Shader" path="res://scene/shading/ghost.gdshader" id="1_n4q4i"] [ext_resource type="Shader" path="res://scene/shading/ghost.gdshader" id="1_n4q4i"]
[ext_resource type="Texture2D" uid="uid://wvnpr0w3srtr" path="res://asset/art/临时草稿/c01_序章/ghost-sheet.png" id="2_vp102"] [ext_resource type="Texture2D" uid="uid://b7gyapghy3tsy" path="res://asset/art/neutral_point_light.png" id="2_4e2gx"]
[ext_resource type="Texture2D" uid="uid://bc64s5xfysrc3" path="res://asset/art/scene/c01/s07_书店外/bg_书店外_夜晚.png" id="4_lap87"] [ext_resource type="Texture2D" uid="uid://bc64s5xfysrc3" path="res://asset/art/scene/c01/s07_书店外/bg_书店外_夜晚.png" id="4_lap87"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fv2fx"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_fv2fx"]
shader = ExtResource("1_n4q4i") shader = ExtResource("1_n4q4i")
shader_parameter/shake_power = 0.01 shader_parameter/shake_power = 0.002
shader_parameter/shake_rate = 1.0 shader_parameter/shake_rate = 0.4
shader_parameter/shake_speed = 6.0 shader_parameter/shake_speed = 6.0
shader_parameter/shake_block_size = 5.0 shader_parameter/shake_block_size = 2.0
shader_parameter/shake_color_rate = 0.005 shader_parameter/shake_color_rate = 0.002
[sub_resource type="AtlasTexture" id="AtlasTexture_vaq88"]
atlas = ExtResource("2_vp102")
region = Rect2(0, 0, 256, 256)
[sub_resource type="AtlasTexture" id="AtlasTexture_mh23v"]
atlas = ExtResource("2_vp102")
region = Rect2(256, 0, 256, 256)
[sub_resource type="AtlasTexture" id="AtlasTexture_5x2re"]
atlas = ExtResource("2_vp102")
region = Rect2(512, 0, 256, 256)
[sub_resource type="SpriteFrames" id="SpriteFrames_fqswq"] [sub_resource type="SpriteFrames" id="SpriteFrames_fqswq"]
animations = [{ animations = [{
"frames": [{ "frames": [{
"duration": 3.0,
"texture": SubResource("AtlasTexture_vaq88")
}, {
"duration": 1.0, "duration": 1.0,
"texture": SubResource("AtlasTexture_mh23v") "texture": ExtResource("2_4e2gx")
}, {
"duration": 2.0,
"texture": SubResource("AtlasTexture_5x2re")
}], }],
"loop": true, "loop": true,
"name": &"default", "name": &"default",

19
util/dialogue_util.gd Normal file
View File

@ -0,0 +1,19 @@
class_name DialogueUtil extends RefCounted
static func get_lines(res: DialogueResource, title: String) -> Array:
var lines = []
var current_line = await res.get_next_dialogue_line(title)
while current_line:
lines.append(current_line)
if current_line.next_id != "end":
current_line = await res.get_next_dialogue_line(current_line.next_id)
else:
break
return lines
# pop os lines
static func generate_lines(content: String) -> Array:
var text = "~ title\n" + content + "\n=> END"
var res = DialogueManager.create_resource_from_text(text)
return await get_lines(res, "title")