mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-09-17 11:11:47 +08:00
feat: statistic gempotion simple text
This commit is contained in:
parent
c0762c62cf
commit
58f40d762d
@ -22,9 +22,17 @@ export interface StatisticsDataOneFloor {
|
|||||||
mdefGemCount: number;
|
mdefGemCount: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface StatisticsDataPotionGem {
|
||||||
|
atkGemCount: number;
|
||||||
|
defGemCount: number;
|
||||||
|
mdefGemCount: number;
|
||||||
|
potionCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface StatisticsData {
|
export interface StatisticsData {
|
||||||
total: StatisticsDataOneFloor;
|
total: StatisticsDataOneFloor;
|
||||||
floors: Map<FloorIds, StatisticsDataOneFloor>;
|
floors: Map<FloorIds, StatisticsDataOneFloor>;
|
||||||
|
potionGem: StatisticsDataPotionGem;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StatisticsProps extends UIComponentProps, DefaultProps {
|
export interface StatisticsProps extends UIComponentProps, DefaultProps {
|
||||||
@ -105,7 +113,21 @@ const EnemyStatistics = defineComponent<StatisticsPanelProps>(props => {
|
|||||||
}, statisticsPanelProps);
|
}, statisticsPanelProps);
|
||||||
|
|
||||||
const PotionStatistics = defineComponent<StatisticsPanelProps>(props => {
|
const PotionStatistics = defineComponent<StatisticsPanelProps>(props => {
|
||||||
return () => <container></container>;
|
return () => {
|
||||||
|
const gemPotion = props.data.potionGem;
|
||||||
|
|
||||||
|
const text1 = `全塔地图中,共有红宝石${gemPotion.atkGemCount}个,共有蓝宝石${gemPotion.defGemCount}个,共有缘宝石${gemPotion.mdefGemCount}个。`;
|
||||||
|
const text2 = `共有血瓶${gemPotion.potionCount}个。`;
|
||||||
|
return (
|
||||||
|
<TextContent
|
||||||
|
text={`${text1}${text2}`}
|
||||||
|
width={330}
|
||||||
|
loc={[0, 5, 330, 470]}
|
||||||
|
height={470}
|
||||||
|
lineHeight={9}
|
||||||
|
></TextContent>
|
||||||
|
);
|
||||||
|
};
|
||||||
}, statisticsPanelProps);
|
}, statisticsPanelProps);
|
||||||
|
|
||||||
export function calculateStatisticsOne(
|
export function calculateStatisticsOne(
|
||||||
@ -240,12 +262,14 @@ export function calculateStatistics(): StatisticsData {
|
|||||||
prev.atkGemCount += curr.atkGemCount;
|
prev.atkGemCount += curr.atkGemCount;
|
||||||
prev.defGemCount += curr.defGemCount;
|
prev.defGemCount += curr.defGemCount;
|
||||||
prev.mdefGemCount += curr.mdefGemCount;
|
prev.mdefGemCount += curr.mdefGemCount;
|
||||||
|
prev.potionCount += curr.potionCount;
|
||||||
return prev;
|
return prev;
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
total,
|
total,
|
||||||
floors
|
floors,
|
||||||
|
potionGem
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user