Skip to content

Commit 8effd94

Browse files
authored
Merge pull request #79 from kikutaro/issue31-74-75-76-77-78
issue31,74,75,76,77,78に対応
2 parents 7530ac8 + 70aa9f0 commit 8effd94

File tree

5 files changed

+74
-34
lines changed

5 files changed

+74
-34
lines changed

const.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class アイテム(Enum):
135135
とちぎのいちご = "とちぎのいちご"
136136
さいりうむ = "さいりうむ"
137137
めがほん = "めがほん"
138+
衣装 = "衣装"
138139

139140
#アイテム表示
140141
アイテム名の文字数最長=6
@@ -258,12 +259,13 @@ class 状態(Enum):
258259
(24,0),(25,0),(24,1),(25,1), (24,2),(25,2),(24,3),(25,3), (24,4),(25,4),(24,5),(25,5), (24,6),(25,6),(24,7),(25,7),
259260
#階段
260261
(0,8),(1,8),(0,9),(1,9), (10,14),(11,14),(10,15),(11,15), (18,2),(19,2),(18,3),(19,3), (30,4),(31,4),(30,5),(31,5),
261-
#アイテム いちご、拡声器、サイリウム
262-
(2,22),(3,22),(2,23),(3,23), (22,4),(23,4),(22,5),(23,5), (24,12),(25,12),(24,13),(25,13),
262+
#アイテム いちご、拡声器、サイリウム 衣装
263+
(2,22),(3,22),(2,23),(3,23), (22,4),(23,4),(22,5),(23,5), (24,12),(25,12),(24,13),(25,13), (28,8),(29,8),(28,9),(29,9)
263264
}
264265
タイル_とちぎのいちごとったあと = [(2, 0), (3, 0), (2, 1), (3, 1)]
265266
タイル_拡声器とったあと = [(22, 0), (23, 0), (22, 1), (23, 1)]
266267
タイル_サイリウムとったあと = [(24, 0), (25, 0), (24, 1), (25, 1)]
268+
タイル_衣装とったあと = [(28, 10), (29, 10), (28, 11), (29, 11)]
267269
タイル_きあらが寝てる床 = [(30, 0), (31, 0), (30, 1), (31, 1)]
268270

269271
#階段
@@ -276,9 +278,9 @@ class 状態(Enum):
276278
階段_Y座標Idx = 1
277279

278280
階段脇_ケータリング = (TILE*2, TILE*29)
279-
階段脇_衣装部屋 = (TILE*3,FIELD * 4 + TILE*3)
280-
階段脇_ステージ裏 = (TILE*49, TILE*24)
281-
階段脇_隠し部屋 = (TILE*27, FIELD * 4 + TILE*7)
281+
階段脇_衣装部屋 = (TILE,FIELD * 4 + TILE*5)
282+
階段脇_ステージ裏 = (TILE*50, TILE*27)
283+
階段脇_隠し部屋 = (CELL*46, CELL*140)
282284

283285
#アイテム
284286
アイテム_とちぎのいちご_識別 = [(2,22),(3,22),(2,23),(3,23)]
@@ -287,6 +289,8 @@ class 状態(Enum):
287289
アイテム_拡声器_配置 = [(122,122),(122,123),(123,122),(123,123)]
288290
アイテム_サイリウム_識別 = [(24,12),(25,12),(24,13),(25,13)]
289291
アイテム_サイリウム_配置 = [(4,84),(5,84),(4,85),(5,85)]
292+
アイテム_衣装_識別 = [(28,8),(29,8),(28,9),(29,9)]
293+
アイテム_衣装_配置 = [(12,154),(12,155),(13,154),(13,155)]
290294

291295
#メッセージ系
292296
M_GAME_START = "Press Enter Key or A/B Button"

model/character.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def 話す(self):
123123
case "ゆずにい":
124124
self.message.話す(const.M_TYPE.WINDOW, self.名前,["きあらちゃん?", "さっき眠そうな顔して", "どこかいきよったで"])
125125
case "しのぶさん":
126-
self.message.話す(const.M_TYPE.WINDOW, self.名前,["ねえ、きあらちゃん衣装まちがえてない?", "こまったわねぇ..."])
126+
self.message.話す(const.M_TYPE.WINDOW, self.名前,["きあらちゃん最初の衣装まちがえてるわ", "こまったわねぇ...", "はやく着替えないといけないのに"])
127127
case "はせがわさん":
128128
self.message.話す(const.M_TYPE.WINDOW, self.名前,["さしはらによばれてライブみにきたよ", "すげーたのしみ!"])
129129
case "じろうさん":

model/main_character.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def 足元チェック(self, x, y):
127127
self.global_y = const.階段脇_ケータリング[const.階段_Y座標Idx]
128128
elif pyxel.tilemaps[0].pget(x //const.CELL ,y //const.CELL) in const.階段_ステージ裏:
129129
pyxel.play(const.BGMチャンネル, [const.階段音])
130-
self.global_x = 46*const.CELL#const.階段脇_隠し部屋[const.階段_X座標Idx]
131-
self.global_y = 140*const.CELL#const.階段脇_隠し部屋[const.階段_Y座標Idx]
130+
self.global_x = const.階段脇_隠し部屋[const.階段_X座標Idx]
131+
self.global_y = const.階段脇_隠し部屋[const.階段_Y座標Idx]
132132
elif pyxel.tilemaps[0].pget(x //const.CELL ,y //const.CELL) in const.階段_隠し部屋:
133133
pyxel.play(const.BGMチャンネル, [const.階段音])
134134
self.global_x = const.階段脇_ステージ裏[const.階段_X座標Idx]
@@ -154,6 +154,13 @@ def 足元チェック(self, x, y):
154154
pyxel.tilemaps[0].pset(const.アイテム_サイリウム_配置[2][0],const.アイテム_サイリウム_配置[2][1],const.タイル_サイリウムとったあと[2])
155155
pyxel.tilemaps[0].pset(const.アイテム_サイリウム_配置[3][0],const.アイテム_サイリウム_配置[3][1],const.タイル_サイリウムとったあと[3])
156156
self.item.アイテムを追加(const.アイテム.さいりうむ.value)
157+
elif pyxel.tilemaps[0].pget(x //const.CELL ,y //const.CELL) in const.アイテム_衣装_識別:
158+
pyxel.play(const.BGMチャンネル, [const.アイテム取得])
159+
pyxel.tilemaps[0].pset(const.アイテム_衣装_配置[0][0],const.アイテム_衣装_配置[0][1],const.タイル_衣装とったあと[0])
160+
pyxel.tilemaps[0].pset(const.アイテム_衣装_配置[1][0],const.アイテム_衣装_配置[1][1],const.タイル_衣装とったあと[1])
161+
pyxel.tilemaps[0].pset(const.アイテム_衣装_配置[2][0],const.アイテム_衣装_配置[2][1],const.タイル_衣装とったあと[2])
162+
pyxel.tilemaps[0].pset(const.アイテム_衣装_配置[3][0],const.アイテム_衣装_配置[3][1],const.タイル_衣装とったあと[3])
163+
self.item.アイテムを追加(const.アイテム.衣装.value)
157164

158165
self.local_x = self.global_x % const.FIELD
159166
self.local_y = self.global_y % const.FIELD

story/ending.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ def update(self):
3535
"これで、みんなそろったね!",
3636
"じゃあ、きょうのライブがんばろうね!!"])
3737

38-
if self.message.complete and pyxel.btn(pyxel.KEY_RETURN):
39-
self.messanger = "ナレーター"
40-
self.message.complete = False
38+
if self.message.complete and (pyxel.btnp(pyxel.GAMEPAD1_BUTTON_A) or pyxel.btnp(pyxel.GAMEPAD1_BUTTON_B) or pyxel.btn(pyxel.KEY_RETURN)):
39+
self.messanger = "ナレーター"
40+
self.message.complete = False
4141

42-
if self.messanger == "ナレーター":
42+
if not self.message.complete and self.messanger == "ナレーター":
4343
self.message.話す(const.M_TYPE.STORY,None,
44-
["10人がそろったイコラブはさいきょう...",
45-
"そして、ライブは大成功に終わった"]
44+
["10人がそろったイコラブはさいきょう...",
45+
"そして、ライブは大成功に終わった"]
4646
)
4747

48-
if self.message.complete and pyxel.btn(pyxel.KEY_RETURN):
49-
self.rpg.change_story(const.STORY.GAMECLEAR)
48+
if self.message.complete and (pyxel.btnp(pyxel.GAMEPAD1_BUTTON_A) or pyxel.btnp(pyxel.GAMEPAD1_BUTTON_B) or pyxel.btn(pyxel.KEY_RETURN)):
49+
self.rpg.change_story(const.STORY.GAMECLEAR)
5050

5151
def draw(self):
5252
pyxel.bltm(

story/play.py

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from model.timer import Timer
77
from model.item import Item
88
import random
9+
from model.menu import Menu
910

1011
class Play:
1112
def __init__(self, rpg):
@@ -39,6 +40,12 @@ def __init__(self, rpg):
3940
self.くろしまトーク = False
4041
self.きあらちゃんおっき = False
4142
self.クリア = False
43+
self.エンディング = False
44+
45+
self.メニュー = Menu(None, const..BLACK.value, const..PINK.value, [
46+
# ("すくしょまち", lambda: self.すくしょまち()),
47+
("えんでぃんぐをみる", lambda: self.えんでぃんぐをみる())
48+
])
4249

4350
self.情報表示 = True
4451

@@ -60,6 +67,15 @@ def __init__(self, rpg):
6067
self.くろしまセリフ = ["さなちゃんとはなしたようだね","さなきあにはおせわになってるから魔法をかけてあげよう" ,"さあ、あるいてみて!"]
6168
self.くろしまセリフ[2:2] = self.くろしま今回のセリフ
6269

70+
self.クリアメッセージ1 = "さがしてくれて、ありがとう!"
71+
self.クリアメッセージ2 = "このスクリーンをキャプチャしてタイムをきそってね!"
72+
self.クリアメッセージ3 = "クリアタイム"
73+
self.ボーナスメッセージ = "衣装ボーナスで-90秒"
74+
self.クリアメッセージ1配置 = self.X軸センタリング(self.クリアメッセージ1, const.FONT_SIZE)
75+
self.クリアメッセージ2配置 = self.X軸センタリング(self.クリアメッセージ2, const.FONT_SIZE)
76+
self.クリアメッセージ3配置 = self.X軸センタリング(self.クリアメッセージ3, const.FONT_SIZE)
77+
self.ボーナスメッセージ配置 = self.X軸センタリング(self.ボーナスメッセージ, const.FONT_SIZE)
78+
6379
def start(self):
6480
pyxel.stop()
6581
self.舞香ちゃん.getMusic().BGMランダム再生()
@@ -68,7 +84,7 @@ def start(self):
6884
self.timer.カウントスタート()
6985

7086
def update(self):
71-
if pyxel.btnp(pyxel.GAMEPAD1_BUTTON_X) or pyxel.btnp(pyxel.KEY_A):
87+
if pyxel.btnp(pyxel.GAMEPAD1_BUTTON_X):
7288
self.情報表示 = not self.情報表示
7389

7490
if ("さなつん" in self.舞香ちゃん.会話済メンバー and self.舞香ちゃん.global_x // const.CELL, self.舞香ちゃん.global_y // const.CELL) in const.くろしままえ and not self.くろしまトーク and self.舞香ちゃん.向き == const.向き.:
@@ -201,23 +217,26 @@ def update(self):
201217
["はいっ!"])
202218

203219
if self.message.complete and (pyxel.btnp(pyxel.GAMEPAD1_BUTTON_A) or pyxel.btnp(pyxel.GAMEPAD1_BUTTON_B) or pyxel.btn(pyxel.KEY_RETURN)):
220+
self.message.cnt += 1
204221
self.クリア = True
205222

206-
#えんでぃんぐへ
207-
208-
if self.message.complete and (pyxel.btnp(pyxel.GAMEPAD1_BUTTON_A) or pyxel.btnp(pyxel.GAMEPAD1_BUTTON_B) or pyxel.btn(pyxel.KEY_RETURN)):
223+
if self.message.complete and (pyxel.btnp(pyxel.GAMEPAD1_BUTTON_A) or pyxel.btnp(pyxel.GAMEPAD1_BUTTON_B) or pyxel.btnp(pyxel.KEY_RETURN)):
209224
#戻る
210225
self.舞香ちゃん.global_x = const.階段脇_ステージ裏[const.階段_X座標Idx]
211226
self.舞香ちゃん.global_y = const.階段脇_ステージ裏[const.階段_Y座標Idx]
212-
self.message.cnt = 0
227+
self.message.cnt = 1
213228
self.message.messages.clear()
229+
self.message.complete = False
214230
else:
215231
self.舞香ちゃん.update(self.members)
216232
for member in self.members:
217233
if member.名前 == "さっしー":
218234
member.舞香ちゃんの情報を得る(const.舞香ちゃん情報キー.会話済メンバー数, len(self.舞香ちゃん.会話済メンバー))
219235
member.update()
220236

237+
if self.クリア and self.エンディング:
238+
self.メニュー.update()
239+
221240
def draw(self):
222241
if not self.クリア:
223242
# pyxel.text(0,0, str(pyxel.frame_count), 7)
@@ -259,34 +278,44 @@ def draw(self):
259278
mes1 = "さがしてくれて、ありがとう!"
260279
mes2 = "このスクリーンをキャプチャしてタイムをきそってね!"
261280
mes3 = "クリアタイム"
262-
pyxel.text(self.X軸センタリング(mes1, const.FONT_SIZE), 60, mes1, const..BLACK.value, self.rpg.m_font)
263-
pyxel.text(self.X軸センタリング(mes2, const.FONT_SIZE), 80, mes2, const..BLACK.value, self.rpg.m_font)
264-
pyxel.text(self.X軸センタリング(mes3, const.FONT_SIZE), 100, mes3 , const..BLACK.value, self.rpg.m_font)
281+
pyxel.text(self.クリアメッセージ1配置, 60, self.クリアメッセージ1, const..BLACK.value, self.rpg.m_font)
282+
pyxel.text(self.クリアメッセージ2配置, 80, self.クリアメッセージ2, const..BLACK.value, self.rpg.m_font)
283+
pyxel.text(self.クリアメッセージ3配置, 160, self.クリアメッセージ3 , const..BLACK.value, self.rpg.m_font)
265284

266285
#右
267286
if 0 < pyxel.frame_count % 10 and pyxel.frame_count % 10 < 5:
268-
pyxel.blt((const.FIELD - const.キャラサイズ) / 2, (const.FIELD - const.キャラサイズ) / 2,0,
287+
pyxel.blt((const.FIELD - const.キャラサイズ) / 2, 50 / 2,0,
269288
const.キャラ['とくべちゅきあら']['右'][const.向き.][0],
270289
const.キャラ['とくべちゅきあら']['右'][const.向き.][1],
271-
const.キャラサイズ,const.キャラサイズ, const..WHITE.value)
290+
const.キャラサイズ,const.キャラサイズ, const..GRAY.value)
272291
#左
273292
else:
274-
pyxel.blt((const.FIELD - const.キャラサイズ) / 2, (const.FIELD - const.キャラサイズ) / 2,0,
293+
pyxel.blt((const.FIELD - const.キャラサイズ) / 2, 50 / 2,0,
275294
const.キャラ['とくべちゅきあら']['左'][const.向き.][0],
276295
const.キャラ['とくべちゅきあら']['左'][const.向き.][1],
277-
const.キャラサイズ,const.キャラサイズ,const..WHITE.value)
296+
const.キャラサイズ,const.キャラサイズ,const..GRAY.value)
278297

279-
mes4 = str(self.timer.経過時間) + "秒"
280-
pyxel.text(self.X軸センタリング(mes4, const.TITLE_FONT_SIZE), 145, mes4, const..BLACK.value, self.rpg.t_font)
298+
クリア時間メッセージ = str(self.timer.経過時間 - 90) + "秒" if const.アイテム.衣装.value in self.舞香ちゃん.持ってるアイテム() else str(self.timer.経過時間) + "秒"
299+
300+
# クリア時間メッセージ = str(100) + ("秒 - 衣装ボーナス90秒 = " + str(100-90) if False else "") + "秒"
301+
pyxel.text(self.X軸センタリング(クリア時間メッセージ, const.TITLE_FONT_SIZE), 175, クリア時間メッセージ, const..BLACK.value, self.rpg.t_font)
302+
if const.アイテム.衣装.value in self.舞香ちゃん.持ってるアイテム():
303+
pyxel.text(self.ボーナスメッセージ配置, 195, self.ボーナスメッセージ , const..RED.value, self.rpg.m_font)
304+
305+
self.エンディング = True
306+
self.メニュー.draw()
281307

282-
if pyxel.btn(pyxel.KEY_RETURN):
283-
pass
284-
285308
def X軸センタリング(self, text, font_size):
286309
return ((const.FIELD - len(text) * font_size)) / 2
287310

288311
def マップ更新(self,x座標,y座標):
289312
pyxel.cls(const..WHITE.value)
290313
描画マップx = (x座標 + const.キャラサイズ // 2) // const.FIELD * const.FIELD
291314
描画マップy = (y座標 + const.キャラサイズ // 2) // const.FIELD * const.FIELD
292-
pyxel.bltm(0,0,0, 描画マップx, 描画マップy, const.FIELD,const.FIELD)
315+
pyxel.bltm(0,0,0, 描画マップx, 描画マップy, const.FIELD,const.FIELD)
316+
317+
def えんでぃんぐをみる(self):
318+
self.rpg.change_story(const.STORY.ENDING)
319+
320+
def すくしょまち(self):
321+
pass

0 commit comments

Comments
 (0)