This commit is contained in:
2025-07-21 23:35:11 +08:00
parent a073682615
commit f841c9ec7f
12 changed files with 6107 additions and 4847 deletions

View File

@@ -31,6 +31,7 @@ export enum GameEvent {
HeroSkillSelectEnd = "HeroSkillSelectEnd",
HeroSelect = "HeroSelect",
EnhancementSelect = "EnhancementSelect",
CanUpdateLv = "CanUpdateLv",
UseEnhancement = "UseEnhancement",
MasterCalled = "MasterCalled",
FightStart = "FightStart",

View File

@@ -54,32 +54,28 @@ export const HQuality = {
}
export const MonSet = {
0:{pos:v3(390,0,0)},
1:{pos:v3(390,+80,0)},
2:{pos:v3(390,-80,0)},
3:{pos:v3(420,0,0)},
4:{pos:v3(420,+80,0)},
5:{pos:v3(420,-80,0)},
6:{pos:v3(450,0,0)},
7:{pos:v3(450,+80,0)},
8:{pos:v3(450,-80,0)},
9:{pos:v3(480,0,0)},
10:{pos:v3(480,+80,0)},
11:{pos:v3(480,-80,0)},
12:{pos:v3(510,0,0)},
13:{pos:v3(510,+80,0)},
14:{pos:v3(510,-80,0)},
15:{pos:v3(540,0,0)},
16:{pos:v3(540,+80,0)},
17:{pos:v3(540,-80,0)},
18:{pos:v3(570,0,0)},
19:{pos:v3(570,+80,0)},
20:{pos:v3(570,-80,0)},
21:{pos:v3(600,0,0)},
22:{pos:v3(600,+80,0)},
23:{pos:v3(600,-80,0)},
24:{pos:v3(630,0,0)},
25:{pos:v3(630,+80,0)},
26:{pos:v3(630,-80,0)},
1:{pos:v3(420,0,0)},
2:{pos:v3(450,0,0)},
3:{pos:v3(480,0,0)},
4:{pos:v3(510,0,0)},
5:{pos:v3(540,0,0)},
6:{pos:v3(570,0,0)},
7:{pos:v3(600,0,0)},
8:{pos:v3(630,0,0)},
9:{pos:v3(660,0,0)},
10:{pos:v3(690,0,0)},
11:{pos:v3(720,0,0)},
12:{pos:v3(750,0,0)},
13:{pos:v3(780,0,0)},
14:{pos:v3(810,0,0)},
15:{pos:v3(840,0,0)},
16:{pos:v3(870,0,0)},
17:{pos:v3(900,0,0)},
18:{pos:v3(930,0,0)},
19:{pos:v3(960,0,0)},
20:{pos:v3(990,0,0)},
21:{pos:v3(1020,0,0)},
22:{pos:v3(1050,0,0)},
}
// 经验值计算函数 - 复杂递增规律

View File

@@ -94,6 +94,7 @@ export class BuffComp extends Component {
let buff=null
let info= null
if(!this.HeroView) return
if(!this.HeroView.is_master) return
if(this.HeroView.fac==FacSet.HERO) {info=smc.vmdata.hero;buff=this.FIGHTCON.hero_buff}
if(this.HeroView.is_boss) {info=smc.vmdata.boss;buff=this.FIGHTCON.enemy_buff}
//if(this.HeroView.is_kalami) {target_key="enemy";buff_key="enemy"} 不显示小怪
@@ -104,8 +105,8 @@ export class BuffComp extends Component {
info.hp=this.HeroView.hp
info.hp_buff=buff.HP
info.hp_max=this.HeroView.hp_max*(100+buff.HP)/100
info.exp=this.HeroView.exp
info.next_exp=this.HeroView.next_exp
// info.exp=this.HeroView.exp
// info.next_exp=this.HeroView.next_exp
}else{
info.hp=this.HeroView.hp
info.hp_buff=buff.HP
@@ -118,7 +119,7 @@ export class BuffComp extends Component {
view_deatk += this.HeroView.DEBUFF_DEATKS[i].value
}
info.ap=this.HeroView.ap
info.lv=this.HeroView.lv
// info.lv=this.HeroView.lv
info.cd=Number((this.HeroView.cd*(100-buff.ATK_CD)/100).toFixed(2))
console.log("info.buff.ATK_CD",buff.ATK_CD)
info.equip_ap=buff.ATK

View File

@@ -162,26 +162,7 @@ export class HeroViewComp extends CCComp {
// 处理伤害队列
this.processDamageQueue();
}
use_enhancement(e:GameEvent,data:any){
//console.log("[HeroViewComp]:use_enhancement",data)
if(this.is_master){
switch(data.type){
case EnhancementType.ATTACK:
this.add_ap(data.value)
break
case EnhancementType.ATTACK_SPEED:
this.add_speed(data.value)
break
case EnhancementType.HEALTH:
this.add_hp_max(data.value)
break
case EnhancementType.DEF:
this.add_def(data.value)
break
}
}
}
change_atk(e:GameEvent,data:any){
if(!this.is_master) return
@@ -225,12 +206,13 @@ export class HeroViewComp extends CCComp {
*/
add_def(def: number){
this.def+=def
this.BUFFCOMP.vmdata_update()
if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.BUFFCOMP.tooltip(TooltipTypes.defup,def.toFixed(0));
}
add_speed(cd: number){
this.cd -=this.cd*cd/100
this.BUFFCOMP.vmdata_update()
if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.BUFFCOMP.tooltip(TooltipTypes.speedup,speed.toFixed(0));
}
add_ap(ap: number,is_num:boolean=true){
@@ -240,9 +222,12 @@ export class HeroViewComp extends CCComp {
}else{
this.ap += Math.floor(ap/100*this.ap);
}
this.BUFFCOMP.vmdata_update()
this.BUFFCOMP.tooltip(TooltipTypes.apup,ap.toFixed(0));
oops.message.dispatchEvent(GameEvent.APChange,{is_master:this.is_master,fac:this.fac})
if(this.is_master) {
this.BUFFCOMP.vmdata_update();
oops.message.dispatchEvent(GameEvent.APChange,{is_master:this.is_master,fac:this.fac})
}
}
de_ap(ap: number,is_num:boolean=true){
@@ -252,7 +237,7 @@ export class HeroViewComp extends CCComp {
}else{
this.ap -= Math.floor(ap/100*this.ap);
}
this.BUFFCOMP.vmdata_update()
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
update_hp(e:GameEvent,data:any){
//console.log("[HeroViewComp]:update_hp",data)
@@ -269,7 +254,7 @@ export class HeroViewComp extends CCComp {
add_hp_max(hp: number=0,is_num:boolean=true){
this.hp_max += Math.floor(hp) ;
this.hp += Math.floor(hp*(100+this.buff_hp)/100) ;
this.BUFFCOMP.vmdata_update(true)
if(this.is_master) this.BUFFCOMP.vmdata_update(true)
this.BUFFCOMP.tooltip(TooltipTypes.hpup,hp.toFixed(0));
}
@@ -277,7 +262,7 @@ export class HeroViewComp extends CCComp {
de_hp_max(hp: number=0,is_num:boolean=true){ //最大值 只存在数值添加, 比例通过buff_hp处理
//console.log("[HeroViewComp]:de_hp_max de:",hp,this.hp_max)
this.hp_max -= Math.floor(hp) ;
this.BUFFCOMP.vmdata_update(true)
if(this.is_master) this.BUFFCOMP.vmdata_update(true)
}
add_hp(hp: number = 0,is_num:boolean=true) {
@@ -302,7 +287,7 @@ export class HeroViewComp extends CCComp {
this.hp+=real_hp;
this.BUFFCOMP.tooltip(TooltipTypes.health,real_hp.toFixed(0));
}
this.BUFFCOMP.vmdata_update(true)
if(this.is_master) this.BUFFCOMP.vmdata_update(true)
}
@@ -494,7 +479,7 @@ export class HeroViewComp extends CCComp {
this.ent.destroy();
}
}
this.BUFFCOMP.vmdata_update(true)
if(this.is_master) this.BUFFCOMP.vmdata_update(true)
this.showDamage(damage, is_crit);
}
@@ -646,24 +631,40 @@ export class HeroViewComp extends CCComp {
exp_up(e:any,data:any){
if(this.fac==FacSet.MON) return
//console.log("[HeroViewComp]:经验提高",data.exp)
this.exp+=data.exp
this.next_exp=getUpExp(this.lv)
let diff=this.exp-this.next_exp
if(diff >= 0){
this.exp=diff
//console.log("[HeroViewComp]:exp_up",this.exp,this.next_exp)
oops.message.dispatchEvent(GameEvent.EnhancementSelect)
this.to_update()
smc.vmdata.hero.exp+=data.exp
// smc.vmdata.hero.next_exp=getUpExp(this.lv)
if(smc.vmdata.hero.exp >= smc.vmdata.hero.next_exp){
oops.message.dispatchEvent(GameEvent.CanUpdateLv)
}
this.BUFFCOMP.vmdata_update(true) //简易更新vmdata
}
use_enhancement(e:GameEvent,data:any){
//console.log("[HeroViewComp]:use_enhancement",data)
if(!this.is_master) return
switch(data.type){
case EnhancementType.ATTACK:
this.add_ap(data.value)
break
case EnhancementType.ATTACK_SPEED:
this.add_speed(data.value)
break
case EnhancementType.HEALTH:
this.add_hp_max(data.value)
break
case EnhancementType.DEF:
this.add_def(data.value)
break
}
this.to_update()
}
to_update(){
if(!this.is_master) return
oops.message.dispatchEvent(GameEvent.HeroLvUp,{lv:this.lv})
this.lv+=1
this.next_exp=getUpExp(this.lv)
this.BUFFCOMP.vmdata_update()
// oops.message.dispatchEvent(GameEvent.HeroLvUp,{lv:this.lv})
smc.vmdata.hero.exp = smc.vmdata.hero.exp-smc.vmdata.hero.next_exp
smc.vmdata.hero.lv = smc.vmdata.hero.lv+1
smc.vmdata.hero.next_exp=getUpExp(smc.vmdata.hero.lv)
this.BUFFCOMP.lv_up()
this.BUFFCOMP.tooltip(TooltipTypes.lvup)
//@todo 需要添加 升级动画

View File

@@ -25,6 +25,8 @@ export class BarCompComp extends CCComp {
this.on(GameEvent.FightReady,this.readay,this)
this.on(GameEvent.MasterCalled,this.master_called,this)
this.on(GameEvent.APChange,this.ap_change,this)
this.on(GameEvent.CanUpdateLv,this.show_uplv_button,this)
this.on(GameEvent.UseEnhancement,this.hide_uplv_button,this)
}
start() {
@@ -35,6 +37,7 @@ export class BarCompComp extends CCComp {
private readay(){
this.node.getChildByName("bar").active = true
this.node.getChildByName("bar").getChildByName("more").active=false
this.node.getChildByName("bar").getChildByName("uplv").active=false
}
private master_called(e:any,data:any){
this.node.getChildByName("bar").active = true
@@ -58,6 +61,12 @@ export class BarCompComp extends CCComp {
}
}
show_uplv_button(){
this.node.getChildByName("bar").getChildByName("uplv").active=true
}
hide_uplv_button(){
this.node.getChildByName("bar").getChildByName("uplv").active=false
}
show_master_more(){
let barNode = this.node.getChildByName("bar");
let node = barNode.getChildByName("more");

View File

@@ -69,7 +69,9 @@ export class MissionComp extends CCComp {
to_ready(){
oops.message.dispatchEvent(GameEvent.HeroSelect,{is_master:true})
}
to_uplv(){
oops.message.dispatchEvent(GameEvent.EnhancementSelect)
}
to_call_friend(){
oops.message.dispatchEvent(GameEvent.HeroSelect,{is_master:false})
}