Sfoglia il codice sorgente

v2.4.0.1漏洞修复

detopoi 1 anno fa
parent
commit
2140c19ade
6 ha cambiato i file con 18 aggiunte e 22 eliminazioni
  1. 2 1
      game/algo/utils.py
  2. 1 1
      game/const/rouge.py
  3. 1 1
      game/const/window.py
  4. 6 5
      game/level/level.py
  5. 3 10
      game/sprite/npc.py
  6. 5 4
      game/sprite/player.py

+ 2 - 1
game/algo/utils.py

@@ -152,9 +152,10 @@ def save_online():
     if latest_data is None:
         return
     new_data = {}
+    real_exp = int(R.rouge_exp * R.diff_exp[R.difficulty])
     for hero in R.hero_name.keys():
         if hero == R.rouge_hero:
-            exp = latest_data[hero]["exp"] + R.rouge_exp
+            exp = latest_data[hero]["exp"] + real_exp
         else:
             exp = latest_data[hero]["exp"]
         lv = R.current_lv(exp)

+ 1 - 1
game/const/rouge.py

@@ -165,7 +165,7 @@ pass_status = {"Easy": 0, "Normal": 0, "Hell": 0, "Hell+": 0}
 
 hero_name = {"Fox": "小倩", "Boboli": "波波丽", "Naruto_old": "火影", "Asha": "阿莎", "Maria": "玛莉亚", "Surprise": "???"}
 diff_dic = {"Easy": "简单", "Normal": "困难", "Hell": "炼狱", "Hell+": "炼狱+"}
-diff_exp = {"Easy": 0.9, "Normal": 1.4, "Hell": 2, "Hell+": 3}
+diff_exp = {"Easy": 1, "Normal": 1.5, "Hell": 2.2, "Hell+": 3}
 diff_elite_num = {"Easy": 3, "Normal": 4, "Hell": 5, "Hell+": 5}
 diff_elite_normal_num = {"Easy": 4, "Normal": 5, "Hell": 6, "Hell+": 7}
 diff_item = {"Easy": 2, "Normal": 1, "Hell": 0, "Hell+": 0}

+ 1 - 1
game/const/window.py

@@ -1,5 +1,5 @@
 from game.const import game as G
 
 WINDOW_SIZE = WINDOW_W, WINDOW_H = (800, 600)
-WINDOW_CAPTION = f"QQTRogue{G.VERSION}(底层逻辑:永恒; 地牢算法开发与设计:100の雨女; 唯一官方群756422783免费下载; 擅自售卖皆属剽窃!)"
+WINDOW_CAPTION = f"QQTRogue{G.VERSION}(引擎:永恒; 肉鸽作者:100の雨女; 唯一官方群689297964免费下载; 擅自售卖皆属剽窃!)"
 WINDOW_SCROLL_PADDING = 200

+ 6 - 5
game/level/level.py

@@ -860,6 +860,7 @@ class Level:
                     R.new_drop_list = []
                     save_encrypt_single_rouge_file(rouge_other_data, "rougeOBOther")
 
+                real_exp = int(R.rouge_exp * R.diff_exp[R.difficulty])
                 if G.IS_ONLINE:
                     self.message_entry.new_message(sender='酷比终端', message='正在同步至酷比服务器..')
                     util.save_online()
@@ -868,7 +869,7 @@ class Level:
                     new_data = {}
                     for hero in R.hero_name.keys():
                         if hero == R.rouge_hero:
-                            exp = rouge_encrypted_data[hero]["exp"] + R.rouge_exp
+                            exp = rouge_encrypted_data[hero]["exp"] + real_exp
                         else:
                             exp = rouge_encrypted_data[hero]["exp"]
                         lv = R.current_lv(exp)
@@ -876,8 +877,8 @@ class Level:
                     save_encrypt_single_rouge_file(new_data, "rougeOB")
                     R.last_message = R.remain_exp(new_data[R.rouge_hero]["exp"])
 
-                print(R.rouge_hero, ": exp +", R.rouge_exp)
-                R.last_exp = R.rouge_exp
+                print(R.rouge_hero, ": exp +", real_exp)
+                R.last_exp = real_exp
                 # G.SHOW_INPUT = False
                 # 成就记录
                 if G.CURRENT_LEVEL%2!=0:
@@ -895,10 +896,10 @@ class Level:
                     rouge_achivements_encrypted_data.append(new_achivements_data)
                     # 添加新的加密数据
                     save_encrypt_single_rouge_file(rouge_achivements_encrypted_data, "rougeOB_achievement")
-                R.game_exp += R.rouge_exp
+                R.game_exp += real_exp
                 R.rouge_exp = 0
                 # 储存游戏
-                if G.CURRENT_LEVEL %2 == 1:
+                if G.CURRENT_LEVEL % 2 == 1:
                     self.save_progress()
 
 

+ 3 - 10
game/sprite/npc.py

@@ -420,9 +420,7 @@ class Npc(Player, Throwable):
                     R.rouge_exp += random.randint(30, 50)
                 elif self.stats_name in T.elite_list:
                     # R.coin += random.randint(0, int(2*R.coin_lv(R.rouge_lv)))
-                    R.coin += \
-                        random.choices([0, 1, 2], weights=[1, R.coin_lv(R.rouge_lv) - 0.6, R.coin_lv(R.rouge_lv) - 0.8],
-                                       k=1)[0]
+                    R.coin += random.choices([0, 1, 2], weights=[1, R.coin_lv(R.rouge_lv) - 0.6, R.coin_lv(R.rouge_lv) - 0.8], k=1)[0]
                     R.rouge_exp += random.randint(3, 5)
                 else:
                     # R.coin += random.randint(0, int(1*R.coin_lv(R.rouge_lv)))  # random.choices([0, 1], weights=[70, 30], k=1)[0]
@@ -440,10 +438,7 @@ class Npc(Player, Throwable):
                     R.rouge_exp += random.randint(4, 6)
                 else:
                     # R.coin += random.randint(0, int(2*R.coin_lv(R.rouge_lv)))
-                    R.coin += \
-                        random.choices([0, 1, 2],
-                                       weights=[1.6, R.coin_lv(R.rouge_lv) - 0.4, R.coin_lv(R.rouge_lv) - 0.6],
-                                       k=1)[0]
+                    R.coin += random.choices([0, 1, 2], weights=[1.6, R.coin_lv(R.rouge_lv) - 0.4, R.coin_lv(R.rouge_lv) - 0.6], k=1)[0]
                     R.rouge_exp += random.randint(2, 4)
             elif 21 <= G.CURRENT_LEVEL <= 30:
                 if self.stats_name in T.boss_list:
@@ -476,9 +471,7 @@ class Npc(Player, Throwable):
                         k=1)[0]
                     R.rouge_exp += random.randint(8, 12)
                 else:
-                    R.coin += random.randint(1, 2) * \
-                              random.choices([2, 3], weights=[R.coin_lv(R.rouge_lv), R.coin_lv(R.rouge_lv) - 0.2], k=1)[
-                                  0]
+                    R.coin += random.randint(1, 2) * random.choices([2, 3], weights=[R.coin_lv(R.rouge_lv), R.coin_lv(R.rouge_lv) - 0.2], k=1)[0]
                     R.rouge_exp += random.randint(5, 7)
         if self.blood_bar_pos != 0:
             try:

+ 5 - 4
game/sprite/player.py

@@ -716,22 +716,23 @@ class Player(updatable.Updatable):
                 R.new_drop_list = []
                 save_encrypt_single_rouge_file(rouge_other_data, "rougeOBOther")
 
+            real_exp = int(R.rouge_exp * R.diff_exp[R.difficulty])
             if G.IS_ONLINE:
                 util.save_online()
-                level.current_level.message_entry.new_message(sender='Rogue助手', message='经验+'+str(R.rouge_exp) + ', 当前等级经验: ' + R.remain_exp(util.get_online_data()[R.rouge_hero]["exp"]))
+                level.current_level.message_entry.new_message(sender='Rogue助手', message='经验+'+str(real_exp) + ', 当前等级经验: ' + R.remain_exp(util.get_online_data()[R.rouge_hero]["exp"]))
             else:
                 new_data = {}
                 for hero in R.hero_name.keys():
                     if hero == R.rouge_hero:
-                        exp = rouge_encrypted_data[hero]["exp"] + R.rouge_exp
+                        exp = rouge_encrypted_data[hero]["exp"] + real_exp
                     else:
                         exp = rouge_encrypted_data[hero]["exp"]
                     lv = R.current_lv(exp)
                     new_data[hero] = {"exp": exp, "lv": lv}
                 save_encrypt_single_rouge_file(new_data, "rougeOB")
-                level.current_level.message_entry.new_message(sender='Rogue助手', message='经验+'+str(R.rouge_exp) + ', 当前等级经验: ' + R.remain_exp(new_data[R.rouge_hero]["exp"]))
+                level.current_level.message_entry.new_message(sender='Rogue助手', message='经验+'+str(real_exp) + ', 当前等级经验: ' + R.remain_exp(new_data[R.rouge_hero]["exp"]))
 
-            print(R.rouge_hero, ": exp + ", R.rouge_exp)
+            print(R.rouge_hero, ": exp + ", real_exp)
             R.rouge_exp = 0
             last_game_file_path = os.path.join(qqtpve_folder, "rougeOBLastGame.rougedata")  # 存档路径
             if os.path.exists(last_game_file_path):