mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
add graphics
This commit is contained in:
@@ -9,7 +9,7 @@ nijiiro_notes = false
|
|||||||
log_level = 30
|
log_level = 30
|
||||||
fake_online = false
|
fake_online = false
|
||||||
practice_mode_bar_delay = 1
|
practice_mode_bar_delay = 1
|
||||||
score_method = "gen3"
|
score_method = "shinuchi"
|
||||||
|
|
||||||
[nameplate_1p]
|
[nameplate_1p]
|
||||||
name = 'どんちゃん'
|
name = 'どんちゃん'
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class GeneralConfig(TypedDict):
|
|||||||
log_level: int
|
log_level: int
|
||||||
fake_online: bool
|
fake_online: bool
|
||||||
practice_mode_bar_delay: int
|
practice_mode_bar_delay: int
|
||||||
|
score_method: str
|
||||||
|
|
||||||
class NameplateConfig(TypedDict):
|
class NameplateConfig(TypedDict):
|
||||||
name: str
|
name: str
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ class Judgments(IntEnum):
|
|||||||
OK = 1
|
OK = 1
|
||||||
BAD = 2
|
BAD = 2
|
||||||
|
|
||||||
|
class ScoreMethod():
|
||||||
|
GEN3 = "gen3"
|
||||||
|
SHINUCHI = "shinuchi"
|
||||||
|
|
||||||
class GameScreen(Screen):
|
class GameScreen(Screen):
|
||||||
JUDGE_X = 414 * tex.screen_scale
|
JUDGE_X = 414 * tex.screen_scale
|
||||||
JUDGE_Y = 256 * tex.screen_scale
|
JUDGE_Y = 256 * tex.screen_scale
|
||||||
@@ -409,9 +413,9 @@ class Player:
|
|||||||
self.base_score = 0
|
self.base_score = 0
|
||||||
self.score_init = 0
|
self.score_init = 0
|
||||||
self.score_diff = 0
|
self.score_diff = 0
|
||||||
if self.score_method =="shinuchi":
|
if self.score_method == ScoreMethod.SHINUCHI:
|
||||||
self.base_score = calculate_base_score(total_notes)
|
self.base_score = calculate_base_score(total_notes)
|
||||||
elif self.score_method == "gen3":
|
elif self.score_method == ScoreMethod.GEN3:
|
||||||
self.score_diff = self.tja.metadata.course_data[self.difficulty].scorediff
|
self.score_diff = self.tja.metadata.course_data[self.difficulty].scorediff
|
||||||
if self.score_diff <= 0:
|
if self.score_diff <= 0:
|
||||||
logger.warning("Error: No scorediff specified or scorediff less than 0 | Using shinuchi scoring method instead")
|
logger.warning("Error: No scorediff specified or scorediff less than 0 | Using shinuchi scoring method instead")
|
||||||
@@ -880,7 +884,7 @@ class Player:
|
|||||||
ok_window_ms = Player.TIMING_OK
|
ok_window_ms = Player.TIMING_OK
|
||||||
bad_window_ms = Player.TIMING_BAD
|
bad_window_ms = Player.TIMING_BAD
|
||||||
|
|
||||||
if self.score_method == "gen3":
|
if self.score_method == ScoreMethod.GEN3:
|
||||||
self.base_score = self.score_init
|
self.base_score = self.score_init
|
||||||
if 9 < self.combo and self.combo < 30:
|
if 9 < self.combo and self.combo < 30:
|
||||||
self.base_score = math.floor(self.score_init + 1 * self.score_diff)
|
self.base_score = math.floor(self.score_init + 1 * self.score_diff)
|
||||||
@@ -986,7 +990,7 @@ class Player:
|
|||||||
self.chara.set_animation('balloon_popping')
|
self.chara.set_animation('balloon_popping')
|
||||||
self.balloon_anim.update(current_time, self.curr_balloon_count, not self.is_balloon)
|
self.balloon_anim.update(current_time, self.curr_balloon_count, not self.is_balloon)
|
||||||
if self.balloon_anim.is_finished:
|
if self.balloon_anim.is_finished:
|
||||||
if self.score_method == "gen3":
|
if self.score_method == ScoreMethod.GEN3:
|
||||||
self.score += 5000
|
self.score += 5000
|
||||||
self.base_score_list.append(ScoreCounterAnimation(self.player_num, 5000, self.is_2p))
|
self.base_score_list.append(ScoreCounterAnimation(self.player_num, 5000, self.is_2p))
|
||||||
self.balloon_anim = None
|
self.balloon_anim = None
|
||||||
@@ -1264,7 +1268,10 @@ class Player:
|
|||||||
|
|
||||||
def draw_modifiers(self):
|
def draw_modifiers(self):
|
||||||
"""Shows the currently selected modifiers"""
|
"""Shows the currently selected modifiers"""
|
||||||
modifiers_to_draw = ['mod_shinuchi']
|
modifiers_to_draw = []
|
||||||
|
|
||||||
|
if self.score_method == ScoreMethod.SHINUCHI:
|
||||||
|
modifiers_to_draw.append('mod_shinuchi')
|
||||||
|
|
||||||
# Speed modifiers
|
# Speed modifiers
|
||||||
if global_data.modifiers[self.player_num].speed >= 4:
|
if global_data.modifiers[self.player_num].speed >= 4:
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ from libs.utils import (
|
|||||||
is_l_don_pressed,
|
is_l_don_pressed,
|
||||||
is_r_don_pressed
|
is_r_don_pressed
|
||||||
)
|
)
|
||||||
|
from scenes.game import ScoreMethod
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -218,7 +219,10 @@ class ResultPlayer:
|
|||||||
"""
|
"""
|
||||||
if not self.fade_in_finished:
|
if not self.fade_in_finished:
|
||||||
return
|
return
|
||||||
|
if global_data.config["general"]["score_method"] == ScoreMethod.SHINUCHI:
|
||||||
tex.draw_texture('score', 'score_shinuchi', index=self.is_2p)
|
tex.draw_texture('score', 'score_shinuchi', index=self.is_2p)
|
||||||
|
else:
|
||||||
|
tex.draw_texture('score', 'score', index=self.is_2p)
|
||||||
if self.score != '':
|
if self.score != '':
|
||||||
for i in range(len(str(self.score))):
|
for i in range(len(str(self.score))):
|
||||||
tex.draw_texture('score', 'score_num', x=-(i*tex.skin_config["result_score_margin"].x), frame=int(str(self.score)[::-1][i]), index=self.is_2p)
|
tex.draw_texture('score', 'score_num', x=-(i*tex.skin_config["result_score_margin"].x), frame=int(str(self.score)[::-1][i]), index=self.is_2p)
|
||||||
|
|||||||
Reference in New Issue
Block a user