From ae65b5140fcdadb00a7dedc72ca0122f148d366a Mon Sep 17 00:00:00 2001 From: shoucandanghehe Date: Tue, 18 Jun 2024 17:26:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E6=AD=A3=20max=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_tetris_stats/games/tetrio/record/blitz.py | 5 ++++- nonebot_plugin_tetris_stats/games/tetrio/record/sprint.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nonebot_plugin_tetris_stats/games/tetrio/record/blitz.py b/nonebot_plugin_tetris_stats/games/tetrio/record/blitz.py index f6a97c1..93e61da 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/record/blitz.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/record/blitz.py @@ -84,7 +84,10 @@ async def make_blitz_image(player: Player) -> bytes: keys=endcontext.inputs, kpp=round(endcontext.inputs / endcontext.piecesplaced, 2), kps=round(endcontext.inputs / duration, 2), - max=Max(combo=endcontext.combo, btb=endcontext.btb), + max=Max( + combo=max((0, endcontext.combo - 1)), + btb=max((0, endcontext.btb - 1)), + ), pieces=endcontext.piecesplaced, pps=metrics.pps, lines=endcontext.lines, diff --git a/nonebot_plugin_tetris_stats/games/tetrio/record/sprint.py b/nonebot_plugin_tetris_stats/games/tetrio/record/sprint.py index 17d465c..4cf6631 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/record/sprint.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/record/sprint.py @@ -86,7 +86,10 @@ async def make_sprint_image(player: Player) -> bytes: keys=endcontext.inputs, kpp=round(endcontext.inputs / endcontext.piecesplaced, 2), kps=round(endcontext.inputs / duration, 2), - max=Max(combo=endcontext.combo, btb=endcontext.btb), + max=Max( + combo=max((0, endcontext.combo - 1)), + btb=max((0, endcontext.btb - 1)), + ), pieces=endcontext.piecesplaced, pps=metrics.pps, lines=endcontext.lines,