1111import captureScreen , mine_num_bar , videoControl , gameRecordPop
1212from CheckUpdateGui import CheckUpdateGui
1313from githubApi import GitHub , SourceManager
14- import minesweeper_master as mm
14+ import utils
1515import ms_toollib as ms
1616# import configparser
1717# from pathlib import Path
@@ -213,11 +213,12 @@ def game_state(self):
213213 def game_state (self , game_state : str ):
214214 # print(self._game_state, " -> " ,game_state)
215215 match self ._game_state :
216- case "playing" | "joking" :
216+ case "playing" :
217217 if game_state not in ("playing" , "show" , "joking" ):
218218 self .timer_10ms .stop ()
219219 self .unlimit_cursor ()
220- case "show" :
220+ # if game_state in ("study", "joking", "jowin", "jofail", "show"):
221+ case "joking" | "show" :
221222 if game_state not in ("playing" , "show" , "joking" ):
222223 self .timer_10ms .stop ()
223224 self .unlimit_cursor ()
@@ -284,13 +285,13 @@ def layMine(self, i, j):
284285 # 弱无猜7、准无猜8、强可猜9、弱可猜10
285286 if self .gameMode == 5 or self .gameMode == 6 or self .gameMode == 9 :
286287 # 根据模式生成局面
287- Board , _ = mm .laymine_solvable (self .board_constraint ,
288+ Board , _ = utils .laymine_solvable (self .board_constraint ,
288289 self .attempt_times_limit , (xx , yy , num , i , j ))
289290 elif self .gameMode == 0 or self .gameMode == 7 or self .gameMode == 8 or self .gameMode == 10 :
290- Board , _ = mm .laymine (self .board_constraint ,
291+ Board , _ = utils .laymine (self .board_constraint ,
291292 self .attempt_times_limit , (xx , yy , num , i , j ))
292293 elif self .gameMode == 4 :
293- Board , _ = mm .laymine_op (self .board_constraint ,
294+ Board , _ = utils .laymine_op (self .board_constraint ,
294295 self .attempt_times_limit , (xx , yy , num , i , j ))
295296
296297 self .label .ms_board .board = Board
@@ -345,22 +346,22 @@ def ai(self, i, j):
345346 board [i ][j ] = - 1
346347 self .label .ms_board .board = board
347348 elif code == 2 :
348- board , flag = mm .enumerateChangeBoard (self .label .ms_board .board ,
349+ board , flag = utils .enumerateChangeBoard (self .label .ms_board .board ,
349350 self .label .ms_board .game_board , [(i , j )])
350351 self .label .ms_board .board = board
351352 return
352353 elif self .gameMode == 8 :
353354 code = ms .is_guess_while_needless (
354355 self .label .ms_board .game_board , (i , j ))
355356 if code == 2 :
356- board , flag = mm .enumerateChangeBoard (self .label .ms_board .board ,
357+ board , flag = utils .enumerateChangeBoard (self .label .ms_board .board ,
357358 self .label .ms_board .game_board , [(i , j )])
358359 self .label .ms_board .board = board
359360 return
360361 elif self .gameMode == 9 or self .gameMode == 10 :
361362 if self .label .ms_board .board [i ][j ] == - 1 :
362363 # 可猜调整的核心逻辑
363- board , flag = mm .enumerateChangeBoard (self .label .ms_board .board ,
364+ board , flag = utils .enumerateChangeBoard (self .label .ms_board .board ,
364365 self .label .ms_board .game_board , [(i , j )])
365366
366367 self .label .ms_board .board = board
@@ -418,7 +419,7 @@ def chording_ai(self, i, j):
418419 must_guess = False
419420 break
420421 if must_guess :
421- board , flag = mm .enumerateChangeBoard (board ,
422+ board , flag = utils .enumerateChangeBoard (board ,
422423 self .label .ms_board .game_board ,
423424 not_mine_round + is_mine_round )
424425 self .label .ms_board .board = board
@@ -435,12 +436,12 @@ def chording_ai(self, i, j):
435436 must_guess = False
436437 break
437438 if must_guess :
438- board , flag = mm .enumerateChangeBoard (board ,
439+ board , flag = utils .enumerateChangeBoard (board ,
439440 self .label .ms_board .game_board ,
440441 not_mine_round + is_mine_round )
441442 self .label .ms_board .board = board
442443 elif self .gameMode == 9 or self .gameMode == 10 :
443- board , flag = mm .enumerateChangeBoard (board ,
444+ board , flag = utils .enumerateChangeBoard (board ,
444445 self .label .ms_board .game_board ,
445446 not_mine_round + is_mine_round )
446447 self .label .ms_board .board = board
@@ -681,7 +682,7 @@ def gameRestart(self, e=None): # 画界面,但是不埋雷,改数据而不
681682 # 点脸周围时,会传入一个e参数
682683 if not (self .MinenumTimeWigdet .width () >= e .localPos ().x () >= 0 and 0 <= e .localPos ().y () <= self .MinenumTimeWigdet .height ()):
683684 return
684- # 此时self.label.ms_board是mm .abstract_game_board的实例
685+ # 此时self.label.ms_board是utils .abstract_game_board的实例
685686 if self .game_state == 'display' or self .game_state == 'showdisplay' :
686687 # self.timer_video.stop()
687688 # self.ui_video_control.QWidget.close()
@@ -730,11 +731,8 @@ def gameFinished(self):
730731 # "column": self.column,
731732 # "minenum": self.minenum,
732733 })
733- self .label .ms_board .analyse_for_features (["high_risk_guess" , "jump_judge" ,
734- "needless_guess" ,"mouse_trace" ,
735- "vision_transfer" , "survive_poss" ])
736734
737- self .score_board_manager .show (self .label .ms_board , index_type = 3 )
735+ self .score_board_manager .show (self .label .ms_board , index_type = 2 )
738736 self .enable_screenshot ()
739737 self .unlimit_cursor ()
740738
@@ -857,17 +855,15 @@ def gameFailed(self): # 失败后改脸和状态变量
857855 self .timer_10ms .stop ()
858856 self .score_board_manager .editing_row = - 1
859857
860- if self .game_state == 'joking' :
861- self .game_state = 'jofail'
862- else :
863- self .game_state = 'fail'
864-
865- self .set_face (16 )
866-
867858 # “自动重开比例”,大于等于该比例时,不自动重开。负数表示禁用。0相当于禁用,但可以编辑。
868859 if self .label .ms_board .bbbv_solved / self .label .ms_board .bbbv * 100 < self .auto_replay :
869860 self .gameRestart ()
870861 else :
862+ if self .game_state == 'joking' :
863+ self .game_state = 'jofail'
864+ else :
865+ self .game_state = 'fail'
866+ self .set_face (16 )
871867 self .gameFinished ()
872868
873869 def try_record_pop (self ):
@@ -1337,7 +1333,7 @@ def screenShot(self):
13371333 self .timer_10ms .stop ()
13381334 self .score_board_manager .invisible ()
13391335
1340- # self.label.ms_board = mm .abstract_game_board()
1336+ # self.label.ms_board = utils .abstract_game_board()
13411337 # self.label.ms_board.mouse_state = 1
13421338 # self.label.ms_board.game_board_state = 1
13431339 # self.label.ms_board.game_board = ui.board
@@ -1528,7 +1524,8 @@ def play_video(self, video):
15281524 "minenum" : video .mine_num ,
15291525 })
15301526 video .analyse_for_features (["high_risk_guess" , "jump_judge" , "needless_guess" ,
1531- "mouse_trace" , "vision_transfer" , "survive_poss" ])
1527+ "mouse_trace" , "vision_transfer" , "pluck" ,
1528+ "super_fl_local" ])
15321529
15331530 # 组织录像评论
15341531 comments = []
0 commit comments