天赋替换完成
This commit is contained in:
@@ -89820,8 +89820,8 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -0.635,
|
||||
"y": 286.977,
|
||||
"x": -935.629,
|
||||
"y": 311.495,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
@@ -90566,8 +90566,6 @@
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "76F7i9gP5GG63KTqOpSJQ6",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
|
||||
@@ -48,6 +48,8 @@ export enum GameEvent {
|
||||
FuncSelect = "FuncSelect",
|
||||
TalentSelect = "TalentSelect",
|
||||
UseTalentCard = "UseTalentCard",
|
||||
RemoveTalent = "RemoveTalent",
|
||||
ChangeTalent = "ChangeTalent",
|
||||
RefreshCard = "RefreshCard",
|
||||
NewWave = "NewWave",
|
||||
ChangeATK = "ChangeATK",
|
||||
|
||||
@@ -25,6 +25,7 @@ export class HeroConComp extends CCComp {
|
||||
this.on(GameEvent.UseSpecialCard,this.use_special_card,this)
|
||||
this.on(GameEvent.UseEnhancement,this.use_enhancement,this)
|
||||
this.on(GameEvent.UseTalentCard,this.use_talent_card,this)
|
||||
this.on(GameEvent.RemoveTalent,this.remove_talent_card,this)
|
||||
|
||||
this.heroView=this.node.getComponent(HeroViewComp)
|
||||
console.log("[HeroConCompComp]:onLoad",this.heroView)
|
||||
@@ -155,12 +156,15 @@ export class HeroConComp extends CCComp {
|
||||
}
|
||||
}
|
||||
remove_talent_card(e:GameEvent,data:any){
|
||||
console.log("[HeroConCompComp]:remove_talent_card",data)
|
||||
|
||||
let tal=TalentList[data.uuid]
|
||||
console.log("[HeroConCompComp]:remove_talent_card",data,tal)
|
||||
switch(tal.buffType){
|
||||
case BuffAttr.ATK:
|
||||
console.log("[HeroConCompComp]:atk",this.heroView.TALENT[BuffAttr.ATK],tal.value)
|
||||
this.heroView.TALENT[BuffAttr.ATK]-=tal.value
|
||||
this.heroView.count_atrr(BuffAttr.ATK)
|
||||
console.log("[HeroConCompComp]ed:atk",this.heroView.TALENT[BuffAttr.ATK],tal.value)
|
||||
break
|
||||
case BuffAttr.ATK_CD:
|
||||
this.heroView.TALENT[BuffAttr.ATK_CD]-=tal.value
|
||||
|
||||
@@ -305,7 +305,7 @@ export class HeroViewComp extends CCComp {
|
||||
check_atrr(buff:BuffAttr){
|
||||
switch(buff){
|
||||
case BuffAttr.ATK:
|
||||
return Math.floor(this.ap*(100+this.ap+this.TALENT[BuffAttr.ATK])/100)
|
||||
return Math.floor(this.ap_base*(100+this.ap_buff+this.TALENT[BuffAttr.ATK])/100)
|
||||
case BuffAttr.ATK_CD:
|
||||
return this.cd_base/((this.cd_buff+this.TALENT[BuffAttr.ATK_CD])/100+1)
|
||||
case BuffAttr.HP:
|
||||
|
||||
@@ -18,6 +18,7 @@ export class TalsComp extends Component {
|
||||
tal5:any=null
|
||||
tal6:any=null
|
||||
boxs:Node=null
|
||||
cur_tal:string=""
|
||||
// attrs:any={
|
||||
// hero_buff:getBuffNum(),
|
||||
// enemy_buff:getBuffNum(),
|
||||
@@ -52,31 +53,49 @@ export class TalsComp extends Component {
|
||||
console.log("[TalsComp]:tal_add",data)
|
||||
switch(data.slot){
|
||||
case TalentSlot[0]:
|
||||
if(this.tal1.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal1.uuid})
|
||||
}
|
||||
this.tal1.uuid=data.uuid
|
||||
this.tal1.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[0])
|
||||
break
|
||||
case TalentSlot[1]:
|
||||
if(this.tal2.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal2.uuid})
|
||||
}
|
||||
this.tal2.uuid=data.uuid
|
||||
this.tal2.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[1])
|
||||
break
|
||||
case TalentSlot[2]:
|
||||
if(this.tal3.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal3.uuid})
|
||||
}
|
||||
this.tal3.uuid=data.uuid
|
||||
this.tal3.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[2])
|
||||
break
|
||||
case TalentSlot[3]:
|
||||
if(this.tal4.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal4.uuid})
|
||||
}
|
||||
this.tal4.uuid=data.uuid
|
||||
this.tal4.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[3])
|
||||
break
|
||||
case TalentSlot[4]:
|
||||
if(this.tal5.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal5.uuid})
|
||||
}
|
||||
this.tal5.uuid=data.uuid
|
||||
this.tal5.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[4])
|
||||
break
|
||||
case TalentSlot[5]:
|
||||
if(this.tal6.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal6.uuid})
|
||||
}
|
||||
this.tal6.uuid=data.uuid
|
||||
this.tal6.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[5])
|
||||
@@ -100,11 +119,15 @@ export class TalsComp extends Component {
|
||||
}
|
||||
to_change_tal(){
|
||||
console.log("[TalsComp]:to_change_tal")
|
||||
if(this.cur_tal=="") return
|
||||
oops.message.dispatchEvent(GameEvent.TalentSelect,{slot:this.cur_tal})
|
||||
this.close_tal_info()
|
||||
}
|
||||
close_tal_info(){
|
||||
console.log("[TalsComp]:close_tal_info")
|
||||
let node= this.node.getChildByName("info")
|
||||
tween(node).to(0.1,{position:v3(-1000,node.position.y,0)}).start()
|
||||
this.cur_tal=""
|
||||
}
|
||||
show_tal_info(e:any,data:any){
|
||||
console.log("[TalsComp]:show_tal_info",e,data)
|
||||
@@ -113,26 +136,32 @@ export class TalsComp extends Component {
|
||||
case TalentSlot[0]:
|
||||
if(this.tal1.uuid==0) return
|
||||
uuid=this.tal1.uuid
|
||||
this.cur_tal=TalentSlot[0]
|
||||
break
|
||||
case TalentSlot[1]:
|
||||
if(this.tal2.uuid==0) return
|
||||
uuid=this.tal2.uuid
|
||||
this.cur_tal=TalentSlot[1]
|
||||
break
|
||||
case TalentSlot[2]:
|
||||
if(this.tal3.uuid==0) return
|
||||
uuid=this.tal3.uuid
|
||||
this.cur_tal=TalentSlot[2]
|
||||
break
|
||||
case TalentSlot[3]:
|
||||
if(this.tal4.uuid==0) return
|
||||
uuid=this.tal4.uuid
|
||||
this.cur_tal=TalentSlot[3]
|
||||
break
|
||||
case TalentSlot[4]:
|
||||
if(this.tal5.uuid==0) return
|
||||
uuid=this.tal5.uuid
|
||||
this.cur_tal=TalentSlot[4]
|
||||
break
|
||||
case TalentSlot[5]:
|
||||
if(this.tal6.uuid==0) return
|
||||
uuid=this.tal6.uuid
|
||||
this.cur_tal=TalentSlot[5]
|
||||
break
|
||||
}
|
||||
let node= this.node.getChildByName("info")
|
||||
|
||||
Reference in New Issue
Block a user