detopoi 1 éve
szülő
commit
25bcc4c695
2 módosított fájl, 23 hozzáadás és 7 törlés
  1. 17 4
      game/ui/menu/choose_hero_menu.py
  2. 6 3
      game/ui/menu/skin_menu.py

+ 17 - 4
game/ui/menu/choose_hero_menu.py

@@ -40,7 +40,7 @@ diff_cn = {
 # diff_contact = {"Easy": 0.7, "Normal": 1, "Hell": 1.2, "Hell+": 1.3}
 # diff_exp = {"Easy": 1, "Normal": 1.5, "Hell": 2.2, "Hell+": 3}
 diff_dict = {
-    "Easy":   {"unlock": R.pass_status["Easy"],   "name": "简单",  "info": "经验效率100%, 怪物血量-30%, 防御-1200", "condition": "最初的起点"},
+    "Easy":   {"unlock": 1,                       "name": "简单",  "info": "经验效率100%, 怪物血量-30%, 防御-1200", "condition": "最初的起点"},
     "Normal": {"unlock": R.pass_status["Normal"], "name": "困难",  "info": "经验效率150%, 怪物血量+0%, 防御+0",     "condition": "通关简单难度解锁"},
     "Hell":   {"unlock": R.pass_status["Hell"],   "name": "炼狱",  "info": "经验效率220%, 怪物血量+20%, 防御+800",  "condition": "通关困难难度解锁"},
     "Hell+":  {"unlock": R.pass_status["Hell+"],  "name": "炼狱+", "info": "经验效率300%, 怪物血量+30%, 防御+1000", "condition": "通关炼狱难度解锁"},
@@ -134,7 +134,7 @@ class ChoosePage:
         self.current_hero = R.rouge_hero
         self.diff_num = {"Easy": 1, "Normal": 2, "Hell": 3, "Hell+": 4}
         self.diff_status = {"Easy": 0, "Normal": 0, "Hell": 0, "Hell+": 0}
-        self.max_diff = {}
+        self.max_diff = "Easy"
         self.init_choose_page()
         self.load_achievements_data()
 
@@ -143,9 +143,19 @@ class ChoosePage:
         self.rougeOB_achievements = load_rouge_data(self.rouge_achivements_file_path)
 
     def load_achievements_data(self):
-        self.max_diff = self.rougeOB_achievements["Highest"]["diff"]
+        if self.rougeOB_achievements["Highest"]["diff"] != "":
+            self.max_diff = self.rougeOB_achievements["Highest"]["diff"]
         if self.diff_num[self.max_diff] > 1:
             hero_dict["Random"]["own"] = True
+        if self.diff_num[R.difficulty] > self.diff_num[self.max_diff]:  # 作弊
+            print("作弊!!!")
+            R.difficulty = "Easy"
+            with open("config.json", "r", encoding="utf-8") as json_file:
+                mapsetdata = json.load(json_file)
+            mapsetdata["map_set"] = "rogueMapSet"
+            mapsetdata["rogue_difficulty"] = "Easy"
+            with open("config.json", "w", encoding="utf-8") as json_file:
+                json.dump(mapsetdata, json_file, indent=4, ensure_ascii=False)
 
     def draw(self):
         self.screen.buttons.clear()
@@ -204,6 +214,7 @@ class ChoosePage:
         )
         # ===================================================================================
         # ===================================================================================
+        # ===================================================================================
         # ================================= 信息展示 =================================
         diff_info_button = PygameButton(
             self.screen.screen, "", 0.75, 0.47, 18, "#2a2a2a",
@@ -373,6 +384,8 @@ class ChoosePage:
         key = diff_cn[cn_name]
         # 拿到是否已解锁
         owned = (R.pass_status[key] > 0)
+        if key == "Easy":
+            owned = True
         if owned:
             if R.difficulty == key:  # 当前
                 choose_btn.update_image("res/ui/button/chosen.png", "res/ui/button/chosen.png")
@@ -409,7 +422,7 @@ def diff_update_notify(board: PygameButtonBackIMGRoll, observer: PygameButton, c
     cn_name = board.get_current_text()
     current = diff_cn[cn_name]
     is_chosen = "<当前选择>" if (current == R.difficulty) else ""
-    unlock = "" if (R.pass_status[current] > 0) else "(通关一次游戏解锁)"
+    unlock = "" if (R.pass_status[current] > 0 or current == "Easy") else "(通关一次上一难度解锁)"
     info = diff_dict[current]["info"]
     condition = diff_dict[current]["condition"]
     observer.set_text(f" {is_chosen}{cn_name} \n {info} \n {condition} ")

+ 6 - 3
game/ui/menu/skin_menu.py

@@ -70,9 +70,12 @@ class SkinPage:
         max_diff_num = 1
         diff_num = {"Easy": 1, "Normal": 2, "Hell": 3, "Hell+": 4}
         diff_status = {"Easy": 0, "Normal": 0, "Hell": 0, "Hell+": 0}
-        max_level = self.rougeOB_achievements["Highest"]["level"]
-        max_level_hero = self.rougeOB_achievements["Highest"]["hero"]
-        max_diff = self.rougeOB_achievements["Highest"]["diff"]
+        if self.rougeOB_achievements["Highest"]["level"] != "":
+            max_level = self.rougeOB_achievements["Highest"]["level"]
+        if self.rougeOB_achievements["Highest"]["hero"] != "":
+            max_level_hero = self.rougeOB_achievements["Highest"]["hero"]
+        if self.rougeOB_achievements["Highest"]["diff"] != "":
+            max_diff = self.rougeOB_achievements["Highest"]["diff"]
 
         cursor_dict["fire_cursor_gold_kubi"]["own"] = (diff_num[max_diff] >= 4 or (diff_num[max_diff] == 3 and max_level >= 15))
         cursor_dict["fire_cursor_kubi"]["own"] = (diff_num[max_diff] >= 3 or (diff_num[max_diff] == 2 and max_level >= 15))