refactor: 重构关卡经济与战斗流程
1. 移除战斗阶段限制,允许玩家在战斗中操作卡牌 2. 新增波次间5秒自动倒计时机制 3. 将固定波次金币奖励改为怪物死亡掉落 4. 重构卡牌面板逻辑,统一抽卡按钮状态判断 5. 清理冗余的战斗阶段状态变量与相关代码
This commit is contained in:
@@ -15,6 +15,8 @@ import { FieldSkillType } from "../common/config/SkillSet";
|
|||||||
|
|
||||||
import { mLogger } from "../common/Logger";
|
import { mLogger } from "../common/Logger";
|
||||||
import { SkillTriggerHelper } from "./SkillTriggerHelper";
|
import { SkillTriggerHelper } from "./SkillTriggerHelper";
|
||||||
|
import { getMonsterGoldDrop } from "../map/RogueConfig";
|
||||||
|
import { MissionEconomy } from "../map/MissionEconomy";
|
||||||
|
|
||||||
/** 最终伤害数据接口
|
/** 最终伤害数据接口
|
||||||
* 用于封装一次攻击计算的所有结果数据
|
* 用于封装一次攻击计算的所有结果数据
|
||||||
@@ -473,24 +475,28 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 延迟执行掉落逻辑
|
* 怪物死亡掉落金币
|
||||||
*
|
*
|
||||||
* 采用延迟执行的原因:
|
* 实现说明:
|
||||||
* 1. 避免在伤害计算过程中阻塞主线程
|
* - 通过 hero_uuid 查 HeroInfo 获取 monType
|
||||||
* 2. 给死亡动画播放留出时间
|
* - 按怪物类型查 MonsterGoldSet 获取固定金币掉落数(Boss 有独立的高额奖励)
|
||||||
* 3. 可以批量处理多个掉落,优化性能
|
* - 调用 MissionEconomy.addCoin 统一发放金币(会自动触发 UI 更新和评分统计)
|
||||||
*
|
*
|
||||||
* @param entity 死亡的怪物实体
|
* @param entity 死亡的怪物实体
|
||||||
*
|
|
||||||
* @todo 具体实现可以包括:
|
|
||||||
* - 根据怪物等级计算基础掉落
|
|
||||||
* - 幸运值影响掉落品质
|
|
||||||
* - 特殊事件(双倍掉落、稀有掉落等)
|
|
||||||
* - 掉落物在场景中的生成位置计算
|
|
||||||
*/
|
*/
|
||||||
private scheduleDrop(entity: ecs.Entity): void {
|
private scheduleDrop(entity: ecs.Entity): void {
|
||||||
// 这里可以添加掉落逻辑
|
const TAttrsComp = entity.get(HeroAttrsComp);
|
||||||
// 例如:延迟一段时间后生成掉落物品
|
if (!TAttrsComp) return;
|
||||||
|
|
||||||
|
// 通过 hero_uuid 查配置获取怪物类型
|
||||||
|
const info = HeroInfo[TAttrsComp.hero_uuid];
|
||||||
|
const monType = info?.monType ?? 0;
|
||||||
|
const gold = getMonsterGoldDrop(monType, !!TAttrsComp.is_boss);
|
||||||
|
if (gold <= 0) return;
|
||||||
|
|
||||||
|
MissionEconomy.addCoin(gold);
|
||||||
|
mLogger.log(this.debugMode, 'HeroAtkSystem',
|
||||||
|
` ${TAttrsComp.hero_name} 死亡掉落金币 ${gold}(monType=${monType}, isBoss=${TAttrsComp.is_boss})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -135,9 +135,6 @@ export class MissionCardComp extends CCComp {
|
|||||||
|
|
||||||
// ======================== 运行时状态 ========================
|
// ======================== 运行时状态 ========================
|
||||||
|
|
||||||
/** 当前是否为战斗阶段 */
|
|
||||||
private isBattlePhase: boolean = false;
|
|
||||||
|
|
||||||
/** 四个槽位对应的 CardComp 控制器缓存(有序数组) */
|
/** 四个槽位对应的 CardComp 控制器缓存(有序数组) */
|
||||||
private cardComps: CardComp[] = [];
|
private cardComps: CardComp[] = [];
|
||||||
/** 技能卡槽控制器缓存 */
|
/** 技能卡槽控制器缓存 */
|
||||||
@@ -203,7 +200,6 @@ export class MissionCardComp extends CCComp {
|
|||||||
* 6. 执行首次抽卡并分发到 4 个槽位。
|
* 6. 执行首次抽卡并分发到 4 个槽位。
|
||||||
*/
|
*/
|
||||||
onMissionStart() {
|
onMissionStart() {
|
||||||
this.isBattlePhase = false;
|
|
||||||
this.enterPreparePhase();
|
this.enterPreparePhase();
|
||||||
this.poolLv = CARD_POOL_INIT_LEVEL;
|
this.poolLv = CARD_POOL_INIT_LEVEL;
|
||||||
const missionData = this.getMissionData();
|
const missionData = this.getMissionData();
|
||||||
@@ -326,11 +322,9 @@ export class MissionCardComp extends CCComp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 战斗开始:不收起面板,不再强制清空卡牌 */
|
/** 战斗开始:保留卡牌面板,允许玩家在战斗阶段继续抽卡和召唤英雄 */
|
||||||
private onFightStart() {
|
private onFightStart() {
|
||||||
this.isBattlePhase = true;
|
|
||||||
this.enterBattlePhase();
|
this.enterBattlePhase();
|
||||||
this.clearAllCards();
|
|
||||||
|
|
||||||
// 第一次进入战斗阶段,关闭guide4
|
// 第一次进入战斗阶段,关闭guide4
|
||||||
if (!smc.finish_guides.includes(4)) {
|
if (!smc.finish_guides.includes(4)) {
|
||||||
@@ -418,7 +412,6 @@ export class MissionCardComp extends CCComp {
|
|||||||
|
|
||||||
/** 新一波:展开面板 → 刷新费用 UI → 重新抽卡分发 */
|
/** 新一波:展开面板 → 刷新费用 UI → 重新抽卡分发 */
|
||||||
private onNewWave() {
|
private onNewWave() {
|
||||||
this.isBattlePhase = false;
|
|
||||||
this.enterPreparePhase();
|
this.enterPreparePhase();
|
||||||
this.updateCoinAndCostUI();
|
this.updateCoinAndCostUI();
|
||||||
this.layoutCardSlots();
|
this.layoutCardSlots();
|
||||||
@@ -589,12 +582,7 @@ export class MissionCardComp extends CCComp {
|
|||||||
const payload = args ?? event;
|
const payload = args ?? event;
|
||||||
if (!payload) return;
|
if (!payload) return;
|
||||||
|
|
||||||
if (this.isBattlePhase) {
|
// 战斗阶段也允许召唤英雄(无需额外费用),仅校验英雄数量上限
|
||||||
payload.cancel = true;
|
|
||||||
payload.reason = "battle_phase";
|
|
||||||
oops.gui.toast("战斗阶段无法召唤英雄");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const current = this.getAliveHeroCount();
|
const current = this.getAliveHeroCount();
|
||||||
this.syncMissionHeroData(current);
|
this.syncMissionHeroData(current);
|
||||||
@@ -781,10 +769,7 @@ export class MissionCardComp extends CCComp {
|
|||||||
* 3. 重新布局槽位 → 从卡池构建 4 张卡 → 分发到槽位。
|
* 3. 重新布局槽位 → 从卡池构建 4 张卡 → 分发到槽位。
|
||||||
*/
|
*/
|
||||||
private onClickDraw() {
|
private onClickDraw() {
|
||||||
if (this.isBattlePhase) {
|
// 战斗阶段和倒计时阶段均允许刷新抽卡
|
||||||
oops.gui.toast("战斗阶段无法抽卡");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const cost = MissionEconomy.getRefreshCost(this.refreshCost);
|
const cost = MissionEconomy.getRefreshCost(this.refreshCost);
|
||||||
const success = MissionEconomy.executeRefresh(this.refreshCost);
|
const success = MissionEconomy.executeRefresh(this.refreshCost);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
@@ -868,22 +853,13 @@ export class MissionCardComp extends CCComp {
|
|||||||
private enterBattlePhase() {
|
private enterBattlePhase() {
|
||||||
if (!this.cards_node || !this.cards_node.isValid) return;
|
if (!this.cards_node || !this.cards_node.isValid) return;
|
||||||
this.initCardsPanelPos();
|
this.initCardsPanelPos();
|
||||||
|
// 战斗阶段允许抽卡:nobg 按"金币是否足够"判断,而非强制置灰
|
||||||
if (this.cards_chou && this.cards_chou.isValid) {
|
if (this.cards_chou && this.cards_chou.isValid) {
|
||||||
const nobg = this.cards_chou.getChildByName("nobg");
|
const nobg = this.cards_chou.getChildByName("nobg");
|
||||||
if (nobg) {
|
if (nobg) {
|
||||||
nobg.active = true;
|
nobg.active = !this.canDrawCards();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 战斗阶段不再隐藏抽卡面板
|
|
||||||
// Tween.stopAllByTarget(this.cards_node);
|
|
||||||
// tween(this.cards_node)
|
|
||||||
// .to(this.cardsPanelMoveDuration, { scale: this.cardsHideScale })
|
|
||||||
// .call(() => {
|
|
||||||
// if (this.cards_node && this.cards_node.isValid) {
|
|
||||||
// this.cards_node.active = false;
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 构建本次抽卡结果,保证最终可分发3条数据 */
|
/** 构建本次抽卡结果,保证最终可分发3条数据 */
|
||||||
@@ -1098,10 +1074,11 @@ export class MissionCardComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private updateDrawCostUI() {
|
private updateDrawCostUI() {
|
||||||
|
// 战斗阶段也允许抽卡,nobg 统一按"金币是否足够"判断
|
||||||
if (this.cards_chou) {
|
if (this.cards_chou) {
|
||||||
const nobg = this.cards_chou.getChildByName("nobg");
|
const nobg = this.cards_chou.getChildByName("nobg");
|
||||||
if (nobg) {
|
if (nobg) {
|
||||||
nobg.active = this.isBattlePhase ? true : !this.canDrawCards();
|
nobg.active = !this.canDrawCards();
|
||||||
}
|
}
|
||||||
const coinNode = this.cards_chou.getChildByName("coin");
|
const coinNode = this.cards_chou.getChildByName("coin");
|
||||||
const numLabel = coinNode?.getChildByName("num")?.getComponent(Label);
|
const numLabel = coinNode?.getChildByName("num")?.getComponent(Label);
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
|||||||
import { FieldSkillType } from "../common/config/SkillSet";
|
import { FieldSkillType } from "../common/config/SkillSet";
|
||||||
import { FieldSkillHelper } from "../hero/FieldSkillHelper";
|
import { FieldSkillHelper } from "../hero/FieldSkillHelper";
|
||||||
import { spawningEngine } from "./RogueConfig";
|
import { spawningEngine } from "./RogueConfig";
|
||||||
import { MissionEconomy } from "./MissionEconomy";
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
/** 任务(关卡)生命周期阶段 */
|
/** 任务(关卡)生命周期阶段 */
|
||||||
@@ -129,6 +128,10 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
/**秒计时 */
|
/**秒计时 */
|
||||||
PhaseTime: Timer = new Timer(1)
|
PhaseTime: Timer = new Timer(1)
|
||||||
|
/** 波次间倒计时(秒) */
|
||||||
|
private waveCountdown: number = 0;
|
||||||
|
/** 波次间倒计时总时长(秒) */
|
||||||
|
private readonly WAVE_COUNTDOWN_DURATION: number = 5;
|
||||||
/** 上一次显示的时间字符串(避免重复设置) */
|
/** 上一次显示的时间字符串(避免重复设置) */
|
||||||
private lastTimeStr: string = "";
|
private lastTimeStr: string = "";
|
||||||
/** 上一次显示的秒数(避免重复计算) */
|
/** 上一次显示的秒数(避免重复计算) */
|
||||||
@@ -159,10 +162,10 @@ export class MissionComp extends CCComp {
|
|||||||
private currentWave: number = 0;
|
private currentWave: number = 0;
|
||||||
/** 是否为Boss波次 */
|
/** 是否为Boss波次 */
|
||||||
private isBossWave: boolean = false;
|
private isBossWave: boolean = false;
|
||||||
/** 上一次发放金币奖励的波数(防止重复发放) */
|
|
||||||
private lastPrepareCoinWave: number = 0;
|
|
||||||
/** 当前任务阶段 */
|
/** 当前任务阶段 */
|
||||||
public currentPhase: MissionPhase = MissionPhase.None;
|
public currentPhase: MissionPhase = MissionPhase.None;
|
||||||
|
/** 是否处于波次间倒计时状态 */
|
||||||
|
private isWaveCountdown: boolean = false;
|
||||||
|
|
||||||
// ======================== ECS 查询匹配器(预缓存) ========================
|
// ======================== ECS 查询匹配器(预缓存) ========================
|
||||||
|
|
||||||
@@ -219,9 +222,18 @@ export class MissionComp extends CCComp {
|
|||||||
// 如果是暂停状态,且不在 BattleEnd 阶段(全灭时需要播放完 fend 技能动画并自动流转),才真正停止 update 逻辑
|
// 如果是暂停状态,且不在 BattleEnd 阶段(全灭时需要播放完 fend 技能动画并自动流转),才真正停止 update 逻辑
|
||||||
if (smc.mission.pause && this.currentPhase !== MissionPhase.BattleEnd) return
|
if (smc.mission.pause && this.currentPhase !== MissionPhase.BattleEnd) return
|
||||||
|
|
||||||
|
// 波次间倒计时:PrepareStart 复用为倒计时阶段,5 秒后自动进入下一波
|
||||||
|
if (this.currentPhase === MissionPhase.PrepareStart) {
|
||||||
|
this.waveCountdown -= dt;
|
||||||
|
this.updateCountdownUI();
|
||||||
|
if (this.waveCountdown <= 0) {
|
||||||
|
this.autoNextPhase();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 处理过渡阶段的计时
|
// 处理过渡阶段的计时
|
||||||
if (this.currentPhase === MissionPhase.PrepareStart ||
|
if (this.currentPhase === MissionPhase.PrepareEnd ||
|
||||||
this.currentPhase === MissionPhase.PrepareEnd ||
|
|
||||||
this.currentPhase === MissionPhase.BattleStart ||
|
this.currentPhase === MissionPhase.BattleStart ||
|
||||||
this.currentPhase === MissionPhase.BattleEnd) {
|
this.currentPhase === MissionPhase.BattleEnd) {
|
||||||
if (this.PhaseTime.update(dt)) {
|
if (this.PhaseTime.update(dt)) {
|
||||||
@@ -260,6 +272,39 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ======================== 波次倒计时 ========================
|
||||||
|
|
||||||
|
/** 进入波次间倒计时:重置倒计时并显示提示 */
|
||||||
|
private startWaveCountdown() {
|
||||||
|
this.waveCountdown = this.WAVE_COUNTDOWN_DURATION;
|
||||||
|
this.isWaveCountdown = true;
|
||||||
|
this.updateCountdownUI(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新倒计时 UI(显示剩余秒数) */
|
||||||
|
private updateCountdownUI(force: boolean = false) {
|
||||||
|
if (!this.isWaveCountdown) return;
|
||||||
|
const remain = Math.max(0, Math.ceil(this.waveCountdown));
|
||||||
|
if (!force && remain === this.lastTimeSecond) return;
|
||||||
|
this.lastTimeSecond = remain;
|
||||||
|
|
||||||
|
if (this.time_node && this.time_node.isValid) {
|
||||||
|
const phaseNode = this.time_node.getChildByPath("Phase/Label");
|
||||||
|
if (phaseNode) {
|
||||||
|
const label = phaseNode.getComponent(Label);
|
||||||
|
if (label) {
|
||||||
|
label.string = `下一波 ${remain}s`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 结束波次间倒计时 */
|
||||||
|
private stopWaveCountdown() {
|
||||||
|
this.isWaveCountdown = false;
|
||||||
|
this.lastTimeSecond = -1;
|
||||||
|
}
|
||||||
|
|
||||||
// ======================== 奖励与广告 ========================
|
// ======================== 奖励与广告 ========================
|
||||||
|
|
||||||
/** 奖励发放(预留) */
|
/** 奖励发放(预留) */
|
||||||
@@ -425,7 +470,13 @@ export class MissionComp extends CCComp {
|
|||||||
smc.mission.in_fight = false;
|
smc.mission.in_fight = false;
|
||||||
smc.vmdata.mission_data.in_fight = false;
|
smc.vmdata.mission_data.in_fight = false;
|
||||||
smc.mission.stop_spawn_mon = true;
|
smc.mission.stop_spawn_mon = true;
|
||||||
// 不隐藏开始按钮,点击事件在 onStartFightBtnClick 内部做了阶段拦截
|
// 波次间倒计时:隐藏开始按钮(nobg 激活表示不可点击状态)
|
||||||
|
if (this.start_btn && this.start_btn.isValid) {
|
||||||
|
const nobg = this.start_btn.getChildByName("nobg");
|
||||||
|
if (nobg) nobg.active = true;
|
||||||
|
}
|
||||||
|
// 启动 5 秒倒计时,由 update 驱动自动进入下一波
|
||||||
|
this.startWaveCountdown();
|
||||||
oops.message.dispatchEvent("PhasePrepareStart");
|
oops.message.dispatchEvent("PhasePrepareStart");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -526,7 +577,9 @@ export class MissionComp extends CCComp {
|
|||||||
private autoNextPhase() {
|
private autoNextPhase() {
|
||||||
switch (this.currentPhase) {
|
switch (this.currentPhase) {
|
||||||
case MissionPhase.PrepareStart:
|
case MissionPhase.PrepareStart:
|
||||||
this.changePhase(MissionPhase.Prepare);
|
// 波次间倒计时结束,停止倒计时状态,直接进入 PrepareEnd(不再等待玩家点击)
|
||||||
|
this.stopWaveCountdown();
|
||||||
|
this.changePhase(MissionPhase.PrepareEnd);
|
||||||
break;
|
break;
|
||||||
case MissionPhase.PrepareEnd:
|
case MissionPhase.PrepareEnd:
|
||||||
this.changePhase(MissionPhase.BattleStart);
|
this.changePhase(MissionPhase.BattleStart);
|
||||||
@@ -728,7 +781,6 @@ export class MissionComp extends CCComp {
|
|||||||
this.heapTrendTimer = 0;
|
this.heapTrendTimer = 0;
|
||||||
this.heapTrendBaseMB = -1;
|
this.heapTrendBaseMB = -1;
|
||||||
this.monsterCountSyncTimer = 0;
|
this.monsterCountSyncTimer = 0;
|
||||||
this.lastPrepareCoinWave = 0;
|
|
||||||
|
|
||||||
spawningEngine.reset();
|
spawningEngine.reset();
|
||||||
|
|
||||||
@@ -746,8 +798,9 @@ export class MissionComp extends CCComp {
|
|||||||
* 新一波事件回调:
|
* 新一波事件回调:
|
||||||
* 1. 进入准备阶段。
|
* 1. 进入准备阶段。
|
||||||
* 2. 更新当前波数。
|
* 2. 更新当前波数。
|
||||||
* 3. 发放本波金币奖励。
|
* 3. 刷新时间显示。
|
||||||
* 4. 刷新时间显示。
|
*
|
||||||
|
* 注意:金币不再按波次固定发放,改为怪物死亡时掉落(见 HeroAtkSystem)。
|
||||||
*
|
*
|
||||||
* @param event 事件名
|
* @param event 事件名
|
||||||
* @param data { wave: number }
|
* @param data { wave: number }
|
||||||
@@ -772,7 +825,7 @@ export class MissionComp extends CCComp {
|
|||||||
|
|
||||||
this.currentWave = wave;
|
this.currentWave = wave;
|
||||||
smc.vmdata.mission_data.level = wave;
|
smc.vmdata.mission_data.level = wave;
|
||||||
this.grantPrepareCoinByWave(wave);
|
// 金币改为怪物死亡掉落(见 HeroAtkSystem),不再每波固定发放
|
||||||
this.lastTimeSecond = -1;
|
this.lastTimeSecond = -1;
|
||||||
this.clearTime = 0;
|
this.clearTime = 0;
|
||||||
this.update_time();
|
this.update_time();
|
||||||
@@ -794,26 +847,6 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 按波数发放固定金币奖励(外加技能加成)。
|
|
||||||
* 第1波不发放(使用初始金币),从第2波起发放。
|
|
||||||
* 仅在波数首次到达时发放,防止重复。
|
|
||||||
*
|
|
||||||
* @param wave 当前波数
|
|
||||||
*/
|
|
||||||
private grantPrepareCoinByWave(wave: number) {
|
|
||||||
if (wave <= 1) return;
|
|
||||||
if (wave <= this.lastPrepareCoinWave) return;
|
|
||||||
|
|
||||||
// 波次金币公式: baseReward + (wave-1) * waveGrow,且不超过 prepareMaxCoinReward
|
|
||||||
const calculatedReward = FightSet.WAVE_COIN_BASE + (wave - 1) * FightSet.WAVE_COIN_GROW;
|
|
||||||
const waveReward = Math.min(FightSet.WAVE_COIN_MAX, calculatedReward);
|
|
||||||
const reward = MissionEconomy.executeWaveGold(waveReward);
|
|
||||||
|
|
||||||
this.lastPrepareCoinWave = wave;
|
|
||||||
mLogger.log(this.debugMode, "MissionComp", "grantPrepareCoinByWave", { wave, waveReward, reward, coin: smc.vmdata.mission_data.coin });
|
|
||||||
}
|
|
||||||
|
|
||||||
// ======================== 怪物数量管理 ========================
|
// ======================== 怪物数量管理 ========================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -76,6 +76,40 @@ for (const key in HeroInfo) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ======================== 2.5 怪物金币掉落配置 ========================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 怪物金币掉落配置(按 MonType 分类)
|
||||||
|
* - base: 普通怪物死亡时掉落的固定金币数
|
||||||
|
* - boss: Boss 怪物死亡时掉落的固定金币数(仅对 Boss 类型生效)
|
||||||
|
*
|
||||||
|
* 设计说明:
|
||||||
|
* 金币不再按波次固定发放,改为每只怪物死亡时掉落。
|
||||||
|
* Boss 提供高额固定金币奖励,作为战斗收益的核心来源。
|
||||||
|
*/
|
||||||
|
export const MonsterGoldSet: Record<number, { base: number; boss: number }> = {
|
||||||
|
[MonType.Melee]: { base: 1, boss: 0 },
|
||||||
|
[MonType.Heavy]: { base: 2, boss: 0 },
|
||||||
|
[MonType.Long]: { base: 2, boss: 0 },
|
||||||
|
[MonType.Support]: { base: 3, boss: 0 },
|
||||||
|
[MonType.Summoner]: { base: 3, boss: 0 },
|
||||||
|
[MonType.Assassin]: { base: 3, boss: 0 },
|
||||||
|
[MonType.MeleeBoss]: { base: 0, boss: 15 },
|
||||||
|
[MonType.LongBoss]: { base: 0, boss: 15 },
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定怪物类型的金币掉落数量
|
||||||
|
* @param monType 怪物类型(MonType)
|
||||||
|
* @param isBoss 是否为 Boss
|
||||||
|
* @returns 掉落的金币数量(≥0)
|
||||||
|
*/
|
||||||
|
export function getMonsterGoldDrop(monType: number, isBoss: boolean): number {
|
||||||
|
const cfg = MonsterGoldSet[monType];
|
||||||
|
if (!cfg) return 0;
|
||||||
|
return Math.max(0, Math.floor(isBoss ? cfg.boss : cfg.base));
|
||||||
|
}
|
||||||
|
|
||||||
// ======================== 3. 波次级强化库 ========================
|
// ======================== 3. 波次级强化库 ========================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user