Skip to content

Commit

Permalink
debug qol
Browse files Browse the repository at this point in the history
  • Loading branch information
H4M5TER committed Jun 6, 2024
1 parent 5bdd233 commit 1e9b2ad
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions game/RiftWizard2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import sys
import re

DEBUG_MODE = True

os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
# Make all the relative file accesses work
cheats_enabled = False
Expand Down Expand Up @@ -2554,6 +2556,7 @@ def confirm_abandon(self):
self.play_sound("menu_confirm")
self.state = STATE_TITLE
self.examine_target = TITLE_SELECTION_NEW
self.new_game()

def abort_abandon(self):
self.play_sound("menu_confirm")
Expand Down Expand Up @@ -5085,17 +5088,18 @@ def draw_examine_portal(self):
self.draw_string("裂隙", self.examine_display, cur_x, cur_y)
cur_y += linesize

if self.game.next_level or not self.game.has_granted_xp:
cur_y += linesize
self.draw_string("????????", self.examine_display, cur_x, cur_y)
return
if not DEBUG_MODE:
if self.game.next_level or not self.game.has_granted_xp:
cur_y += linesize
self.draw_string("????????", self.examine_display, cur_x, cur_y)
return

if self.examine_target.locked:
cur_y += linesize

width = self.examine_display.get_width() - 2*border_margin
lines = self.draw_wrapped_string("(击败所有敌人和刷怪笼解锁)", self.examine_display, cur_x, cur_y, width)
cur_y += lines*linesize
if self.examine_target.locked:
cur_y += linesize
width = self.examine_display.get_width() - 2*border_margin
lines = self.draw_wrapped_string("(击败所有敌人和刷怪笼解锁)", self.examine_display, cur_x, cur_y, width)
cur_y += lines*linesize

cur_y += linesize

Expand Down Expand Up @@ -5477,7 +5481,7 @@ def draw_title(self):
opts = []
if can_continue_game():
opts.append((TITLE_SELECTION_LOAD, "继续游戏"))
opts.append((TITLE_SELECTION_ABANDON, "放弃游戏"))
opts.append((TITLE_SELECTION_ABANDON, "新游戏"))
else:
opts.append((TITLE_SELECTION_NEW, "新游戏"))

Expand Down Expand Up @@ -5566,15 +5570,15 @@ def process_title_input(self):
self.examine_target = None

if selection == TITLE_SELECTION_NEW:

# TEMP: do not pick mode, just start new game
#self.state = STATE_PICK_MODE
#self.examine_target = 0
self.new_game()
#

if selection == TITLE_SELECTION_ABANDON:
self.open_abandon_prompt()
if DEBUG_MODE:
self.confirm_abandon()
else:
self.open_abandon_prompt()
if selection == TITLE_SELECTION_OPTIONS:
self.open_options()
if selection == TITLE_SELECTION_LOAD:
Expand Down Expand Up @@ -6124,6 +6128,11 @@ def new_game(self, mutators=None, trial_name=None, seed=None):
self.make_level_screenshot()
SteamAdapter.set_presence_level(1)

if DEBUG_MODE:
self.game.p1.xp += 100
for i, c in all_consumables:
self.game.p1.add_item(i())

def play_battle_music(self, num=None):
if not self.track_queue:
self.track_queue = [i for i in range(2, 11)]
Expand Down

0 comments on commit 1e9b2ad

Please sign in to comment.