mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 19:50:12 +01:00
fix knight of nights and battle no 1
This commit is contained in:
24
libs/tja.py
24
libs/tja.py
@@ -649,30 +649,6 @@ class TJAParser:
|
||||
branch_balloon_count = count
|
||||
branch_params = part[13:]
|
||||
|
||||
if branch_params[0] == 'r':
|
||||
# Helper function to find and set drumroll branch params
|
||||
def set_drumroll_branch_params(note_list, bar_list):
|
||||
for i in range(len(note_list)-1, -1, -1):
|
||||
if 5 <= note_list[i].type <= 7 or note_list[i].type == 9:
|
||||
drumroll_ms = note_list[i].hit_ms
|
||||
for bar_idx in range(len(bar_list)-1, -1, -1):
|
||||
if bar_list[bar_idx].hit_ms <= drumroll_ms:
|
||||
bar_list[bar_idx].branch_params = branch_params
|
||||
return True
|
||||
break
|
||||
return False
|
||||
|
||||
# Always try to set in master notes
|
||||
set_drumroll_branch_params(master_notes.play_notes, master_notes.bars)
|
||||
|
||||
# If we have existing branches, also apply to them
|
||||
if branch_m and len(branch_m) > 0:
|
||||
set_drumroll_branch_params(branch_m[-1].play_notes, branch_m[-1].bars)
|
||||
if branch_e and len(branch_e) > 0:
|
||||
set_drumroll_branch_params(branch_e[-1].play_notes, branch_e[-1].bars)
|
||||
if branch_n and len(branch_n) > 0:
|
||||
set_drumroll_branch_params(branch_n[-1].play_notes, branch_n[-1].bars)
|
||||
else:
|
||||
def set_branch_params(bar_list: list[Note], branch_params: str, section_bar: Optional[Note]):
|
||||
if bar_list and len(bar_list) > 1:
|
||||
section_index = -2
|
||||
|
||||
@@ -499,7 +499,7 @@ class BoxManager:
|
||||
def update(self, current_time_ms: float, is_2p: bool):
|
||||
self.is_2p = is_2p
|
||||
if self.is_2p:
|
||||
self.box_locations = ["SONG_SELECT_2P", "SETTINGS"]
|
||||
self.box_locations = ["SONG_SELECT_2P", "PRACTICE_SELECT", "SETTINGS"]
|
||||
for i, box in enumerate(self.boxes):
|
||||
box.location = self.box_locations[i]
|
||||
self.fade_out.update(current_time_ms)
|
||||
|
||||
@@ -416,14 +416,13 @@ class Player:
|
||||
self.play_notes = deque(sorted(self.play_notes))
|
||||
self.draw_note_list = deque(sorted(self.draw_note_list, key=lambda x: x.load_ms))
|
||||
self.draw_bar_list = deque(sorted(self.draw_bar_list, key=lambda x: x.load_ms))
|
||||
timing_threshold = current_ms - Player.TIMING_BAD
|
||||
total_don = [note for note in self.play_notes if note.type in {1, 3}]
|
||||
total_kat = [note for note in self.play_notes if note.type in {2, 4}]
|
||||
total_other = [note for note in self.play_notes if note.type not in {1, 2, 3, 4}]
|
||||
|
||||
self.don_notes = deque([note for note in total_don if note.hit_ms > timing_threshold])
|
||||
self.kat_notes = deque([note for note in total_kat if note.hit_ms > timing_threshold])
|
||||
self.other_notes = deque([note for note in total_other if note.hit_ms > timing_threshold])
|
||||
self.don_notes = deque([note for note in total_don if note.hit_ms > current_ms])
|
||||
self.kat_notes = deque([note for note in total_kat if note.hit_ms > current_ms])
|
||||
self.other_notes = deque([note for note in total_other if note.hit_ms > current_ms])
|
||||
|
||||
def get_result_score(self):
|
||||
"""Returns the score, good count, ok count, bad count, max combo, and total drumroll"""
|
||||
@@ -485,11 +484,10 @@ class Player:
|
||||
end_roll = -1
|
||||
|
||||
note_lists = [
|
||||
self.current_notes_draw,
|
||||
self.branch_n[0].draw_notes if self.branch_n else [],
|
||||
self.branch_e[0].draw_notes if self.branch_e else [],
|
||||
self.branch_m[0].draw_notes if self.branch_m else [],
|
||||
self.draw_note_list if self.draw_note_list else []
|
||||
self.other_notes,
|
||||
self.branch_m[0].play_notes if self.branch_m else [],
|
||||
self.branch_e[0].play_notes if self.branch_e else [],
|
||||
self.branch_n[0].play_notes if self.branch_n else [],
|
||||
]
|
||||
|
||||
end_roll = -1
|
||||
@@ -897,6 +895,7 @@ class Player:
|
||||
self.branch_indicator.level_down('normal')
|
||||
self.branch_m.pop(0)
|
||||
self.branch_e.pop(0)
|
||||
if self.branch_indicator is not None:
|
||||
logger.info(f"Branch set to {self.branch_indicator.difficulty} based on conditions {self.branch_condition_count}, {e_req, m_req}")
|
||||
self.branch_condition_count = 0
|
||||
|
||||
|
||||
@@ -256,6 +256,7 @@ class PracticeGameScreen(GameScreen):
|
||||
tex.draw_texture('practice', 'playing', index=int(self.player_1.player_number)-1, fade=0.5)
|
||||
tex.draw_texture('practice', 'progress_bar_bg')
|
||||
if self.paused:
|
||||
tex.draw_texture('practice', 'paused', fade=0.5)
|
||||
progress = min((self.scrobble_time + self.scrobble_move.attribute - self.bars[0].hit_ms) / self.player_1.end_time, 1)
|
||||
else:
|
||||
progress = min(self.current_ms / self.player_1.end_time, 1)
|
||||
|
||||
Reference in New Issue
Block a user