66from model .timer import Timer
77from model .item import Item
88import random
9+ from model .menu import Menu
910
1011class 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