From 8b87ca88e522b56d922e35cdd7ca112a0e27ac97 Mon Sep 17 00:00:00 2001 From: qdzwxe Date: Thu, 4 Sep 2025 22:19:19 +0800 Subject: [PATCH 1/3] feat: statistic total page --- .../src/render/ui/statistics.tsx | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/packages-user/client-modules/src/render/ui/statistics.tsx b/packages-user/client-modules/src/render/ui/statistics.tsx index a8b3db6..7b1e3c3 100644 --- a/packages-user/client-modules/src/render/ui/statistics.tsx +++ b/packages-user/client-modules/src/render/ui/statistics.tsx @@ -48,7 +48,8 @@ export const Statistics = defineComponent(props => { ; const TotalStatistics = defineComponent(props => { - return () => ( - - - - ); + return () => { + const total = props.data.total; + + const text1 = `全塔地图中,共有怪物${total.enemyCount}个。`; + const text2 = `共有宝石${total.gemCount}个,共加攻击力${total.atkValue}点、防御力${total.defValue}点,魔防${total.mdefValue}点。`; + const text3 = `共有血瓶${total.potionCount}个,共加生命值${total.potionValue}点。`; + + return ( + + ); + }; }, statisticsPanelProps); const FloorStatistics = defineComponent(props => { From 92319deb0a2cf659911d809f4bdd19e810b63af2 Mon Sep 17 00:00:00 2001 From: qdzwxe Date: Thu, 4 Sep 2025 22:29:30 +0800 Subject: [PATCH 2/3] feat: statistic gempotion calc --- .../src/render/ui/statistics.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages-user/client-modules/src/render/ui/statistics.tsx b/packages-user/client-modules/src/render/ui/statistics.tsx index 7b1e3c3..0237440 100644 --- a/packages-user/client-modules/src/render/ui/statistics.tsx +++ b/packages-user/client-modules/src/render/ui/statistics.tsx @@ -17,6 +17,9 @@ export interface StatisticsDataOneFloor { atkValue: number; defValue: number; mdefValue: number; + atkGemCount: number; + defGemCount: number; + mdefGemCount: number; } export interface StatisticsData { @@ -137,7 +140,10 @@ export function calculateStatisticsOne( potionValue: 0, atkValue: 0, defValue: 0, - mdefValue: 0 + mdefValue: 0, + atkGemCount: 0, + defGemCount: 0, + mdefGemCount: 0 }; if (!diff) return statistics; core.status.maps[floorId].blocks.forEach(v => { @@ -165,12 +171,15 @@ export function calculateStatisticsOne( } if (atk > 0) { statistics.atkValue += atk; + statistics.atkGemCount++; } if (def > 0) { statistics.defValue += def; + statistics.defGemCount++; } if (mdef > 0) { statistics.mdefValue += mdef; + statistics.mdefGemCount++; } } } @@ -227,6 +236,13 @@ export function calculateStatistics(): StatisticsData { return prev; }); + const potionGem = floors.values().reduce((prev, curr) => { + prev.atkGemCount += curr.atkGemCount; + prev.defGemCount += curr.defGemCount; + prev.mdefGemCount += curr.mdefGemCount; + return prev; + }); + return { total, floors From 58f40d762d8ce24e878a5203249dd731a3640189 Mon Sep 17 00:00:00 2001 From: qdzwxe Date: Mon, 8 Sep 2025 22:55:27 +0800 Subject: [PATCH 3/3] feat: statistic gempotion simple text --- .../src/render/ui/statistics.tsx | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/packages-user/client-modules/src/render/ui/statistics.tsx b/packages-user/client-modules/src/render/ui/statistics.tsx index 0237440..eadb7e7 100644 --- a/packages-user/client-modules/src/render/ui/statistics.tsx +++ b/packages-user/client-modules/src/render/ui/statistics.tsx @@ -22,9 +22,17 @@ export interface StatisticsDataOneFloor { mdefGemCount: number; } +export interface StatisticsDataPotionGem { + atkGemCount: number; + defGemCount: number; + mdefGemCount: number; + potionCount: number; +} + export interface StatisticsData { total: StatisticsDataOneFloor; floors: Map; + potionGem: StatisticsDataPotionGem; } export interface StatisticsProps extends UIComponentProps, DefaultProps { @@ -105,7 +113,21 @@ const EnemyStatistics = defineComponent(props => { }, statisticsPanelProps); const PotionStatistics = defineComponent(props => { - return () => ; + return () => { + const gemPotion = props.data.potionGem; + + const text1 = `全塔地图中,共有红宝石${gemPotion.atkGemCount}个,共有蓝宝石${gemPotion.defGemCount}个,共有缘宝石${gemPotion.mdefGemCount}个。`; + const text2 = `共有血瓶${gemPotion.potionCount}个。`; + return ( + + ); + }; }, statisticsPanelProps); export function calculateStatisticsOne( @@ -240,12 +262,14 @@ export function calculateStatistics(): StatisticsData { prev.atkGemCount += curr.atkGemCount; prev.defGemCount += curr.defGemCount; prev.mdefGemCount += curr.mdefGemCount; + prev.potionCount += curr.potionCount; return prev; }); return { total, - floors + floors, + potionGem }; }