refactor(game/config): 替换硬编码费用为集中配置项
新增GameSet.ts中FightSet枚举的REFRESH_COST和BASE_COST常量,替换CardSet.ts和MissionCardComp.ts内的硬编码费用值。
This commit is contained in:
@@ -97,7 +97,7 @@ HeroList.forEach(uuid => {
|
|||||||
|
|
||||||
const basePoolLv = hero.pool_lv || 1;
|
const basePoolLv = hero.pool_lv || 1;
|
||||||
const baseHeroLv = hero.lv || 1;
|
const baseHeroLv = hero.lv || 1;
|
||||||
const baseCost = 5;
|
const baseCost = FightSet.BASE_COST;
|
||||||
const baseWeight = 25;
|
const baseWeight = 25;
|
||||||
|
|
||||||
// 生成从 basePoolLv 到 CARD_POOL_MAX_LEVEL 的卡牌
|
// 生成从 basePoolLv 到 CARD_POOL_MAX_LEVEL 的卡牌
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ export enum FightSet {
|
|||||||
SHIELD_MAX = 5,
|
SHIELD_MAX = 5,
|
||||||
WAVE_HEAL_RATE = 0.5, // 回合结束时所有英雄恢复最大生命值的比例
|
WAVE_HEAL_RATE = 0.5, // 回合结束时所有英雄恢复最大生命值的比例
|
||||||
PUNCTURE_DOWN = 50,
|
PUNCTURE_DOWN = 50,
|
||||||
|
REFRESH_COST = 1,
|
||||||
|
BASE_COST=3
|
||||||
|
// 刷新成本
|
||||||
}
|
}
|
||||||
|
|
||||||
export const laneIdx = {
|
export const laneIdx = {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export class MissionCardComp extends CCComp {
|
|||||||
/** 按钮弹起缩放(峰值) */
|
/** 按钮弹起缩放(峰值) */
|
||||||
private readonly buttonClickScale: number = 1.06;
|
private readonly buttonClickScale: number = 1.06;
|
||||||
/** 抽卡(刷新)费用 */
|
/** 抽卡(刷新)费用 */
|
||||||
refreshCost: number = 2;
|
refreshCost: number = FightSet.REFRESH_COST;
|
||||||
/** 卡牌面板展开/收起动画时长(秒) */
|
/** 卡牌面板展开/收起动画时长(秒) */
|
||||||
cardsPanelMoveDuration: number = 0.2;
|
cardsPanelMoveDuration: number = 0.2;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user