refactor: 重构无限关模式,移除章节概念,统一使用关卡-回合结构
This commit is contained in:
@@ -104,15 +104,15 @@ export enum GameEvent {
|
||||
STAGE_PROGRESS_UPDATE = "STAGE_PROGRESS_UPDATE",
|
||||
/** 奖励领取完成(payload 为空,UI 刷新待领取列表/红点) */
|
||||
REWARD_CLAIMED = "REWARD_CLAIMED",
|
||||
/** 小节开始(payload: { chapter, stage, section },MissionMonComp 据此生成怪物) */
|
||||
/** 回合开始(payload: { stage, section },MissionMonComp 据此生成怪物) */
|
||||
SectionStart = "SectionStart",
|
||||
/** 小节结束(payload: { chapter, stage, section },玩家点击"下一节"后推进) */
|
||||
/** @deprecated 已废弃:无限关模式无节间结算,回合自动推进,勿再监听 */
|
||||
SectionEnd = "SectionEnd",
|
||||
/** 大关结束(payload: { chapter, stage },10 节打完) */
|
||||
/** @deprecated 已废弃:无限关模式无大关结算,勿再监听 */
|
||||
StageEnd = "StageEnd",
|
||||
/** 章节结束(payload: { chapter },10 关打完) */
|
||||
/** @deprecated 已废弃:无限关模式无章节概念,勿再监听 */
|
||||
ChapterEnd = "ChapterEnd",
|
||||
/** 结算弹窗点击"下一节"(payload 为空,MissionComp 据此推进到下一小节) */
|
||||
/** @deprecated 已废弃:无限关模式无"下一节"手动推进,勿再监听 */
|
||||
NextSection = "NextSection",
|
||||
/** 结算弹窗点击"再来一次"(payload 为空,MissionComp 据此重开本关) */
|
||||
RestartMission = "RestartMission",
|
||||
|
||||
@@ -117,12 +117,11 @@ export function getSectionType(section: number): SectionType {
|
||||
|
||||
/**
|
||||
* 获取回合配置(无限关:按需动态生成,不再依赖章节静态表)
|
||||
* @param chapter 章节号(无限关模式已废弃章节概念,参数仅为兼容旧调用方,恒忽略)
|
||||
* @param stage 关卡号(1~∞)
|
||||
* @param section 回合号(1~SECTIONS_PER_STAGE)
|
||||
* @returns 回合配置,回合号越界时返回 null
|
||||
*/
|
||||
export function getSectionConfig(chapter: number, stage: number, section: number): SectionConfig | null {
|
||||
export function getSectionConfig(stage: number, section: number): SectionConfig | null {
|
||||
if (section < 1 || section > SECTIONS_PER_STAGE) return null;
|
||||
|
||||
const type = getSectionType(section);
|
||||
@@ -140,12 +139,11 @@ export function getSectionConfig(chapter: number, stage: number, section: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前进度显示文本(无限关:只展示 关-回合,章节号恒忽略)
|
||||
* @param chapter 章节号(兼容参数,恒忽略)
|
||||
* 获取当前进度显示文本(无限关:只展示 关-回合)
|
||||
* @param stage 关卡号
|
||||
* @param section 回合号
|
||||
* @returns 格式化文本,如 "5-3"
|
||||
*/
|
||||
export function getProgressText(chapter: number, stage: number, section: number): string {
|
||||
export function getProgressText(stage: number, section: number): string {
|
||||
return `${stage}-${section}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user