Files
pixelheros/assets/script/game/common/config/GameSet.ts
walkpan d0f88708c6 feat(gameplay): 重新平衡游戏经济、英雄属性和怪物配置
调整游戏核心平衡参数以优化15分钟游戏体验:
1. 提升抽卡和升级金币消耗(CHOU_GOLD 5→100,LVUP_GOLD 10→50)
2. 重制英雄基础属性和成长值(战士HP 200→300,法师AP 14→40)
3. 优化怪物生成逻辑和属性曲线(BOSS HP 25000→2000)
4. 更新经济系统公式和波次权重配置
2026-01-16 23:36:43 +08:00

146 lines
3.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* @Author: dgflash
* @Date: 2021-11-23 15:28:39
* @LastEditors: dgflash
* @LastEditTime: 2022-01-26 16:42:00
*/
/** 碰撞分组 */
export enum BoxSet {
//物理碰撞tag
SKILL_TAG=8,
ATK_RANGE = 4,
//group
DEFAULT = 1,
MONSTER = 2,
HERO = 4,
//地图边界
LETF_END = -420,
RIGHT_END = 420,
//游戏地平线
GAME_LINE = 120,
//攻击距离
}
export enum CardType {
Talent = 1,
Skill = 2,
Potion = 3,
Partner = 4,
Attr = 5,
}
export enum CardKind {
Atk = 1,
Atted = 2,
Buff = 3,
Attr = 4,
Skill = 5,
Hp = 6,
Dead = 7,
Partner = 8,
}
/**
* 获取等级对应的奖励类型
* @param level 当前等级
* @returns 奖励类型 CardType
*/
export function getLevelRewardType(level: number): CardType {
if (level === 1) {
return CardType.Skill;
} else if (level >= 2 && level <= 5) {
return CardType.Talent;
} else if (level === 6) {
return CardType.Partner;
} else {
return CardType.Potion; // 以后暂时都是物品
}
}
export enum FacSet {
HERO=0,
MON=1,
}
/** 数字格式化工具函数 */
export class NumberFormatter {
/**
* 将数字转换为易读格式
* @param num 要转换的数字
* @returns 格式化后的字符串
* 例如1234 -> "1.2k", 1234567 -> "1.2M", 1234567890 -> "1.2B"
*/
static formatNumber(num: number): string {
if (num < 1000) {
return num.toString();
} else if (num < 1000000) {
// 5位数用k表示 (1000-999999)
return (num / 1000).toFixed(1).replace(/\.0$/, '') + 'k';
} else if (num < 1000000000) {
// 7位数用M表示 (1000000-999999999)
return (num / 1000000).toFixed(1).replace(/\.0$/, '') + 'M';
} else if (num < 1000000000000) {
// 10位数用B表示 (1000000000-999999999999)
return (num / 1000000000).toFixed(1).replace(/\.0$/, '') + 'B';
} else {
// 更大的数字用T表示
return (num / 1000000000000).toFixed(1).replace(/\.0$/, '') + 'T';
}
}
/**
* 将数字转换为中文格式
* @param num 要转换的数字
* @returns 中文格式的字符串
* 例如1234 -> "1.2千", 1234567 -> "1.2百万"
*/
static formatNumberChinese(num: number): string {
if (num < 10000) {
return num.toString();
} else if (num < 100000000) {
// 万级别
return (num / 10000).toFixed(1).replace(/\.0$/, '') + '万';
} else if (num < 1000000000000) {
// 亿级别
return (num / 100000000).toFixed(1).replace(/\.0$/, '') + '亿';
} else {
// 万亿级别
return (num / 1000000000000).toFixed(1).replace(/\.0$/, '') + '万亿';
}
}
}
export enum FightSet {
CRIT_DAMAGE=50,//暴击伤害
MORE_RC=10,//更多次数 广告获取的次数
HEARTPOS=-320,//基地位置
HERO_MAX_NUM=3,//英雄最大数量
LVUP_GOLD=50,//升级需要的金币
LVUP_GOLD_UP=50,//升级需要的金币
CHOU_GOLD=100,//抽卡需要的金币
}
export enum IndexSet {
/** 英雄基础层级 */
HERO = 2000,
/** 一线怪物基础层级(y=120) - 层级较低,在后面 */
MON1 = 1000,
/** 二线怪物基础层级(y=80) - 层级较高,在前面 */
MON2 = 3000,
/** 每个怪物的层级增量,确保后生成的在前面 */
MON_INCREMENT = 1,
SLILL=4000,
BOSS=2100,
}
export const TooltipTypes = {
life:1,
health:2,
skill:3,
crit:4,
uskill:5,
lvup:6,
apup:7,
hpup:8,
addmp:9,
shield:10,
}