mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
Compare commits
4 Commits
5a5f9d9d0d
...
0fa765e58b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fa765e58b | ||
|
|
0e5100c3d0 | ||
|
|
7111677e0f | ||
|
|
a461a4efa9 |
Submodule Skins/PyTaikoGreen updated: 1829a2538b...8cac9f3e0b
@@ -33,7 +33,7 @@ class OsuParser:
|
|||||||
self.metadata.offset = -30/1000
|
self.metadata.offset = -30/1000
|
||||||
self.metadata.title["en"] = self.osu_metadata["Version"]
|
self.metadata.title["en"] = self.osu_metadata["Version"]
|
||||||
self.metadata.subtitle["en"] = self.osu_metadata["Creator"]
|
self.metadata.subtitle["en"] = self.osu_metadata["Creator"]
|
||||||
match = re.search(r'\[Events\][\s\S]*?^[ \t]*(\d+),(\d+),"([^"]+)"', osu_file.read_text(), re.MULTILINE)
|
match = re.search(r'\[Events\][\s\S]*?^[ \t]*(\d+),(\d+),"([^"]+)"', osu_file.read_text(encoding='utf-8'), re.MULTILINE)
|
||||||
if match:
|
if match:
|
||||||
self.metadata.bgmovie = osu_file.parent / Path(match.group(3))
|
self.metadata.bgmovie = osu_file.parent / Path(match.group(3))
|
||||||
self.metadata.course_data[0] = CourseData()
|
self.metadata.course_data[0] = CourseData()
|
||||||
|
|||||||
@@ -955,7 +955,7 @@ class Player:
|
|||||||
big = curr_note.type == NoteType.DON_L or curr_note.type == NoteType.KAT_L
|
big = curr_note.type == NoteType.DON_L or curr_note.type == NoteType.KAT_L
|
||||||
if (curr_note.hit_ms - good_window_ms) <= ms_from_start <= (curr_note.hit_ms + good_window_ms):
|
if (curr_note.hit_ms - good_window_ms) <= ms_from_start <= (curr_note.hit_ms + good_window_ms):
|
||||||
self.draw_judge_list.append(Judgment(Judgments.GOOD, big, self.is_2p))
|
self.draw_judge_list.append(Judgment(Judgments.GOOD, big, self.is_2p))
|
||||||
self.lane_hit_effect = LaneHitEffect(Judgments.GOOD, self.is_2p)
|
self.lane_hit_effect = LaneHitEffect(drum_type, Judgments.GOOD, self.is_2p)
|
||||||
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_num, self.base_score, self.is_2p))
|
self.base_score_list.append(ScoreCounterAnimation(self.player_num, self.base_score, self.is_2p))
|
||||||
@@ -973,6 +973,7 @@ class Player:
|
|||||||
|
|
||||||
elif (curr_note.hit_ms - ok_window_ms) <= ms_from_start <= (curr_note.hit_ms + ok_window_ms):
|
elif (curr_note.hit_ms - ok_window_ms) <= ms_from_start <= (curr_note.hit_ms + ok_window_ms):
|
||||||
self.draw_judge_list.append(Judgment(Judgments.OK, big, self.is_2p))
|
self.draw_judge_list.append(Judgment(Judgments.OK, big, self.is_2p))
|
||||||
|
self.lane_hit_effect = LaneHitEffect(drum_type, Judgments.OK, self.is_2p)
|
||||||
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_num, 10 * math.floor(self.base_score / 2 / 10), self.is_2p))
|
self.base_score_list.append(ScoreCounterAnimation(self.player_num, 10 * math.floor(self.base_score / 2 / 10), self.is_2p))
|
||||||
@@ -1036,7 +1037,7 @@ class Player:
|
|||||||
self.kusudama_anim = None
|
self.kusudama_anim = None
|
||||||
|
|
||||||
def spawn_hit_effects(self, drum_type: DrumType, side: Side):
|
def spawn_hit_effects(self, drum_type: DrumType, side: Side):
|
||||||
self.lane_hit_effect = LaneHitEffect(drum_type, self.is_2p)
|
self.lane_hit_effect = LaneHitEffect(drum_type, Judgments.BAD, self.is_2p) # Bad code detected...
|
||||||
self.draw_drum_hit_list.append(DrumHitEffect(drum_type, side, self.is_2p))
|
self.draw_drum_hit_list.append(DrumHitEffect(drum_type, side, self.is_2p))
|
||||||
|
|
||||||
def handle_input(self, ms_from_start: float, current_time: float, background: Optional[Background]):
|
def handle_input(self, ms_from_start: float, current_time: float, background: Optional[Background]):
|
||||||
@@ -1461,9 +1462,10 @@ class Judgment:
|
|||||||
|
|
||||||
class LaneHitEffect:
|
class LaneHitEffect:
|
||||||
"""Display a gradient overlay when the player hits the drum"""
|
"""Display a gradient overlay when the player hits the drum"""
|
||||||
def __init__(self, type: Judgments | DrumType, is_2p: bool):
|
def __init__(self, type: DrumType, judgment: Judgments, is_2p: bool):
|
||||||
self.is_2p = is_2p
|
self.is_2p = is_2p
|
||||||
self.type = type
|
self.type = type
|
||||||
|
self.judgment = judgment
|
||||||
self.fade = tex.get_animation(0, is_copy=True)
|
self.fade = tex.get_animation(0, is_copy=True)
|
||||||
self.fade.start()
|
self.fade.start()
|
||||||
self.is_finished = False
|
self.is_finished = False
|
||||||
@@ -1474,12 +1476,12 @@ class LaneHitEffect:
|
|||||||
self.is_finished = True
|
self.is_finished = True
|
||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
if self.type == Judgments.GOOD:
|
if self.type == DrumType.DON:
|
||||||
tex.draw_texture('lane', 'lane_hit_effect', frame=2, index=self.is_2p, fade=self.fade.attribute)
|
|
||||||
elif self.type == DrumType.DON:
|
|
||||||
tex.draw_texture('lane', 'lane_hit_effect', frame=0, index=self.is_2p, fade=self.fade.attribute)
|
tex.draw_texture('lane', 'lane_hit_effect', frame=0, index=self.is_2p, fade=self.fade.attribute)
|
||||||
elif self.type == DrumType.KAT:
|
elif self.type == DrumType.KAT:
|
||||||
tex.draw_texture('lane', 'lane_hit_effect', frame=1, index=self.is_2p, fade=self.fade.attribute)
|
tex.draw_texture('lane', 'lane_hit_effect', frame=1, index=self.is_2p, fade=self.fade.attribute)
|
||||||
|
if self.judgment == Judgments.GOOD or self.judgment == Judgments.OK:
|
||||||
|
tex.draw_texture('lane', 'lane_hit_effect', frame=2, index=self.is_2p, fade=self.fade.attribute)
|
||||||
|
|
||||||
class DrumHitEffect:
|
class DrumHitEffect:
|
||||||
"""Display the side of the drum hit"""
|
"""Display the side of the drum hit"""
|
||||||
|
|||||||
Reference in New Issue
Block a user