添加 升级系统
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@ import { VM } from "../../../../extensions/oops-plugin-framework/assets/libs/mod
|
|||||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { Initialize } from "../initialize/Initialize";
|
import { Initialize } from "../initialize/Initialize";
|
||||||
import { GameMap } from "../map/GameMap";
|
import { GameMap } from "../map/GameMap";
|
||||||
import { MissionData } from "./config/Mission";
|
import { MissionData, VmInfo } from "./config/Mission";
|
||||||
|
|
||||||
|
|
||||||
// import { Role } from "../role/Role";
|
// import { Role } from "../role/Role";
|
||||||
@@ -40,69 +40,18 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
|
|
||||||
},
|
},
|
||||||
hero:{
|
hero:{
|
||||||
hp:0,
|
|
||||||
hp_max:0,
|
|
||||||
hp_buff:0,
|
|
||||||
cd:3,
|
|
||||||
damage:0,
|
|
||||||
ap:0,
|
|
||||||
equip_ap:0,
|
|
||||||
buff_ap:0,
|
|
||||||
debuff_ap:0,
|
|
||||||
def:0,
|
|
||||||
crit:0,
|
|
||||||
crit_d:99,
|
|
||||||
dod:99,
|
|
||||||
dod_no:false,
|
|
||||||
crit_no:false,
|
|
||||||
wind:0,
|
|
||||||
thorns:0,
|
|
||||||
lifesteal:0,
|
|
||||||
|
|
||||||
},
|
},
|
||||||
friend:{
|
friend:{
|
||||||
hp:0,
|
|
||||||
hp_max:0,
|
|
||||||
hp_buff:0,
|
|
||||||
cd:3,
|
|
||||||
damage:0,
|
|
||||||
ap:0,
|
|
||||||
equip_ap:0,
|
|
||||||
buff_ap:0,
|
|
||||||
debuff_ap:0,
|
|
||||||
def:0,
|
|
||||||
crit:0,
|
|
||||||
crit_d:99,
|
|
||||||
dod:99,
|
|
||||||
dod_no:false,
|
|
||||||
crit_no:false,
|
|
||||||
wind:0,
|
|
||||||
thorns:0,
|
|
||||||
lifesteal:0,
|
|
||||||
},
|
},
|
||||||
boss:{
|
boss:{
|
||||||
hp:0,
|
|
||||||
hp_max:0,
|
|
||||||
hp_buff:0,
|
|
||||||
cd:3,
|
|
||||||
damage:0,
|
|
||||||
ap:0,
|
|
||||||
equip_ap:0,
|
|
||||||
buff_ap:0,
|
|
||||||
debuff_ap:0,
|
|
||||||
def:0,
|
|
||||||
crit:0,
|
|
||||||
crit_d:99,
|
|
||||||
dod:99,
|
|
||||||
dod_no:false,
|
|
||||||
crit_no:false,
|
|
||||||
wind:0,
|
|
||||||
thorns:0,
|
|
||||||
lifesteal:0,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
vmAdd() {
|
vmAdd() {
|
||||||
this.vmdata.mission_data=MissionData
|
this.vmdata.mission_data=JSON.parse(JSON.stringify(MissionData))
|
||||||
|
this.vmdata.hero=JSON.parse(JSON.stringify(VmInfo))
|
||||||
|
this.vmdata.friend=JSON.parse(JSON.stringify(VmInfo))
|
||||||
|
this.vmdata.boss=JSON.parse(JSON.stringify(VmInfo))
|
||||||
VM.add(this.vmdata, "data");
|
VM.add(this.vmdata, "data");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,4 +50,5 @@ export enum GameEvent {
|
|||||||
UpdateVMData = "UpdateVMData",
|
UpdateVMData = "UpdateVMData",
|
||||||
UpdateHP = "UpdateHP",
|
UpdateHP = "UpdateHP",
|
||||||
APChange = "APChange",
|
APChange = "APChange",
|
||||||
|
EXPUP = "EXPUP",
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
export const MonsetList = {
|
export const MonsetList = {
|
||||||
1:{
|
1:{
|
||||||
1:[5001],
|
1:[5001],
|
||||||
@@ -102,3 +101,26 @@ export const MissionData = {
|
|||||||
in_fight:false,
|
in_fight:false,
|
||||||
fight_time:0,//战斗时间
|
fight_time:0,//战斗时间
|
||||||
}
|
}
|
||||||
|
export const VmInfo = {
|
||||||
|
hp:0,
|
||||||
|
hp_max:0,
|
||||||
|
hp_buff:0,
|
||||||
|
lv:1,
|
||||||
|
exp:0,
|
||||||
|
next_exp:100,
|
||||||
|
cd:3,
|
||||||
|
damage:0,
|
||||||
|
ap:0,
|
||||||
|
equip_ap:0,
|
||||||
|
buff_ap:0,
|
||||||
|
debuff_ap:0,
|
||||||
|
def:0,
|
||||||
|
crit:0,
|
||||||
|
crit_d:99,
|
||||||
|
dod:99,
|
||||||
|
dod_no:false,
|
||||||
|
crit_no:false,
|
||||||
|
wind:0,
|
||||||
|
thorns:0,
|
||||||
|
lifesteal:0,
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export enum HeroKind {
|
|||||||
* 词条解释:
|
* 词条解释:
|
||||||
* 0:战士 1:远程 2:法师
|
* 0:战士 1:远程 2:法师
|
||||||
* * */
|
* * */
|
||||||
export enum HeroType {
|
export enum HType {
|
||||||
warrior = 0,
|
warrior = 0,
|
||||||
remote = 1,
|
remote = 1,
|
||||||
mage = 2,
|
mage = 2,
|
||||||
@@ -89,133 +89,216 @@ export const getTotalUpExp = (currentLevel: number, targetLevel: number): number
|
|||||||
return totalExp;
|
return totalExp;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 保留原有的 UpExp 对象以保持向后兼容性
|
// 简化的升级属性增长计算
|
||||||
export const UpExp = {
|
// 基于 HType 的攻击力增长配置
|
||||||
1: getUpExp(1), // 100
|
export const ApGrowthByType = {
|
||||||
2: getUpExp(2), // 110
|
[HType.warrior]: (baseAp: number) => Math.floor(baseAp * 0.05) + 3, // 战士:+5% + 3
|
||||||
3: getUpExp(3), // 130
|
[HType.remote]: (baseAp: number) => Math.floor(baseAp * 0.10) + 2, // 远程:+10% + 2
|
||||||
4: getUpExp(4), // 160
|
[HType.mage]: (baseAp: number) => Math.floor(baseAp * 0.15) + 1, // 法师:+15% + 1
|
||||||
5: getUpExp(5), // 200
|
};
|
||||||
6: getUpExp(6), // 250
|
|
||||||
7: getUpExp(7), // 310
|
// 基于 HType 的HP增长配置
|
||||||
8: getUpExp(8), // 380
|
export const HpGrowthByType = {
|
||||||
9: getUpExp(9), // 460
|
[HType.warrior]: (baseHp: number) => Math.floor(baseHp * 0.08) + 10, // 战士:+8% + 10
|
||||||
10: getUpExp(10), // 550
|
[HType.remote]: (baseHp: number) => Math.floor(baseHp * 0.05) + 5, // 远程:+5% + 5
|
||||||
11: getUpExp(11), // 650
|
[HType.mage]: (baseHp: number) => Math.floor(baseHp * 0.03) + 3, // 法师:+3% + 3
|
||||||
12: getUpExp(12), // 760
|
};
|
||||||
13: getUpExp(13), // 880
|
|
||||||
14: getUpExp(14), // 1010
|
// 获取从1级升级到2级增加的攻击力
|
||||||
15: getUpExp(15), // 1150
|
export const getUpAp = (heroId: number): number => {
|
||||||
16: getUpExp(16), // 1300
|
const heroInfo = HeroInfo[heroId];
|
||||||
17: getUpExp(17), // 1460
|
if (!heroInfo) {
|
||||||
18: getUpExp(18), // 1630
|
console.warn(`[getUpAp] 英雄 ${heroId} 不存在`);
|
||||||
19: getUpExp(19), // 1810
|
return 0;
|
||||||
20: getUpExp(20), // 2000
|
}
|
||||||
21: getUpExp(21), // 2200
|
|
||||||
22: getUpExp(22), // 2410
|
const baseAp = heroInfo.ap;
|
||||||
23: getUpExp(23), // 2630
|
const heroType = heroInfo.type;
|
||||||
24: getUpExp(24), // 2860
|
const growthFunction = ApGrowthByType[heroType] || ApGrowthByType[HType.warrior];
|
||||||
25: getUpExp(25), // 3100
|
return growthFunction(baseAp);
|
||||||
26: getUpExp(26), // 3350
|
};
|
||||||
27: getUpExp(27), // 3610
|
|
||||||
28: getUpExp(28), // 3880
|
// 获取从1级升级到2级增加的HP
|
||||||
29: getUpExp(29), // 4160
|
export const getUpHp = (heroId: number): number => {
|
||||||
30: getUpExp(30), // 4450
|
const heroInfo = HeroInfo[heroId];
|
||||||
|
if (!heroInfo) {
|
||||||
|
console.warn(`[getUpHp] 英雄 ${heroId} 不存在`);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseHp = heroInfo.hp;
|
||||||
|
const heroType = heroInfo.type;
|
||||||
|
const growthFunction = HpGrowthByType[heroType] || HpGrowthByType[HType.warrior];
|
||||||
|
return growthFunction(baseHp);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取英雄在指定等级的总攻击力
|
||||||
|
export const getHeroTotalAp = (heroId: number, level: number): number => {
|
||||||
|
const heroInfo = HeroInfo[heroId];
|
||||||
|
if (!heroInfo) {
|
||||||
|
console.warn(`[getHeroTotalAp] 英雄 ${heroId} 不存在`);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseAp = heroInfo.ap;
|
||||||
|
const heroType = heroInfo.type;
|
||||||
|
const growthFunction = ApGrowthByType[heroType] || ApGrowthByType[HType.warrior];
|
||||||
|
const levelUpAp = growthFunction(baseAp);
|
||||||
|
return baseAp + levelUpAp;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取英雄在指定等级的总HP
|
||||||
|
export const getHeroTotalHp = (heroId: number, level: number): number => {
|
||||||
|
const heroInfo = HeroInfo[heroId];
|
||||||
|
if (!heroInfo) {
|
||||||
|
console.warn(`[getHeroTotalHp] 英雄 ${heroId} 不存在`);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseHp = heroInfo.hp;
|
||||||
|
const heroType = heroInfo.type;
|
||||||
|
const growthFunction = HpGrowthByType[heroType] || HpGrowthByType[HType.warrior];
|
||||||
|
const levelUpHp = growthFunction(baseHp);
|
||||||
|
return baseHp + levelUpHp;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取从当前等级升级到目标等级增加的攻击力
|
||||||
|
export const getApIncrease = (heroId: number, currentLevel: number, targetLevel: number): number => {
|
||||||
|
const heroInfo = HeroInfo[heroId];
|
||||||
|
if (!heroInfo) {
|
||||||
|
console.warn(`[getApIncrease] 英雄 ${heroId} 不存在`);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseAp = heroInfo.ap;
|
||||||
|
const heroType = heroInfo.type;
|
||||||
|
const growthFunction = ApGrowthByType[heroType] || ApGrowthByType[HType.warrior];
|
||||||
|
return growthFunction(baseAp);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取从当前等级升级到目标等级增加的HP
|
||||||
|
export const getHpIncrease = (heroId: number, currentLevel: number, targetLevel: number): number => {
|
||||||
|
const heroInfo = HeroInfo[heroId];
|
||||||
|
if (!heroInfo) {
|
||||||
|
console.warn(`[getHpIncrease] 英雄 ${heroId} 不存在`);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseHp = heroInfo.hp;
|
||||||
|
const heroType = heroInfo.type;
|
||||||
|
const growthFunction = HpGrowthByType[heroType] || HpGrowthByType[HType.warrior];
|
||||||
|
return growthFunction(baseHp);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取升级后的完整属性信息
|
||||||
|
export const getLevelUpStats = (heroId: number, currentLevel: number, targetLevel: number) => {
|
||||||
|
return {
|
||||||
|
apIncrease: getApIncrease(heroId, currentLevel, targetLevel),
|
||||||
|
hpIncrease: getHpIncrease(heroId, currentLevel, targetLevel),
|
||||||
|
newTotalAp: getHeroTotalAp(heroId, targetLevel),
|
||||||
|
newTotalHp: getHeroTotalHp(heroId, targetLevel)
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// 根据英雄类型获取增长模式描述
|
||||||
|
export const getGrowthModeDescription = (heroType: HType): string => {
|
||||||
|
switch (heroType) {
|
||||||
|
case HType.warrior:
|
||||||
|
return "战士型:AP固定增长为主(每级+3,+5%),HP高增长(每级+10,+8%)";
|
||||||
|
case HType.remote:
|
||||||
|
return "远程型:AP平衡增长(每级+2,+10%),HP中等增长(每级+5,+5%)";
|
||||||
|
case HType.mage:
|
||||||
|
return "法师型:AP百分比增长为主(每级+1,+15%),HP低增长(每级+3,+3%)";
|
||||||
|
default:
|
||||||
|
return "未知类型";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const HeroInfo = {
|
export const HeroInfo = {
|
||||||
5001:{uuid:5001,name:"神圣守护",path:"k2", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:50,ap:10,dis:700,cd:3,
|
5001:{uuid:5001,name:"神圣守护",path:"k2", quality:HQuality.BLUE,lv:1,kind:1,type:HType.warrior,hp:50,ap:10,dis:700,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5002:{uuid:5002,name:"幻影剑豪",path:"k1", quality:HQuality.BLUE,lv:1,kind:2,type:0,hp:50,ap:10,dis:700,cd:3,
|
5002:{uuid:5002,name:"幻影剑豪",path:"k1", quality:HQuality.BLUE,lv:1,kind:2,type:HType.warrior,hp:50,ap:10,dis:700,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5003:{uuid:5003,name:"战争领主",path:"k5", quality:HQuality.BLUE,lv:1,kind:2,type:0,hp:50,ap:10,dis:700,cd:3,
|
5003:{uuid:5003,name:"战争领主",path:"k5", quality:HQuality.BLUE,lv:1,kind:2,type:HType.warrior,hp:50,ap:10,dis:700,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5004:{uuid:5004,name:"混沌法师",path:"zh1", quality:HQuality.BLUE,lv:1,kind:2,type:2,hp:50,ap:10,dis:700,cd:3.5,
|
5004:{uuid:5004,name:"混沌法师",path:"zh1", quality:HQuality.BLUE,lv:1,kind:2,type:HType.mage,hp:50,ap:10,dis:700,cd:3.5,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5005:{uuid:5005,name:"火焰法师",path:"zh2", quality:HQuality.BLUE,lv:1,kind:2,type:2,hp:50,ap:15,dis:700,cd:3.5,
|
5005:{uuid:5005,name:"火焰法师",path:"zh2", quality:HQuality.BLUE,lv:1,kind:2,type:HType.mage,hp:50,ap:15,dis:700,cd:3.5,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5006:{uuid:5006,name:"风暴精灵",path:"m4", quality:HQuality.BLUE,lv:1,kind:2,type:2,hp:50,ap:15,dis:700,cd:3.5,
|
5006:{uuid:5006,name:"风暴精灵",path:"m4", quality:HQuality.BLUE,lv:1,kind:2,type:HType.mage,hp:50,ap:15,dis:700,cd:3.5,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5008:{uuid:5008,name:"战争祭祀",path:"d2", quality:HQuality.BLUE,lv:1,kind:2,type:2,hp:50,ap:10,dis:700,cd:3.5,
|
5008:{uuid:5008,name:"战争祭祀",path:"d2", quality:HQuality.BLUE,lv:1,kind:2,type:HType.mage,hp:50,ap:10,dis:700,cd:3.5,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5009:{uuid:5009,name:"暴风射手",path:"a5", quality:HQuality.BLUE,lv:1,kind:2,type:1,hp:50,ap:15,dis:700,cd:3.2,
|
5009:{uuid:5009,name:"暴风射手",path:"a5", quality:HQuality.BLUE,lv:1,kind:2,type:HType.remote,hp:50,ap:15,dis:700,cd:3.2,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6002],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6002],info:"说明"},
|
||||||
|
|
||||||
5010:{uuid:5010,name:"苍穹射手",path:"a3", quality:HQuality.BLUE,lv:1,kind:1,type:1,hp:50,ap:15,dis:700,cd:3.2,
|
5010:{uuid:5010,name:"苍穹射手",path:"a3", quality:HQuality.BLUE,lv:1,kind:1,type:HType.remote,hp:50,ap:15,dis:700,cd:3.2,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6002],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6002],info:"说明"},
|
||||||
|
|
||||||
5011:{uuid:5011,name:"幽灵射手",path:"a4", quality:HQuality.BLUE,lv:1,kind:2,type:1,hp:50,ap:15,dis:700,cd:3.2,
|
5011:{uuid:5011,name:"幽灵射手",path:"a4", quality:HQuality.BLUE,lv:1,kind:2,type:HType.remote,hp:50,ap:15,dis:700,cd:3.2,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6002],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6002],info:"说明"},
|
||||||
|
|
||||||
//怪物
|
//怪物
|
||||||
5201:{uuid:5201,name:"兽人战士",path:"mor1", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3,
|
5201:{uuid:5201,name:"兽人战士",path:"mor1", quality:HQuality.BLUE,lv:1,kind:1,type:HType.warrior,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5202:{uuid:5202,name:"兽人刺客",path:"mor2", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3,
|
5202:{uuid:5202,name:"兽人刺客",path:"mor2", quality:HQuality.BLUE,lv:1,kind:1,type:HType.warrior,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5203:{uuid:5203,name:"兽人护卫",path:"mor3", quality:HQuality.BLUE,lv:1,kind:1,type:1,hp:200,ap:5,dis:400,cd:3.2,
|
5203:{uuid:5203,name:"兽人护卫",path:"mor3", quality:HQuality.BLUE,lv:1,kind:1,type:HType.remote,hp:200,ap:5,dis:400,cd:3.2,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5204:{uuid:5204,name:"石卫", path:"mgem1",quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3,
|
5204:{uuid:5204,name:"石卫", path:"mgem1",quality:HQuality.BLUE,lv:1,kind:1,type:HType.warrior,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5205:{uuid:5205,name:"土卫", path:"mgem2",quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3,
|
5205:{uuid:5205,name:"土卫", path:"mgem2",quality:HQuality.BLUE,lv:1,kind:1,type:HType.warrior,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5206:{uuid:5206,name:"树人", path:"mgem3",quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3,
|
5206:{uuid:5206,name:"树人", path:"mgem3",quality:HQuality.BLUE,lv:1,kind:1,type:HType.warrior,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5216:{uuid:5216,name:"元素1", path:"my1", quality:HQuality.BLUE,lv:2,kind:1,type:2,hp:200,ap:5,dis:400,cd:3.5,
|
5216:{uuid:5216,name:"元素1", path:"my1", quality:HQuality.BLUE,lv:2,kind:1,type:HType.mage,hp:200,ap:5,dis:400,cd:3.5,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5217:{uuid:5217,name:"元素2", path:"my2", quality:HQuality.BLUE,lv:2,kind:1,type:2,hp:200,ap:5,dis:400,cd:3.5,
|
5217:{uuid:5217,name:"元素2", path:"my2", quality:HQuality.BLUE,lv:2,kind:1,type:HType.mage,hp:200,ap:5,dis:400,cd:3.5,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5218:{uuid:5218,name:"元素3", path:"my3", quality:HQuality.BLUE,lv:2,kind:1,type:2,hp:200,ap:5,dis:400,cd:3.5,
|
5218:{uuid:5218,name:"元素3", path:"my3", quality:HQuality.BLUE,lv:2,kind:1,type:HType.mage,hp:200,ap:5,dis:400,cd:3.5,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5219:{uuid:5219,name:"牛头战士",path:"mn1", quality:HQuality.BLUE,lv:2,kind:1,type:0,hp:200,ap:5,dis:400,cd:3,
|
5219:{uuid:5219,name:"牛头战士",path:"mn1", quality:HQuality.BLUE,lv:2,kind:1,type:HType.warrior,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5220:{uuid:5220,name:"牛头战士",path:"mn2", quality:HQuality.BLUE,lv:1,kind:1,type:1,hp:200,ap:5,dis:400,cd:3.2,
|
5220:{uuid:5220,name:"牛头战士",path:"mn2", quality:HQuality.BLUE,lv:1,kind:1,type:HType.remote,hp:200,ap:5,dis:400,cd:3.2,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5221:{uuid:5221,name:"牛头战士",path:"mn3", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3,
|
5221:{uuid:5221,name:"牛头战士",path:"mn3", quality:HQuality.BLUE,lv:1,kind:1,type:HType.warrior,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5222:{uuid:5222,name:"独眼巨人",path:"md1", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3,
|
5222:{uuid:5222,name:"独眼巨人",path:"md1", quality:HQuality.BLUE,lv:1,kind:1,type:HType.warrior,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5223:{uuid:5223,name:"独眼巨人",path:"md2", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3,
|
5223:{uuid:5223,name:"独眼巨人",path:"md2", quality:HQuality.BLUE,lv:1,kind:1,type:HType.warrior,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5224:{uuid:5224,name:"独眼巨人",path:"md3", quality:HQuality.BLUE,lv:1,kind:1,type:1,hp:200,ap:5,dis:400,cd:3.2,
|
5224:{uuid:5224,name:"独眼巨人",path:"md3", quality:HQuality.BLUE,lv:1,kind:1,type:HType.remote,hp:200,ap:5,dis:400,cd:3.2,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5225:{uuid:5225,name:"精英独眼",path:"md4", quality:HQuality.BLUE,lv:1,kind:1,type:2,hp:200,ap:5,dis:400,cd:3,
|
5225:{uuid:5225,name:"精英独眼",path:"md4", quality:HQuality.BLUE,lv:1,kind:1,type:HType.mage,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5226:{uuid:5226,name:"精英牛头",path:"mn4", quality:HQuality.BLUE,lv:1,kind:1,type:2,hp:200,ap:5,dis:400,cd:3,
|
5226:{uuid:5226,name:"精英牛头",path:"mn4", quality:HQuality.BLUE,lv:1,kind:1,type:HType.mage,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"},
|
||||||
|
|
||||||
5227:{uuid:5227,name:"精英兽人",path:"mor4", quality:HQuality.BLUE,lv:1,kind:1,type:2,hp:200,ap:5,dis:400,cd:3,
|
5227:{uuid:5227,name:"精英兽人",path:"mor4", quality:HQuality.BLUE,lv:1,kind:1,type:HType.mage,hp:200,ap:5,dis:400,cd:3,
|
||||||
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}
|
crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const HeroUpInfo = {
|
|
||||||
5001:{ap_up:0,ap_up_rate:10,self_ap_up:0,self_ap_up_rate:0,hp_up:0,self_hp_up:0},
|
|
||||||
5002:{ap_up:5,ap_up_rate:0,self_ap_up:0,self_ap_up_rate:0,hp_up:0,self_hp_up:0},
|
|
||||||
5003:{ap_up:0,ap_up_rate:0,self_ap_up:0,self_ap_up_rate:20,hp_up:0,self_hp_up:0},
|
|
||||||
5004:{ap_up:0,ap_up_rate:0,self_ap_up:10,self_ap_up_rate:20,hp_up:0,self_hp_up:0},
|
|
||||||
5005:{ap_up:0,ap_up_rate:0,self_ap_up:0,self_ap_up_rate:0,hp_up:1,self_hp_up:0},
|
|
||||||
5006:{ap_up:0,ap_up_rate:0,self_ap_up:0,self_ap_up_rate:0,hp_up:1,self_hp_up:1},
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ export class BuffComp extends Component {
|
|||||||
info.hp=this.HeroView.hp
|
info.hp=this.HeroView.hp
|
||||||
info.hp_buff=buff.HP
|
info.hp_buff=buff.HP
|
||||||
info.hp_max=this.HeroView.hp_max*(100+buff.HP)/100
|
info.hp_max=this.HeroView.hp_max*(100+buff.HP)/100
|
||||||
|
info.exp=this.HeroView.exp
|
||||||
|
info.next_exp=this.HeroView.next_exp
|
||||||
}else{
|
}else{
|
||||||
info.hp=this.HeroView.hp
|
info.hp=this.HeroView.hp
|
||||||
info.hp_buff=buff.HP
|
info.hp_buff=buff.HP
|
||||||
@@ -120,6 +122,7 @@ export class BuffComp extends Component {
|
|||||||
view_deatk += this.HeroView.DEBUFF_DEATKS[i].value
|
view_deatk += this.HeroView.DEBUFF_DEATKS[i].value
|
||||||
}
|
}
|
||||||
info.ap=this.HeroView.ap
|
info.ap=this.HeroView.ap
|
||||||
|
info.lv=this.HeroView.lv
|
||||||
info.cd=this.HeroView.cd*(100-buff.ATK_CD)/100
|
info.cd=this.HeroView.cd*(100-buff.ATK_CD)/100
|
||||||
console.log("info.buff.ATK_CD",buff.ATK_CD)
|
console.log("info.buff.ATK_CD",buff.ATK_CD)
|
||||||
info.equip_ap=buff.ATK
|
info.equip_ap=buff.ATK
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { GameEvent } from "../common/config/GameEvent";
|
|||||||
import { FightConComp } from "../map/FightConComp";
|
import { FightConComp } from "../map/FightConComp";
|
||||||
import { EquipSpecialAttr } from "../common/config/Equips";
|
import { EquipSpecialAttr } from "../common/config/Equips";
|
||||||
import { FightSet } from "../common/config/Mission";
|
import { FightSet } from "../common/config/Mission";
|
||||||
import { HeroPos } from "../common/config/heroSet";
|
import { getApIncrease, getHpIncrease, getUpExp, HeroPos } from "../common/config/heroSet";
|
||||||
import { FriendModelComp } from "./FriendModel";
|
import { FriendModelComp } from "./FriendModel";
|
||||||
import { MasterModelComp } from "./MasterModel";
|
import { MasterModelComp } from "./MasterModel";
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
@@ -30,6 +30,8 @@ export class HeroViewComp extends CCComp {
|
|||||||
hero_name : string = "hero";
|
hero_name : string = "hero";
|
||||||
fight_pos:number=0;
|
fight_pos:number=0;
|
||||||
lv:number =1;
|
lv:number =1;
|
||||||
|
exp:number = 0;
|
||||||
|
next_exp:number = 100;
|
||||||
scale: number = 1; /** 角色阵营 1:hero -1 :mon */
|
scale: number = 1; /** 角色阵营 1:hero -1 :mon */
|
||||||
type: number = 0; /**角色类型 0近战-需要贴身 1远程-保持距离 2辅助 */
|
type: number = 0; /**角色类型 0近战-需要贴身 1远程-保持距离 2辅助 */
|
||||||
fac:number=0; //阵营 0:hero 1:monster
|
fac:number=0; //阵营 0:hero 1:monster
|
||||||
@@ -108,6 +110,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
console.log("[HeroViewComp]:hero view comp ",this.FIGHTCON)
|
console.log("[HeroViewComp]:hero view comp ",this.FIGHTCON)
|
||||||
this.on(GameEvent.ChangeATK_EQUIP_SPECIAL_ATTR,this.change_atk,this)
|
this.on(GameEvent.ChangeATK_EQUIP_SPECIAL_ATTR,this.change_atk,this)
|
||||||
this.on(GameEvent.UpdateHP,this.update_hp,this)
|
this.on(GameEvent.UpdateHP,this.update_hp,this)
|
||||||
|
this.on(GameEvent.EXPUP,this.exp_up,this)
|
||||||
// let anm = this.node.getChildByName("anm")
|
// let anm = this.node.getChildByName("anm")
|
||||||
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);
|
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);
|
||||||
}
|
}
|
||||||
@@ -127,7 +130,6 @@ export class HeroViewComp extends CCComp {
|
|||||||
if(this.is_friend){ //只有伙伴需要召唤后添加hp 怪物,和boss 不要设置减hp debuff 主要 一开始就战斗开始就存在,所以不需要
|
if(this.is_friend){ //只有伙伴需要召唤后添加hp 怪物,和boss 不要设置减hp debuff 主要 一开始就战斗开始就存在,所以不需要
|
||||||
this.hp+=this.FIGHTCON.friend_buff.HP*this.hp_max/100
|
this.hp+=this.FIGHTCON.friend_buff.HP*this.hp_max/100
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
update(dt: number){
|
update(dt: number){
|
||||||
if(!smc.mission.play||smc.mission.pause) return
|
if(!smc.mission.play||smc.mission.pause) return
|
||||||
@@ -323,6 +325,12 @@ export class HeroViewComp extends CCComp {
|
|||||||
this.do_dead_trigger()
|
this.do_dead_trigger()
|
||||||
this.Friend_alive_cd=new Timer(this.FIGHTCON.friend_alive_cd)
|
this.Friend_alive_cd=new Timer(this.FIGHTCON.friend_alive_cd)
|
||||||
console.log("[HeroViewComp]:角色死亡",this.hero_uuid)
|
console.log("[HeroViewComp]:角色死亡",this.hero_uuid)
|
||||||
|
if(this.is_kalami){
|
||||||
|
oops.message.dispatchEvent(GameEvent.EXPUP,{exp:50})
|
||||||
|
}
|
||||||
|
if(this.is_boss){
|
||||||
|
oops.message.dispatchEvent(GameEvent.EXPUP,{exp:100})
|
||||||
|
}
|
||||||
if(this.is_master){
|
if(this.is_master){
|
||||||
console.log("[HeroViewComp]:英雄死亡")
|
console.log("[HeroViewComp]:英雄死亡")
|
||||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
||||||
@@ -563,14 +571,27 @@ export class HeroViewComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exp_up(e:any,data:any){
|
exp_up(e:any,data:any){
|
||||||
console.log("[HeroViewComp]:exp_up",data)
|
if(this.fac==FacSet.MON) return
|
||||||
this.lv+=1
|
console.log("[HeroViewComp]:经验提高",data.exp)
|
||||||
this.ap=this.ap*this.lv
|
this.exp+=data.exp
|
||||||
this.BUFFCOMP.vmdata_update(true)
|
this.next_exp=getUpExp(this.lv)
|
||||||
|
let diff=this.exp-this.next_exp
|
||||||
|
if(diff >= 0){
|
||||||
|
this.exp=diff
|
||||||
|
this.to_update()
|
||||||
|
}
|
||||||
|
this.BUFFCOMP.vmdata_update(true) //简易更新vmdata
|
||||||
}
|
}
|
||||||
|
|
||||||
to_update(){
|
to_update(){
|
||||||
this.ap=this.ap*this.lv
|
console.log("[HeroViewComp]:升级",this.lv)
|
||||||
|
this.add_ap(getApIncrease(this.hero_uuid,this.lv,this.lv+1))
|
||||||
|
this.add_hp_max(getHpIncrease(this.hero_uuid,this.lv,this.lv+1))
|
||||||
|
this.lv+=1
|
||||||
|
this.next_exp=getUpExp(this.lv)
|
||||||
|
console.log("[HeroViewComp]:up ap,hp",getApIncrease(this.hero_uuid,this.lv,this.lv+1),getHpIncrease(this.hero_uuid,this.lv,this.lv+1))
|
||||||
|
this.BUFFCOMP.vmdata_update()
|
||||||
|
//@todo 需要添加 升级动画
|
||||||
}
|
}
|
||||||
/** 显示伤害数字 */
|
/** 显示伤害数字 */
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
|||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||||
import { FightSet, MissionData, Missions, MissionStatus} from "../common/config/Mission";
|
import { FightSet, MissionData, Missions, MissionStatus, VmInfo} from "../common/config/Mission";
|
||||||
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||||
@@ -151,10 +151,13 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data_init(){
|
data_init(){
|
||||||
//局内数据初始化
|
//局内数据初始化 smc 数据初始化
|
||||||
console.log("局内数据初始化")
|
console.log("局内数据初始化")
|
||||||
smc.mission.play = true;
|
smc.mission.play = true;
|
||||||
smc.vmdata.mission_data = JSON.parse(JSON.stringify(MissionData));
|
smc.vmdata.mission_data = JSON.parse(JSON.stringify(MissionData));
|
||||||
|
smc.vmdata.hero = JSON.parse(JSON.stringify(VmInfo));
|
||||||
|
smc.vmdata.friend = JSON.parse(JSON.stringify(VmInfo));
|
||||||
|
smc.vmdata.boss = JSON.parse(JSON.stringify(VmInfo));
|
||||||
this.GlodAddTimer=new Timer(smc.vmdata.mission_data.refrsh_time)
|
this.GlodAddTimer=new Timer(smc.vmdata.mission_data.refrsh_time)
|
||||||
this.hide_call_friend()
|
this.hide_call_friend()
|
||||||
this.hide_skill_get(null,"skill1")
|
this.hide_skill_get(null,"skill1")
|
||||||
|
|||||||
@@ -39,8 +39,8 @@
|
|||||||
- [ ] boss信息面板
|
- [ ] boss信息面板
|
||||||
- [ ] 金币掉落 动画 从头顶掉到底部bar
|
- [ ] 金币掉落 动画 从头顶掉到底部bar
|
||||||
- [x] 技能和伙伴都 需要主动点击 才会弹出,特定回合出现选项
|
- [x] 技能和伙伴都 需要主动点击 才会弹出,特定回合出现选项
|
||||||
- [ ] 添加等级系统,主将和伙伴都可以升级,升级获得属性提升和 技能获取
|
- [x] 添加等级系统,主将和伙伴都可以升级,升级获得属性提升和 技能获取
|
||||||
|
- [ ] 添加升级动画
|
||||||
|
|
||||||
|
|
||||||
波数 升级 获取装备的等级
|
波数 升级 获取装备的等级
|
||||||
|
|||||||
Reference in New Issue
Block a user