mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 19:50:12 +01:00
add moji judgment display
This commit is contained in:
@@ -355,7 +355,7 @@ class Player:
|
|||||||
else:
|
else:
|
||||||
self.judge_counter = None
|
self.judge_counter = None
|
||||||
|
|
||||||
self.input_log: dict[float, tuple] = dict()
|
self.input_log: dict[float, str] = dict()
|
||||||
stars = tja.metadata.course_data[self.difficulty].level
|
stars = tja.metadata.course_data[self.difficulty].level
|
||||||
self.gauge = Gauge(self.player_number, self.difficulty, stars, self.total_notes, self.is_2p)
|
self.gauge = Gauge(self.player_number, self.difficulty, stars, self.total_notes, self.is_2p)
|
||||||
self.gauge_hit_effect: list[GaugeHitEffect] = []
|
self.gauge_hit_effect: list[GaugeHitEffect] = []
|
||||||
@@ -528,6 +528,7 @@ class Player:
|
|||||||
else:
|
else:
|
||||||
background.add_chibi(True, 1)
|
background.add_chibi(True, 1)
|
||||||
self.bad_count += 1
|
self.bad_count += 1
|
||||||
|
self.input_log[self.don_notes[0].index] = 'BAD'
|
||||||
if self.gauge is not None:
|
if self.gauge is not None:
|
||||||
self.gauge.add_bad()
|
self.gauge.add_bad()
|
||||||
self.don_notes.popleft()
|
self.don_notes.popleft()
|
||||||
@@ -542,6 +543,7 @@ class Player:
|
|||||||
else:
|
else:
|
||||||
background.add_chibi(True, 1)
|
background.add_chibi(True, 1)
|
||||||
self.bad_count += 1
|
self.bad_count += 1
|
||||||
|
self.input_log[self.kat_notes[0].index] = 'BAD'
|
||||||
if self.gauge is not None:
|
if self.gauge is not None:
|
||||||
self.gauge.add_bad()
|
self.gauge.add_bad()
|
||||||
self.kat_notes.popleft()
|
self.kat_notes.popleft()
|
||||||
@@ -723,6 +725,7 @@ class Player:
|
|||||||
self.good_count += 1
|
self.good_count += 1
|
||||||
self.score += self.base_score
|
self.score += self.base_score
|
||||||
self.base_score_list.append(ScoreCounterAnimation(self.player_number, self.base_score, self.is_2p))
|
self.base_score_list.append(ScoreCounterAnimation(self.player_number, self.base_score, self.is_2p))
|
||||||
|
self.input_log[curr_note.index] = 'GOOD'
|
||||||
self.note_correct(curr_note, current_time)
|
self.note_correct(curr_note, current_time)
|
||||||
if self.gauge is not None:
|
if self.gauge is not None:
|
||||||
self.gauge.add_good()
|
self.gauge.add_good()
|
||||||
@@ -739,6 +742,7 @@ class Player:
|
|||||||
self.ok_count += 1
|
self.ok_count += 1
|
||||||
self.score += 10 * math.floor(self.base_score / 2 / 10)
|
self.score += 10 * math.floor(self.base_score / 2 / 10)
|
||||||
self.base_score_list.append(ScoreCounterAnimation(self.player_number, 10 * math.floor(self.base_score / 2 / 10), self.is_2p))
|
self.base_score_list.append(ScoreCounterAnimation(self.player_number, 10 * math.floor(self.base_score / 2 / 10), self.is_2p))
|
||||||
|
self.input_log[curr_note.index] = 'OK'
|
||||||
self.note_correct(curr_note, current_time)
|
self.note_correct(curr_note, current_time)
|
||||||
if self.gauge is not None:
|
if self.gauge is not None:
|
||||||
self.gauge.add_ok()
|
self.gauge.add_ok()
|
||||||
@@ -751,6 +755,7 @@ class Player:
|
|||||||
background.add_chibi(False, 1)
|
background.add_chibi(False, 1)
|
||||||
|
|
||||||
elif (curr_note.hit_ms - bad_window_ms) <= ms_from_start <= (curr_note.hit_ms + bad_window_ms):
|
elif (curr_note.hit_ms - bad_window_ms) <= ms_from_start <= (curr_note.hit_ms + bad_window_ms):
|
||||||
|
self.input_log[curr_note.index] = 'BAD'
|
||||||
self.draw_judge_list.append(Judgement('BAD', big, self.is_2p))
|
self.draw_judge_list.append(Judgement('BAD', big, self.is_2p))
|
||||||
self.bad_count += 1
|
self.bad_count += 1
|
||||||
self.combo = 0
|
self.combo = 0
|
||||||
@@ -808,7 +813,6 @@ class Player:
|
|||||||
|
|
||||||
drum_value = 1 if note_type == 'DON' else 2
|
drum_value = 1 if note_type == 'DON' else 2
|
||||||
self.check_note(ms_from_start, drum_value, current_time, background)
|
self.check_note(ms_from_start, drum_value, current_time, background)
|
||||||
self.input_log[ms_from_start] = (note_type, side)
|
|
||||||
|
|
||||||
def autoplay_manager(self, ms_from_start: float, current_time: float, background: Optional[Background]):
|
def autoplay_manager(self, ms_from_start: float, current_time: float, background: Optional[Background]):
|
||||||
"""Manages autoplay behavior"""
|
"""Manages autoplay behavior"""
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class PracticeGameScreen(GameScreen):
|
|||||||
self.scrobble_index = nearest_bar_index - 1
|
self.scrobble_index = nearest_bar_index - 1
|
||||||
self.scrobble_time = self.bars[self.scrobble_index].hit_ms
|
self.scrobble_time = self.bars[self.scrobble_index].hit_ms
|
||||||
else:
|
else:
|
||||||
|
self.player_1.input_log.clear()
|
||||||
resume_bar_index = max(0, self.scrobble_index)
|
resume_bar_index = max(0, self.scrobble_index)
|
||||||
previous_bar_index = max(0, self.scrobble_index - 1)
|
previous_bar_index = max(0, self.scrobble_index - 1)
|
||||||
|
|
||||||
@@ -235,7 +236,13 @@ class PracticeGameScreen(GameScreen):
|
|||||||
|
|
||||||
if note.display:
|
if note.display:
|
||||||
tex.draw_texture('notes', str(note.type), x=x_position, y=y_position+192, center=True)
|
tex.draw_texture('notes', str(note.type), x=x_position, y=y_position+192, center=True)
|
||||||
tex.draw_texture('notes', 'moji', frame=note.moji, x=x_position - (168//2) + 64, y=323 + y_position)
|
color = ray.WHITE
|
||||||
|
if note.index in self.player_1.input_log:
|
||||||
|
if self.player_1.input_log[note.index] == 'GOOD':
|
||||||
|
color = ray.Color(255, 233, 0, 255)
|
||||||
|
elif self.player_1.input_log[note.index] == 'BAD':
|
||||||
|
color = ray.Color(34, 189, 243, 255)
|
||||||
|
tex.draw_texture('notes', 'moji', frame=note.moji, x=x_position - (168//2) + 64, y=323 + y_position, color=color)
|
||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
self.background.draw()
|
self.background.draw()
|
||||||
@@ -245,9 +252,9 @@ class PracticeGameScreen(GameScreen):
|
|||||||
self.player_1.draw_overlays(self.mask_shader)
|
self.player_1.draw_overlays(self.mask_shader)
|
||||||
tex.draw_texture('practice', 'progress_bar_bg')
|
tex.draw_texture('practice', 'progress_bar_bg')
|
||||||
if self.paused:
|
if self.paused:
|
||||||
progress = (self.scrobble_time + self.scrobble_move.attribute - self.bars[0].hit_ms) / self.player_1.end_time
|
progress = min((self.scrobble_time + self.scrobble_move.attribute - self.bars[0].hit_ms) / self.player_1.end_time, 1)
|
||||||
else:
|
else:
|
||||||
progress = self.current_ms / self.player_1.end_time
|
progress = min(self.current_ms / self.player_1.end_time, 1)
|
||||||
tex.draw_texture('practice', 'progress_bar', x2=progress * 890)
|
tex.draw_texture('practice', 'progress_bar', x2=progress * 890)
|
||||||
for marker in self.markers:
|
for marker in self.markers:
|
||||||
tex.draw_texture('practice', 'gogo_marker', x=((marker - self.bars[0].hit_ms) / self.player_1.end_time) * 890)
|
tex.draw_texture('practice', 'gogo_marker', x=((marker - self.bars[0].hit_ms) / self.player_1.end_time) * 890)
|
||||||
|
|||||||
Reference in New Issue
Block a user